]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 846809 ] Cleaning of 11 samples
authorJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 11:25:46 +0000 (11:25 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 11:25:46 +0000 (11:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
samples/drawing/drawing.cpp
samples/internat/internat.cpp
samples/keyboard/keyboard.cpp
samples/listbox/lboxtest.cpp
samples/mobile/wxedit/wxedit.cpp
samples/notebook/notebook.cpp
samples/treectrl/treetest.cpp
samples/typetest/typetest.cpp
samples/vscroll/vstest.cpp
samples/widgets/checkbox.cpp
samples/widgets/radiobox.cpp
samples/wxtest/test_wdr.h

index 828799729396b894812556f9bf0c4beb3a68b865..bf43a853b06ac5f0632c61599fe07a800d805fdd 100644 (file)
@@ -150,7 +150,7 @@ public:
     void OnPaint(wxPaintEvent &event);
     void OnMouseMove(wxMouseEvent &event);
 
-    void Show(ScreenToShow show) { m_show = show; Refresh(); }
+    void ToShow(ScreenToShow show) { m_show = show; Refresh(); }
 
     // set or remove the clipping region
     void Clip(bool clip) { m_clip = clip; Refresh(); }
@@ -1141,7 +1141,7 @@ void MyFrame::OnClip(wxCommandEvent& event)
 
 void MyFrame::OnShow(wxCommandEvent& event)
 {
-    m_canvas->Show((ScreenToShow)(event.GetId() - MenuShow_First));
+    m_canvas->ToShow((ScreenToShow)(event.GetId() - MenuShow_First));
 }
 
 void MyFrame::OnOption(wxCommandEvent& event)
index 71304b917d7c5e9911827450dcf4198972c24121..ba105e911ca14287ce537f8ba01811c777448365 100644 (file)
@@ -337,8 +337,7 @@ void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
 {
     const wxChar* title = _("Testing _N() (ngettext)");
     wxTextEntryDialog d(this,
-           _("Please enter range for plural forms of \"n files deleted\""
-               "phrase"),
+           _("Please enter range for plural forms of \"n files deleted\" phrase"),
            title, _T("0-10"));
     if (d.ShowModal() == wxID_OK)
     {
index 29cc5abb9611fc6de6a61c5a644c3adf9afbdb6c..ae4b8022e5eeaa33171da6b6788695e058d1a0c1 100644 (file)
@@ -352,7 +352,7 @@ void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
 void TextWindow::LogEvent(const wxChar *name, wxKeyEvent& event)
 {
     wxString key;
-    long keycode = event.KeyCode();
+    long keycode = event.GetKeyCode();
     switch ( keycode )
     {
         case WXK_BACK: key = _T("BACK"); break;
index 2e38ba5d72359f74d2dc9e33123f02fc24fabcf0..df14dbd815036562f0a4a310d8e5af24365fdf0b 100644 (file)
@@ -38,6 +38,7 @@
 
 // for all others, include the necessary headers
 #ifndef WX_PRECOMP
+    #include "wx/wx.h"
     #include "wx/app.h"
     #include "wx/frame.h"
     #include "wx/dcclient.h"
@@ -257,11 +258,6 @@ private:
 
 IMPLEMENT_APP(LboxTestApp)
 
-#ifdef __WXUNIVERSAL__
-    WX_USE_THEME(win32);
-    WX_USE_THEME(gtk);
-#endif // __WXUNIVERSAL__
-
 // ----------------------------------------------------------------------------
 // event tables
 // ----------------------------------------------------------------------------
@@ -670,14 +666,15 @@ void LboxTestFrame::OnUpdateUIAddSeveral(wxUpdateUIEvent& event)
 void LboxTestFrame::OnListbox(wxCommandEvent& event)
 {
     int sel = event.GetInt();
-    m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
+    m_textDelete->SetValue(wxString::Format(_T("%d"), sel));
 
     wxLogMessage(_T("Listbox item %d selected"), sel);
 }
 
 void LboxTestFrame::OnListboxDClick(wxCommandEvent& event)
 {
-    wxLogMessage(_T("Listbox item %d double clicked"), event.GetInt());
+    int sel = event.GetInt();
+    wxLogMessage(_T("Listbox item %d double clicked"), sel);
 }
 
 void LboxTestFrame::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
index 5213691c09d7b8c52bf3b620ff5258bcfd12808e..5798973d7763c255bcee70c7f173d6df110c9cd9 100644 (file)
@@ -152,19 +152,19 @@ void MyFrame::CreateMyMenuBar()
     SetMenuBar( menu_bar );
 }
 
-void MyFrame::OnCopy( wxCommandEvent &event )
+void MyFrame::OnCopy( wxCommandEvent& WXUNUSED(event) )
 {
 }
 
-void MyFrame::OnCut( wxCommandEvent &event )
+void MyFrame::OnCut( wxCommandEvent& WXUNUSED(event) )
 {
 }
 
-void MyFrame::OnPaste( wxCommandEvent &event )
+void MyFrame::OnPaste( wxCommandEvent& WXUNUSED(event) )
 {
 }
 
-void MyFrame::OnDelete( wxCommandEvent &event )
+void MyFrame::OnDelete( wxCommandEvent& WXUNUSED(event) )
 {
 }
 
@@ -177,17 +177,27 @@ void MyFrame::OnLastFiles( wxCommandEvent &event )
         
     size_t index = event.GetId() - ID_LAST_1;
     
-    wxASSERT( index < m_history.GetCount() );
-    
+    if( index < m_history.GetCount() )
+    {
     m_filename = m_history[index];
     
     m_text->Clear();
     m_text->LoadFile( m_filename );
     
     SetStatusText( m_filename );
+    }
+    else
+    {
+        wxMessageBox(
+            _T("This entry is empty. It should be filled once you will start opening."),
+            _T("Empty entry"),
+            wxOK | wxICON_INFORMATION,
+            this
+        );
+    }
 }
 
-void MyFrame::OnNew( wxCommandEvent &event )
+void MyFrame::OnNew( wxCommandEvent& WXUNUSED(event) )
 {
     if (!Discard()) return;
 
@@ -201,7 +211,7 @@ void MyFrame::OnNew( wxCommandEvent &event )
     SetStatusText( _T("") );
 }
 
-void MyFrame::OnOpen( wxCommandEvent &event )
+void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
 {
     if (!Discard()) return;
 
@@ -246,12 +256,12 @@ void MyFrame::OnOpen( wxCommandEvent &event )
     }
 }
 
-void MyFrame::OnSave( wxCommandEvent &event )
+void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) )
 {
     Save();
 }
 
-void MyFrame::OnSaveAs( wxCommandEvent &event )
+void MyFrame::OnSaveAs( wxCommandEvent& WXUNUSED(event) )
 {
     wxFileDialog dialog( this, _T("Open text"), _T(""), _T(""),
         _T("Text file (*.txt)|*.txt|Any file (*)|*"),
@@ -265,14 +275,14 @@ void MyFrame::OnSaveAs( wxCommandEvent &event )
     }
 }
 
-void MyFrame::OnAbout( wxCommandEvent &event )
+void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
 {
     wxMessageDialog dialog( this, _T("Welcome to wxEdit\n(C)opyright Robert Roebling"),
         _T("About wxEdit"), wxOK|wxICON_INFORMATION );
     dialog.ShowModal();
 }
 
-void MyFrame::OnQuit( wxCommandEvent &event )
+void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
 {
      Close( TRUE );
 }
@@ -340,7 +350,7 @@ void MyFrame::OnUpdateUI( wxUpdateUIEvent &event )
     }
 }
 
-void MyFrame::OnCloseWindow( wxCloseEvent &event )
+void MyFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
 {
     // Save changes?
     if (!Discard()) return;    
index ab4506cbd726fe8761d337a068e79c96c6cdf66f..01ed0558dd1b45c8e8e89b86580e7f78a1ed78ec 100644 (file)
@@ -161,11 +161,9 @@ wxPanel *MyNotebook::CreateInsertPage()
 
 void MyNotebook::CreateInitialPages()
 {
-    wxPanel *panel = (wxPanel *) NULL;
-
     // Create and add some panels to the notebook
 
-    panel = CreateRadioButtonsPage();
+    wxPanel *panel = CreateRadioButtonsPage();
     AddPage( panel, RADIOBUTTONS_PAGE_NAME, FALSE, GetIconIndex() );
 
     panel = CreateVetoPage();
index 270161f9ca6293119fe0bb654e685b1cccb2972d..13ba5b3b37bf8ee777f599d2a3b5b1a630f89765 100644 (file)
 #include "icon3.xpm"
 #include "icon4.xpm"
 #include "icon5.xpm"
+
+#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
 #include "mondrian.xpm"
+#endif
 
 
 // verify that the item is ok and insult the user if it is not
index 8ee42c8455f3fd2b748550ec908690127979cdca..695f8fec2b1a0f1e523639ac80497023a25ca8f4 100644 (file)
@@ -728,7 +728,6 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
     textCtrl.WriteText( _T("\nTesting Ungetch():\n\n") );
 
     char ch = 0;
-    size_t pos = 0;
     wxString str;
 
     textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
@@ -744,7 +743,7 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
     wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
 
     ch = file_input.GetC();
-    pos = file_input.TellI();
+    size_t pos = file_input.TellI();
     str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
     textCtrl.WriteText( str );
 
@@ -808,7 +807,6 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
     textCtrl.WriteText( _T("\nTesting Ungetch() in buffered input stream:\n\n") );
 
     char ch = 0;
-    size_t pos = 0;
     wxString str;
 
     textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
@@ -825,7 +823,7 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
     wxBufferedInputStream buf_input( file_input );
 
     ch = buf_input.GetC();
-    pos = buf_input.TellI();
+    size_t pos = buf_input.TellI();
     str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
     textCtrl.WriteText( str );
 
@@ -977,10 +975,11 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
     textCtrl.Clear();
     textCtrl << _T("\nTest byte order macros:\n\n");
 
-    if (wxBYTE_ORDER == wxLITTLE_ENDIAN)
+    #if wxBYTE_ORDER == wxLITTLE_ENDIAN
         textCtrl << _T("This is a little endian system.\n\n");
-    else
+    #else
         textCtrl << _T("This is a big endian system.\n\n");
+    #endif
 
     wxString text;
 
index 378fe4cebc6658c973fd08637f7f847a0ccac7e8..d5e9b9a26376f31090cff187b9dd4362ad09283c 100644 (file)
@@ -27,6 +27,7 @@
 // for all others, include the necessary headers (this file is usually all you
 // need because it includes almost all "standard" wxWindows headers)
 #ifndef WX_PRECOMP
+    #include "wx/wx.h"
     #include "wx/app.h"
     #include "wx/frame.h"
 #endif
index fe14ea96573f6a95912c37d65b6e2df5492703ed..4cd2da6f662fbc7514ac8bb4e86e242803825a89 100644 (file)
@@ -148,8 +148,8 @@ void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event)
     };
     wxCheckBoxState state = (wxCheckBoxState) event.GetInt();
 
-    wxCHECK_RET( (state >= 0) && (state < WXSIZEOF(stateNames)),
-        "event.GetInt() returned an invalid wxCheckBoxState" );
+    wxCHECK_RET( (state >= (wxCheckBoxState)0) && (state < (wxCheckBoxState)WXSIZEOF(stateNames)),
+        _T("event.GetInt() returned an invalid wxCheckBoxState") );
 
     wxLogMessage(wxT("Checkbox now set to state: %s"),
         stateNames[state].c_str());
index 612c3fe51544a704c7775b288e09934fd1d40238..4967b10661f600d88499f454e77c860a99845913 100644 (file)
@@ -384,10 +384,12 @@ void RadioWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
 void RadioWidgetsPage::OnRadioBox(wxCommandEvent& event)
 {
     int sel = m_radio->GetSelection();
+    int event_sel = event.GetSelection();
+    wxUnusedVar(event_sel);
 
     wxLogMessage(_T("Radiobox selection changed, now %d"), sel);
 
-    wxASSERT_MSG( sel == event.GetSelection(),
+    wxASSERT_MSG( sel == event_sel,
                   _T("selection should be the same in event and radiobox") );
 
     m_textCurSel->SetValue(wxString::Format(_T("%d"), sel));
index 352fe7a4efb847746f153d20dd155cc546879460..f45b301ca1a974e9f4fbb1aa064d9cbe5ecb4208 100644 (file)
@@ -24,7 +24,6 @@
 #include <wx/listctrl.h>
 #include <wx/treectrl.h>
 #include <wx/notebook.h>
-#include <wx/grid.h>
 
 // Declare window functions