Applied patch [ 592063 ] generic notebook does not OnSelChanging

Misc other mods


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-08-08 08:54:49 +00:00
parent c266945cab
commit 1c507b171a
4 changed files with 39 additions and 0 deletions

View File

@@ -679,4 +679,36 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
m_notebook->GetEventHandler()->ProcessEvent(event);
}
// Allows Vetoing
bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
{
bool retval = TRUE;
if (m_notebook)
{
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
#if defined (__WIN16__)
int activatePos = activateId;
int deactivatePos = deactivateId;
#else
// Translate from wxTabView's ids (which aren't position-dependent)
// to wxNotebook's (which are).
wxNotebookPage* pActive = (wxNotebookPage*) activateId;
wxNotebookPage* pDeactive = (wxNotebookPage*) deactivateId;
int activatePos = m_notebook->FindPagePosition(pActive);
int deactivatePos = m_notebook->FindPagePosition(pDeactive);
#endif
event.SetEventObject(m_notebook);
event.SetSelection(activatePos);
event.SetOldSelection(deactivatePos);
if (m_notebook->GetEventHandler()->ProcessEvent(event))
{
retval = event.IsAllowed();
}
}
return retval;
}