virtual wxControl *GetWidget() const { return m_radio; }
virtual void RecreateWidget() { CreateRadio(); }
+ // lazy creation of the content
+ virtual void CreateContent();
+
protected:
// event handlers
void OnCheckOrRadioBox(wxCommandEvent& event);
// ------------
// the check/radio boxes for styles
- wxCheckBox *m_chkVert;
+ wxCheckBox *m_chkSpecifyRows;
wxCheckBox *m_chkEnableItem;
wxCheckBox *m_chkShowItem;
wxRadioBox *m_radioDir;
: WidgetsPage(book, imaglist, radio_xpm)
{
// init everything
- m_chkVert = (wxCheckBox *)NULL;
+ m_chkSpecifyRows = (wxCheckBox *)NULL;
m_chkEnableItem = (wxCheckBox *)NULL;
m_chkShowItem = (wxCheckBox *)NULL;
m_radio =
m_radioDir = (wxRadioBox *)NULL;
m_sizerRadio = (wxSizer *)NULL;
+}
+void RadioWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical layout"));
+ m_chkSpecifyRows = CreateCheckBoxAndAddToSizer
+ (
+ sizerLeft,
+ "Major specifies &rows count"
+ );
static const wxString layoutDir[] =
{
// final initializations
SetSizer(sizerTop);
-
- sizerTop->Fit(this);
}
// ----------------------------------------------------------------------------
m_textLabel->SetValue(_T("I'm a radiobox"));
m_textLabelBtns->SetValue(_T("item"));
- m_chkVert->SetValue(false);
+ m_chkSpecifyRows->SetValue(false);
m_chkEnableItem->SetValue(true);
m_chkShowItem->SetValue(true);
m_radioDir->SetSelection(RadioDir_Default);
labelBtn.c_str(), (unsigned long)n + 1);
}
- int flags = m_chkVert->GetValue() ? wxRA_VERTICAL
- : wxRA_HORIZONTAL;
+ int flags = m_chkSpecifyRows->GetValue() ? wxRA_SPECIFY_ROWS
+ : wxRA_SPECIFY_COLS;
flags |= ms_defaultFlags;
void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event)
{
// only enable it if something is not set to default
- bool enable = m_chkVert->GetValue();
+ bool enable = m_chkSpecifyRows->GetValue();
if ( !enable )
{