Skip to content

Commit

Permalink
fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cnjinhao committed Jun 11, 2024
1 parent e778f41 commit 6ea5c9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
13 changes: 5 additions & 8 deletions include/nana/gui/widgets/treebox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,18 @@ namespace nana
public:
struct treebox_node_type
{
treebox_node_type();
treebox_node_type(std::string);
treebox_node_type(std::string = {});
treebox_node_type& operator=(const treebox_node_type&);

::std::string text;
std::any value;
bool expanded;
bool hidden;
bool selected;
checkstate checked;
bool expanded{ false };
bool hidden{ false };
bool selected{ false };
checkstate checked{ checkstate::unchecked };
::std::string img_idstr;
};

struct pseudo_node_type{};

using tree_cont_type = widgets::detail::tree_cont<treebox_node_type>;
using node_type = tree_cont_type::node_type;

Expand Down
1 change: 1 addition & 0 deletions source/gui/programming_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,7 @@ namespace api
return restrict::bedrock.vkeyboard().numeric(wd, padding);
#else
(void)wd;
(void)padding;
return false;
#endif
}
Expand Down
1 change: 0 additions & 1 deletion source/gui/widgets/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,6 @@ namespace nana
{
nana::size size = _m_client_size();

unsigned int two = platform_abstraction::dpi_scale(widget_->handle(), 2u);
size.width += platform_abstraction::dpi_scale(widget_->handle(), detail_.border.x) * 2u;
size.height += platform_abstraction::dpi_scale(widget_->handle(), detail_.border.y) * 2u;

Expand Down
9 changes: 4 additions & 5 deletions source/gui/widgets/treebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,8 @@ namespace nana

bool set_selected_multi(node_type* node, bool crtl, bool shift)
{
(void)shift;

if (crtl)
{
data.stop_drawing = true;
Expand Down Expand Up @@ -956,7 +958,7 @@ namespace nana
if(node_state.selected != node)
{
data.stop_drawing = true;
if (node_state.selected && single_selection || node == nullptr)
if ((node_state.selected && single_selection) || !node)
{
auto nodes_copy = node_state.nodes_selected;
node_state.clear();
Expand Down Expand Up @@ -1911,12 +1913,9 @@ namespace nana

//class trigger
//struct treebox_node_type
trigger::treebox_node_type::treebox_node_type()
:expanded(false), hidden(false), checked(checkstate::unchecked), selected(false)
{}

trigger::treebox_node_type::treebox_node_type(std::string text)
:text(std::move(text)), expanded(false), hidden(false), checked(checkstate::unchecked), selected(false)
:text(std::move(text))
{}

trigger::treebox_node_type& trigger::treebox_node_type::operator=(const treebox_node_type& rhs)
Expand Down

0 comments on commit 6ea5c9c

Please sign in to comment.