Beispiel #1
0
void UIMultiScreenLayout::setViewMenu(QMenu *pViewMenu)
{
    /* Assign view-menu: */
    m_pViewMenu = pViewMenu;
    /* Prepare view-menu: */
    prepareViewMenu();
}
Beispiel #2
0
void SCH_EDIT_FRAME::ReCreateMenuBar()
{
    // Create and try to get the current menubar
    wxString   text;
    wxMenuBar* menuBar = GetMenuBar();

    if( !menuBar )
        menuBar = new wxMenuBar();

    // Delete all existing menus so they can be rebuilt.
    // This allows language changes of the menu text on the fly.
    menuBar->Freeze();

    while( menuBar->GetMenuCount() )
        delete menuBar->Remove( 0 );

    // Recreate all menus:

    // Menu File:
    wxMenu* fileMenu = new wxMenu;
    prepareFilesMenu( fileMenu, Kiface().IsSingle() );

    // Menu Edit:
    wxMenu* editMenu = new wxMenu;
    prepareEditMenu( editMenu );

    // Menu View:
    wxMenu* viewMenu = new wxMenu;
    prepareViewMenu( viewMenu );

    // Menu place:
    wxMenu* placeMenu = new wxMenu;
    preparePlaceMenu( placeMenu );

    // Menu Preferences:
    wxMenu* preferencesMenu = new wxMenu;
    preparePreferencesMenu( this, preferencesMenu );

    // Menu Tools:
    wxMenu* toolsMenu = new wxMenu;
    prepareToolsMenu( toolsMenu );

    // Help Menu:
    wxMenu* helpMenu = new wxMenu;
    prepareHelpMenu( helpMenu );

    // Create the menubar and append all submenus
    menuBar->Append( fileMenu, _( "&File" ) );
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( placeMenu, _( "&Place" ) );
    menuBar->Append( preferencesMenu, _( "P&references" ) );
    menuBar->Append( toolsMenu, _( "&Tools" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );

    menuBar->Thaw();

    // Associate the menu bar with the frame, if no previous menubar
    if( GetMenuBar() == NULL )
        SetMenuBar( menuBar );
    else
        menuBar->Refresh();
}