示例#1
0
void WinFrame::CreateMenuItems()
{
    menuBar_ = new wxMenuBar;

    /* Create main menu */
    auto menuMain = new wxMenu;
    {
        menuMain->Append(MENU_QUIT, "&Quit", "Quits the applications");
    }
    menuBar_->Append(menuMain, "&Main");

    /* Create compute mode menu */
    auto menuMode = new wxMenu;
    {
        menuMode->AppendRadioItem(MENU_RADIAN, "&Radian", "Sets the compute mode to radian")->Check();
        menuMode->AppendRadioItem(MENU_DEGREE, "&Degree", "Sets the compute mode to degree");
    }
    menuBar_->Append(menuMode, "&Compute Mode");

    /* Create help menu */
    auto menuHelp = new wxMenu;
    {
        menuHelp->Append(MENU_INTRO, "&Getting Started", "Shows a brief information with all supported functions and operations");
        menuHelp->Append(MENU_DEMO, "Show &Demo", "Shows the next demonstration");
        menuHelp->AppendSeparator();
        menuHelp->Append(MENU_INFO, "&About", "Shows the application information");
    }
    menuBar_->Append(menuHelp, "&Help");

    SetMenuBar(menuBar_);
}
示例#2
0
CMenuArtifact::CMenuArtifact(int nOffset) 
  : wxMenu("",0), m_nOffset(nOffset)
{
  for(int i = 0; i < CArtifactDisplayList::ARTIFACT_DISPLAY_COUNT; i++)
  {
    AppendRadioItem(
      _Ndx2MenuID(i),CArtifactDisplayList::apsDisplay[i]);
  }
  SetDefault();
}