X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c734a8b9a4a881b0348d686e16dbee1ba6a53424..3afe2fd691f7b46d8a076c6c45663005c5173d49:/samples/text/text.cpp diff --git a/samples/text/text.cpp b/samples/text/text.cpp index a2509fbc41..0d885c38e1 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: text.cpp -// Purpose: TextCtrl wxWindows sample +// Purpose: TextCtrl wxWidgets sample // Author: Robert Roebling // Modified by: // RCS-ID: $Id$ @@ -8,10 +8,6 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "text.cpp" -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -66,7 +62,7 @@ public: const wxPoint &pos, const wxSize &size, int style = 0) : wxTextCtrl(parent, id, value, pos, size, style) { - m_hasCapture = FALSE; + m_hasCapture = false; } void OnKeyDown(wxKeyEvent& event); @@ -153,47 +149,47 @@ public: #endif // wxUSE_TOOLTIPS #if wxUSE_CLIPBOARD - void OnPasteFromClipboard( wxCommandEvent &event ) + void OnPasteFromClipboard( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoPasteFromClipboard(); } - void OnCopyToClipboard( wxCommandEvent &event ) + void OnCopyToClipboard( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoCopyToClipboard(); } #endif // wxUSE_CLIPBOARD - void OnAddTextFreeze( wxCommandEvent& event ) + void OnAddTextFreeze( wxCommandEvent& WXUNUSED(event) ) { DoAddText(true); } - void OnAddText( wxCommandEvent& event ) + void OnAddText( wxCommandEvent& WXUNUSED(event) ) { DoAddText(false); } - void OnRemoveText( wxCommandEvent& event ) + void OnRemoveText( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoRemoveText(); } - void OnReplaceText( wxCommandEvent& event ) + void OnReplaceText( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoReplaceText(); } - void OnSelectText( wxCommandEvent& event ) + void OnSelectText( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoSelectText(); } - void OnMoveToEndOfText( wxCommandEvent &event ) + void OnMoveToEndOfText( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoMoveToEndOfText(); } - void OnMoveToEndOfEntry( wxCommandEvent &event ) + void OnMoveToEndOfEntry( wxCommandEvent& WXUNUSED(event) ) { m_panel->DoMoveToEndOfEntry(); } - void OnScrollLineDown(wxCommandEvent& event) + void OnScrollLineDown(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->LineDown() ) wxLogMessage(_T("Already at the bottom")); } - void OnScrollLineUp(wxCommandEvent& event) + void OnScrollLineUp(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->LineUp() ) wxLogMessage(_T("Already at the top")); } - void OnScrollPageDown(wxCommandEvent& event) + void OnScrollPageDown(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->PageDown() ) wxLogMessage(_T("Already at the bottom")); } - void OnScrollPageUp(wxCommandEvent& event) + void OnScrollPageUp(wxCommandEvent& WXUNUSED(event)) { if ( !m_panel->m_textrich->PageUp() ) wxLogMessage(_T("Already at the top")); @@ -232,7 +228,7 @@ public: MyTextCtrl::ms_logFocus = event.IsChecked(); } - void OnSetText(wxCommandEvent& event) + void OnSetText(wxCommandEvent& WXUNUSED(event)) { m_panel->m_text->SetValue(_T("Hello, world (what else did you expect)?")); } @@ -351,7 +347,7 @@ bool MyApp::OnInit() { // Create the main frame window MyFrame *frame = new MyFrame((wxFrame *) NULL, - _T("Text wxWindows sample"), 50, 50, 700, 420); + _T("Text wxWidgets sample"), 50, 50, 700, 420); frame->SetSizeHints( 500, 400 ); wxMenu *file_menu = new wxMenu; @@ -374,8 +370,8 @@ bool MyApp::OnInit() tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, _T("Set &delay\tCtrl-D")); tooltip_menu->AppendSeparator(); tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, _T("&Toggle tooltips\tCtrl-T"), - _T("enable/disable tooltips"), TRUE); - tooltip_menu->Check(TEXT_TOOLTIPS_ENABLE, TRUE); + _T("enable/disable tooltips"), true); + tooltip_menu->Check(TEXT_TOOLTIPS_ENABLE, true); menu_bar->Append(tooltip_menu, _T("&Tooltips")); #endif // wxUSE_TOOLTIPS @@ -398,10 +394,10 @@ bool MyApp::OnInit() menuText->AppendSeparator(); menuText->Append(TEXT_MOVE_ENDTEXT, _T("Move cursor to the end of &text")); menuText->Append(TEXT_MOVE_ENDENTRY, _T("Move cursor to the end of &entry")); - menuText->Append(TEXT_SET_EDITABLE, _T("Toggle &editable state"), _T(""), TRUE); - menuText->Append(TEXT_SET_ENABLED, _T("Toggle e&nabled state"), _T(""), TRUE); - menuText->Check(TEXT_SET_EDITABLE, TRUE); - menuText->Check(TEXT_SET_ENABLED, TRUE); + menuText->Append(TEXT_SET_EDITABLE, _T("Toggle &editable state"), _T(""), true); + menuText->Append(TEXT_SET_ENABLED, _T("Toggle e&nabled state"), _T(""), true); + menuText->Check(TEXT_SET_EDITABLE, true); + menuText->Check(TEXT_SET_ENABLED, true); menuText->AppendSeparator(); menuText->Append(TEXT_LINE_DOWN, _T("Scroll text one line down")); menuText->Append(TEXT_LINE_UP, _T("Scroll text one line up")); @@ -410,33 +406,33 @@ bool MyApp::OnInit() menu_bar->Append(menuText, _T("Te&xt")); wxMenu *menuLog = new wxMenu; - menuLog->Append(TEXT_LOG_KEY, _T("Log &key events"), _T(""), TRUE); - menuLog->Append(TEXT_LOG_CHAR, _T("Log &char events"), _T(""), TRUE); - menuLog->Append(TEXT_LOG_MOUSE, _T("Log &mouse events"), _T(""), TRUE); - menuLog->Append(TEXT_LOG_TEXT, _T("Log &text events"), _T(""), TRUE); - menuLog->Append(TEXT_LOG_FOCUS, _T("Log &focus events"), _T(""), TRUE); + menuLog->Append(TEXT_LOG_KEY, _T("Log &key events"), _T(""), true); + menuLog->Append(TEXT_LOG_CHAR, _T("Log &char events"), _T(""), true); + menuLog->Append(TEXT_LOG_MOUSE, _T("Log &mouse events"), _T(""), true); + menuLog->Append(TEXT_LOG_TEXT, _T("Log &text events"), _T(""), true); + menuLog->Append(TEXT_LOG_FOCUS, _T("Log &focus events"), _T(""), true); menuLog->AppendSeparator(); menuLog->Append(TEXT_CLEAR, _T("&Clear the log\tCtrl-C"), _T("Clear the log window contents")); // select only the interesting events by default - menuLog->Check(TEXT_LOG_KEY, TRUE); - menuLog->Check(TEXT_LOG_CHAR, TRUE); - menuLog->Check(TEXT_LOG_TEXT, TRUE); + menuLog->Check(TEXT_LOG_KEY, true); + menuLog->Check(TEXT_LOG_CHAR, true); + menuLog->Check(TEXT_LOG_TEXT, true); MyTextCtrl::ms_logKey = MyTextCtrl::ms_logChar = - MyTextCtrl::ms_logText = TRUE; + MyTextCtrl::ms_logText = true; menu_bar->Append(menuLog, _T("&Log")); frame->SetMenuBar(menu_bar); - frame->Show(TRUE); + frame->Show(true); SetTopWindow(frame); // report success - return TRUE; + return true; } //---------------------------------------------------------------------- @@ -448,9 +444,9 @@ BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl) EVT_KEY_UP(MyTextCtrl::OnKeyUp) EVT_CHAR(MyTextCtrl::OnChar) - EVT_TEXT(-1, MyTextCtrl::OnText) - EVT_TEXT_URL(-1, MyTextCtrl::OnTextURL) - EVT_TEXT_MAXLEN(-1, MyTextCtrl::OnTextMaxLen) + EVT_TEXT(wxID_ANY, MyTextCtrl::OnText) + EVT_TEXT_URL(wxID_ANY, MyTextCtrl::OnTextURL) + EVT_TEXT_MAXLEN(wxID_ANY, MyTextCtrl::OnTextMaxLen) EVT_MOUSE_EVENTS(MyTextCtrl::OnMouseEvent) @@ -458,11 +454,11 @@ BEGIN_EVENT_TABLE(MyTextCtrl, wxTextCtrl) EVT_KILL_FOCUS(MyTextCtrl::OnKillFocus) END_EVENT_TABLE() -bool MyTextCtrl::ms_logKey = FALSE; -bool MyTextCtrl::ms_logChar = FALSE; -bool MyTextCtrl::ms_logMouse = FALSE; -bool MyTextCtrl::ms_logText = FALSE; -bool MyTextCtrl::ms_logFocus = FALSE; +bool MyTextCtrl::ms_logKey = false; +bool MyTextCtrl::ms_logChar = false; +bool MyTextCtrl::ms_logMouse = false; +bool MyTextCtrl::ms_logText = false; +bool MyTextCtrl::ms_logFocus = false; void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const { @@ -700,7 +696,7 @@ void MyTextCtrl::OnText(wxCommandEvent& event) } } -void MyTextCtrl::OnTextMaxLen(wxCommandEvent& event) +void MyTextCtrl::OnTextMaxLen(wxCommandEvent& WXUNUSED(event)) { wxLogMessage(_T("You can't enter more characters into this control.")); } @@ -780,13 +776,13 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) if (!m_hasCapture) { wxLogDebug( wxT("Now capturing mouse and events.") ); - m_hasCapture = TRUE; + m_hasCapture = true; CaptureMouse(); } else { wxLogDebug( wxT("Stopped capturing mouse and events.") ); - m_hasCapture = FALSE; + m_hasCapture = false; ReleaseMouse(); } break; @@ -838,9 +834,9 @@ BEGIN_EVENT_TABLE(MyPanel, wxPanel) END_EVENT_TABLE() MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) - : wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ) + : wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) ) { - m_log = new wxTextCtrl( this, -1, _T("This is the log window.\n"), + m_log = new wxTextCtrl( this, wxID_ANY, _T("This is the log window.\n"), wxPoint(5,260), wxSize(630,100), wxTE_MULTILINE | wxTE_READONLY /* | wxTE_RICH */); @@ -848,8 +844,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) // single line text controls - m_text = new MyTextCtrl( this, -1, _T("Single line."), - wxPoint(10,10), wxSize(140,-1), + m_text = new MyTextCtrl( this, wxID_ANY, _T("Single line."), + wxPoint(10,10), wxSize(140,wxDefaultSize.y), wxTE_PROCESS_ENTER); m_text->SetForegroundColour(*wxBLUE); m_text->SetBackgroundColour(*wxLIGHT_GREY); @@ -857,19 +853,19 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_text->SetInsertionPoint(0); m_text->WriteText( _T("Prepended. ") ); - m_password = new MyTextCtrl( this, -1, _T(""), - wxPoint(10,50), wxSize(140,-1), wxTE_PASSWORD ); + m_password = new MyTextCtrl( this, wxID_ANY, _T(""), + wxPoint(10,50), wxSize(140,wxDefaultSize.y), wxTE_PASSWORD ); - m_readonly = new MyTextCtrl( this, -1, _T("Read only"), - wxPoint(10,90), wxSize(140,-1), wxTE_READONLY ); + m_readonly = new MyTextCtrl( this, wxID_ANY, _T("Read only"), + wxPoint(10,90), wxSize(140,wxDefaultSize.y), wxTE_READONLY ); - m_limited = new MyTextCtrl(this, -1, _T("Max 8 ch"), - wxPoint(10, 130), wxSize(140, -1)); + m_limited = new MyTextCtrl(this, wxID_ANY, _T("Max 8 ch"), + wxPoint(10, 130), wxSize(140, wxDefaultSize.y)); m_limited->SetMaxLength(8); // multi line text controls - m_horizontal = new MyTextCtrl( this, -1, _T("Multiline text control with a horizontal scrollbar."), + m_horizontal = new MyTextCtrl( this, wxID_ANY, _T("Multiline text control with a horizontal scrollbar."), wxPoint(10,170), wxSize(140,70), wxTE_MULTILINE | wxHSCROLL ); // a little hack to use the command line argument for encoding testing @@ -879,21 +875,21 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) { case '2': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - FALSE, _T(""), + false, _T(""), wxFONTENCODING_ISO8859_2)); m_horizontal->SetValue(_T("®lu»ouèký kùò zbìsile èe¹tina «»")); break; case '1': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - FALSE, _T(""), + false, _T(""), wxFONTENCODING_CP1251)); m_horizontal->SetValue(_T("Ïðèâåò!")); break; case '8': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - FALSE, _T(""), + false, _T(""), wxFONTENCODING_CP1251)); #if wxUSE_UNICODE m_horizontal->SetValue(L"\x0412\x0430\x0434\x0438\x043c \x0426"); @@ -907,7 +903,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_horizontal->SetValue(_T("Text in default encoding")); } - m_multitext = new MyTextCtrl( this, -1, _T("Multi line."), + m_multitext = new MyTextCtrl( this, wxID_ANY, _T("Multi line."), wxPoint(180,10), wxSize(240,70), wxTE_MULTILINE ); m_multitext->SetFont(*wxITALIC_FONT); (*m_multitext) << _T(" Appended."); @@ -928,17 +924,13 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxPoint(180,170), wxSize(240,70), wxTE_MULTILINE); m_enter->SetClientData((void *)_T("enter")); -#if 0 - m_textrich = new MyTextCtrl(this, -1, _T("Allows more than 30Kb of text\n") + m_textrich = new MyTextCtrl(this, wxID_ANY, _T("Allows more than 30Kb of text\n") _T("(even under broken Win9x)\n") _T("and a very very very very very ") _T("very very very long line to test ") _T("wxHSCROLL style"), wxPoint(450, 10), wxSize(230, 230), - wxTE_RICH2 | - wxTE_MULTILINE | - // wxTE_AUTO_URL | - wxHSCROLL); + wxTE_RICH | wxTE_MULTILINE | wxHSCROLL); m_textrich->SetStyle(0, 10, *wxRED); m_textrich->SetStyle(10, 20, *wxBLUE); m_textrich->SetStyle(30, 40, @@ -953,13 +945,6 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_textrich->SetDefaultStyle(wxTextAttr(*wxBLUE, *wxWHITE)); m_textrich->AppendText(_T("And this should be in blue and the text you ") _T("type should be in blue as well")); -#else - m_textrich = new MyTextCtrl(this, -1, _T(""), - wxPoint(450, 10), wxSize(230, 230), - wxTE_RICH2 | - wxTE_MULTILINE | - wxHSCROLL); -#endif } void MyPanel::OnSize( wxSizeEvent &event ) @@ -1144,7 +1129,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h) - : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h) ) + : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h) ) { CreateStatusBar(2); @@ -1153,7 +1138,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h void MyFrame::OnQuit (wxCommandEvent& WXUNUSED(event) ) { - Close(TRUE); + Close(true); } void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) @@ -1175,7 +1160,8 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) } #if wxUSE_TOOLTIPS -void MyFrame::OnSetTooltipDelay(wxCommandEvent& event) + +void MyFrame::OnSetTooltipDelay(wxCommandEvent& WXUNUSED(event)) { static long s_delay = 5000; @@ -1196,9 +1182,9 @@ void MyFrame::OnSetTooltipDelay(wxCommandEvent& event) wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay); } -void MyFrame::OnToggleTooltips(wxCommandEvent& event) +void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event)) { - static bool s_enabled = TRUE; + static bool s_enabled = true; s_enabled = !s_enabled; @@ -1215,7 +1201,7 @@ void MyFrame::OnLogClear(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetEditable(wxCommandEvent& WXUNUSED(event)) { - static bool s_editable = TRUE; + static bool s_editable = true; s_editable = !s_editable; m_panel->m_text->SetEditable(s_editable); @@ -1237,7 +1223,7 @@ void MyFrame::OnSetEnabled(wxCommandEvent& WXUNUSED(event)) m_panel->m_textrich->Enable(enabled); } -void MyFrame::OnFileSave(wxCommandEvent& event) +void MyFrame::OnFileSave(wxCommandEvent& WXUNUSED(event)) { if ( m_panel->m_textrich->SaveFile(_T("dummy.txt")) ) { @@ -1254,7 +1240,7 @@ void MyFrame::OnFileSave(wxCommandEvent& event) wxLogStatus(this, _T("Couldn't save the file")); } -void MyFrame::OnFileLoad(wxCommandEvent& event) +void MyFrame::OnFileLoad(wxCommandEvent& WXUNUSED(event)) { if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) ) wxLogStatus(this, _T("Successfully loaded file")); @@ -1262,10 +1248,10 @@ void MyFrame::OnFileLoad(wxCommandEvent& event) wxLogStatus(this, _T("Couldn't load the file")); } -void MyFrame::OnRichTextTest(wxCommandEvent& event) +void MyFrame::OnRichTextTest(wxCommandEvent& WXUNUSED(event)) { RichTextFrame* frame = new RichTextFrame(this, _T("Rich Text Editor")); - frame->Show(TRUE); + frame->Show(true); } void MyFrame::OnIdle( wxIdleEvent& event ) @@ -1328,10 +1314,10 @@ BEGIN_EVENT_TABLE(RichTextFrame, wxFrame) END_EVENT_TABLE() RichTextFrame::RichTextFrame(wxWindow* parent, const wxString& title): - wxFrame(parent, -1, title, wxDefaultPosition, wxSize(300, 400)) + wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxSize(300, 400)) { m_currentPosition = -1; - m_textCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, + m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH2); wxString value; @@ -1372,12 +1358,12 @@ RichTextFrame::RichTextFrame(wxWindow* parent, const wxString& title): // Event handlers -void RichTextFrame::OnClose(wxCommandEvent& event) +void RichTextFrame::OnClose(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } -void RichTextFrame::OnLeftAlign(wxCommandEvent& event) +void RichTextFrame::OnLeftAlign(wxCommandEvent& WXUNUSED(event)) { wxTextAttr attr; attr.SetAlignment(wxTEXT_ALIGNMENT_LEFT); @@ -1389,7 +1375,7 @@ void RichTextFrame::OnLeftAlign(wxCommandEvent& event) m_currentPosition = -1; } -void RichTextFrame::OnRightAlign(wxCommandEvent& event) +void RichTextFrame::OnRightAlign(wxCommandEvent& WXUNUSED(event)) { wxTextAttr attr; attr.SetAlignment(wxTEXT_ALIGNMENT_RIGHT); @@ -1401,7 +1387,7 @@ void RichTextFrame::OnRightAlign(wxCommandEvent& event) m_currentPosition = -1; } -void RichTextFrame::OnJustify(wxCommandEvent& event) +void RichTextFrame::OnJustify(wxCommandEvent& WXUNUSED(event)) { wxTextAttr attr; attr.SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED); @@ -1413,7 +1399,7 @@ void RichTextFrame::OnJustify(wxCommandEvent& event) m_currentPosition = -1; } -void RichTextFrame::OnCentre(wxCommandEvent& event) +void RichTextFrame::OnCentre(wxCommandEvent& WXUNUSED(event)) { wxTextAttr attr; attr.SetAlignment(wxTEXT_ALIGNMENT_CENTRE); @@ -1425,7 +1411,7 @@ void RichTextFrame::OnCentre(wxCommandEvent& event) m_currentPosition = -1; } -void RichTextFrame::OnChangeFont(wxCommandEvent& event) +void RichTextFrame::OnChangeFont(wxCommandEvent& WXUNUSED(event)) { wxFontData data; @@ -1447,11 +1433,11 @@ void RichTextFrame::OnChangeFont(wxCommandEvent& event) } } -void RichTextFrame::OnChangeTextColour(wxCommandEvent& event) +void RichTextFrame::OnChangeTextColour(wxCommandEvent& WXUNUSED(event)) { wxColourData data; data.SetColour(* wxBLACK); - data.SetChooseFull(TRUE); + data.SetChooseFull(true); for (int i = 0; i < 16; i++) { wxColour colour(i*16, i*16, i*16); @@ -1476,11 +1462,11 @@ void RichTextFrame::OnChangeTextColour(wxCommandEvent& event) } } -void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& event) +void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) { wxColourData data; data.SetColour(* wxWHITE); - data.SetChooseFull(TRUE); + data.SetChooseFull(true); for (int i = 0; i < 16; i++) { wxColour colour(i*16, i*16, i*16); @@ -1505,10 +1491,15 @@ void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& event) } } -void RichTextFrame::OnLeftIndent(wxCommandEvent& event) +void RichTextFrame::OnLeftIndent(wxCommandEvent& WXUNUSED(event)) { - wxString indentStr = wxGetTextFromUser(_("Please enter the left indent in tenths of a millimetre."), - _("Left Indent")); + wxString indentStr = wxGetTextFromUser + ( + _("Please enter the left indent in tenths of a millimetre."), + _("Left Indent"), + wxEmptyString, + this + ); if (!indentStr.IsEmpty()) { int indent = wxAtoi(indentStr); @@ -1524,10 +1515,15 @@ void RichTextFrame::OnLeftIndent(wxCommandEvent& event) } } -void RichTextFrame::OnRightIndent(wxCommandEvent& event) +void RichTextFrame::OnRightIndent(wxCommandEvent& WXUNUSED(event)) { - wxString indentStr = wxGetTextFromUser(_("Please enter the right indent in tenths of a millimetre."), - _("Right Indent")); + wxString indentStr = wxGetTextFromUser + ( + _("Please enter the right indent in tenths of a millimetre."), + _("Right Indent"), + wxEmptyString, + this + ); if (!indentStr.IsEmpty()) { int indent = wxAtoi(indentStr); @@ -1543,7 +1539,7 @@ void RichTextFrame::OnRightIndent(wxCommandEvent& event) } } -void RichTextFrame::OnIdle(wxIdleEvent& event) +void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) { long insertionPoint = m_textCtrl->GetInsertionPoint(); if (insertionPoint != m_currentPosition)