Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-26 12:44:28 +00:00
parent 3db5226517
commit 90c0f5a958
6 changed files with 114 additions and 121 deletions

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: notebook.cpp // Name: src/mac/carbon/notebmac.cpp
// Purpose: implementation of wxNotebook // Purpose: implementation of wxNotebook
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -43,7 +43,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_SET_FOCUS(wxNotebook::OnSetFocus)
@@ -94,7 +94,7 @@ bool wxNotebook::Create(wxWindow *parent,
long style, long style,
const wxString& name) const wxString& name)
{ {
m_macIsUserPane = FALSE ; m_macIsUserPane = false ;
if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) ) if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
return false; return false;
@@ -107,11 +107,11 @@ bool wxNotebook::Create(wxWindow *parent,
bounds.bottom = bounds.top + 100 ; bounds.bottom = bounds.top + 100 ;
UInt16 tabstyle = kControlTabDirectionNorth ; UInt16 tabstyle = kControlTabDirectionNorth ;
if ( HasFlag(wxNB_LEFT) ) if ( HasFlag(wxBK_LEFT) )
tabstyle = kControlTabDirectionWest ; tabstyle = kControlTabDirectionWest ;
else if ( HasFlag( wxNB_RIGHT ) ) else if ( HasFlag( wxBK_RIGHT ) )
tabstyle = kControlTabDirectionEast ; tabstyle = kControlTabDirectionEast ;
else if ( HasFlag( wxNB_BOTTOM ) ) else if ( HasFlag( wxBK_BOTTOM ) )
tabstyle = kControlTabDirectionSouth ; tabstyle = kControlTabDirectionSouth ;
ControlTabSize tabsize = kControlTabSizeLarge ; ControlTabSize tabsize = kControlTabSizeLarge ;
@@ -131,7 +131,7 @@ bool wxNotebook::Create(wxWindow *parent,
MacPostControlCreate(pos,size) ; MacPostControlCreate(pos,size) ;
return TRUE ; return true ;
} }
// dtor // dtor
@@ -165,7 +165,7 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
int wxNotebook::SetSelection(size_t nPage) int wxNotebook::SetSelection(size_t nPage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
if ( int(nPage) != m_nSelection ) if ( int(nPage) != m_nSelection )
{ {
@@ -207,16 +207,16 @@ wxString wxNotebook::GetPageText(size_t nPage) const
int wxNotebook::GetPageImage(size_t nPage) const int wxNotebook::GetPageImage(size_t nPage) const
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
return m_images[nPage]; return m_images[nPage];
} }
bool wxNotebook::SetPageImage(size_t nPage, int nImage) bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false,
_T("invalid image index in SetPageImage()") ); _T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] ) if ( nImage != m_images[nPage] )
@@ -229,7 +229,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
MacSetupTabs() ; MacSetupTabs() ;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -262,7 +262,7 @@ bool wxNotebook::DeleteAllPages()
MacSetupTabs(); MacSetupTabs();
m_nSelection = -1 ; m_nSelection = -1 ;
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} }
@@ -481,12 +481,12 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse)) void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
{ {
// don't set the sizes of the pages - their correct size is not yet known // don't set the sizes of the pages - their correct size is not yet known
wxControl::SetConstraintSizes(FALSE); wxControl::SetConstraintSizes(false);
} }
bool wxNotebook::DoPhase(int WXUNUSED(nPhase)) bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{ {
return TRUE; return true;
} }
#endif // wxUSE_CONSTRAINTS #endif // wxUSE_CONSTRAINTS
@@ -505,13 +505,13 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
{ {
if ( nOldSel != -1 ) if ( nOldSel != -1 )
{ {
m_pages[nOldSel]->Show(FALSE); m_pages[nOldSel]->Show(false);
} }
if ( nSel != -1 ) if ( nSel != -1 )
{ {
wxNotebookPage *pPage = m_pages[nSel]; wxNotebookPage *pPage = m_pages[nSel];
pPage->Show(TRUE); pPage->Show(true);
pPage->SetFocus(); pPage->SetFocus();
} }
@@ -549,4 +549,3 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
} }
#endif #endif

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: notebook.cpp // Name: src/mac/classic/notebmac.cpp
// Purpose: implementation of wxNotebook // Purpose: implementation of wxNotebook
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -39,7 +39,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_MOUSE_EVENTS(wxNotebook::OnMouse) EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
@@ -92,10 +92,10 @@ static inline int wxMacTabMargin(long nbStyle, long side)
} }
// If the style matches the side asked for then return the tab margin, // If the style matches the side asked for then return the tab margin,
// but we have to special case wxNB_TOP since it is zero... // but we have to special case wxBK_TOP since it is zero...
if ( side == wxNB_TOP) if ( side == wxBK_TOP)
{ {
if ( nbStyle != 0 && nbStyle & (wxNB_LEFT|wxNB_RIGHT|wxNB_BOTTOM)) if ( nbStyle != 0 && nbStyle & (wxBK_LEFT|wxBK_RIGHT|wxBK_BOTTOM))
{ {
return otherMargin; return otherMargin;
} }
@@ -112,22 +112,22 @@ static inline int wxMacTabMargin(long nbStyle, long side)
static inline int wxMacTabLeftMargin(long style) static inline int wxMacTabLeftMargin(long style)
{ {
return wxMacTabMargin(style, wxNB_LEFT); return wxMacTabMargin(style, wxBK_LEFT);
} }
static inline int wxMacTabTopMargin(long style) static inline int wxMacTabTopMargin(long style)
{ {
return wxMacTabMargin(style, wxNB_TOP); return wxMacTabMargin(style, wxBK_TOP);
} }
static inline int wxMacTabRightMargin(long style) static inline int wxMacTabRightMargin(long style)
{ {
return wxMacTabMargin(style, wxNB_RIGHT); return wxMacTabMargin(style, wxBK_RIGHT);
} }
static inline int wxMacTabBottomMargin(long style) static inline int wxMacTabBottomMargin(long style)
{ {
return wxMacTabMargin(style, wxNB_BOTTOM); return wxMacTabMargin(style, wxBK_BOTTOM);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -183,11 +183,11 @@ bool wxNotebook::Create(wxWindow *parent,
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
int tabstyle = kControlTabSmallNorthProc ; int tabstyle = kControlTabSmallNorthProc ;
if ( HasFlag(wxNB_LEFT) ) if ( HasFlag(wxBK_LEFT) )
tabstyle = kControlTabSmallWestProc ; tabstyle = kControlTabSmallWestProc ;
else if ( HasFlag( wxNB_RIGHT ) ) else if ( HasFlag( wxBK_RIGHT ) )
tabstyle = kControlTabSmallEastProc ; tabstyle = kControlTabSmallEastProc ;
else if ( HasFlag( wxNB_BOTTOM ) ) else if ( HasFlag( wxBK_BOTTOM ) )
tabstyle = kControlTabSmallSouthProc ; tabstyle = kControlTabSmallSouthProc ;
@@ -195,7 +195,7 @@ bool wxNotebook::Create(wxWindow *parent,
tabstyle , (long) this ) ; tabstyle , (long) this ) ;
MacPostControlCreate() ; MacPostControlCreate() ;
return TRUE ; return true ;
} }
// dtor // dtor
@@ -263,7 +263,7 @@ wxSize wxNotebook::DoGetBestSize() const
int wxNotebook::SetSelection(size_t nPage) int wxNotebook::SetSelection(size_t nPage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
if ( int(nPage) != m_nSelection ) if ( int(nPage) != m_nSelection )
{ {
@@ -305,16 +305,16 @@ wxString wxNotebook::GetPageText(size_t nPage) const
int wxNotebook::GetPageImage(size_t nPage) const int wxNotebook::GetPageImage(size_t nPage) const
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
return m_images[nPage]; return m_images[nPage];
} }
bool wxNotebook::SetPageImage(size_t nPage, int nImage) bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false,
_T("invalid image index in SetPageImage()") ); _T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] ) if ( nImage != m_images[nPage] )
@@ -327,7 +327,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
MacSetupTabs() ; MacSetupTabs() ;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -360,7 +360,7 @@ bool wxNotebook::DeleteAllPages()
MacSetupTabs(); MacSetupTabs();
m_nSelection = -1 ; m_nSelection = -1 ;
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} }
@@ -611,12 +611,12 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse)) void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
{ {
// don't set the sizes of the pages - their correct size is not yet known // don't set the sizes of the pages - their correct size is not yet known
wxControl::SetConstraintSizes(FALSE); wxControl::SetConstraintSizes(false);
} }
bool wxNotebook::DoPhase(int WXUNUSED(nPhase)) bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{ {
return TRUE; return true;
} }
#endif // wxUSE_CONSTRAINTS #endif // wxUSE_CONSTRAINTS
@@ -635,13 +635,13 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
{ {
if ( nOldSel != -1 ) if ( nOldSel != -1 )
{ {
m_pages[nOldSel]->Show(FALSE); m_pages[nOldSel]->Show(false);
} }
if ( nSel != -1 ) if ( nSel != -1 )
{ {
wxNotebookPage *pPage = m_pages[nSel]; wxNotebookPage *pPage = m_pages[nSel];
pPage->Show(TRUE); pPage->Show(true);
pPage->SetFocus(); pPage->SetFocus();
} }
@@ -725,4 +725,3 @@ void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart ,
ProcessEvent(event); ProcessEvent(event);
#endif #endif
} }

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: notebook.cpp // Name: src/os2/notebook.cpp
// Purpose: implementation of wxNotebook // Purpose: implementation of wxNotebook
// Author: David Webster // Author: David Webster
// Modified by: // Modified by:
@@ -56,7 +56,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
@@ -162,11 +162,11 @@ WXDWORD wxNotebook::OS2GetStyle (
dwTabStyle |= WS_TABSTOP | BKS_SOLIDBIND | BKS_ROUNDEDTABS | BKS_TABTEXTCENTER | BKS_TABBEDDIALOG; dwTabStyle |= WS_TABSTOP | BKS_SOLIDBIND | BKS_ROUNDEDTABS | BKS_TABTEXTCENTER | BKS_TABBEDDIALOG;
if (lStyle & wxNB_BOTTOM) if (lStyle & wxBK_BOTTOM)
dwTabStyle |= BKS_MAJORTABBOTTOM | BKS_BACKPAGESBL; dwTabStyle |= BKS_MAJORTABBOTTOM | BKS_BACKPAGESBL;
else if (lStyle & wxNB_RIGHT) else if (lStyle & wxBK_RIGHT)
dwTabStyle |= BKS_MAJORTABRIGHT | BKS_BACKPAGESBR; dwTabStyle |= BKS_MAJORTABRIGHT | BKS_BACKPAGESBR;
else if (lStyle & wxNB_LEFT) else if (lStyle & wxBK_LEFT)
dwTabStyle |= BKS_MAJORTABLEFT | BKS_BACKPAGESTL; dwTabStyle |= BKS_MAJORTABLEFT | BKS_BACKPAGESTL;
else // default to top else // default to top
dwTabStyle |= BKS_MAJORTABTOP | BKS_BACKPAGESTR; dwTabStyle |= BKS_MAJORTABTOP | BKS_BACKPAGESTR;
@@ -209,7 +209,7 @@ int wxNotebook::GetRowCount() const
int wxNotebook::SetSelection( size_t nPage ) int wxNotebook::SetSelection( size_t nPage )
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
if (nPage != (size_t)m_nSelection) if (nPage != (size_t)m_nSelection)
{ {
@@ -243,7 +243,7 @@ int wxNotebook::SetSelection( size_t nPage )
bool wxNotebook::SetPageText( size_t nPage, bool wxNotebook::SetPageText( size_t nPage,
const wxString& rsStrText ) const wxString& rsStrText )
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );
return (bool)::WinSendMsg( m_hWnd return (bool)::WinSendMsg( m_hWnd
,BKM_SETTABTEXT ,BKM_SETTABTEXT
,MPFROMLONG((ULONG)m_alPageId[nPage]) ,MPFROMLONG((ULONG)m_alPageId[nPage])
@@ -258,7 +258,7 @@ wxString wxNotebook::GetPageText ( size_t nPage ) const
wxString sStr; wxString sStr;
ULONG ulRc; ULONG ulRc;
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxT(""), wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, wxT("notebook page out of range") );
memset(&vBookText, '\0', sizeof(BOOKTEXT)); memset(&vBookText, '\0', sizeof(BOOKTEXT));
vBookText.textLen = 0; // This will get the length vBookText.textLen = 0; // This will get the length
@@ -300,7 +300,7 @@ wxString wxNotebook::GetPageText ( size_t nPage ) const
int wxNotebook::GetPageImage ( size_t nPage ) const int wxNotebook::GetPageImage ( size_t nPage ) const
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
// //
// For OS/2 just return the page // For OS/2 just return the page
@@ -489,7 +489,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
ULONG ulApiPage; ULONG ulApiPage;
wxASSERT( pPage != NULL ); wxASSERT( pPage != NULL );
wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false );
// //
// Under OS/2 we can only insert FIRST, LAST, NEXT or PREV. Requires // Under OS/2 we can only insert FIRST, LAST, NEXT or PREV. Requires
@@ -515,7 +515,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
return FALSE; return false;
} }
m_alPageId.Insert((long)ulApiPage, nPage); m_alPageId.Insert((long)ulApiPage, nPage);
} }
@@ -533,7 +533,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
vError = ::WinGetLastError(vHabmain); vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError); sError = wxPMErrorToStr(vError);
return FALSE; return false;
} }
m_alPageId.Insert((long)ulApiPage, nPage); m_alPageId.Insert((long)ulApiPage, nPage);
} }
@@ -548,7 +548,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
,MPFROMLONG((ULONG)m_alPageId[nPage]) ,MPFROMLONG((ULONG)m_alPageId[nPage])
,MPFROMHWND(pPage->GetHWND()) ,MPFROMHWND(pPage->GetHWND())
)) ))
return FALSE; return false;
} }
// //
// If the inserted page is before the selected one, we must update the // If the inserted page is before the selected one, we must update the
@@ -600,7 +600,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
if (!SetPageText( nPage if (!SetPageText( nPage
,rsStrText ,rsStrText
)) ))
return FALSE; return false;
} }
// //
@@ -611,7 +611,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
if (!SetPageImage( nPage if (!SetPageImage( nPage
,nImageId ,nImageId
)) ))
return FALSE; return false;
} }
if (pPage) if (pPage)
@@ -631,7 +631,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
// //
// This updates internal flag too - otherwise it will get out of sync // This updates internal flag too - otherwise it will get out of sync
// //
pPage->Show(FALSE); pPage->Show(false);
} }
// //
@@ -650,7 +650,7 @@ bool wxNotebook::InsertPage ( size_t nPage,
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} // end of wxNotebook::InsertPage } // end of wxNotebook::InsertPage
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -675,13 +675,13 @@ void wxNotebook::OnSelChange (
int nPageCount = GetPageCount(); int nPageCount = GetPageCount();
int nSel; int nSel;
ULONG ulOS2Sel = (ULONG)rEvent.GetOldSelection(); ULONG ulOS2Sel = (ULONG)rEvent.GetOldSelection();
bool bFound = FALSE; bool bFound = false;
for (nSel = 0; nSel < nPageCount; nSel++) for (nSel = 0; nSel < nPageCount; nSel++)
{ {
if (ulOS2Sel == (ULONG)m_alPageId[nSel]) if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{ {
bFound = TRUE; bFound = true;
break; break;
} }
} }
@@ -689,17 +689,17 @@ void wxNotebook::OnSelChange (
if (!bFound) if (!bFound)
return; return;
m_pages[nSel]->Show(FALSE); m_pages[nSel]->Show(false);
ulOS2Sel = (ULONG)rEvent.GetSelection(); ulOS2Sel = (ULONG)rEvent.GetSelection();
bFound = FALSE; bFound = false;
for (nSel = 0; nSel < nPageCount; nSel++) for (nSel = 0; nSel < nPageCount; nSel++)
{ {
if (ulOS2Sel == (ULONG)m_alPageId[nSel]) if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{ {
bFound = TRUE; bFound = true;
break; break;
} }
} }
@@ -709,7 +709,7 @@ void wxNotebook::OnSelChange (
wxNotebookPage* pPage = m_pages[nSel]; wxNotebookPage* pPage = m_pages[nSel];
pPage->Show(TRUE); pPage->Show(true);
m_nSelection = nSel; m_nSelection = nSel;
} }
@@ -816,21 +816,17 @@ void wxNotebook::OnNavigationKey (
// //
// Override these 2 functions to do nothing: everything is done in OnSize // Override these 2 functions to do nothing: everything is done in OnSize
// //
void wxNotebook::SetConstraintSizes( void wxNotebook::SetConstraintSizes( bool WXUNUSED(bRecurse) )
bool WXUNUSED(bRecurse)
)
{ {
// //
// Don't set the sizes of the pages - their correct size is not yet known // Don't set the sizes of the pages - their correct size is not yet known
// //
wxControl::SetConstraintSizes(FALSE); wxControl::SetConstraintSizes(false);
} // end of wxNotebook::SetConstraintSizes } // end of wxNotebook::SetConstraintSizes
bool wxNotebook::DoPhase ( bool wxNotebook::DoPhase ( int WXUNUSED(nPhase) )
int WXUNUSED(nPhase)
)
{ {
return TRUE; return true;
} // end of wxNotebook::DoPhase } // end of wxNotebook::DoPhase
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -846,7 +842,7 @@ bool wxNotebook::OS2OnScroll ( int nOrientation,
// up-down control // up-down control
// //
if (wControl) if (wControl)
return FALSE; return false;
return wxNotebookBase::OS2OnScroll( nOrientation return wxNotebookBase::OS2OnScroll( nOrientation
,wSBCode ,wSBCode
,wPos ,wPos

View File

@@ -42,7 +42,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
@@ -81,9 +81,9 @@ wxBEGIN_FLAGS( wxNotebookStyle )
wxFLAGS_MEMBER(wxHSCROLL) wxFLAGS_MEMBER(wxHSCROLL)
wxFLAGS_MEMBER(wxNB_FIXEDWIDTH) wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
wxFLAGS_MEMBER(wxNB_LEFT) wxFLAGS_MEMBER(wxBK_LEFT)
wxFLAGS_MEMBER(wxNB_RIGHT) wxFLAGS_MEMBER(wxBK_RIGHT)
wxFLAGS_MEMBER(wxNB_BOTTOM) wxFLAGS_MEMBER(wxBK_BOTTOM)
wxEND_FLAGS( wxNotebookStyle ) wxEND_FLAGS( wxNotebookStyle )

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: univ/notebook.cpp // Name: src/univ/notebook.cpp
// Purpose: wxNotebook implementation // Purpose: wxNotebook implementation
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@@ -170,7 +170,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
int wxNotebook::GetPageImage(size_t nPage) const int wxNotebook::GetPageImage(size_t nPage) const
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
return m_images[nPage]; return m_images[nPage];
} }
@@ -209,7 +209,7 @@ wxNotebook::~wxNotebook()
int wxNotebook::SetSelection(size_t nPage) int wxNotebook::SetSelection(size_t nPage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
if ( (size_t)nPage == m_sel ) if ( (size_t)nPage == m_sel )
{ {
@@ -654,14 +654,14 @@ bool wxNotebook::IsVertical() const
wxDirection wxNotebook::GetTabOrientation() const wxDirection wxNotebook::GetTabOrientation() const
{ {
long style = GetWindowStyle(); long style = GetWindowStyle();
if ( style & wxNB_BOTTOM ) if ( style & wxBK_BOTTOM )
return wxBOTTOM; return wxBOTTOM;
else if ( style & wxNB_RIGHT ) else if ( style & wxBK_RIGHT )
return wxRIGHT; return wxRIGHT;
else if ( style & wxNB_LEFT ) else if ( style & wxBK_LEFT )
return wxLEFT; return wxLEFT;
// wxNB_TOP == 0 so we don't have to test for it // wxBK_TOP == 0 so we don't have to test for it
return wxTOP; return wxTOP;
} }
@@ -1427,4 +1427,3 @@ void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)
} }
#endif // wxUSE_NOTEBOOK #endif // wxUSE_NOTEBOOK

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: settingsdialog.cpp // Name: utils/configtool/src/settingsdialog.cpp
// Purpose: Settings dialog // Purpose: Settings dialog
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
@@ -88,7 +88,7 @@ void ctSettingsDialog::CreateControls()
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2); item1->SetSizer(item2);
m_notebook = new wxNotebook(item1, wxID_ANY, wxDefaultPosition, wxSize(200, 200), wxNB_TOP); m_notebook = new wxNotebook(item1, wxID_ANY, wxDefaultPosition, wxSize(200, 200), wxBK_TOP);
ctGeneralSettingsDialog* item4 = new ctGeneralSettingsDialog(m_notebook, ID_GENERAL_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0); ctGeneralSettingsDialog* item4 = new ctGeneralSettingsDialog(m_notebook, ID_GENERAL_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);
m_notebook->AddPage(item4, _("General")); m_notebook->AddPage(item4, _("General"));
ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(m_notebook, ID_LOCATION_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0); ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(m_notebook, ID_LOCATION_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);