projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxMemoryDC constructor now optionally accepts a wxBitmap parameter,
[wxWidgets.git]
/
src
/
mac
/
carbon
/
notebmac.cpp
diff --git
a/src/mac/carbon/notebmac.cpp
b/src/mac/carbon/notebmac.cpp
index 414bc978f95366947ab30371d039c703e670ad7e..5861863c684cb06ca47472df442a520cadc51438 100644
(file)
--- a/
src/mac/carbon/notebmac.cpp
+++ b/
src/mac/carbon/notebmac.cpp
@@
-160,25
+160,27
@@
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
return DoGetSizeFromClientSize( sizePage );
}
return DoGetSizeFromClientSize( sizePage );
}
-int wxNotebook::
SetSelection(size_t nPage
)
+int wxNotebook::
DoSetSelection(size_t nPage, int flags
)
{
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("SetSelection: invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("
Do
SetSelection: invalid notebook page") );
- if (
int(nPage) !=
m_nSelection )
+ if (
m_nSelection == wxNOT_FOUND || nPage != (size_t)
m_nSelection )
{
{
- wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
- event.SetSelection(nPage);
- event.SetOldSelection(m_nSelection);
- event.SetEventObject(this);
- if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
+ if ( flags & SetSelection_SendEvent )
{
{
- // program allows the page change
- event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
- (void)GetEventHandler()->ProcessEvent(event);
+ if ( !SendPageChangingEvent(nPage) )
+ {
+ // vetoed by program
+ return m_nSelection;
+ }
+ //else: program allows the page change
-
ChangePage
(m_nSelection, nPage);
+
SendPageChangedEvent
(m_nSelection, nPage);
}
}
+
+ ChangePage(m_nSelection, nPage);
}
}
+ //else: no change
return m_nSelection;
}
return m_nSelection;
}