Show read-only and not read-only wxODComboBox and wxComboBox in the sample
Extend the sample to compare disabled read-only and disabled not read-only combo boxes. See #3383.
This commit is contained in:
@@ -1017,14 +1017,14 @@ void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )
|
|||||||
groupSizer->AddStretchSpacer();
|
groupSizer->AddStretchSpacer();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disabled ODComboBox
|
// Disabled read-only ODComboBox
|
||||||
groupSizer->Add( new wxStaticText(dlg,wxID_ANY,"Disabled:"),
|
groupSizer->Add( new wxStaticText(dlg,wxID_ANY,"Read-only disabled:"),
|
||||||
wxSizerFlags().Border(wxRIGHT, border) );
|
wxSizerFlags().Border(wxRIGHT, border) );
|
||||||
|
|
||||||
odc = new wxOwnerDrawnComboBox(dlg,wxID_ANY,wxEmptyString,
|
odc = new wxOwnerDrawnComboBox(dlg,wxID_ANY,wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
m_arrItems,
|
m_arrItems,
|
||||||
wxCB_SORT|wxCB_READONLY // wxNO_BORDER|wxCB_READONLY
|
wxCB_READONLY // wxNO_BORDER|wxCB_READONLY
|
||||||
);
|
);
|
||||||
|
|
||||||
odc->SetValue("Dot Dash");
|
odc->SetValue("Dot Dash");
|
||||||
@@ -1032,6 +1032,18 @@ void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
groupSizer->Add( odc, wxSizerFlags(3).Expand().Border(wxALL, border) );
|
groupSizer->Add( odc, wxSizerFlags(3).Expand().Border(wxALL, border) );
|
||||||
|
|
||||||
|
// Disabled ODComboBox
|
||||||
|
groupSizer->Add(new wxStaticText(dlg, wxID_ANY, "Disabled:"),
|
||||||
|
wxSizerFlags().Border(wxRIGHT, border));
|
||||||
|
|
||||||
|
odc = new wxOwnerDrawnComboBox(dlg, wxID_ANY, wxEmptyString,
|
||||||
|
wxDefaultPosition, wxDefaultSize, m_arrItems);
|
||||||
|
|
||||||
|
odc->SetValue("Dot Dash");
|
||||||
|
odc->Enable(false);
|
||||||
|
|
||||||
|
groupSizer->Add(odc, wxSizerFlags(3).Expand().Border(wxALL, border));
|
||||||
|
|
||||||
rowSizer->Add( groupSizer, 1, wxEXPAND|wxALL, border );
|
rowSizer->Add( groupSizer, 1, wxEXPAND|wxALL, border );
|
||||||
|
|
||||||
|
|
||||||
@@ -1077,14 +1089,14 @@ void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )
|
|||||||
groupSizer->AddStretchSpacer();
|
groupSizer->AddStretchSpacer();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disabled wxComboBox
|
// Disabled read-only wxComboBox
|
||||||
groupSizer->Add( new wxStaticText(dlg,wxID_ANY,"Disabled:"),
|
groupSizer->Add( new wxStaticText(dlg,wxID_ANY,"Read-only disabled:"),
|
||||||
wxSizerFlags().Border(wxRIGHT, border) );
|
wxSizerFlags().Border(wxRIGHT, border) );
|
||||||
|
|
||||||
cb = new wxComboBox(dlg,wxID_ANY,wxEmptyString,
|
cb = new wxComboBox(dlg,wxID_ANY,wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
m_arrItems,
|
m_arrItems,
|
||||||
wxCB_SORT|wxCB_READONLY // wxNO_BORDER|wxCB_READONLY
|
wxCB_READONLY // wxNO_BORDER|wxCB_READONLY
|
||||||
);
|
);
|
||||||
|
|
||||||
cb->SetValue("Dot Dash");
|
cb->SetValue("Dot Dash");
|
||||||
@@ -1092,6 +1104,19 @@ void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
groupSizer->Add( cb, wxSizerFlags(3).Expand().Border(wxALL, border) );
|
groupSizer->Add( cb, wxSizerFlags(3).Expand().Border(wxALL, border) );
|
||||||
|
|
||||||
|
//
|
||||||
|
// Disabled wxComboBox
|
||||||
|
groupSizer->Add(new wxStaticText(dlg, wxID_ANY, "Disabled:"),
|
||||||
|
wxSizerFlags().Border(wxRIGHT, border));
|
||||||
|
|
||||||
|
cb = new wxComboBox(dlg, wxID_ANY, wxEmptyString,
|
||||||
|
wxDefaultPosition, wxDefaultSize, m_arrItems);
|
||||||
|
|
||||||
|
cb->SetValue("Dot Dash");
|
||||||
|
cb->Enable(false);
|
||||||
|
|
||||||
|
groupSizer->Add(cb, wxSizerFlags(3).Expand().Border(wxALL, border));
|
||||||
|
|
||||||
rowSizer->Add( groupSizer, 1, wxEXPAND|wxALL, border );
|
rowSizer->Add( groupSizer, 1, wxEXPAND|wxALL, border );
|
||||||
|
|
||||||
colSizer->Add( rowSizer, 1, wxEXPAND|wxALL, border );
|
colSizer->Add( rowSizer, 1, wxEXPAND|wxALL, border );
|
||||||
|
Reference in New Issue
Block a user