From fc6bbc6dad24c086af8ed1caea39dc3d4482eb95 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 13 Dec 1999 23:05:56 +0000 Subject: [PATCH] updated the sample and renamed the files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/toolbar/Makefile.in | 2 +- samples/toolbar/makefile.b32 | 2 +- samples/toolbar/makefile.bcc | 2 +- samples/toolbar/makefile.dos | 2 +- samples/toolbar/makefile.g95 | 2 +- samples/toolbar/makefile.vc | 2 +- samples/toolbar/makefile.wat | 2 +- samples/toolbar/{test.cpp => toolbar.cpp} | 28 +++++++++-------------- samples/toolbar/{test.def => toolbar.def} | 0 samples/toolbar/{test.rc => toolbar.rc} | 0 10 files changed, 18 insertions(+), 24 deletions(-) rename samples/toolbar/{test.cpp => toolbar.cpp} (94%) rename samples/toolbar/{test.def => toolbar.def} (100%) rename samples/toolbar/{test.rc => toolbar.rc} (100%) diff --git a/samples/toolbar/Makefile.in b/samples/toolbar/Makefile.in index 9ae0fa71c7..0d69e480ec 100644 --- a/samples/toolbar/Makefile.in +++ b/samples/toolbar/Makefile.in @@ -13,7 +13,7 @@ top_srcdir = @top_srcdir@ top_builddir = ../.. program_dir = samples/toolbar -PROGRAM=test +PROGRAM=toolbar OBJECTS=$(PROGRAM).o diff --git a/samples/toolbar/makefile.b32 b/samples/toolbar/makefile.b32 index 95ddc80d76..1645915c3a 100644 --- a/samples/toolbar/makefile.b32 +++ b/samples/toolbar/makefile.b32 @@ -9,7 +9,7 @@ WXDIR = $(WXWIN) -TARGET=test +TARGET=toolbar OBJECTS = $(TARGET).obj !include $(WXDIR)\src\makeprog.b32 diff --git a/samples/toolbar/makefile.bcc b/samples/toolbar/makefile.bcc index 669f01905a..3694771dd1 100644 --- a/samples/toolbar/makefile.bcc +++ b/samples/toolbar/makefile.bcc @@ -12,7 +12,7 @@ WXDIR = $(WXWIN) -TARGET=test +TARGET=toolbar OBJECTS=$(TARGET).obj !include $(WXDIR)\src\makeprog.bcc diff --git a/samples/toolbar/makefile.dos b/samples/toolbar/makefile.dos index 13e3a4ce8e..c98a1b1f01 100644 --- a/samples/toolbar/makefile.dos +++ b/samples/toolbar/makefile.dos @@ -10,7 +10,7 @@ WXDIR = $(WXWIN) -TARGET=test +TARGET=toolbar OBJECTS = $(TARGET).obj !include $(WXDIR)\src\makeprog.msc diff --git a/samples/toolbar/makefile.g95 b/samples/toolbar/makefile.g95 index b4a920f047..d011eb9db7 100644 --- a/samples/toolbar/makefile.g95 +++ b/samples/toolbar/makefile.g95 @@ -9,7 +9,7 @@ WXDIR = ../.. -TARGET=test +TARGET=toolbar OBJECTS = $(TARGET).o include $(WXDIR)/src/makeprog.g95 diff --git a/samples/toolbar/makefile.vc b/samples/toolbar/makefile.vc index 4ada748eda..bbff798ce4 100644 --- a/samples/toolbar/makefile.vc +++ b/samples/toolbar/makefile.vc @@ -11,7 +11,7 @@ # Set WXDIR for your system WXDIR = $(WXWIN) -PROGRAM=test +PROGRAM=toolbar OBJECTS = $(PROGRAM).obj !include $(WXDIR)\src\makeprog.vc diff --git a/samples/toolbar/makefile.wat b/samples/toolbar/makefile.wat index 81a83e42a9..8c27bfb8a9 100644 --- a/samples/toolbar/makefile.wat +++ b/samples/toolbar/makefile.wat @@ -7,7 +7,7 @@ WXDIR = $(%WXWIN) -PROGRAM = test +PROGRAM = toolbar OBJECTS = $(PROGRAM).obj !include $(WXDIR)\src\makeprog.wat diff --git a/samples/toolbar/test.cpp b/samples/toolbar/toolbar.cpp similarity index 94% rename from samples/toolbar/test.cpp rename to samples/toolbar/toolbar.cpp index 84aeb13a20..623e503e5c 100644 --- a/samples/toolbar/test.cpp +++ b/samples/toolbar/toolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: test.cpp +// Name: toolbar.cpp // Purpose: wxToolBar sample // Author: Julian Smart // Modified by: @@ -214,8 +214,6 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons) toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file"); currentX += width + 5; toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file"); - currentX += width + 5; - toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1"); wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO); combo->Append("This"); @@ -227,6 +225,8 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons) if ( !smallicons ) { + currentX += width + 5; + toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1"); currentX += width + 5; toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 2"); currentX += width + 5; @@ -243,7 +243,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons) toolBar->Realize(); // Can delete the bitmaps since they're reference counted - int i, max = smallicons ? 3 : WXSIZEOF(toolBarBitmaps); + int i, max = smallicons ? 2 : WXSIZEOF(toolBarBitmaps); for (i = 0; i < max; i++) delete toolBarBitmaps[i]; @@ -274,11 +274,11 @@ MyFrame::MyFrame(wxFrame* parent, // Make a menubar wxMenu *tbarMenu = new wxMenu; - tbarMenu->Append(IDM_TOOLBAR_TOGGLETOOLBAR, "&Toggle toolbar", "Change the toolbar kind"); - tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, "&Enable print button", ""); - tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, "&Delete print button", ""); - tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, "&Insert print button", ""); - tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, "Toggle &help button", ""); + tbarMenu->Append(IDM_TOOLBAR_TOGGLETOOLBAR, "&Toggle toolbar\tCtrl-T", "Change the toolbar kind"); + tbarMenu->Append(IDM_TOOLBAR_ENABLEPRINT, "&Enable print button\tCtrl-E", ""); + tbarMenu->Append(IDM_TOOLBAR_DELETEPRINT, "&Delete print button\tCtrl-D", ""); + tbarMenu->Append(IDM_TOOLBAR_INSERTPRINT, "&Insert print button\tCtrl-I", ""); + tbarMenu->Append(IDM_TOOLBAR_TOGGLEHELP, "Toggle &help button\tCtrl-T", ""); wxMenu *fileMenu = new wxMenu; fileMenu->Append(wxID_EXIT, "E&xit", "Quit toolbar sample" ); @@ -378,12 +378,7 @@ void MyFrame::DoDeletePrint() { wxToolBar *tb = GetToolBar(); - // only implemented in wxGTK and wxMSW for now -#if !defined(__WXGTK__) && !defined(__WXMSW__) - wxMessageBox("Sorry, wxToolBar::DeleteTool is not implemented."); -#else tb->DeleteTool( wxID_PRINT ); -#endif } void MyFrame::DoToggleHelp() @@ -400,9 +395,8 @@ void MyFrame::OnInsertPrint(wxCommandEvent& WXUNUSED(event)) wxBitmap bmp(print_xpm); #endif - GetToolBar()->AddTool(wxID_PRINT, bmp, wxNullBitmap, - FALSE, 0, -1, - (wxObject *) NULL, "Delete this tool"); + GetToolBar()->InsertTool(0, wxID_PRINT, bmp, wxNullBitmap, + FALSE, (wxObject *) NULL, "Delete this tool"); GetToolBar()->Realize(); } diff --git a/samples/toolbar/test.def b/samples/toolbar/toolbar.def similarity index 100% rename from samples/toolbar/test.def rename to samples/toolbar/toolbar.def diff --git a/samples/toolbar/test.rc b/samples/toolbar/toolbar.rc similarity index 100% rename from samples/toolbar/test.rc rename to samples/toolbar/toolbar.rc -- 2.45.2