Applied patch [ 846809 ] Cleaning of 11 samples
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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))
 | 
			
		||||
 
 | 
			
		||||
@@ -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;    
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,10 @@
 | 
			
		||||
#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
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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());
 | 
			
		||||
 
 | 
			
		||||
@@ -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));
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,6 @@
 | 
			
		||||
#include <wx/listctrl.h>
 | 
			
		||||
#include <wx/treectrl.h>
 | 
			
		||||
#include <wx/notebook.h>
 | 
			
		||||
#include <wx/grid.h>
 | 
			
		||||
 | 
			
		||||
// Declare window functions
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user