git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36018
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/carbon/notebmac.cpp
// Purpose: implementation of wxNotebook
// Author: Stefan Csomor
// Modified by:
// Purpose: implementation of wxNotebook
// Author: Stefan Csomor
// Modified by:
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
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_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
long style,
const wxString& name)
{
long style,
const wxString& name)
{
- m_macIsUserPane = FALSE ;
-
+ m_macIsUserPane = false ;
+
if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
return false;
if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
return false;
bounds.bottom = bounds.top + 100 ;
UInt16 tabstyle = kControlTabDirectionNorth ;
bounds.bottom = bounds.top + 100 ;
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 ;
if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
tabsize = kControlTabSizeSmall ;
else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
{
if (UMAGetSystemVersion() >= 0x1030 )
ControlTabSize tabsize = kControlTabSizeLarge ;
if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
tabsize = kControlTabSizeSmall ;
else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
{
if (UMAGetSystemVersion() >= 0x1030 )
- tabsize = kControlSizeSmall;
+ tabsize = kControlSizeSmall;
}
m_peer = new wxMacControl(this) ;
verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
}
m_peer = new wxMacControl(this) ;
verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
- tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) );
-
-
+ tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) );
+
+
MacPostControlCreate(pos,size) ;
MacPostControlCreate(pos,size) ;
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 )
{
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];
}
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{
return m_images[nPage];
}
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()") );
if ( nImage != m_images[nPage] )
_T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
MacSetupTabs();
m_nSelection = -1 ;
InvalidateBestSize();
MacSetupTabs();
m_nSelection = -1 ;
InvalidateBestSize();
// if the inserted page is before the selected one, we must update the
// index of the selected page
// if the inserted page is before the selected one, we must update the
// index of the selected page
- if ( int(nPage) <= m_nSelection )
+ if ( int(nPage) <= m_nSelection )
{
m_nSelection++;
// while this still is the same page showing, we need to update the tabs
m_peer->SetValue( m_nSelection + 1 ) ;
}
{
m_nSelection++;
// while this still is the same page showing, we need to update the tabs
m_peer->SetValue( m_nSelection + 1 ) ;
}
// some page should be selected: either this one or the first one if there
// is still no selection
int selNew = -1;
// some page should be selected: either this one or the first one if there
// is still no selection
int selNew = -1;
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
- wxControl::SetConstraintSizes(FALSE);
+ // don't set the sizes of the pages - their correct size is not yet known
+ wxControl::SetConstraintSizes(false);
}
bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{
}
bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{
}
#endif // wxUSE_CONSTRAINTS
}
#endif // wxUSE_CONSTRAINTS
// hide the currently active panel and show the new one
void wxNotebook::ChangePage(int nOldSel, int nSel)
{
// hide the currently active panel and show the new one
void wxNotebook::ChangePage(int nOldSel, int nSel)
{
- m_pages[nOldSel]->Show(FALSE);
+ m_pages[nOldSel]->Show(false);
}
if ( nSel != -1 )
{
wxNotebookPage *pPage = m_pages[nSel];
}
if ( nSel != -1 )
{
wxNotebookPage *pPage = m_pages[nSel];
m_nSelection = nSel;
m_peer->SetValue( m_nSelection + 1 ) ;
}
m_nSelection = nSel;
m_peer->SetValue( m_nSelection + 1 ) ;
}
-wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
+wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
{
OSStatus status = eventNotHandledErr ;
{
OSStatus status = eventNotHandledErr ;
SInt32 newSel = m_peer->GetValue() - 1 ;
if ( newSel != m_nSelection )
{
SInt32 newSel = m_peer->GetValue() - 1 ;
if ( newSel != m_nSelection )
{
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
+// Name: src/mac/classic/notebmac.cpp
// Purpose: implementation of wxNotebook
// Author: Stefan Csomor
// Modified by:
// Purpose: implementation of wxNotebook
// Author: Stefan Csomor
// Modified by:
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
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_SIZE(wxNotebook::OnSize)
EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
EVT_SIZE(wxNotebook::OnSize)
}
// 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...
- if ( side == wxNB_TOP)
+ // but we have to special case wxBK_TOP since it is zero...
+ if ( side == wxBK_TOP)
- if ( nbStyle != 0 && nbStyle & (wxNB_LEFT|wxNB_RIGHT|wxNB_BOTTOM))
+ if ( nbStyle != 0 && nbStyle & (wxBK_LEFT|wxBK_RIGHT|wxBK_BOTTOM))
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);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
int tabstyle = kControlTabSmallNorthProc ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
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 ;
tabstyle , (long) this ) ;
MacPostControlCreate() ;
tabstyle , (long) this ) ;
MacPostControlCreate() ;
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
{
wxSize sizeTotal = sizePage;
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
{
wxSize sizeTotal = sizePage;
- sizeTotal.x += 2 * m_macHorizontalBorder + wxMacTabLeftMargin(GetWindowStyle()) +
+ sizeTotal.x += 2 * m_macHorizontalBorder + wxMacTabLeftMargin(GetWindowStyle()) +
wxMacTabRightMargin(GetWindowStyle()) ;
wxMacTabRightMargin(GetWindowStyle()) ;
- sizeTotal.y += 2 * m_macVerticalBorder + wxMacTabTopMargin(GetWindowStyle()) +
+ sizeTotal.y += 2 * m_macVerticalBorder + wxMacTabTopMargin(GetWindowStyle()) +
wxMacTabBottomMargin(GetWindowStyle()) ;
return sizeTotal;
wxMacTabBottomMargin(GetWindowStyle()) ;
return sizeTotal;
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 )
{
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];
}
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{
return m_images[nPage];
}
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()") );
if ( nImage != m_images[nPage] )
_T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
MacSetupTabs();
m_nSelection = -1 ;
InvalidateBestSize();
MacSetupTabs();
m_nSelection = -1 ;
InvalidateBestSize();
// if the inserted page is before the selected one, we must update the
// index of the selected page
// if the inserted page is before the selected one, we must update the
// index of the selected page
- if ( int(nPage) <= m_nSelection )
+ if ( int(nPage) <= m_nSelection )
{
m_nSelection++;
// while this still is the same page showing, we need to update the tabs
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
}
{
m_nSelection++;
// while this still is the same page showing, we need to update the tabs
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
}
// some page should be selected: either this one or the first one if there
// is still no selection
int selNew = -1;
// some page should be selected: either this one or the first one if there
// is still no selection
int selNew = -1;
sizeof( info ), (Ptr)&info );
wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ;
if ( UMAGetSystemVersion() < 0x1030 )
sizeof( info ), (Ptr)&info );
wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ;
if ( UMAGetSystemVersion() < 0x1030 )
- {
- UnregisterIconRef( 'WXNG' , (OSType) 1 ) ;
+ {
+ UnregisterIconRef( 'WXNG' , (OSType) 1 ) ;
ReleaseIconRef( iconRef ) ;
DisposeHandle( (Handle) iconFamily ) ;
}
ReleaseIconRef( iconRef ) ;
DisposeHandle( (Handle) iconFamily ) ;
}
// fit the notebook page to the tab control's display area
int w, h;
GetSize(&w, &h);
// fit the notebook page to the tab control's display area
int w, h;
GetSize(&w, &h);
-
- return wxRect(
- wxMacTabLeftMargin(GetWindowStyle()) + m_macHorizontalBorder,
+
+ return wxRect(
+ wxMacTabLeftMargin(GetWindowStyle()) + m_macHorizontalBorder,
wxMacTabTopMargin(GetWindowStyle()) + m_macVerticalBorder,
w - wxMacTabLeftMargin(GetWindowStyle()) - wxMacTabRightMargin(GetWindowStyle()) - 2*m_macHorizontalBorder,
wxMacTabTopMargin(GetWindowStyle()) + m_macVerticalBorder,
w - wxMacTabLeftMargin(GetWindowStyle()) - wxMacTabRightMargin(GetWindowStyle()) - 2*m_macHorizontalBorder,
- h - wxMacTabTopMargin(GetWindowStyle()) - wxMacTabBottomMargin(GetWindowStyle()) - 2*m_macVerticalBorder);
+ h - wxMacTabTopMargin(GetWindowStyle()) - wxMacTabBottomMargin(GetWindowStyle()) - 2*m_macVerticalBorder);
}
// ----------------------------------------------------------------------------
// wxNotebook callbacks
}
// ----------------------------------------------------------------------------
// wxNotebook callbacks
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
- wxControl::SetConstraintSizes(FALSE);
+ // don't set the sizes of the pages - their correct size is not yet known
+ wxControl::SetConstraintSizes(false);
}
bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{
}
bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
{
}
#endif // wxUSE_CONSTRAINTS
}
#endif // wxUSE_CONSTRAINTS
// hide the currently active panel and show the new one
void wxNotebook::ChangePage(int nOldSel, int nSel)
{
// hide the currently active panel and show the new one
void wxNotebook::ChangePage(int nOldSel, int nSel)
{
- m_pages[nOldSel]->Show(FALSE);
+ m_pages[nOldSel]->Show(false);
}
if ( nSel != -1 )
{
wxNotebookPage *pPage = m_pages[nSel];
}
if ( nSel != -1 )
{
wxNotebookPage *pPage = m_pages[nSel];
m_nSelection = nSel;
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
}
m_nSelection = nSel;
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
}
ProcessEvent(event);
#endif
}
ProcessEvent(event);
#endif
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
+// Name: src/os2/notebook.cpp
// Purpose: implementation of wxNotebook
// Author: David Webster
// Modified by:
// Purpose: implementation of wxNotebook
// Author: David Webster
// Modified by:
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
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_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
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;
else // default to top
dwTabStyle |= BKS_MAJORTABTOP | BKS_BACKPAGESTR;
dwTabStyle |= BKS_MAJORTABLEFT | BKS_BACKPAGESTL;
else // default to top
dwTabStyle |= BKS_MAJORTABTOP | BKS_BACKPAGESTR;
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)
{
bool wxNotebook::SetPageText( size_t nPage,
const wxString& rsStrText )
{
bool wxNotebook::SetPageText( size_t nPage,
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
,BKM_SETTABTEXT
,MPFROMLONG((ULONG)m_alPageId[nPage])
return (bool)::WinSendMsg( m_hWnd
,BKM_SETTABTEXT
,MPFROMLONG((ULONG)m_alPageId[nPage])
wxString sStr;
ULONG ulRc;
wxString sStr;
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));
vBookText.textLen = 0; // This will get the length
memset(&vBookText, '\0', sizeof(BOOKTEXT));
vBookText.textLen = 0; // This will get the length
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
ULONG ulApiPage;
wxASSERT( pPage != NULL );
ULONG ulApiPage;
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
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
}
m_alPageId.Insert((long)ulApiPage, nPage);
}
}
m_alPageId.Insert((long)ulApiPage, nPage);
}
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
}
m_alPageId.Insert((long)ulApiPage, nPage);
}
}
m_alPageId.Insert((long)ulApiPage, nPage);
}
,MPFROMLONG((ULONG)m_alPageId[nPage])
,MPFROMHWND(pPage->GetHWND())
))
,MPFROMLONG((ULONG)m_alPageId[nPage])
,MPFROMHWND(pPage->GetHWND())
))
}
//
// 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
if (!SetPageText( nPage
,rsStrText
))
if (!SetPageText( nPage
,rsStrText
))
if (!SetPageImage( nPage
,nImageId
))
if (!SetPageImage( nPage
,nImageId
))
//
// Don't show pages by default (we'll need to adjust their size first)
//
//
// Don't show pages by default (we'll need to adjust their size first)
//
- HWND hWnd = GetWinHwnd(pPage);
+ HWND hWnd = GetWinHwnd(pPage);
WinSetWindowULong( hWnd
,QWL_STYLE
WinSetWindowULong( hWnd
,QWL_STYLE
//
// This updates internal flag too - otherwise it will get out of sync
//
//
// This updates internal flag too - otherwise it will get out of sync
//
}
//
// Some page should be selected: either this one or the first one if there is
// still no selection
//
}
//
// Some page should be selected: either this one or the first one if there is
// still no selection
//
if (bSelect)
nSelNew = nPage;
if (bSelect)
nSelNew = nPage;
} // end of wxNotebook::InsertPage
// ----------------------------------------------------------------------------
} // end of wxNotebook::InsertPage
// ----------------------------------------------------------------------------
//
if (rEvent.GetEventObject() == this)
{
//
if (rEvent.GetEventObject() == this)
{
- int nPageCount = GetPageCount();
- int nSel;
- ULONG ulOS2Sel = (ULONG)rEvent.GetOldSelection();
- bool bFound = FALSE;
+ int nPageCount = GetPageCount();
+ int nSel;
+ ULONG ulOS2Sel = (ULONG)rEvent.GetOldSelection();
+ bool bFound = false;
for (nSel = 0; nSel < nPageCount; nSel++)
{
if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{
for (nSel = 0; nSel < nPageCount; nSel++)
{
if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{
- m_pages[nSel]->Show(FALSE);
+ m_pages[nSel]->Show(false);
ulOS2Sel = (ULONG)rEvent.GetSelection();
ulOS2Sel = (ULONG)rEvent.GetSelection();
for (nSel = 0; nSel < nPageCount; nSel++)
{
if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{
for (nSel = 0; nSel < nPageCount; nSel++)
{
if (ulOS2Sel == (ULONG)m_alPageId[nSel])
{
wxNotebookPage* pPage = m_pages[nSel];
wxNotebookPage* pPage = m_pages[nSel];
//
// 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(
- bool WXUNUSED(bRecurse)
-)
+void wxNotebook::SetConstraintSizes( 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 (
- int WXUNUSED(nPhase)
-)
+bool wxNotebook::DoPhase ( int WXUNUSED(nPhase) )
} // end of wxNotebook::DoPhase
// ----------------------------------------------------------------------------
} // end of wxNotebook::DoPhase
// ----------------------------------------------------------------------------
// up-down control
//
if (wControl)
// up-down control
//
if (wControl)
return wxNotebookBase::OS2OnScroll( nOrientation
,wSBCode
,wPos
return wxNotebookBase::OS2OnScroll( nOrientation
,wSBCode
,wPos
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
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)
wxFLAGS_MEMBER(wxHSCROLL)
wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
wxFLAGS_MEMBER(wxHSCROLL)
wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
- wxFLAGS_MEMBER(wxNB_LEFT)
- wxFLAGS_MEMBER(wxNB_RIGHT)
- wxFLAGS_MEMBER(wxNB_BOTTOM)
+ wxFLAGS_MEMBER(wxBK_LEFT)
+ wxFLAGS_MEMBER(wxBK_RIGHT)
+ wxFLAGS_MEMBER(wxBK_BOTTOM)
wxEND_FLAGS( wxNotebookStyle )
wxEND_FLAGS( wxNotebookStyle )
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: univ/notebook.cpp
+// Name: src/univ/notebook.cpp
// Purpose: wxNotebook implementation
// Author: Vadim Zeitlin
// Modified by:
// Purpose: wxNotebook implementation
// Author: Vadim Zeitlin
// Modified by:
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];
}
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 )
{
wxDirection wxNotebook::GetTabOrientation() const
{
long style = GetWindowStyle();
wxDirection wxNotebook::GetTabOrientation() const
{
long style = GetWindowStyle();
- if ( style & wxNB_BOTTOM )
+ if ( style & wxBK_BOTTOM )
- else if ( style & wxNB_RIGHT )
+ else if ( style & wxBK_RIGHT )
- else if ( style & wxNB_LEFT )
+ else if ( style & wxBK_LEFT )
- // wxNB_TOP == 0 so we don't have to test for it
+ // wxBK_TOP == 0 so we don't have to test for it
}
#endif // wxUSE_NOTEBOOK
}
#endif // wxUSE_NOTEBOOK
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: settingsdialog.cpp
+// Name: utils/configtool/src/settingsdialog.cpp
// Purpose: Settings dialog
// Author: Julian Smart
// Modified by:
// Purpose: Settings dialog
// Author: Julian Smart
// Modified by:
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
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);
m_notebook->AddPage(item4, _("General"));
ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(m_notebook, ID_LOCATION_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"));
ctLocationSettingsDialog* item11 = new ctLocationSettingsDialog(m_notebook, ID_LOCATION_SETTINGS_DIALOG, wxDefaultPosition, wxSize(100, 80), 0);