Fix behaviour of menu items for wxTR_NO_LINES in the sample
It was getting wrongly updated because the menu item corresponded to the absence of the style rather than its presence. Fix this by inverting the menu item meaning, even if it's not very natural, it should be good enough for the sample and preferable to complicating its code.
This commit is contained in:
@@ -240,7 +240,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
|||||||
style_menu->AppendCheckItem(TreeTest_TogTwist, wxT("Toggle &twister buttons"));
|
style_menu->AppendCheckItem(TreeTest_TogTwist, wxT("Toggle &twister buttons"));
|
||||||
style_menu->AppendCheckItem(TreeTest_ToggleButtons, wxT("Toggle image &buttons"));
|
style_menu->AppendCheckItem(TreeTest_ToggleButtons, wxT("Toggle image &buttons"));
|
||||||
style_menu->AppendSeparator();
|
style_menu->AppendSeparator();
|
||||||
style_menu->AppendCheckItem(TreeTest_TogLines, wxT("Toggle &connecting lines"));
|
style_menu->AppendCheckItem(TreeTest_TogLines, wxT("Toggle &no lines"));
|
||||||
style_menu->AppendCheckItem(TreeTest_TogRootLines, wxT("Toggle &lines at root"));
|
style_menu->AppendCheckItem(TreeTest_TogRootLines, wxT("Toggle &lines at root"));
|
||||||
style_menu->AppendCheckItem(TreeTest_TogHideRoot, wxT("Toggle &hidden root"));
|
style_menu->AppendCheckItem(TreeTest_TogHideRoot, wxT("Toggle &hidden root"));
|
||||||
style_menu->AppendCheckItem(TreeTest_TogBorder, wxT("Toggle &item border"));
|
style_menu->AppendCheckItem(TreeTest_TogBorder, wxT("Toggle &item border"));
|
||||||
@@ -387,7 +387,7 @@ void MyFrame::CreateTreeWithDefStyle()
|
|||||||
wxMenuBar *mbar = GetMenuBar();
|
wxMenuBar *mbar = GetMenuBar();
|
||||||
mbar->Check(TreeTest_TogButtons, (style & wxTR_HAS_BUTTONS) != 0);
|
mbar->Check(TreeTest_TogButtons, (style & wxTR_HAS_BUTTONS) != 0);
|
||||||
mbar->Check(TreeTest_TogButtons, (style & wxTR_TWIST_BUTTONS) != 0);
|
mbar->Check(TreeTest_TogButtons, (style & wxTR_TWIST_BUTTONS) != 0);
|
||||||
mbar->Check(TreeTest_TogLines, (style & wxTR_NO_LINES) == 0);
|
mbar->Check(TreeTest_TogLines, (style & wxTR_NO_LINES) != 0);
|
||||||
mbar->Check(TreeTest_TogRootLines, (style & wxTR_LINES_AT_ROOT) != 0);
|
mbar->Check(TreeTest_TogRootLines, (style & wxTR_LINES_AT_ROOT) != 0);
|
||||||
mbar->Check(TreeTest_TogHideRoot, (style & wxTR_HIDE_ROOT) != 0);
|
mbar->Check(TreeTest_TogHideRoot, (style & wxTR_HIDE_ROOT) != 0);
|
||||||
mbar->Check(TreeTest_TogEdit, (style & wxTR_EDIT_LABELS) != 0);
|
mbar->Check(TreeTest_TogEdit, (style & wxTR_EDIT_LABELS) != 0);
|
||||||
|
Reference in New Issue
Block a user