From 9a6c9e31b0731764f26a3124f7d0dabaa86a1a06 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2004 20:20:29 +0000 Subject: [PATCH 1/1] added checkbox for testing wxNB_MULTILINE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/notebook/notebook.cpp | 47 +++++++++++++++++++---------------- samples/notebook/notebook.h | 4 ++- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 01ed0558dd..2dec8d9a0c 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -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) ) diff --git a/samples/notebook/notebook.h b/samples/notebook/notebook.h index 20862f7327..2d32a1f064 100644 --- a/samples/notebook/notebook.h +++ b/samples/notebook/notebook.h @@ -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, -- 2.45.2