From: Vadim Zeitlin Date: Thu, 2 Mar 2000 01:06:16 +0000 (+0000) Subject: no changes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9121bed24932c908973354297da8750adc4f7374 no changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index ca95765f7b..789b36b069 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -111,6 +111,7 @@ public: void OnEnableAll(wxCommandEvent& event); void OnChangeColour(wxCommandEvent& event); void OnTestButton(wxCommandEvent& event); + void OnBmpButton(wxCommandEvent& event); wxListBox *m_listbox, *m_listboxSorted; @@ -263,7 +264,6 @@ bool MyApp::OnInit() frame->SetMenuBar(menu_bar); frame->Show(TRUE); - frame->SetCursor(wxCursor(wxCURSOR_HAND)); //frame->GetPanel()->m_notebook->SetSelection(6); @@ -328,6 +328,7 @@ const int ID_SPINCTRL = 185; const int ID_BUTTON_TEST1 = 190; const int ID_BUTTON_TEST2 = 191; +const int ID_BITMAP_BTN = 192; const int ID_CHANGE_COLOUR = 200; @@ -383,6 +384,7 @@ EVT_BUTTON (ID_BUTTON_LABEL, MyPanel::OnUpdateLabel) EVT_CHECKBOX (ID_CHANGE_COLOUR, MyPanel::OnChangeColour) EVT_BUTTON (ID_BUTTON_TEST1, MyPanel::OnTestButton) EVT_BUTTON (ID_BUTTON_TEST2, MyPanel::OnTestButton) +EVT_BUTTON (ID_BITMAP_BTN, MyPanel::OnBmpButton) END_EVENT_TABLE() MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) @@ -502,6 +504,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #endif // wxUSE_TOOLTIPS (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, "&Toggle colour", wxPoint(110,170) ); + panel->SetCursor(wxCursor(wxCURSOR_HAND)); m_notebook->AddPage(panel, "wxListBox", TRUE, Image_List); panel = new wxPanel(m_notebook); @@ -631,7 +634,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) dc.DrawText("Bitmap", 30, 40); dc.SelectObject( wxNullBitmap ); - (void)new wxBitmapButton(panel, -1, bitmap, wxPoint(100, 20)); + (void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20)); #ifdef __WXMSW__ // test for masked bitmap display @@ -745,6 +748,11 @@ void MyPanel::OnTestButton(wxCommandEvent& event) event.GetId() == ID_BUTTON_TEST1 ? _T('1') : _T('2')); } +void MyPanel::OnBmpButton(wxCommandEvent& event) +{ + wxLogMessage(_T("Bitmap button clicked.")); +} + void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event)) { static wxColour s_colOld; @@ -1222,7 +1230,7 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) { wxBusyCursor bc; -#if 0 // VZ: my temp test code, will remove +#if 1 // VZ: my temp test code, will remove wxGetTextFromUser("msg", "caption", "val", this); return; #endif // 0 diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index add313c026..dd794c9b34 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -223,10 +223,13 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // ... and attach this menu bar to the frame SetMenuBar(menuBar); + // create the listbox in which we will show misc messages as they come + m_listbox = new wxListBox(this, -1); + #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(); - SetStatusText(_T("Welcome to wxWindows!")); + SetStatusText(_T("Welcome to wxWindows exec sample!")); #endif // wxUSE_STATUSBAR } diff --git a/samples/minifram/test.cpp b/samples/minifram/test.cpp index 7cb4e05da5..6d1b34c895 100644 --- a/samples/minifram/test.cpp +++ b/samples/minifram/test.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". @@ -49,7 +49,7 @@ wxButton *button = (wxButton*) NULL; // The `main program' equivalent, creating the windows and returning the // main frame -bool MyApp::OnInit(void) +bool MyApp::OnInit() { // Create the mini frame window mini_frame = new MyMiniFrame((wxFrame *) NULL, -1, "wxMiniFrame sample", @@ -58,14 +58,14 @@ bool MyApp::OnInit(void) mini_frame->CreateToolBar(wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT, ID_TOOLBAR); InitToolbar(mini_frame->GetToolBar()); - + // Create the main frame window main_frame = new MyMainFrame((wxFrame *) NULL, -1, "wxFrame sample", wxPoint(100, 100), wxSize(300, 200)); - + main_frame->CreateToolBar(wxNO_BORDER|wxTB_VERTICAL, ID_TOOLBAR); InitToolbar(main_frame->GetToolBar()); - + button = new wxButton( main_frame, ID_REPARENT, "Press to reparent!" ); #ifdef __WXMSW__ @@ -77,7 +77,7 @@ bool MyApp::OnInit(void) #endif SetTopWindow(main_frame); - + main_frame->Show(TRUE); mini_frame->Show(TRUE); @@ -139,7 +139,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar) toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help"); toolBar->Realize(); - + toolBar->EnableTool( wxID_HELP, FALSE ); // Can delete the bitmaps since they're reference counted @@ -201,8 +201,8 @@ void MyMainFrame::OnReparent(wxCommandEvent& WXUNUSED(event)) // after closing the mini_frame. We'll have the last laugh. if (! mini_frame_exists) wxMessageBox("The miniframe no longer exists.\n" - "You don't want to make this button an orphan, do you?", - "You got to be kidding"); + "You don't want to make this button an orphan, do you?", + "You got to be kidding"); else button->Reparent( mini_frame ); } diff --git a/samples/newgrid/griddemo.cpp b/samples/newgrid/griddemo.cpp index 7817e47a27..c8d754d620 100644 --- a/samples/newgrid/griddemo.cpp +++ b/samples/newgrid/griddemo.cpp @@ -815,26 +815,10 @@ static const wxChar* severities[] = static struct BugsGridData { int id; - - // Borland can't deal with global wxStrings and will generate a - // compile time error with the initializing the gs_dataGridBugs - // array (below) - // -#ifndef __BORLANDC__ - wxString summary; -#else - wxChar *summary; -#endif - + wxChar summary[80]; Severity severity; int prio; - -#ifndef __BORLANDC__ - wxString platform; -#else - wxChar *platform; -#endif - + wxChar platform[12]; bool opened; } gs_dataBugsGrid [] = { @@ -958,27 +942,11 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value ) break; case Col_Summary: -#ifndef __BORLANDC__ - gd.summary = value; -#else - // this generates a warning message if you are using the - // memory tracing code but it should be ok :MB - // - delete gd.summary; - gd.summary = copystring( value.c_str() ); -#endif + wxStrncpy(gd.summary, value, WXSIZEOF(gd.summary)); break; case Col_Platform: -#ifndef __BORLANDC__ - gd.platform = value; -#else - // this generates a warning message if you are using the - // memory tracing code but it should be ok :MB - // - delete gd.platform; - gd.platform = copystring( value.c_str() ); -#endif + wxStrncpy(gd.platform, value, WXSIZEOF(gd.platform)); break; } }