From: Vadim Zeitlin Date: Wed, 3 Feb 2010 21:07:46 +0000 (+0000) Subject: Test wxTE_PROCESS_ENTER style in the widgets sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2d1e63c0a52861df231829cd5741f151d5672cd0?hp=15b850072622e84759c9592e1e591ecdee4aee1c Test wxTE_PROCESS_ENTER style in the widgets sample. Add a checkbox for toggling wxTE_PROCESS_ENTER to the text page and use this style by default. This makes it easier to check that this style works as intended, including that it generates the correct events. See #11691. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 4a7c0dd659..4eebb91f70 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -106,6 +106,7 @@ static const struct ControlValues bool password; bool readonly; + bool processEnter; bool filename; WrapStyle wrapStyle; @@ -118,6 +119,7 @@ static const struct ControlValues TextLines_Multi, // multiline false, // not password false, // not readonly + true, // do process enter false, // not filename WrapStyle_Word, // wrap on word boundaries #ifdef __WXMSW__ @@ -205,6 +207,7 @@ protected: // the checkboxes controlling text ctrl styles wxCheckBox *m_chkPassword, *m_chkReadonly, + *m_chkProcessEnter, *m_chkFilename; // under MSW we test rich edit controls as well here @@ -364,6 +367,7 @@ TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) m_chkPassword = m_chkReadonly = + m_chkProcessEnter = m_chkFilename = (wxCheckBox *)NULL; m_text = @@ -410,6 +414,9 @@ void TextWidgetsPage::CreateContent() m_chkReadonly = CreateCheckBoxAndAddToSizer( sizerLeft, wxT("&Read-only mode") ); + m_chkProcessEnter = CreateCheckBoxAndAddToSizer( + sizerLeft, wxT("Process &Enter") + ); m_chkFilename = CreateCheckBoxAndAddToSizer( sizerLeft, wxT("&Filename control") ); @@ -611,6 +618,7 @@ void TextWidgetsPage::Reset() m_chkPassword->SetValue(DEFAULTS.password); m_chkReadonly->SetValue(DEFAULTS.readonly); + m_chkProcessEnter->SetValue(DEFAULTS.processEnter); m_chkFilename->SetValue(DEFAULTS.filename); m_radioWrap->SetSelection(DEFAULTS.wrapStyle); @@ -641,6 +649,8 @@ void TextWidgetsPage::CreateText() flags |= wxTE_PASSWORD; if ( m_chkReadonly->GetValue() ) flags |= wxTE_READONLY; + if ( m_chkProcessEnter->GetValue() ) + flags |= wxTE_PROCESS_ENTER; switch ( m_radioWrap->GetSelection() ) { @@ -885,6 +895,7 @@ void TextWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) #endif // __WXMSW__ (m_chkPassword->GetValue() != DEFAULTS.password) || (m_chkReadonly->GetValue() != DEFAULTS.readonly) || + (m_chkProcessEnter->GetValue() != DEFAULTS.processEnter) || (m_chkFilename->GetValue() != DEFAULTS.filename) || (m_radioWrap->GetSelection() != DEFAULTS.wrapStyle) ); }