Test wxTE_PROCESS_ENTER in the combobox page of the widgets sample.
Remove the unused "File name" checkbox in this page and put "Process Enter" one in its place to allow toggling wxTE_PROCESS_ENTER interactively to test whether it works as expected. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -153,7 +153,7 @@ protected:
|
|||||||
// the checkboxes for styles
|
// the checkboxes for styles
|
||||||
wxCheckBox *m_chkSort,
|
wxCheckBox *m_chkSort,
|
||||||
*m_chkReadonly,
|
*m_chkReadonly,
|
||||||
*m_chkFilename;
|
*m_chkProcessEnter;
|
||||||
|
|
||||||
// the combobox itself and the sizer it is in
|
// the combobox itself and the sizer it is in
|
||||||
wxComboBox *m_combobox;
|
wxComboBox *m_combobox;
|
||||||
@@ -243,7 +243,7 @@ ComboboxWidgetsPage::ComboboxWidgetsPage(WidgetsBookCtrl *book,
|
|||||||
// init everything
|
// init everything
|
||||||
m_chkSort =
|
m_chkSort =
|
||||||
m_chkReadonly =
|
m_chkReadonly =
|
||||||
m_chkFilename = (wxCheckBox *)NULL;
|
m_chkProcessEnter = (wxCheckBox *)NULL;
|
||||||
|
|
||||||
m_combobox = (wxComboBox *)NULL;
|
m_combobox = (wxComboBox *)NULL;
|
||||||
m_sizerCombo = (wxSizer *)NULL;
|
m_sizerCombo = (wxSizer *)NULL;
|
||||||
@@ -278,8 +278,7 @@ void ComboboxWidgetsPage::CreateContent()
|
|||||||
|
|
||||||
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Sort items"));
|
m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Sort items"));
|
||||||
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Read only"));
|
m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Read only"));
|
||||||
m_chkFilename = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&File name"));
|
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("Process &Enter"));
|
||||||
m_chkFilename->Disable(); // not implemented yet
|
|
||||||
|
|
||||||
sizerLeftTop->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
|
sizerLeftTop->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
|
||||||
sizerLeftTop->Add(m_radioKind, 0, wxGROW | wxALL, 5);
|
sizerLeftTop->Add(m_radioKind, 0, wxGROW | wxALL, 5);
|
||||||
@@ -404,7 +403,7 @@ void ComboboxWidgetsPage::Reset()
|
|||||||
{
|
{
|
||||||
m_chkSort->SetValue(false);
|
m_chkSort->SetValue(false);
|
||||||
m_chkReadonly->SetValue(false);
|
m_chkReadonly->SetValue(false);
|
||||||
m_chkFilename->SetValue(false);
|
m_chkProcessEnter->SetValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboboxWidgetsPage::CreateCombo()
|
void ComboboxWidgetsPage::CreateCombo()
|
||||||
@@ -415,6 +414,9 @@ void ComboboxWidgetsPage::CreateCombo()
|
|||||||
flags |= wxCB_SORT;
|
flags |= wxCB_SORT;
|
||||||
if ( m_chkReadonly->GetValue() )
|
if ( m_chkReadonly->GetValue() )
|
||||||
flags |= wxCB_READONLY;
|
flags |= wxCB_READONLY;
|
||||||
|
if ( m_chkProcessEnter->GetValue() )
|
||||||
|
flags |= wxTE_PROCESS_ENTER;
|
||||||
|
|
||||||
|
|
||||||
switch ( m_radioKind->GetSelection() )
|
switch ( m_radioKind->GetSelection() )
|
||||||
{
|
{
|
||||||
@@ -452,11 +454,6 @@ void ComboboxWidgetsPage::CreateCombo()
|
|||||||
0, NULL,
|
0, NULL,
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
#if 0
|
|
||||||
if ( m_chkFilename->GetValue() )
|
|
||||||
;
|
|
||||||
#endif // TODO
|
|
||||||
|
|
||||||
unsigned int count = items.GetCount();
|
unsigned int count = items.GetCount();
|
||||||
for ( unsigned int n = 0; n < count; n++ )
|
for ( unsigned int n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
@@ -594,7 +591,7 @@ void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
|
|||||||
{
|
{
|
||||||
event.Enable( m_chkSort->GetValue() ||
|
event.Enable( m_chkSort->GetValue() ||
|
||||||
m_chkReadonly->GetValue() ||
|
m_chkReadonly->GetValue() ||
|
||||||
m_chkFilename->GetValue() );
|
m_chkProcessEnter->GetValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboboxWidgetsPage::OnUpdateUIInsert(wxUpdateUIEvent& event)
|
void ComboboxWidgetsPage::OnUpdateUIInsert(wxUpdateUIEvent& event)
|
||||||
|
Reference in New Issue
Block a user