No real changes, just replace -1 with wxNOT_FOUND in wxBookCtrl code.
Make the code consistently use wxNOT_FOUND instead of -1 everywhere. See #12622. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -204,7 +204,7 @@ public:
|
||||
int imageId = -1) = 0;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
//
|
||||
// NB: this function will generate PAGE_CHANGING/ED events
|
||||
virtual int SetSelection(size_t n) = 0;
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
void AdvanceSelection(bool forward = true)
|
||||
{
|
||||
int nPage = GetNextPage(forward);
|
||||
if ( nPage != -1 )
|
||||
if ( nPage != wxNOT_FOUND )
|
||||
{
|
||||
// cast is safe because of the check above
|
||||
SetSelection((size_t)nPage);
|
||||
@@ -353,7 +353,7 @@ class WXDLLIMPEXP_CORE wxBookCtrlEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
|
||||
: wxNotifyEvent(commandType, winid)
|
||||
{
|
||||
m_nSel = nSel;
|
||||
@@ -370,10 +370,10 @@ public:
|
||||
virtual wxEvent *Clone() const { return new wxBookCtrlEvent(*this); }
|
||||
|
||||
// accessors
|
||||
// the currently selected page (-1 if none)
|
||||
// the currently selected page (wxNOT_FOUND if none)
|
||||
int GetSelection() const { return m_nSel; }
|
||||
void SetSelection(int nSel) { m_nSel = nSel; }
|
||||
// the page that was selected before the change (-1 if none)
|
||||
// the page that was selected before the change (wxNOT_FOUND if none)
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
|
||||
|
||||
|
@@ -56,7 +56,7 @@ protected:
|
||||
// ------------------------------------------------------------------------
|
||||
public:
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
int SetSelection(size_t nPage);
|
||||
// get the currently selected page
|
||||
int GetSelection() const;
|
||||
|
@@ -56,11 +56,11 @@ public:
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// Find the position of the wxNotebookPage, -1 if not found.
|
||||
// Find the position of the wxNotebookPage, wxNOT_FOUND if not found.
|
||||
int FindPagePosition(wxNotebookPage* page) const;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage);
|
||||
// cycle thru the tabs
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
// ---------
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||
// get the currently selected page
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
// ---------
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||
// get the currently selected page
|
||||
|
@@ -86,7 +86,7 @@ public:
|
||||
virtual size_t GetPageCount() const;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage);
|
||||
// get the currently selected page
|
||||
|
@@ -96,8 +96,8 @@ public:
|
||||
bool SendPageChangingEvent(int nPage);
|
||||
|
||||
// sends the event about page change from old to new (or GetSelection() if
|
||||
// new is -1)
|
||||
void SendPageChangedEvent(int nPageOld, int nPageNew = -1);
|
||||
// new is wxNOT_FOUND)
|
||||
void SendPageChangedEvent(int nPageOld, int nPageNew = wxNOT_FOUND);
|
||||
|
||||
// wxBookCtrlBase overrides this method to return false but we do need
|
||||
// focus because we have tabs
|
||||
|
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
//
|
||||
// Set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
//
|
||||
int SetSelection(size_t nPage);
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
// accessors
|
||||
// ---------
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||
// get the currently selected page
|
||||
|
Reference in New Issue
Block a user