From de33f6715d89f13b66fb536ebfe01d8296e3e0fd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 25 Aug 2018 22:28:43 +0200 Subject: [PATCH] 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. --- samples/treectrl/treetest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index b8256ef1e6..18a5c2797a 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -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_ToggleButtons, wxT("Toggle image &buttons")); 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_TogHideRoot, wxT("Toggle &hidden root")); style_menu->AppendCheckItem(TreeTest_TogBorder, wxT("Toggle &item border")); @@ -387,7 +387,7 @@ void MyFrame::CreateTreeWithDefStyle() wxMenuBar *mbar = GetMenuBar(); mbar->Check(TreeTest_TogButtons, (style & wxTR_HAS_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_TogHideRoot, (style & wxTR_HIDE_ROOT) != 0); mbar->Check(TreeTest_TogEdit, (style & wxTR_EDIT_LABELS) != 0);