From 2153bf897ad0d4a6cdf321eef093123fa4aed8bb Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Sun, 13 Jun 2004 00:02:35 +0000 Subject: [PATCH] replaced menu calls Append([...], true) with the less cryptic AppendCheckItem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dialogs/dialogs.cpp | 6 +++--- samples/dragimag/dragimag.cpp | 2 +- samples/drawing/drawing.cpp | 9 ++++----- samples/font/font.cpp | 8 ++++---- samples/menu/menu.cpp | 4 ++-- samples/text/text.cpp | 14 +++++++------- samples/treectrl/treetest.cpp | 22 +++++++++++----------- samples/validate/validate.cpp | 2 +- 8 files changed, 33 insertions(+), 34 deletions(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 96f70704d1..ccda7099f3 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -312,15 +312,15 @@ bool MyApp::OnInit() #if wxUSE_FINDREPLDLG wxMenu *find_menu = new wxMenu; - find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), wxEmptyString, true); - find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), wxEmptyString, true); + find_menu->AppendCheckItem(DIALOGS_FIND, _T("&Find dialog\tCtrl-F")); + find_menu->AppendCheckItem(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F")); file_menu->Append(wxID_ANY,_T("Searching"),find_menu); #endif // wxUSE_FINDREPLDLG #if USE_MODAL_PRESENTATION wxMenu *modal_menu = new wxMenu; modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W")); - modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), wxEmptyString, true); + modal_menu->AppendCheckItem(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z")); file_menu->Append(wxID_ANY,_T("Modal/Modeless"),modal_menu); #endif // USE_MODAL_PRESENTATION diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index dba6484896..1141186f1a 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -332,7 +332,7 @@ MyFrame::MyFrame() { wxMenu *file_menu = new wxMenu(); file_menu->Append( wxID_ABOUT, _T("&About...")); - file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), true); + file_menu->AppendCheckItem( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen")); file_menu->Append( wxID_EXIT, _T("E&xit")); wxMenuBar *menu_bar = new wxMenuBar(); diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 8e3ae49a16..e461b212ee 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -1079,8 +1079,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) menuUserScale->Append( UserScale_Restore, _T("&Restore to normal\tCtrl-0") ); wxMenu *menuAxis = new wxMenu; - menuAxis->Append( AxisMirror_Horiz, _T("Mirror horizontally\tCtrl-M"), _T(""), true ); - menuAxis->Append( AxisMirror_Vertic, _T("Mirror vertically\tCtrl-N"), _T(""), true ); + menuAxis->AppendCheckItem( AxisMirror_Horiz, _T("Mirror horizontally\tCtrl-M") ); + menuAxis->AppendCheckItem( AxisMirror_Vertic, _T("Mirror vertically\tCtrl-N") ); wxMenu *menuLogical = new wxMenu; menuLogical->Append( LogicalOrigin_MoveDown, _T("Move &down\tCtrl-D") ); @@ -1095,8 +1095,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) menuColour->Append( Colour_TextForeground, _T("Text &foreground...") ); menuColour->Append( Colour_TextBackground, _T("Text &background...") ); menuColour->Append( Colour_Background, _T("Background &colour...") ); - menuColour->Append( Colour_BackgroundMode, _T("&Opaque/transparent\tCtrl-B"), _T(""), true ); - menuColour->Append( Colour_TextureBackgound, _T("Draw textured back&ground\tCtrl-T"), _T(""), true); + menuColour->AppendCheckItem( Colour_BackgroundMode, _T("&Opaque/transparent\tCtrl-B") ); + menuColour->AppendCheckItem( Colour_TextureBackgound, _T("Draw textured back&ground\tCtrl-T") ); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; @@ -1110,7 +1110,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); - // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText(_T("Welcome to wxWidgets!")); diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 61eeecb067..a2d13fa08d 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -243,10 +243,10 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) menuFont->Append(Font_IncSize, wxT("&Increase font size by 2 points\tCtrl-I")); menuFont->Append(Font_DecSize, wxT("&Decrease font size by 2 points\tCtrl-D")); menuFont->AppendSeparator(); - menuFont->Append(Font_Bold, wxT("&Bold\tCtrl-B"), wxT("Toggle bold state"), true); - menuFont->Append(Font_Italic, wxT("&Oblique\tCtrl-O"), wxT("Toggle italic state"), true); - menuFont->Append(Font_Underlined, wxT("&Underlined\tCtrl-U"), - wxT("Toggle underlined state"), true); + menuFont->AppendCheckItem(Font_Bold, wxT("&Bold\tCtrl-B"), wxT("Toggle bold state")); + menuFont->AppendCheckItem(Font_Italic, wxT("&Oblique\tCtrl-O"), wxT("Toggle italic state")); + menuFont->AppendCheckItem(Font_Underlined, wxT("&Underlined\tCtrl-U"), + wxT("Toggle underlined state")); menuFont->AppendSeparator(); menuFont->Append(Font_CheckNativeToFromString, diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 3665eebae1..1f2bbdc0fa 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -513,7 +513,7 @@ wxMenu *MyFrame::CreateDummyMenu(wxString *title) wxMenu *menu = new wxMenu; menu->Append(Menu_Dummy_First, _T("&First item\tCtrl-F1")); menu->AppendSeparator(); - menu->Append(Menu_Dummy_Second, _T("&Second item\tCtrl-F2"), _T(""), true); + menu->AppendCheckItem(Menu_Dummy_Second, _T("&Second item\tCtrl-F2")); if ( title ) { @@ -929,7 +929,7 @@ void MyFrame::ShowContextMenu(const wxPoint& pos) menu.Append(Menu_Help_About, _T("&About")); menu.Append(Menu_Popup_Submenu, _T("&Submenu"), CreateDummyMenu(NULL)); menu.Append(Menu_Popup_ToBeDeleted, _T("To be &deleted")); - menu.Append(Menu_Popup_ToBeChecked, _T("To be &checked"), _T(""), true); + menu.AppendCheckItem(Menu_Popup_ToBeChecked, _T("To be &checked")); menu.Append(Menu_Popup_ToBeGreyed, _T("To be &greyed"), _T("This menu item should be initially greyed out")); menu.AppendSeparator(); diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 0d885c38e1..1ff95544ce 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -394,8 +394,8 @@ bool MyApp::OnInit() menuText->AppendSeparator(); menuText->Append(TEXT_MOVE_ENDTEXT, _T("Move cursor to the end of &text")); menuText->Append(TEXT_MOVE_ENDENTRY, _T("Move cursor to the end of &entry")); - menuText->Append(TEXT_SET_EDITABLE, _T("Toggle &editable state"), _T(""), true); - menuText->Append(TEXT_SET_ENABLED, _T("Toggle e&nabled state"), _T(""), true); + menuText->AppendCheckItem(TEXT_SET_EDITABLE, _T("Toggle &editable state")); + menuText->AppendCheckItem(TEXT_SET_ENABLED, _T("Toggle e&nabled state")); menuText->Check(TEXT_SET_EDITABLE, true); menuText->Check(TEXT_SET_ENABLED, true); menuText->AppendSeparator(); @@ -406,11 +406,11 @@ bool MyApp::OnInit() menu_bar->Append(menuText, _T("Te&xt")); wxMenu *menuLog = new wxMenu; - menuLog->Append(TEXT_LOG_KEY, _T("Log &key events"), _T(""), true); - menuLog->Append(TEXT_LOG_CHAR, _T("Log &char events"), _T(""), true); - menuLog->Append(TEXT_LOG_MOUSE, _T("Log &mouse events"), _T(""), true); - menuLog->Append(TEXT_LOG_TEXT, _T("Log &text events"), _T(""), true); - menuLog->Append(TEXT_LOG_FOCUS, _T("Log &focus events"), _T(""), true); + menuLog->AppendCheckItem(TEXT_LOG_KEY, _T("Log &key events")); + menuLog->AppendCheckItem(TEXT_LOG_CHAR, _T("Log &char events")); + menuLog->AppendCheckItem(TEXT_LOG_MOUSE, _T("Log &mouse events")); + menuLog->AppendCheckItem(TEXT_LOG_TEXT, _T("Log &text events")); + menuLog->AppendCheckItem(TEXT_LOG_FOCUS, _T("Log &focus events")); menuLog->AppendSeparator(); menuLog->Append(TEXT_CLEAR, _T("&Clear the log\tCtrl-C"), _T("Clear the log window contents")); diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 4b6f7d7ef3..3fb9a987d3 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -186,20 +186,20 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h) file_menu->AppendSeparator(); file_menu->Append(TreeTest_Quit, wxT("E&xit\tAlt-X")); - style_menu->Append(TreeTest_TogButtons, wxT("Toggle &normal buttons"), wxT(""), true); - style_menu->Append(TreeTest_TogTwist, wxT("Toggle &twister buttons"), wxT(""), true); - style_menu->Append(TreeTest_ToggleButtons, wxT("Toggle image &buttons"), wxT(""), true); + style_menu->AppendCheckItem(TreeTest_TogButtons, wxT("Toggle &normal buttons")); + style_menu->AppendCheckItem(TreeTest_TogTwist, wxT("Toggle &twister buttons")); + style_menu->AppendCheckItem(TreeTest_ToggleButtons, wxT("Toggle image &buttons")); style_menu->AppendSeparator(); - style_menu->Append(TreeTest_TogLines, wxT("Toggle &connecting lines"), wxT(""), true); - style_menu->Append(TreeTest_TogRootLines, wxT("Toggle &lines at root"), wxT(""), true); - style_menu->Append(TreeTest_TogHideRoot, wxT("Toggle &hidden root"), wxT(""), true); - style_menu->Append(TreeTest_TogBorder, wxT("Toggle &item border"), wxT(""), true); - style_menu->Append(TreeTest_TogFullHighlight, wxT("Toggle &full row highlight"), wxT(""), true); - style_menu->Append(TreeTest_TogEdit, wxT("Toggle &edit mode"), wxT(""), true); + style_menu->AppendCheckItem(TreeTest_TogLines, wxT("Toggle &connecting 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")); + style_menu->AppendCheckItem(TreeTest_TogFullHighlight, wxT("Toggle &full row highlight")); + style_menu->AppendCheckItem(TreeTest_TogEdit, wxT("Toggle &edit mode")); #ifndef NO_MULTIPLE_SELECTION - style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"), wxT(""), true); + style_menu->AppendCheckItem(TreeTest_ToggleSel, wxT("Toggle &selection mode")); #endif // NO_MULTIPLE_SELECTION - style_menu->Append(TreeTest_ToggleImages, wxT("Toggle show ima&ges"), wxT(""), true); + style_menu->AppendCheckItem(TreeTest_ToggleImages, wxT("Toggle show ima&ges")); style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze...")); style_menu->AppendSeparator(); style_menu->Append(TreeTest_SetFgColour, wxT("Set &foreground colour...")); diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index 9fba07791b..052d043a52 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -107,7 +107,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, int x, int y, int w, int wxMenu *file_menu = new wxMenu; file_menu->Append(VALIDATE_TEST_DIALOG, wxT("&Test"), wxT("Demonstrate validators")); - file_menu->Append(VALIDATE_TOGGLE_BELL, wxT("&Bell on error"), wxT("Toggle bell on error"), true); + file_menu->AppendCheckItem(VALIDATE_TOGGLE_BELL, wxT("&Bell on error"), wxT("Toggle bell on error")); file_menu->AppendSeparator(); file_menu->Append(wxID_EXIT, wxT("E&xit")); -- 2.47.2