X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47d67540a017101b3e46abe9ef0f55914d8de37e..f0824a5a4a255989b5153945ade9e21232724980:/samples/toolbar/test.cpp diff --git a/samples/toolbar/test.cpp b/samples/toolbar/test.cpp index 0274aefac2..69bbfe4173 100644 --- a/samples/toolbar/test.cpp +++ b/samples/toolbar/test.cpp @@ -21,9 +21,11 @@ #endif #include "wx/toolbar.h" +#include + #include "test.h" -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #include "bitmaps/new.xpm" #include "bitmaps/open.xpm" @@ -38,7 +40,6 @@ IMPLEMENT_APP(MyApp) - // The `main program' equivalent, creating the windows and returning the // main frame bool MyApp::OnInit(void) @@ -51,11 +52,7 @@ bool MyApp::OnInit(void) frame->CreateStatusBar(); // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon("mondrian")); -#else - frame->SetIcon( wxIcon(mondrian_xpm) ); -#endif + frame->SetIcon(wxICON(mondrian)); // Make a menubar wxMenu *fileMenu = new wxMenu; @@ -92,8 +89,6 @@ bool MyApp::OnInit(void) bool MyApp::InitToolbar(wxToolBar* toolBar) { - toolBar->SetMargins(5, 5); - // Set up toolbar wxBitmap* toolBarBitmaps[8]; @@ -125,21 +120,21 @@ bool MyApp::InitToolbar(wxToolBar* toolBar) #endif int currentX = 5; - toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "New file"); + 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, (float)currentX, -1, (wxObject *) NULL, "Open file"); + toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file"); currentX += width + 5; - toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Save file"); + toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Save file"); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Copy"); + toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Copy"); currentX += width + 5; - toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Cut"); + toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Cut"); currentX += width + 5; - toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Paste"); + toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste"); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Print"); + toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Print"); currentX += width + 5; toolBar->AddSeparator(); toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help"); @@ -167,7 +162,7 @@ END_EVENT_TABLE() // Define my frame constructor MyFrame::MyFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): - wxFrame(parent, id, title, pos, size, style) + wxFrame(parent, id, title, pos, size, style), m_timer(this) { m_textWindow = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE); } @@ -179,7 +174,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("wxWindows wxToolBar demo\n", "About wxToolBar"); +// (void)wxMessageBox("wxWindows wxToolBar demo\n", "About wxToolBar"); + wxLogStatus("Started timer."); + + m_timer.Start(500, TRUE); } // Define the behaviour for the frame closing