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(); }
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)
{
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)
{
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;
// 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"
IMPLEMENT_APP(LboxTestApp)
-#ifdef __WXUNIVERSAL__
- WX_USE_THEME(win32);
- WX_USE_THEME(gtk);
-#endif // __WXUNIVERSAL__
-
// ----------------------------------------------------------------------------
// event tables
// ----------------------------------------------------------------------------
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))
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) )
{
}
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;
SetStatusText( _T("") );
}
-void MyFrame::OnOpen( wxCommandEvent &event )
+void MyFrame::OnOpen( wxCommandEvent& WXUNUSED(event) )
{
if (!Discard()) return;
}
}
-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 (*)|*"),
}
}
-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 );
}
}
}
-void MyFrame::OnCloseWindow( wxCloseEvent &event )
+void MyFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
{
// Save changes?
if (!Discard()) return;
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();
#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
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") );
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 );
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") );
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 );
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;
// 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
};
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());
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));
#include <wx/listctrl.h>
#include <wx/treectrl.h>
#include <wx/notebook.h>
-#include <wx/grid.h>
// Declare window functions