当前位置: 首页>>代码示例>>C++>>正文


C++ wxNotebookEvent::GetId方法代码示例

本文整理汇总了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)
}
开发者ID:ashengmz,项目名称:espeak,代码行数:33,代码来源:espeakedit.cpp

示例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();
}
开发者ID:Aetherdyne,项目名称:glintercept,代码行数:49,代码来源:GLIBitmapNotebook.cpp


注:本文中的wxNotebookEvent::GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。