本文整理汇总了C++中wxNotebookEvent::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ wxNotebookEvent::GetId方法的具体用法?C++ wxNotebookEvent::GetId怎么用?C++ wxNotebookEvent::GetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxNotebookEvent
的用法示例。
在下文中一共展示了wxNotebookEvent::GetId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPageChanged
void MyFrame::OnPageChanged(wxNotebookEvent& event)
{//=================================================
int pagenum;
wxString title;
SpectDisplay *page;
pagenum = event.GetSelection();
if(event.GetId() == ID_SCREENPAGES)
{
title = screenpages->GetPageText(pagenum);
if((title != _T("Prosody")) && (adding_page != 2))
{
page = (SpectDisplay *)screenpages->GetPage(pagenum);
if(page != currentcanvas)
{
if(currentcanvas != NULL)
{
currentcanvas->OnActivate(0);
}
page->OnActivate(1);
}
MakeMenu(2, NULL);
}
else
{
MakeMenu(3, NULL);
}
}
adding_page = 0; // work around for wxNotebook bug (version 2.8.7)
}
示例2: OnPageChange
void GLIBitmapNotebook::OnPageChange(wxNotebookEvent &event)
{
// Ensure our window ID and a valid page was selected previously
if(event.GetId() == GetId())
{
int newPage = event.GetSelection();
int oldPage = event.GetOldSelection();
// Get if the selected pages are valid
if(newPage >= 0 && newPage < bitmapViews.size() &&
oldPage >= 0 && oldPage < bitmapViews.size())
{
int scrollStartX = 0;
int scrollStartY = 0;
int oldScrollPPUX = 1;
int oldScrollPPUY = 1;
int newScrollPPUX = 1;
int newScrollPPUY = 1;
// Get the old scroll position
bitmapViews[oldPage]->GetViewStart(&scrollStartX, &scrollStartY);
bitmapViews[oldPage]->GetScrollPixelsPerUnit(&oldScrollPPUX, &oldScrollPPUY);
// Get the new scroll pixels per unit (probably the same as the old one)
bitmapViews[newPage]->GetScrollPixelsPerUnit(&newScrollPPUX, &newScrollPPUY);
// Ensure a valid setting of the scroll area
if(newScrollPPUX != 0 && newScrollPPUY != 0)
{
// Set the new scroll position
bitmapViews[newPage]->Scroll(scrollStartX*oldScrollPPUX/newScrollPPUX,
scrollStartY*oldScrollPPUY/newScrollPPUY);
}
else
{
bitmapViews[newPage]->Scroll(0, 0);
}
// Get the current GL buffer type displayed
bitmapViews[newPage]->GetGLBufferType(preferedBufferTypeID, preferedDrawBufferID);
// Update the window title the new image
parentControl->UpdateWindowTitle();
}
}
// Allow others to process
event.Skip();
}