added checkbox for testing wxNB_MULTILINE

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-02-07 20:20:29 +00:00
parent e69683678e
commit 9a6c9e31b0
2 changed files with 29 additions and 22 deletions

View File

@ -244,16 +244,18 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
wxT("Forgot to update something") );
m_radioOrient = new wxRadioBox
(
m_panel, ID_RADIO_ORIENT,
wxT("&Tab orientation"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(strOrientations), strOrientations,
1, wxRA_SPECIFY_COLS
);
(
m_panel, ID_RADIO_ORIENT,
wxT("&Tab orientation"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(strOrientations), strOrientations,
1, wxRA_SPECIFY_COLS
);
m_chkShowImages = new wxCheckBox( m_panel, ID_CHK_SHOWIMAGES,
wxT("&Show images") );
m_chkMultiLine = new wxCheckBox( m_panel, ID_CHK_MULTILINE,
wxT("&Multiple lines") );
m_btnAddPage = new wxButton( m_panel, ID_BTN_ADD_PAGE, wxT("&Add page") );
@ -283,22 +285,21 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
m_sizerTop = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL);
{
sizerLeft->Add(m_radioOrient, 0, wxEXPAND);
sizerLeft->Add(m_chkShowImages, 0, wxEXPAND | wxTOP, 4);
sizerLeft->Add(m_radioOrient, 0, wxEXPAND);
sizerLeft->Add(m_chkShowImages, 0, wxEXPAND | wxTOP, 4);
sizerLeft->Add(m_chkMultiLine, 0, wxEXPAND | wxTOP, 4);
sizerLeft->Add(0, 0, 1); // Spacer
sizerLeft->Add(0, 0, 1); // Spacer
sizerLeft->Add(m_btnAddPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnInsertPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnDeleteCurPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnDeleteLastPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnNextPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnAddPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnInsertPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnDeleteCurPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnDeleteLastPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(m_btnNextPage, 0, wxEXPAND | (wxTOP | wxBOTTOM), 4);
sizerLeft->Add(0, 0, 1); // Spacer
sizerLeft->Add(0, 0, 1); // Spacer
sizerLeft->Add(m_btnExit, 0, wxEXPAND);
}
sizerLeft->Add(m_btnExit, 0, wxEXPAND);
m_sizerTop->Add(sizerLeft, 0, wxEXPAND | wxALL, 4);
@ -358,11 +359,14 @@ void MyFrame::ReInitNotebook()
break;
}
if ( m_chkMultiLine->IsChecked() )
flags |= wxNB_MULTILINE;
MyNotebook *notebook = m_notebook;
m_notebook = new MyNotebook(m_panel, ID_NOTEBOOK,
wxDefaultPosition, wxDefaultSize,
flags|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE);
flags);
if ( m_chkShowImages->IsChecked() )
{
@ -406,6 +410,7 @@ void MyFrame::ReInitNotebook()
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_RADIOBOX(ID_RADIO_ORIENT, MyFrame::OnCheckOrRadioBox)
EVT_CHECKBOX(ID_CHK_SHOWIMAGES, MyFrame::OnCheckOrRadioBox)
EVT_CHECKBOX(ID_CHK_MULTILINE, MyFrame::OnCheckOrRadioBox)
EVT_BUTTON(ID_BTN_ADD_PAGE, MyFrame::OnButtonAddPage)
EVT_BUTTON(ID_BTN_INSERT_PAGE, MyFrame::OnButtonInsertPage)
@ -425,7 +430,7 @@ END_EVENT_TABLE()
void MyFrame::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
{
ReInitNotebook();
ReInitNotebook();
}
void MyFrame::OnButtonAddPage( wxCommandEvent& WXUNUSED(event) )

View File

@ -105,7 +105,8 @@ private:
wxPanel *m_panel; // Panel containing notebook and other controls
wxRadioBox *m_radioOrient;
wxCheckBox *m_chkShowImages;
wxCheckBox *m_chkShowImages,
*m_chkMultiLine;
wxButton *m_btnAddPage;
wxButton *m_btnInsertPage;
@ -141,6 +142,7 @@ enum ID_CONTROLS
{
ID_RADIO_ORIENT = wxID_HIGHEST,
ID_CHK_SHOWIMAGES,
ID_CHK_MULTILINE,
ID_BTN_ADD_PAGE,
ID_BTN_INSERT_PAGE,
ID_BTN_DELETE_CUR_PAGE,