X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/425ec0a5a3c94ba0a560eca83cb3620b83bc6baf..ba97f6f8a39e978f5081f86752faa18ea3af7ba4:/samples/notebook/notebook.cpp diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 63116dd916..8a204570a5 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -6,7 +6,7 @@ // Created: 26/10/98 // RCS-ID: $Id$ // Copyright: (c) 1998-2002 wxWidgets team -// License: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -213,7 +213,7 @@ wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName) if ( pageName == MAXIMIZED_BUTTON_PAGE_NAME ) return CreateBigButtonPage(parent); - wxFAIL_MSG( _T("unknown page name") ); + wxFAIL_MSG( wxT("unknown page name") ); return NULL; } @@ -291,7 +291,7 @@ MyFrame::MyFrame() m_type = Type_Listbook; #elif wxUSE_TREEBOOK m_type = Type_Treebook; -#elif +#else #error "Don't use Notebook sample without any book enabled in wxWidgets build!" #endif @@ -322,11 +322,11 @@ MyFrame::MyFrame() menuType->Check(ID_BOOK_NOTEBOOK + m_type, true); wxMenu *menuOrient = new wxMenu; - menuOrient->AppendRadioItem(ID_ORIENT_DEFAULT, wxT("&Default\tCtrl-5")); - menuOrient->AppendRadioItem(ID_ORIENT_TOP, wxT("&Top\tCtrl-6")); - menuOrient->AppendRadioItem(ID_ORIENT_BOTTOM, wxT("&Bottom\tCtrl-7")); - menuOrient->AppendRadioItem(ID_ORIENT_LEFT, wxT("&Left\tCtrl-8")); - menuOrient->AppendRadioItem(ID_ORIENT_RIGHT, wxT("&Right\tCtrl-9")); + menuOrient->AppendRadioItem(ID_ORIENT_DEFAULT, wxT("&Default\tAlt-0")); + menuOrient->AppendRadioItem(ID_ORIENT_TOP, wxT("&Top\tAlt-1")); + menuOrient->AppendRadioItem(ID_ORIENT_BOTTOM, wxT("&Bottom\tAlt-2")); + menuOrient->AppendRadioItem(ID_ORIENT_LEFT, wxT("&Left\tAlt-3")); + menuOrient->AppendRadioItem(ID_ORIENT_RIGHT, wxT("&Right\tAlt-4")); wxMenu *menuPageOperations = new wxMenu; menuPageOperations->Append(ID_ADD_PAGE, wxT("&Add page\tAlt-A")); @@ -402,10 +402,11 @@ MyFrame::MyFrame() RecreateBook(); m_panel->SetSizer(m_sizerFrame); + m_panel->Layout(); - m_sizerFrame->SetSizeHints(this); - - Centre(wxBOTH); + wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(m_panel, wxSizerFlags(1).Expand()); + SetSizerAndFit(sizer); } MyFrame::~MyFrame() @@ -461,7 +462,7 @@ MyFrame::~MyFrame() CASE_TOOLBOOK(before toolb after) \ \ default: \ - wxFAIL_MSG( _T("unknown book control type") ); \ + wxFAIL_MSG( wxT("unknown book control type") ); \ } int MyFrame::TranslateBookFlag(int nb, int lb, int chb, int tbk, int toolbk) const @@ -584,7 +585,7 @@ void MyFrame::AddFlagStrIfFlagPresent(wxString & flagStr, long flags, long flag, if( (flags & flag) == flag ) { if( !flagStr.empty() ) - flagStr += _T(" | "); + flagStr += wxT(" | "); flagStr += flagName; } } @@ -628,10 +629,10 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event)) wxString flagsStr; - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, _T("wxBK_HITTEST_NOWHERE") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, _T("wxBK_HITTEST_ONICON") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, _T("wxBK_HITTEST_ONLABEL") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, _T("wxBK_HITTEST_ONPAGE") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, wxT("wxBK_HITTEST_NOWHERE") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, wxT("wxBK_HITTEST_ONICON") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, wxT("wxBK_HITTEST_ONLABEL") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, wxT("wxBK_HITTEST_ONPAGE") ); wxLogMessage(wxT("HitTest at (%d,%d): %d: %s"), pt.x, @@ -678,7 +679,7 @@ void MyFrame::OnMulti(wxCommandEvent& event) m_multi = event.IsChecked(); RecreateBook(); m_sizerFrame->Layout(); - wxLogMessage(_T("Multiline setting works only in wxNotebook.")); + wxLogMessage(wxT("Multiline setting works only in wxNotebook.")); } void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event)) @@ -731,7 +732,7 @@ void MyFrame::OnAddSubPage(wxCommandEvent& WXUNUSED(event)) const int selPos = currBook->GetSelection(); if ( selPos == wxNOT_FOUND ) { - wxLogError(_T("Select the parent page first!")); + wxLogError(wxT("Select the parent page first!")); return; } @@ -759,7 +760,7 @@ void MyFrame::OnAddPageBefore(wxCommandEvent& WXUNUSED(event)) const int selPos = currBook->GetSelection(); if ( selPos == wxNOT_FOUND ) { - wxLogError(_T("Select the parent page first!")); + wxLogError(wxT("Select the parent page first!")); return; } @@ -890,35 +891,35 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) { wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, - _T("wxNotebook") + wxT("wxNotebook") }, #endif // wxUSE_NOTEBOOK #if wxUSE_LISTBOOK { wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, - _T("wxListbook") + wxT("wxListbook") }, #endif // wxUSE_LISTBOOK #if wxUSE_CHOICEBOOK { wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, - _T("wxChoicebook") + wxT("wxChoicebook") }, #endif // wxUSE_CHOICEBOOK #if wxUSE_TREEBOOK { wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, - _T("wxTreebook") + wxT("wxTreebook") }, #endif // wxUSE_TREEBOOK #if wxUSE_TOOLBOOK { wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, - _T("wxToolbook") + wxT("wxToolbook") }, #endif // wxUSE_TOOLBOOK }; @@ -956,7 +957,7 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) ) != wxYES ) { event.Veto(); - veto = _T(" (vetoed)"); + veto = wxT(" (vetoed)"); } }