您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddMenuItem函数代码示例

51自学网 2021-06-01 19:41:09
  C++
这篇教程C++ AddMenuItem函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AddMenuItem函数的典型用法代码示例。如果您正苦于以下问题:C++ AddMenuItem函数的具体用法?C++ AddMenuItem怎么用?C++ AddMenuItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AddMenuItem函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _

void EDA_3D_FRAME::CreateMenuBar(){    wxMenuBar* menuBar   = new wxMenuBar;    wxMenu*    fileMenu  = new wxMenu;    wxMenu*    prefsMenu = new wxMenu;    menuBar->Append( fileMenu, _( "&File" ) );    fileMenu->Append( ID_MENU_SCREENCOPY_PNG, _( "Create Image (png format)" ) );    fileMenu->Append( ID_MENU_SCREENCOPY_JPEG, _( "Create Image (jpeg format)" ) );#if (defined(__WINDOWS__) || defined(__APPLE__ ) )    // Does not work properly under linux    fileMenu->AppendSeparator();    fileMenu->Append( ID_TOOL_SCREENCOPY_TOCLIBBOARD, _( "Copy 3D Image to Clipboard" ) );#endif    fileMenu->AppendSeparator();    fileMenu->Append( wxID_EXIT, _( "&Exit" ) );    menuBar->Append( prefsMenu, _( "&Preferences" ) );    AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,                 _( "Realistic Mode" ),                 KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );    wxMenu * renderOptionsMenu = new wxMenu;    AddMenuItem( prefsMenu, renderOptionsMenu, ID_MENU3D_COLOR,           _( "Render options" ), KiBitmap( tools_xpm ) );    AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SHADOWS,        _( "Render Shadows" ),        KiBitmap( green_xpm ), wxITEM_CHECK );    AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SHOW_HOLES_IN_ZONES,        _( "Show Holes in Zones" ),        _( "Holes inside a copper layer copper zones are shown, "            "but the calculation time is longer" ),        KiBitmap( green_xpm ), wxITEM_CHECK );    AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_TEXTURES,        _( "Render Textures" ),        _( "Apply a grid/cloud textures to Board, Solder Mask and Silkscreen" ),        KiBitmap( green_xpm ), wxITEM_CHECK );    AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_SMOOTH,        _( "Render Smooth Normals" ),        KiBitmap( green_xpm ), wxITEM_CHECK );    AddMenuItem( renderOptionsMenu, ID_MENU3D_FL_RENDER_MATERIAL,        _( "Render Material properties" ),        KiBitmap( green_xpm ), wxITEM_CHECK );    prefsMenu->AppendSeparator();    wxMenu * backgrounColorMenu = new wxMenu;    // Add submenu Choose Colors    AddMenuItem( prefsMenu, backgrounColorMenu, ID_MENU3D_COLOR,           _( "Choose Colors" ), KiBitmap( palette_xpm ) );    AddMenuItem( backgrounColorMenu, ID_MENU3D_BGCOLOR_TOP_SELECTION,                 _( "Background Top Color" ), KiBitmap( palette_xpm ) );    AddMenuItem( backgrounColorMenu, ID_MENU3D_BGCOLOR_SELECTION,                 _( "Background Bottom Color" ), KiBitmap( palette_xpm ) );    AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,                 _( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );    // Creates grid menu    wxMenu * gridlistMenu = new wxMenu;    AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,           _( "3D Grid" ), KiBitmap( grid_xpm ) );    gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString );    gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString );    gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString );    gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString );    gridlistMenu->AppendCheckItem( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString );    // If the grid is on, check the corresponding menuitem showing the grid  size    if( IsEnabled( FL_GRID ) )    {        gridlistMenu->Check( ID_MENU3D_GRID_10_MM, GetPrm3DVisu().m_3D_Grid == 10.0 );        gridlistMenu->Check( ID_MENU3D_GRID_5_MM, GetPrm3DVisu().m_3D_Grid == 5.0 );        gridlistMenu->Check( ID_MENU3D_GRID_2P5_MM, GetPrm3DVisu().m_3D_Grid == 2.5 );        gridlistMenu->Check( ID_MENU3D_GRID_1_MM, GetPrm3DVisu().m_3D_Grid == 1.0 );    }    else        gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );    prefsMenu->AppendSeparator();    AddMenuItem( prefsMenu, ID_MENU3D_SHOW_BOARD_BODY,           _( "Show Board Body" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );    AddMenuItem( prefsMenu, ID_MENU3D_USE_COPPER_THICKNESS,           _( "Show Copper Thickness" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );    AddMenuItem( prefsMenu, ID_MENU3D_MODULE_ONOFF,//.........这里部分代码省略.........
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:101,


示例2: create_PopUpMenu

GtkWidget * create_PopUpMenu( void ){ GtkWidget * window1; GtkWidget * Menu = NULL; GtkWidget * SubMenu = NULL; GtkWidget * MenuItem = NULL; GtkWidget * H, * N, * D, * F; demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext); mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext); int global_sub_size = mpctx_get_global_sub_size(guiInfo.mpcontext); Menu=gtk_menu_new(); gtk_widget_realize (Menu); window1 = gtk_widget_get_toplevel(Menu);  AddMenuItem( window1, (const char*)about_xpm, Menu,MSGTR_MENU_AboutMPlayer"     ", evAbout );  AddSeparator( Menu );   SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_MENU_Open );    AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_MENU_PlayFile"    ", evLoadPlay );#ifdef CONFIG_VCD    AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD );#endif#ifdef CONFIG_DVDREAD    AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD );#endif    AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_MENU_PlayURL, evSetURL );    AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_MENU_LoadSubtitle"   ", evLoadSubtitle );    AddMenuItem( window1, (const char*)nosub_xpm, SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle );    AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile );   SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_MENU_Playing );    AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_MENU_Play"        ", evPlay );    AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_MENU_Pause, evPause );    AddMenuItem( window1, (const char*)stop_xpm, SubMenu,MSGTR_MENU_Stop, evStop );    AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_MENU_NextStream, evNext );    AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_MENU_PrevStream, evPrev );//    AddSeparator( SubMenu );//    AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec );//    AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec );//    AddMenuItem( SubMenu,"Back 1 min", evBackward1min );//    AddMenuItem( SubMenu,"Fwd 1 min", evForward1min );//   SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size );//    AddMenuItem( SubMenu,MSGTR_MENU_NormalSize"      ", evNormalSize );//    AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize );//    AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen );#ifdef CONFIG_VCD   VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_MENU_VCD );    AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD );    AddSeparator( VCDSubMenu );    VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_MENU_Titles );    if ( guiInfo.Tracks )     {      char tmp[32]; int i;      for ( i=1;i < guiInfo.Tracks;i++ )       {        snprintf( tmp,32,MSGTR_MENU_Title,i );    //AddMenuItem( VCDTitleMenu,tmp,( i << 16 ) + evSetVCDTrack );        AddMenuItem(window1, (const char*)empty_xpm, VCDTitleMenu,tmp,( ( i + 1 ) << 16 ) + evSetVCDTrack );       }     }     else      {       MenuItem=AddMenuItem( window1, (const char*)empty_xpm, VCDTitleMenu,MSGTR_MENU_None,evNone );       gtk_widget_set_sensitive( MenuItem,FALSE );      }#endif#ifdef CONFIG_DVDREAD   DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_MENU_DVD );    AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_MENU_PlayDisc"    ", evPlayDVD );//    AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone );    AddSeparator( DVDSubMenu );    DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_MENU_Titles );     if ( guiInfo.Tracks )      {       char tmp[32]; int i;       for ( i=1 ; i<= guiInfo.Tracks;i++ )        {         snprintf( tmp,32,MSGTR_MENU_Title,i);         AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,tmp,			   guiInfo.Track == i,			   (i << 16) + evSetDVDTitle );        }      }      else       {        MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDTitleMenu,MSGTR_MENU_None,evNone );        gtk_widget_set_sensitive( MenuItem,FALSE );       }    DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_MENU_Chapters );     if ( guiInfo.Chapters )      {       char tmp[32]; int i;       for ( i=1;i <= guiInfo.Chapters;i++ )        {         snprintf( tmp,32,MSGTR_MENU_Chapter,i );         AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiInfo.Chapter == i,			   ( i << 16 ) + evSetDVDChapter );        }      }      else//.........这里部分代码省略.........
开发者ID:Newbleeto,项目名称:mplayer-tegra,代码行数:101,


示例3: AddMenuItem

void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, uint32 dtSender, uint32 dtAction, char const* BoxMessage, uint32 BoxMoney, bool Coded){    AddMenuItem(Icon, std::string(Message ? Message : ""), dtSender, dtAction, std::string(BoxMessage ? BoxMessage : ""), BoxMoney, Coded);}
开发者ID:Actionfox,项目名称:mangos,代码行数:4,


示例4: GetCrossHairPosition

/* Create command lines for a popup menu, for track and via editing * also update Netclass selection */void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ){    wxPoint  cursorPosition = GetCrossHairPosition();    wxString msg;    SetCurrentNetClass( Track->GetNetClassName() );    int flags = Track->GetFlags();    if( flags == 0 )    {        msg = AddHotkeyName( _( "Begin Track" ),                             g_Board_Editor_Hokeys_Descr, HK_ADD_NEW_TRACK );        AddMenuItem( PopMenu, ID_POPUP_PCB_BEGIN_TRACK,                     msg, KiBitmap( add_tracks_xpm ) );        if( Track->Type() == PCB_VIA_T )        {            msg = AddHotkeyName( _( "Drag Via" ), g_Board_Editor_Hokeys_Descr,                                 HK_DRAG_ITEM );            AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE, msg,                         KiBitmap( move_xpm ) );        }        else        {            if( Track->IsPointOnEnds( cursorPosition, -1 ) != 0 )            {                msg = AddHotkeyName( _( "Move Node" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );                AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_TRACK_NODE,                             msg, KiBitmap( move_xpm ) );            }            else            {                msg = AddHotkeyName( _( "Drag Segments, Keep Slope" ), g_Board_Editor_Hokeys_Descr,                                     HK_DRAG_TRACK_KEEP_SLOPE );                AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE,                             msg, KiBitmap( drag_segment_withslope_xpm ) );                msg = AddHotkeyName( _( "Drag Segment" ), g_Board_Editor_Hokeys_Descr,                                     HK_DRAG_ITEM );                AddMenuItem( PopMenu, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,                             msg, KiBitmap( drag_track_segment_xpm ) );                msg = AddHotkeyName( _( "Duplicate Track" ), g_Board_Editor_Hokeys_Descr,                                     HK_DUPLICATE_ITEM );                AddMenuItem( PopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,                             msg, KiBitmap( duplicate_line_xpm ) );                msg = AddHotkeyName( _("Move Track Exactly" ), g_Board_Editor_Hokeys_Descr,                                     HK_MOVE_ITEM_EXACT );                AddMenuItem( PopMenu, ID_POPUP_PCB_MOVE_EXACT,                             msg, KiBitmap( move_line_xpm ) );                msg = AddHotkeyName( _("Create Track Array" ), g_Board_Editor_Hokeys_Descr,                                     HK_CREATE_ARRAY );                AddMenuItem( PopMenu, ID_POPUP_PCB_CREATE_ARRAY,                             msg, KiBitmap( array_line_xpm ) );                AddMenuItem( PopMenu, ID_POPUP_PCB_BREAK_TRACK,                             _( "Break Track" ), KiBitmap( break_line_xpm ) );            }        }        AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER,                     _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) );    }    else if( flags & IS_DRAGGED )   // Drag via or node in progress    {        AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_MOVED_TRACK_NODE,                     _( "Place Node" ), KiBitmap( checked_ok_xpm ) );        return;    }    else // Edition in progress    {        if( flags & IS_NEW )        {            msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_LEFT_DCLICK );            AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) );        }        msg = AddHotkeyName( _( "Place Through Via" ), g_Board_Editor_Hokeys_Descr, HK_ADD_THROUGH_VIA );        AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_THROUGH_VIA, msg, KiBitmap( via_xpm ) );        msg = AddHotkeyName( _( "Select Layer and Place Through Via" ),                             g_Board_Editor_Hokeys_Descr, HK_SEL_LAYER_AND_ADD_THROUGH_VIA );        AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_THROUGH_VIA,                     msg, KiBitmap( select_w_layer_xpm ) );        if( GetDesignSettings().m_BlindBuriedViaAllowed )        {            msg = AddHotkeyName( _( "Place Blind/Buried Via" ),                                 g_Board_Editor_Hokeys_Descr, HK_ADD_BLIND_BURIED_VIA );            AddMenuItem( PopMenu, ID_POPUP_PCB_PLACE_BLIND_BURIED_VIA, msg, KiBitmap( via_buried_xpm ) );            msg = AddHotkeyName( _( "Select Layer and Place Blind/Buried Via" ),                                 g_Board_Editor_Hokeys_Descr, HK_SEL_LAYER_AND_ADD_BLIND_BURIED_VIA );            AddMenuItem( PopMenu, ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_BLIND_BURIED_VIA,//.........这里部分代码省略.........
开发者ID:chgans,项目名称:kicad,代码行数:101,


示例5: AddMenuItem

/* Create the wxMenuitem list for zone outlines editing and zone filling */void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu ){    wxString msg;    if( edge_zone->GetFlags() == IS_DRAGGED )    {        AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_DRAGGED_ZONE_OUTLINE_SEGMENT,                     _( "Place Edge Outline" ), KiBitmap( checked_ok_xpm ) );    }    else if( edge_zone->GetFlags() )    {        if( (edge_zone->GetFlags() & IN_EDIT ) )            AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_CORNER,                         _( "Place Corner" ), KiBitmap( checked_ok_xpm ) );        else            AddMenuItem( aPopMenu, ID_POPUP_PCB_PLACE_ZONE_OUTLINES,                         _( "Place Zone" ), KiBitmap( checked_ok_xpm ) );    }    else    {        wxMenu* zones_menu = new wxMenu();        AddMenuItem( aPopMenu, zones_menu, -1,                    edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ),                    KiBitmap( add_zone_xpm ) );        if( edge_zone->HitTestForCorner( RefPos( true ) ) >= 0 )        {            AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_CORNER,                         _( "Move Corner" ), KiBitmap( move_xpm ) );            AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CORNER,                         _( "Delete Corner" ), KiBitmap( delete_xpm ) );        }        else if( edge_zone->HitTestForEdge( RefPos( true ) ) >= 0 )        {            AddMenuItem( zones_menu, ID_POPUP_PCB_ADD_ZONE_CORNER,                         _( "Create Corner" ), KiBitmap( add_corner_xpm ) );            msg = AddHotkeyName( _( "Drag Outline Segment" ), g_Board_Editor_Hokeys_Descr,                                 HK_DRAG_ITEM );            AddMenuItem( zones_menu, ID_POPUP_PCB_DRAG_ZONE_OUTLINE_SEGMENT,                         msg, KiBitmap( drag_outline_segment_xpm ) );        }        zones_menu->AppendSeparator();        AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_SIMILAR_ZONE,                     _( "Add Similar Zone" ), KiBitmap( add_zone_xpm ) );        AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_ADD_CUTOUT_ZONE,                     _( "Add Cutout Area" ), KiBitmap( add_zone_cutout_xpm ) );        AddMenuItem( zones_menu, ID_POPUP_PCB_ZONE_DUPLICATE,                     _( "Duplicate Zone Onto Layer" ), KiBitmap( zone_duplicate_xpm ) );        zones_menu->AppendSeparator();        if( ! edge_zone->GetIsKeepout() )            AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ),                         KiBitmap( fill_zone_xpm ) );        if( !edge_zone->GetFilledPolysList().IsEmpty() )        {            AddMenuItem( zones_menu, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,                         _( "Remove Filled Areas in Zone" ), KiBitmap( zone_unfill_xpm ) );        }        msg = AddHotkeyName( _( "Move Zone" ), g_Board_Editor_Hokeys_Descr, HK_MOVE_ITEM );        AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_ZONE_OUTLINES, msg, KiBitmap( move_xpm ) );        msg = AddHotkeyName( _("Move Zone Exactly" ), g_Board_Editor_Hokeys_Descr,                             HK_MOVE_ITEM_EXACT );        AddMenuItem( zones_menu, ID_POPUP_PCB_MOVE_EXACT,                     msg, KiBitmap( move_zone_xpm ) );        msg = AddHotkeyName( _( "Edit Zone Properties" ), g_Board_Editor_Hokeys_Descr,                             HK_EDIT_ITEM );        AddMenuItem( zones_menu, ID_POPUP_PCB_EDIT_ZONE_PARAMS,                     msg, KiBitmap( edit_xpm ) );        zones_menu->AppendSeparator();        if( edge_zone->GetSelectedCorner() >= 0 &&            edge_zone->Outline()->IsCutoutContour( edge_zone->GetSelectedCorner() ) )            AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CUTOUT,                         _( "Delete Cutout" ), KiBitmap( delete_xpm ) );        AddMenuItem( zones_menu, ID_POPUP_PCB_DELETE_ZONE_CONTAINER,                     _( "Delete Zone Outline" ), KiBitmap( delete_xpm ) );    }}
开发者ID:chgans,项目名称:kicad,代码行数:91,


示例6: AddMenuItem

 void Menu::AppendMenuItem(int item_id,     const std::wstring& label,     MenuItemType type) {     AddMenuItem(-1, item_id, label, type); }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:6,


示例7: GetRegistryValue

int CGitExtensionsShellEx::PopulateMenu(HMENU hMenu, int firstId, int id, bool isSubMenu){    CString szShellVisibleMenuItems = GetRegistryValue(HKEY_CURRENT_USER, "SOFTWARE//GitExtensions//GitExtensions", "ShellVisibleMenuItems");    // preset values, if not used    AddFilesId = -1;    ApplyPatchId = -1;    BrowseId = -1;    CreateBranchId = -1;    CheckoutBranchId = -1;    CheckoutRevisionId = -1;    CloneId = -1;    CommitId = -1;    FileHistoryId = -1;    PullId = -1;    PushId = -1;    SettingsId = -1;    ViewDiffId = -1;    ResetFileChangesId = -1;    int pos = 0;    if (isSubMenu)    {        if (IsMenuItemVisible(szShellVisibleMenuItems, 0))            AddMenuItem(hMenu, "Add files", IDI_ICONADDED, firstId, ++id, AddFilesId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 1))            AddMenuItem(hMenu, "Apply patch", 0, firstId, ++id, ApplyPatchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 2))            AddMenuItem(hMenu, "Browse", IDI_ICONBROWSEFILEEXPLORER, firstId, ++id, BrowseId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 3))            AddMenuItem(hMenu, "Create branch", IDI_ICONBRANCHCREATE, firstId, ++id, CreateBranchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 4))            AddMenuItem(hMenu, "Checkout branch", IDI_ICONBRANCHCHECKOUT, firstId, ++id, CheckoutBranchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 5))            AddMenuItem(hMenu, "Checkout revision", IDI_ICONREVISIONCHECKOUT, firstId, ++id, CheckoutRevisionId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 6))            AddMenuItem(hMenu, "Clone", IDI_ICONCLONEREPOGIT, firstId, ++id, CloneId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 7))            AddMenuItem(hMenu, "Commit", IDI_ICONCOMMIT, firstId, ++id, CommitId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 8))            AddMenuItem(hMenu, "File history", IDI_ICONFILEHISTORY, firstId, ++id, FileHistoryId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 9))            AddMenuItem(hMenu, "Reset file changes", IDI_ICONTRESETFILETO, firstId, ++id, ResetFileChangesId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 10))            AddMenuItem(hMenu, "Pull", IDI_ICONPULL, firstId, ++id, PullId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 11))            AddMenuItem(hMenu, "Push", IDI_ICONPUSH, firstId, ++id, PushId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 12))            AddMenuItem(hMenu, "Settings", IDI_ICONSETTINGS, firstId, ++id, SettingsId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 13))            AddMenuItem(hMenu, "View diff", IDI_ICONDIFF, firstId, ++id, ViewDiffId=pos++);    }    else    {        if (IsMenuItemVisible(szShellVisibleMenuItems, 0))            AddMenuItem(hMenu, "GitEx Add files", IDI_ICONADDED, firstId, ++id, AddFilesId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 1))            AddMenuItem(hMenu, "GitEx Apply patch", 0, firstId, ++id, ApplyPatchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 2))            AddMenuItem(hMenu, "GitEx Browse", IDI_ICONBROWSEFILEEXPLORER, firstId, ++id, BrowseId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 3))            AddMenuItem(hMenu, "GitEx Create branch", IDI_ICONBRANCHCREATE, firstId, ++id, CreateBranchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 4))            AddMenuItem(hMenu, "GitEx Checkout branch", IDI_ICONBRANCHCHECKOUT, firstId, ++id, CheckoutBranchId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 5))            AddMenuItem(hMenu, "GitEx Checkout revision", IDI_ICONREVISIONCHECKOUT, firstId, ++id, CheckoutRevisionId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 6))            AddMenuItem(hMenu, "GitEx Clone", IDI_ICONCLONEREPOGIT, firstId, ++id, CloneId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 7))            AddMenuItem(hMenu, "GitEx Commit", IDI_ICONCOMMIT, firstId, ++id, CommitId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 8))            AddMenuItem(hMenu, "GitEx File history", IDI_ICONFILEHISTORY, firstId, ++id, FileHistoryId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 9))            AddMenuItem(hMenu, "GitEx Reset file changes", IDI_ICONTRESETFILETO, firstId, ++id, ResetFileChangesId=pos++);        if (IsMenuItemVisible(szShellVisibleMenuItems, 10))            AddMenuItem(hMenu, "GitEx Pull", IDI_ICONPULL, firstId, ++id, PullId=pos++);//.........这里部分代码省略.........
开发者ID:jianhuiz,项目名称:gitextensions,代码行数:101,


示例8: AddMenusForComponent

void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ){    if( Component->Type() != SCH_COMPONENT_T )    {        wxASSERT( 0 );        return;    }    wxString       msg;    LIB_ALIAS*     libEntry;    libEntry = CMP_LIBRARY::FindLibraryEntry( Component->GetLibName() );    if( !Component->GetFlags() )    {        msg.Printf( _( "Move Component %s" ),                    GetChars( Component->GetField( REFERENCE )->GetText() ) );        msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );        AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );        msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG );        AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( move_xpm ) );    }    wxMenu* orientmenu = new wxMenu;    msg = AddHotkeyName( _( "Rotate +" ), s_Schematic_Hokeys_Descr, HK_ROTATE );    AddMenuItem( orientmenu, ID_SCH_ROTATE_COUNTERCLOCKWISE, msg,                 KiBitmap( rotate_ccw_xpm ) );    AddMenuItem( orientmenu, ID_SCH_ROTATE_CLOCKWISE, _( "Rotate -" ),                 KiBitmap( rotate_cw_xpm ) );    msg = AddHotkeyName( _( "Mirror --" ), s_Schematic_Hokeys_Descr, HK_MIRROR_X_COMPONENT );    AddMenuItem( orientmenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );    msg = AddHotkeyName( _( "Mirror ||" ), s_Schematic_Hokeys_Descr, HK_MIRROR_Y_COMPONENT );    AddMenuItem( orientmenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );    msg = AddHotkeyName( _( "Normal" ), s_Schematic_Hokeys_Descr, HK_ORIENT_NORMAL_COMPONENT );    AddMenuItem( orientmenu, ID_SCH_ORIENT_NORMAL, msg, KiBitmap( normal_xpm ) );    AddMenuItem( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP,                 _( "Orient Component" ), KiBitmap( orient_xpm ) );    AddMenusForEditComponent( PopMenu, Component );    if( !Component->GetFlags() )    {        msg = AddHotkeyName( _( "Copy Component" ), s_Schematic_Hokeys_Descr,                             HK_COPY_COMPONENT_OR_LABEL );        AddMenuItem( PopMenu, ID_POPUP_SCH_COPY_ITEM, msg, KiBitmap( copy_button_xpm ) );        msg = AddHotkeyName( _( "Delete Component" ), s_Schematic_Hokeys_Descr, HK_DELETE );        AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_CMP, msg, KiBitmap( delete_xpm ) );    }    if( libEntry && !libEntry->GetDocFileName().IsEmpty() )        AddMenuItem( PopMenu, ID_POPUP_SCH_DISPLAYDOC_CMP, _( "Doc" ), KiBitmap( datasheet_xpm ) );}
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:52,


示例9: prepareToolsMenu

void prepareToolsMenu( wxMenu* aParentMenu ){    wxString text;    text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hotkeys_Descr,                          HK_UPDATE_PCB_FROM_SCH );    AddMenuItem( aParentMenu,                 ID_UPDATE_PCB_FROM_SCH,                 text, _( "Update PCB design with current schematic." ),                 KiBitmap( update_pcb_from_sch_xpm ) );    // Run Pcbnew    AddMenuItem( aParentMenu, ID_RUN_PCB, _( "&Open PCB Editor" ),                 _( "Run Pcbnew" ),                 KiBitmap( pcbnew_xpm ) );    aParentMenu->AppendSeparator();    AddMenuItem( aParentMenu, ID_RUN_LIBRARY, _( "Symbol Library &Editor" ),                 HELP_RUN_LIB_EDITOR,                 KiBitmap( libedit_xpm ) );    AddMenuItem( aParentMenu, ID_RESCUE_CACHED, _( "&Rescue Symbols..." ),                 _( "Find old symbols in project and rename/rescue them" ),                 KiBitmap( rescue_xpm ) );    AddMenuItem( aParentMenu, ID_REMAP_SYMBOLS, _( "Remap S&ymbols..." ),                 _( "Remap legacy library symbols to symbol library table" ),                 KiBitmap( rescue_xpm ) );    aParentMenu->AppendSeparator();    AddMenuItem( aParentMenu, ID_OPEN_CMP_TABLE, _( "Edit Symbol Field&s..." ),                 KiBitmap( spreadsheet_xpm ) );    AddMenuItem( aParentMenu, ID_EDIT_COMPONENTS_TO_SYMBOLS_LIB_ID,                 _( "Edit Symbol &Library References..." ),                 _( "Edit links between schematic symbols and library symbols" ),                 KiBitmap( edit_cmp_symb_links_xpm ) );    aParentMenu->AppendSeparator();    AddMenuItem( aParentMenu, ID_GET_ANNOTATE, _( "&Annotate Schematic..." ),                 HELP_ANNOTATE,                 KiBitmap( annotate_xpm ) );    AddMenuItem( aParentMenu, ID_BUS_MANAGER, _( "Bus &Definitions..." ),                 HELP_BUS_MANAGER,                 KiBitmap( bus_definition_tool_xpm ) );    aParentMenu->AppendSeparator();    // Run CvPcb    AddMenuItem( aParentMenu, ID_RUN_CVPCB, _( "A&ssign Footprints..." ),                 _( "Assign PCB footprints to schematic symbols" ),                 KiBitmap( cvpcb_xpm ) );    AddMenuItem( aParentMenu, ID_GET_TOOLS, _( "Generate Bill of &Materials..." ),                 HELP_GENERATE_BOM,                 KiBitmap( bom_xpm ) );    aParentMenu->AppendSeparator();#ifdef KICAD_SPICE    // Simulator    AddMenuItem( aParentMenu, ID_SIM_SHOW, _("Simula&tor"),                 _( "Simulate circuit" ),                 KiBitmap( simulator_xpm ) );#endif /* KICAD_SPICE */}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:72,


示例10: GetMenuBar

//.........这里部分代码省略.........    // Units submenu    CONDITIONAL_MENU* unitsSubMenu = new CONDITIONAL_MENU( false, selTool );    unitsSubMenu->SetTitle( _( "&Units" ) );    unitsSubMenu->SetIcon( unit_mm_xpm );    unitsSubMenu->AddCheckItem( ACTIONS::imperialUnits,   imperialUnitsCondition );    unitsSubMenu->AddCheckItem( ACTIONS::metricUnits,     metricUnitsCondition );    viewMenu->AddMenu( unitsSubMenu );    viewMenu->AddCheckItem( ACTIONS::toggleCursorStyle,   fullCrosshairCondition );    viewMenu->AddSeparator();    viewMenu->AddCheckItem( EE_ACTIONS::toggleHiddenPins, hiddenPinsCondition );#ifdef __APPLE__    viewMenu->AppendSeparator();#endif    //-- Place menu -----------------------------------------------------------    //    CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool );    placeMenu->AddItem( EE_ACTIONS::placeSymbol,            EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placePower,             EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::drawWire,               EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::drawBus,                EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeBusWireEntry,      EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeBusBusEntry,       EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeNoConnect,         EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeJunction,          EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeLabel,             EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeGlobalLabel,       EE_CONDITIONS::ShowAlways );    placeMenu->AddSeparator();    placeMenu->AddItem( EE_ACTIONS::placeHierarchicalLabel, EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::drawSheet,              EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::importSheetPin,         EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeSheetPin,          EE_CONDITIONS::ShowAlways );    placeMenu->AddSeparator();    placeMenu->AddItem( EE_ACTIONS::drawLines,              EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeSchematicText,     EE_CONDITIONS::ShowAlways );    placeMenu->AddItem( EE_ACTIONS::placeImage,             EE_CONDITIONS::ShowAlways );    //-- Inspect menu -----------------------------------------------    //    wxMenu* inspectMenu = new wxMenu;    AddMenuItem( inspectMenu, ID_GET_ERC, _( "Electrical Rules &Checker" ),                 _( "Perform electrical rules check" ), KiBitmap( erc_xpm ) );    //-- Tools menu -----------------------------------------------    //    wxMenu* toolsMenu = new wxMenu;    prepareToolsMenu( toolsMenu );    //-- Preferences menu -----------------------------------------------    //    CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );    auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {        return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;    };    auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {        return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;    };    prefsMenu->AddItem( ID_PREFERENCES_CONFIGURE_PATHS, _( "Configure Pa&ths..." ),                        _( "Edit path configuration environment variables" ),                        path_xpm,                          EE_CONDITIONS::ShowAlways );    prefsMenu->AddItem( ID_EDIT_SYM_LIB_TABLE, _( "Manage Symbol Libraries..." ),                        _( "Edit the global and project symbol library lists" ),                        library_table_xpm,                 EE_CONDITIONS::ShowAlways );    prefsMenu->AddItem( wxID_PREFERENCES,                        AddHotkeyName( _( "&Preferences..." ), g_Eeschema_Hotkeys_Descr, HK_PREFERENCES ),                        _( "Show preferences for all open tools" ),                        preference_xpm,                    EE_CONDITIONS::ShowAlways );    prefsMenu->AddSeparator();    Pgm().AddMenuLanguageList( prefsMenu );    prefsMenu->AddSeparator();    prefsMenu->AddCheckItem( ACTIONS::acceleratedGraphics, acceleratedGraphicsCondition );    prefsMenu->AddCheckItem( ACTIONS::standardGraphics,    standardGraphicsCondition );    //-- Menubar -----------------------------------------------    //    menuBar->Append( fileMenu, _( "&File" ) );    menuBar->Append( editMenu, _( "&Edit" ) );    menuBar->Append( viewMenu, _( "&View" ) );    menuBar->Append( placeMenu, _( "&Place" ) );    menuBar->Append( inspectMenu, _( "&Inspect" ) );    menuBar->Append( toolsMenu, _( "&Tools" ) );    menuBar->Append( prefsMenu, _( "P&references" ) );    AddStandardHelpMenu( menuBar );    SetMenuBar( menuBar );    delete oldMenuBar;}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:101,


示例11: GetCurItem

BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode ){    BOARD_ITEM* item = GetCurItem();    if( GetBoard()->m_Modules == NULL )        return NULL;    GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();    // Assign to scanList the proper item types desired based on tool type    // or hotkey that is in play.    const KICAD_T* scanList = NULL;    if( aHotKeyCode )    {        // @todo: add switch here and add calls to PcbGeneralLocateAndDisplay(        // int aHotKeyCode ) when searching is needed from a hotkey handler    }    else    {        scanList = GENERAL_COLLECTOR::ModulesAndTheirItems;    }    m_Collector->Collect( GetBoard(), scanList, RefPos( true ), guide );    // Remove redundancies: when an item is found, we can remove the module from list    if( m_Collector->GetCount() > 1 )    {        for( int ii = 0; ii < m_Collector->GetCount(); ii++ )        {            item = (*m_Collector)[ii];            if( item->Type() != PCB_MODULE_T )                continue;            m_Collector->Remove( ii );            ii--;        }    }    if( m_Collector->GetCount() <= 1 )    {        item = (*m_Collector)[0];        SetCurItem( item );    }    else    // we can't figure out which item user wants, do popup menu so user can choose    {        wxMenu      itemMenu;        // Give a title to the selection menu. It also allow to close the popup menu without any action        wxMenuItem* item_title = new wxMenuItem( &itemMenu, wxID_NONE, _( "Selection Clarification" ) );#ifdef __WINDOWS__        wxFont      bold_font( *wxNORMAL_FONT );        bold_font.SetWeight( wxFONTWEIGHT_BOLD );        bold_font.SetStyle( wxFONTSTYLE_ITALIC );        item_title->SetFont( bold_font );#endif        itemMenu.Append( item_title );        itemMenu.AppendSeparator();        int limit = std::min( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );        for( int ii = 0; ii<limit; ++ii )        {            item = (*m_Collector)[ii];            wxString    text = item->GetSelectMenuText();            BITMAP_DEF  xpm  = item->GetMenuImage();            AddMenuItem( &itemMenu,                         ID_POPUP_PCB_ITEM_SELECTION_START + ii,                         text,                         KiBitmap( xpm ) );        }        // this menu's handler is void        // PCB_BASE_FRAME::ProcessItemSelection()        // and it calls SetCurItem() which in turn calls DisplayInfo() on the        // item.        m_canvas->SetAbortRequest( true );   // changed in false if an item        PopupMenu( &itemMenu );              // m_AbortRequest = false if an item is selected        m_canvas->MoveCursorToCrossHair();        m_canvas->SetIgnoreMouseEvents( false );        // The function ProcessItemSelection() has set the current item, return it.        item = GetCurItem();    }    if( item )    {        SetMsgPanel( item );    }    return item;}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:99,


示例12: GetMenuBar

/** * @brief (Re)Create the menubar for the component editor frame */void LIB_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;    // Select current library    AddMenuItem( fileMenu,                 ID_LIBEDIT_SELECT_CURRENT_LIB,                 _( "&Current Library" ),                 _( "Select working library" ),                 KiBitmap( library_xpm ) );    fileMenu->AppendSeparator();    // Save current library    AddMenuItem( fileMenu,                 ID_LIBEDIT_SAVE_CURRENT_LIB,                 _( "&Save Current Library/tCtrl+S" ),                 _( "Save the current active library" ),                 KiBitmap( save_xpm ) );    // Save current library as...    AddMenuItem( fileMenu,                 ID_LIBEDIT_SAVE_CURRENT_LIB_AS,                 _( "Save Current Library &As" ),                 _( "Save current active library as..." ),                 KiBitmap( save_as_xpm ) );    // Separator    fileMenu->AppendSeparator();    // Export as png file    AddMenuItem( fileMenu,                 ID_LIBEDIT_GEN_PNG_FILE,                 _( "Create &PNG File from Screen" ),                 _( "Create a PNG file from the component displayed on screen" ),                 KiBitmap( plot_xpm ) );    // Export as SVG file    AddMenuItem( fileMenu,                 ID_LIBEDIT_GEN_SVG_FILE,                 _( "Create S&VG File" ),                 _( "Create a SVG file from the current loaded component" ),                 KiBitmap( plot_svg_xpm ) );    // Separator    fileMenu->AppendSeparator();    // Quit    AddMenuItem( fileMenu,                 wxID_EXIT,                 _( "&Quit" ),                 _( "Quit Library Editor" ),                 KiBitmap( exit_xpm ) );    // Edit menu    wxMenu* editMenu = new wxMenu;    // Undo    text = AddHotkeyName( _( "&Undo" ), s_Libedit_Hokeys_Descr, HK_UNDO );    AddMenuItem( editMenu,                 wxID_UNDO,                 text,                 _( "Undo last edit" ),                 KiBitmap( undo_xpm ) );    // Redo    text = AddHotkeyName( _( "&Redo" ), s_Libedit_Hokeys_Descr, HK_REDO );    AddMenuItem( editMenu,                 wxID_REDO,                 text,                 _( "Redo the last undo command" ),                 KiBitmap( redo_xpm ) );    // Separator    editMenu->AppendSeparator();    // Delete    AddMenuItem( editMenu,                 ID_LIBEDIT_DELETE_ITEM_BUTT,                 _( "&Delete" ),//.........这里部分代码省略.........
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:101,


示例13: GetScreen

/* Prepare the right-click pullup menu. * The menu already has a list of zoom commands. */bool GERBVIEW_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu ){    GERBER_DRAW_ITEM* currItem = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem();    wxString    msg;    bool        BlockActive = !GetScreen()->m_BlockLocate.IsIdle();    bool        busy = currItem && currItem->GetFlags();    // Do not initiate a start block validation on menu.    m_canvas->SetCanStartBlock( -1 );    // Simple location of elements where possible.    if( !busy )    {        currItem = Locate( aPosition, CURSEUR_OFF_GRILLE );        busy = currItem && currItem->GetFlags();    }    // If command in progress, end command.    if( GetToolId() != ID_NO_TOOL_SELECTED )    {        if( busy )            AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,                         _( "Cancel" ), KiBitmap( cancel_xpm )  );        else            AddMenuItem( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,                         _( "End Tool" ), KiBitmap( cursor_xpm ) );        aPopMenu->AppendSeparator();    }    else    {        if( busy || BlockActive )        {            if( BlockActive )            {                AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,                             _( "Cancel Block" ), KiBitmap( cancel_xpm ) );                aPopMenu->AppendSeparator();                AddMenuItem( aPopMenu, ID_POPUP_PLACE_BLOCK,                             _( "Place Block" ), KiBitmap( checked_ok_xpm ) );            }            else            {                AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,                             _( "Cancel" ), KiBitmap( cancel_xpm ) );            }            aPopMenu->AppendSeparator();        }    }    if( BlockActive )        return true;    if( currItem )    {        GetScreen()->SetCurItem( currItem );        bool add_separator = false;        // Now, display a context menu        // to allow highlighting items which share the same attributes        // as the selected item (net attributes and aperture attributes)        const GBR_NETLIST_METADATA& net_attr = currItem->GetNetAttributes();        if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) ||            ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_CMP ) )        {            AddMenuItem( aPopMenu, ID_HIGHLIGHT_CMP_ITEMS,                         wxString::Format( _( "Highlight items of component /"%s/"" ),                                            GetChars( net_attr.m_Cmpref ) ),                         KiBitmap( file_footprint_xpm ) );            add_separator = true;        }        if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) )        {            AddMenuItem( aPopMenu, ID_HIGHLIGHT_NET_ITEMS,                         wxString::Format( _( "Highlight items of net /"%s/"" ),                                            GetChars( net_attr.m_Netname ) ),                         KiBitmap( general_ratsnest_xpm ) );            add_separator = true;        }        D_CODE* apertDescr = currItem->GetDcodeDescr();        if( apertDescr && !apertDescr->m_AperFunction.IsEmpty() )        {            AddMenuItem( aPopMenu, ID_HIGHLIGHT_APER_ATTRIBUTE_ITEMS,                         wxString::Format( _( "Highlight aperture type /"%s/"" ),                                            GetChars( apertDescr->m_AperFunction ) ),                         KiBitmap( flag_xpm ) );            add_separator = true;        }        if( add_separator )            aPopMenu->AppendSeparator();    }//.........这里部分代码省略.........
开发者ID:cpavlina,项目名称:kicad,代码行数:101,


示例14: GetColumnCount

void ColumnManager::OnContextMenuHeader(CWnd* pWnd, CPoint point, bool isGroundEnable /* = false*/){	CHeaderCtrl* pHeaderCtrl = (CHeaderCtrl*)pWnd;	if ((point.x == -1) && (point.y == -1))	{		CRect rect;		pHeaderCtrl->GetItemRect(0, &rect);		pHeaderCtrl->ClientToScreen(&rect);		point = rect.CenterPoint();	}	CMenu popup;	if (popup.CreatePopupMenu())	{		int columnCount = GetColumnCount();		CString temp;		UINT uCheckedFlags = MF_STRING | MF_ENABLED | MF_CHECKED;		UINT uUnCheckedFlags = MF_STRING | MF_ENABLED;		// build control menu		//temp.LoadString(IDS_STATUSLIST_SHOWGROUPS);		//popup.AppendMenu(isGroundEnable? uCheckedFlags : uUnCheckedFlags, columnCount, temp);		temp.LoadString(IDS_STATUSLIST_RESETCOLUMNORDER);		popup.AppendMenu(uUnCheckedFlags, columnCount + 2, temp);		popup.AppendMenu(MF_SEPARATOR);		// standard columns		AddMenuItem(&popup);		// user-prop columns:		// find relevant ones and sort 'em		std::map<CString, int> sortedProps;		for (int i = (int)itemName.size(); i < columnCount; ++i)			if (IsRelevant(i))				sortedProps[GetName(i)] = i;		if (!sortedProps.empty())		{			// add 'em to the menu			popup.AppendMenu(MF_SEPARATOR);			for (auto iter = sortedProps.cbegin(), end = sortedProps.cend(); iter != end; ++iter)			{				popup.AppendMenu(IsVisible(iter->second)					? uCheckedFlags					: uUnCheckedFlags					, iter->second					, iter->first);			}		}		// show menu & let user pick an entry		int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY, point.x, point.y, pWnd);		if ((cmd >= 1) && (cmd < columnCount))			SetVisible(cmd, !IsVisible(cmd));		else if (cmd == columnCount)		{			pWnd->GetParent()->SendMessage(LVM_ENABLEGROUPVIEW, !isGroundEnable, NULL);			//EnableGroupView(!isGroundEnable);		}		else if (cmd == columnCount + 1)			RemoveUnusedProps();		else if (cmd == columnCount + 2)		{			temp.LoadString(IDS_CONFIRMRESETCOLUMNORDER);			if (MessageBox(pWnd->m_hWnd, temp, L"TortoiseGit", MB_YESNO | MB_ICONQUESTION) == IDYES)				ResetColumns(m_dwDefaultColumns);		}	}}
开发者ID:YueLinHo,项目名称:TortoiseGit,代码行数:76,


示例15: AddMenusForEditComponent

void AddMenusForEditComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ){    if( Component->Type() != SCH_COMPONENT_T )    {        wxASSERT( 0 );        return;    }    wxString       msg;    LIB_ALIAS*     libEntry;    LIB_COMPONENT* libComponent = NULL;    libEntry = CMP_LIBRARY::FindLibraryEntry( Component->GetLibName() );    if( libEntry )        libComponent = libEntry->GetComponent();    wxMenu* editmenu = new wxMenu;    msg = AddHotkeyName( _( "Edit" ), s_Schematic_Hokeys_Descr, HK_EDIT );    AddMenuItem( editmenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_component_xpm ) );    if( libComponent && libComponent->IsNormal() )    {        msg = AddHotkeyName( _( "Value" ), s_Schematic_Hokeys_Descr,                             HK_EDIT_COMPONENT_VALUE );        AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_VALUE, msg,                     KiBitmap( edit_comp_value_xpm ) );        msg = AddHotkeyName( _( "Reference" ), s_Schematic_Hokeys_Descr,                             HK_EDIT_COMPONENT_REFERENCE );        AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_REFERENCE, msg,                     KiBitmap( edit_comp_ref_xpm ) );        msg = AddHotkeyName( _( "Footprint" ), s_Schematic_Hokeys_Descr,                             HK_EDIT_COMPONENT_FOOTPRINT );        AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_FOOTPRINT, msg,                     KiBitmap( edit_comp_footprint_xpm ) );    }    if( libComponent && libComponent->HasConversion() )        AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ),                     KiBitmap( component_select_alternate_shape_xpm ) );    if( libComponent && ( libComponent->GetPartCount() >= 2 ) )    {        wxMenu* sel_unit_menu = new wxMenu; int ii;        for( ii = 0; ii < libComponent->GetPartCount(); ii++ )        {            wxString num_unit;            int unit = Component->GetUnit();            num_unit.Printf( _( "Unit %d %c" ), ii + 1,                             "?ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ ii + 1 ] );            wxMenuItem * item = sel_unit_menu->Append( ID_POPUP_SCH_SELECT_UNIT1 + ii,                                                       num_unit, wxEmptyString,                                                       wxITEM_CHECK );            if( unit == ii + 1 )                item->Check(true);        }        AddMenuItem( editmenu, sel_unit_menu, ID_POPUP_SCH_SELECT_UNIT_CMP,                     _( "Unit" ), KiBitmap( component_select_unit_xpm ) );    }    if( !Component->GetFlags() )    {        AddMenuItem( editmenu, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP,                     _( "Edit with Library Editor" ),                     KiBitmap( libedit_xpm ) );    }    AddMenuItem( PopMenu, editmenu, ID_SCH_EDIT_ITEM,                 _( "Edit Component" ), KiBitmap( edit_component_xpm ) );}
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:75,


示例16: GetScreen

SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aFilterList[],                                      int aHotKeyCommandId ){    SCH_ITEM* item = NULL;    m_collectedItems.Collect( GetScreen()->GetDrawItems(), aFilterList, aPosition );    if( m_collectedItems.GetCount() == 0 )    {        ClearMsgPanel();    }    else if( m_collectedItems.GetCount() == 1 )    {        item = m_collectedItems[0];    }    else    {        // There are certain combinations of items that do not need clarification such as        // a corner were two lines meet or all the items form a junction.        if( aHotKeyCommandId )        {            switch( aHotKeyCommandId )            {            case HK_DRAG:                if( m_collectedItems.IsCorner() || m_collectedItems.IsNode( false )                    || m_collectedItems.IsDraggableJunction() )                {                    item = m_collectedItems[0];                }            default:                ;            }        }        if( item == NULL )        {            wxASSERT_MSG( m_collectedItems.GetCount() <= MAX_SELECT_ITEM_IDS,                          wxT( "Select item clarification context menu size limit exceeded." ) );            wxMenu selectMenu;            wxMenuItem* title = new wxMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ) );            selectMenu.Append( title );            selectMenu.AppendSeparator();            for( int i = 0;  i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS;  i++ )            {                wxString text = m_collectedItems[i]->GetSelectMenuText();                BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();                AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, KiBitmap( xpm ) );            }            // Set to NULL in case user aborts the clarification context menu.            GetScreen()->SetCurItem( NULL );            m_canvas->SetAbortRequest( true );   // Changed to false if an item is selected            PopupMenu( &selectMenu );            m_canvas->MoveCursorToCrossHair();            item = GetScreen()->GetCurItem();        }    }    GetScreen()->SetCurItem( item );    if( item )    {        if( item->Type() == SCH_COMPONENT_T )            ( (SCH_COMPONENT*) item )->SetCurrentSheetPath( &GetCurrentSheet() );        MSG_PANEL_ITEMS items;        item->GetMsgPanelInfo( items );        SetMsgPanel( items );    }    else    {        ClearMsgPanel();    }    return item;}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:79,


示例17: GetScreen

/* Prepare context menu when a click on the right mouse button occurs. * * This menu is then added to the list of zoom commands. */bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ){    SCH_ITEM* item = GetScreen()->GetCurItem();    bool      BlockActive = GetScreen()->IsBlockActive();    wxString msg;    // Do not start a block command  on context menu.    m_canvas->SetCanStartBlock( -1 );    if( BlockActive )    {        AddMenusForBlock( PopMenu, this );        PopMenu->AppendSeparator();        // If we have a block containing only one main element        // we append its edition submenu        if( item != NULL )        {            switch( item->Type() )            {                case SCH_COMPONENT_T:                    AddMenusForEditComponent( PopMenu, (SCH_COMPONENT *) item );                    PopMenu->AppendSeparator();                    break;                case SCH_TEXT_T:                    msg = AddHotkeyName( _( "Edit Text" ), s_Schematic_Hokeys_Descr, HK_EDIT );                    AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );                    PopMenu->AppendSeparator();                    break;                case SCH_LABEL_T:                    msg = AddHotkeyName( _( "Edit Label" ), s_Schematic_Hokeys_Descr, HK_EDIT );                    AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );                    PopMenu->AppendSeparator();                    break;                case SCH_GLOBAL_LABEL_T:                    msg = AddHotkeyName( _( "Edit Global Label" ), s_Schematic_Hokeys_Descr,                                         HK_EDIT );                    AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );                    PopMenu->AppendSeparator();                    break;                case SCH_HIERARCHICAL_LABEL_T:                    msg = AddHotkeyName( _( "Edit Hierarchical Label" ), s_Schematic_Hokeys_Descr,                                         HK_EDIT );                    AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );                    PopMenu->AppendSeparator();                    break;                case SCH_BITMAP_T:                    msg = AddHotkeyName( _( "Edit Image" ), s_Schematic_Hokeys_Descr, HK_EDIT );                    AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( image_xpm ) );                    PopMenu->AppendSeparator();                    break;                default:                    break;            }        }        return true;    }    // Try to locate items at cursor position.    if( (item == NULL) || (item->GetFlags() == 0) )    {        item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins );        // If the clarify item selection context menu is aborted, don't show the context menu.        if( item == NULL && m_canvas->GetAbortRequest() )        {            m_canvas->SetAbortRequest( false );            return false;        }    }    // If a command is in progress: add "cancel" and "end tool" menu    // If    if( GetToolId() != ID_NO_TOOL_SELECTED )    {        if( item && item->GetFlags() )        {            AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "Cancel" ),                         KiBitmap( cancel_xpm ) );        }        else        {            AddMenuItem( PopMenu, ID_CANCEL_CURRENT_COMMAND, _( "End Tool" ),                         KiBitmap( cursor_xpm ) );        }        PopMenu->AppendSeparator();        switch( GetToolId() )        {//.........这里部分代码省略.........
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:101,


示例18: AddMenusForBlock

void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame ){    wxString msg;    AddMenuItem( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),                 KiBitmap( cancel_xpm ) );    PopMenu->AppendSeparator();    if( frame->GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE )        AddMenuItem( PopMenu, ID_POPUP_ZOOM_BLOCK, _( "Window Zoom" ), KiBitmap( zoom_area_xpm ) );    AddMenuItem( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), KiBitmap( checked_ok_xpm ) );    // After a block move (that is also a block selection) one can reselect    // a block function.    if( frame->GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE )    {        msg = AddHotkeyName( _( "Save Block" ), s_Schematic_Hokeys_Descr,                             HK_SAVE_BLOCK );        AddMenuItem( PopMenu, wxID_COPY, msg, KiBitmap( copy_button_xpm ) );        AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, _( "Copy Block" ), KiBitmap( copyblock_xpm ) );        msg = AddHotkeyName( _( "Drag Block" ), s_Schematic_Hokeys_Descr,                             HK_MOVEBLOCK_TO_DRAGBLOCK );        AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, KiBitmap( move_xpm ) );        AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, _( "Delete Block" ), KiBitmap( delete_xpm ) );        msg = AddHotkeyName( _( "Mirror Block ||" ), s_Schematic_Hokeys_Descr,                             HK_MIRROR_Y_COMPONENT );        AddMenuItem( PopMenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );        msg = AddHotkeyName( _( "Mirror Block --" ), s_Schematic_Hokeys_Descr,                             HK_MIRROR_X_COMPONENT );        AddMenuItem( PopMenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );        msg = AddHotkeyName( _( "Rotate Block CCW" ), s_Schematic_Hokeys_Descr, HK_ROTATE );        AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_ccw_xpm ) );#if 0  #ifdef __WINDOWS__        AddMenuItem( menu_other_block_commands, ID_GEN_COPY_BLOCK_TO_CLIPBOARD,                     _( "Copy to Clipboard" ), KiBitmap( copy_button_xpm ) );  #endif#endif    }}
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:43,


示例19: Menu

MenuGameMain::MenuGameMain(std::shared_ptr<Settings> &settings) : Menu((std::shared_ptr<AcedSharedDLL::BaseSettings>)settings) {	SetMenuHeader(std::string("Game Main Menu"));	SetId(AcedSharedDLL::STATES::EDITORMAINMENU);	int widestItem = settings->GetFontWidth(GetMenuHeader());	auto itemStoreNew = std::shared_ptr<AcedSharedDLL::MenuItem>(new AcedSharedDLL::MenuItem());	itemStoreNew->SetId(AcedSharedDLL::STATES::NEW);	itemStoreNew->SetMenuItemText(std::string("New Map"));	if (widestItem < settings->GetFontWidth(itemStoreNew->GetMenuItemText())) {		widestItem = settings->GetFontWidth(itemStoreNew->GetMenuItemText());	}	AddMenuItem(itemStoreNew);	auto itemStoreLoad = std::shared_ptr<AcedSharedDLL::MenuItem>(new AcedSharedDLL::MenuItem());	itemStoreLoad->SetId(AcedSharedDLL::STATES::LOAD);	itemStoreLoad->SetMenuItemText(std::string("Load Map"));	if (widestItem < settings->GetFontWidth(itemStoreLoad->GetMenuItemText())) {		widestItem = settings->GetFontWidth(itemStoreLoad->GetMenuItemText());	}	AddMenuItem(itemStoreLoad);	auto itemStoreEdit = std::shared_ptr<AcedSharedDLL::MenuItem>(new AcedSharedDLL::MenuItem());	itemStoreEdit->SetId(AcedSharedDLL::STATES::EDITORMAINMENU);	itemStoreEdit->SetMenuItemText(std::string("Edit Mode"));	if (widestItem < settings->GetFontWidth(itemStoreEdit->GetMenuItemText())) {		widestItem = settings->GetFontWidth(itemStoreEdit->GetMenuItemText());	}	AddMenuItem(itemStoreEdit);	auto itemStoreOptions = std::shared_ptr<AcedSharedDLL::MenuItem>(new AcedSharedDLL::MenuItem());	itemStoreOptions->SetId(AcedSharedDLL::STATES::OPTIONS);	itemStoreOptions->SetMenuItemText(std::string("Options"));	if (widestItem < settings->GetFontWidth(itemStoreOptions->GetMenuItemText())) {		widestItem = settings->GetFontWidth(itemStoreOptions->GetMenuItemText());	}	AddMenuItem(itemStoreOptions);	auto itemStoreQuit = std::shared_ptr<AcedSharedDLL::MenuItem>(new AcedSharedDLL::MenuItem());	itemStoreQuit->SetId(AcedSharedDLL::STATES::QUIT);	itemStoreQuit->SetMenuItemText(std::string("Quit"));	if (widestItem < settings->GetFontWidth(itemStoreQuit->GetMenuItemText())) {		widestItem = settings->GetFontWidth(itemStoreQuit->GetMenuItemText());	}	AddMenuItem(itemStoreQuit);	widestItem += (AcedSharedDLL::Constants::TileSize() * 4);	SetMenuX((settings->GetScreenWidth() / 2) - (widestItem / 2) - (AcedSharedDLL::Constants::TileSize() * 4));	SetMenuY(100);	SetMenuHeaderX((settings->GetScreenWidth() / 2) - (widestItem / 2) - (AcedSharedDLL::Constants::TileSize() * 4));	SetMenuHeaderY(50 + AcedSharedDLL::Constants::TileSize());	SetMenuHeaderHeight(50 - AcedSharedDLL::Constants::TileSize());	int i = 0;	int xloc = settings->GetScreenWidth() /2;	int yloc = 100 + AcedSharedDLL::Constants::TileSize();	int yspacing = AcedSharedDLL::Constants::TileSize()*2;	auto menuSize = GetMenuItems().size();	for (i = 0; i < menuSize; i++)	{		GetMenuItems()[i]->SetMenuItemX(xloc);		GetMenuItems()[i]->SetMenuItemY(yloc);		yloc = yloc + yspacing;	}	SetMenuWidth(settings->GetScreenWidth() - (2 * GetMenuX()));	SetMenuHeaderWidth(settings->GetScreenWidth() - (2 * GetMenuX()));	SetMenuHeight(yloc - GetMenuY());	SetCurrentSelection();}
开发者ID:ZeroPoints,项目名称:Aced,代码行数:77,


示例20: AddMenusForMarkers

void AddMenusForMarkers( wxMenu* aPopMenu, SCH_MARKER* aMarker, SCH_EDIT_FRAME* aFrame ){    AddMenuItem( aPopMenu, ID_POPUP_SCH_DELETE, _( "Delete Marker" ), KiBitmap( delete_xpm ) );    AddMenuItem( aPopMenu, ID_POPUP_SCH_GETINFO_MARKER, _( "Marker Error Info" ),                 KiBitmap( info_xpm ) );}
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:6,


示例21: GetCurItem

bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ){    wxString    msg;    STATUS_FLAGS flags = 0;    bool        trackFound = false; // Flag set to true,                                    // if a track is being the cursor, to avoid                                    // to display menus relative to tracks twice    bool        blockActive  = !GetScreen()->m_BlockLocate.IsIdle();    BOARD_ITEM* item = GetCurItem();    m_canvas->SetCanStartBlock( -1 );    // Avoid to start a block command when clicking on menu    // If a command or a block is in progress:    // Put the Cancel command (if needed) and the End command    if( blockActive )    {        createPopUpBlockMenu( aPopMenu );        aPopMenu->AppendSeparator();        return true;    }    if( GetToolId() != ID_NO_TOOL_SELECTED )    {        if( item && item->GetFlags() )        {            AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel" ),                         KiBitmap( cancel_xpm ) );        }        else        {            AddMenuItem( aPopMenu, ID_POPUP_CLOSE_CURRENT_TOOL,                         _( "End Tool" ), KiBitmap( cursor_xpm ) );        }        aPopMenu->AppendSeparator();    }    else    {        if( item && item->GetFlags() )        {            AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,                         _( "Cancel" ), KiBitmap( cancel_xpm ) );            aPopMenu->AppendSeparator();        }    }    // Select a proper item    wxPoint cursorPos = GetCrossHairPosition();    wxPoint selectPos = m_Collector->GetRefPos();    selectPos = GetNearestGridPosition( selectPos );    /*  We can reselect another item only if there are no item being edited     * because ALL moving functions use GetCurItem(), therefore GetCurItem()     * must return the same item during moving. We know an item is moving     * if( item && (item->m_Flags != 0)) is true and after calling     * PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,     * not the current item being edited. In such case we cannot call     * PcbGeneralLocateAndDisplay().     */    if( !item || (item->GetFlags() == 0) )    {        // show the "item selector" menu if no item selected or        // if there is a selected item but the mouse has moved        // (therefore a new item is perhaps under the cursor)        if( !item || cursorPos != selectPos )        {            m_canvas->SetAbortRequest( false );            PcbGeneralLocateAndDisplay();            if( m_canvas->GetAbortRequest() )            {                return false;            }        }    }    item = GetCurItem();    flags = item ? item->GetFlags() : 0;    // Add the context menu, which depends on the picked item:    if( item )    {        switch( item->Type() )        {        case PCB_MODULE_T:            createPopUpMenuForFootprints( (MODULE*) item, aPopMenu );            if( m_mainToolBar->GetToolToggled( ID_TOOLBARH_PCB_MODE_MODULE ) )            {                aPopMenu->AppendSeparator();                if( !( (MODULE*) item )->IsLocked() )                {                    msg = AddHotkeyName( _("Lock Footprint" ), g_Board_Editor_Hokeys_Descr,                                         HK_LOCK_UNLOCK_FOOTPRINT );                    AddMenuItem( aPopMenu, ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE, msg,//.........这里部分代码省略.........
开发者ID:chgans,项目名称:kicad,代码行数:101,


示例22: GetMenuBar

/** * @brief (Re)Create the menubar for the schematic frame */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;    // New    AddMenuItem( fileMenu,                 ID_NEW_PROJECT,                 _( "&New" ),                 _( "New schematic project" ),                 KiBitmap( new_xpm ) );    // Open    text = AddHotkeyName( _( "&Open" ), s_Schematic_Hokeys_Descr, HK_LOAD_SCH );    AddMenuItem( fileMenu,                 ID_LOAD_PROJECT, text,                 _( "Open an existing schematic project" ),                 KiBitmap( open_document_xpm ) );    // Open Recent submenu    static wxMenu* openRecentMenu;    // Add this menu to list menu managed by m_fileHistory    // (the file history will be updated when adding/removing files in history    if( openRecentMenu )        wxGetApp().GetFileHistory().RemoveMenu( openRecentMenu );    openRecentMenu = new wxMenu();    wxGetApp().GetFileHistory().UseMenu( openRecentMenu );    wxGetApp().GetFileHistory().AddFilesToMenu( openRecentMenu );    AddMenuItem( fileMenu, openRecentMenu,                 wxID_ANY, _( "Open &Recent" ),                 _( "Open a recent opened schematic project" ),                 KiBitmap( open_project_xpm ) );    // Import    AddMenuItem( fileMenu,                 ID_APPEND_PROJECT, _( "&Append Schematic" ),                 _( "Append another schematic project to the current loaded schematic" ),                 KiBitmap( open_document_xpm ) );    // Separator    fileMenu->AppendSeparator();    // Save schematic project    text = AddHotkeyName( _( "&Save Whole Schematic Project" ),                          s_Schematic_Hokeys_Descr, HK_SAVE_SCH );    AddMenuItem( fileMenu,                 ID_SAVE_PROJECT, text,                 _( "Save all sheets in the schematic project" ),                 KiBitmap( save_project_xpm ) );    // Save current sheet    AddMenuItem( fileMenu,                 ID_UPDATE_ONE_SHEET,                 _( "Save &Current Sheet Only" ),                 _( "Save only current schematic sheet" ),                 KiBitmap( save_xpm ) );    // Save current sheet as    AddMenuItem( fileMenu,                 ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,                 _( "Save Current Sheet &As" ),                 _( "Save current schematic sheet as..." ),                 KiBitmap( save_as_xpm ) );    // Separator    fileMenu->AppendSeparator();    // Page settings    AddMenuItem( fileMenu,                 ID_SHEET_SET,                 _( "Pa&ge Settings" ),                 _( "Settigns for page size and information" ),                 KiBitmap( sheetset_xpm ) );    // Print    AddMenuItem( fileMenu,                 wxID_PRINT,                 _( "Pri&nt" ),                 _( "Print schematic" ),//.........这里部分代码省略.........
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:101,


示例23: AddMenuItem

void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, bool Coded){    AddMenuItem(Icon, Message, 0, 0, "", 0, Coded);}
开发者ID:Bootz,项目名称:CactusEMU,代码行数:4,


示例24: GetDrawItem

bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ){    LIB_ITEM*   item = GetDrawItem();    bool        blockActive = GetScreen()->IsBlockActive();    if( blockActive )    {        AddMenusForBlock( PopMenu, this );        PopMenu->AppendSeparator();        return true;    }    LIB_PART*      part = GetCurPart();    if( !part )        return true;    //  If Command in progress, put menu "cancel"    if( item && item->InEditMode() )    {        AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "Cancel" ),                     KiBitmap( cancel_xpm ) );        PopMenu->AppendSeparator();    }    else    {        item = LocateItemUsingCursor( aPosition );        // If the clarify item selection context menu is aborted, don't show the context menu.        if( item == NULL && m_canvas->GetAbortRequest() )        {            m_canvas->SetAbortRequest( false );            return false;        }        if( GetToolId() != ID_NO_TOOL_SELECTED )        {            // If a tool is active, put menu "end tool"            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _( "End Tool" ),                         KiBitmap( cursor_xpm ) );            PopMenu->AppendSeparator();        }    }    if( item )    {        MSG_PANEL_ITEMS items;        item->GetMsgPanelInfo( items );        SetMsgPanel( items );    }    else    {        return true;    }    m_drawItem = item;    bool not_edited = !item->InEditMode();    wxString msg;    switch( item->Type() )    {    case LIB_PIN_T:        AddMenusForPin( PopMenu, (LIB_PIN*) item, this );        break;    case LIB_ARC_T:        if( not_edited )        {            msg = AddHotkeyName( _( "Move Arc" ), g_Libedit_Hokeys_Descr,                                 HK_LIBEDIT_MOVE_GRAPHIC_ITEM );            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,                         KiBitmap( move_arc_xpm ) );            msg = AddHotkeyName( _( "Drag Arc Size" ), g_Libedit_Hokeys_Descr, HK_DRAG );            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, KiBitmap( move_arc_xpm ) );        }        msg = AddHotkeyName( _( "Edit Arc Options" ), g_Libedit_Hokeys_Descr, HK_EDIT );        AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, KiBitmap( options_arc_xpm ) );        if( not_edited )        {            msg = AddHotkeyName( _( "Delete Arc" ), g_Libedit_Hokeys_Descr, HK_DELETE );            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, KiBitmap( delete_arc_xpm ) );        }        break;    case LIB_CIRCLE_T:        if( not_edited )        {            msg = AddHotkeyName( _( "Move Circle" ), g_Libedit_Hokeys_Descr,                                 HK_LIBEDIT_MOVE_GRAPHIC_ITEM );            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,                         KiBitmap( move_circle_xpm ) );            msg = AddHotkeyName( _( "Drag Circle Outline" ), g_Libedit_Hokeys_Descr, HK_DRAG );            AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg,                         KiBitmap( move_rectangle_xpm ) );        }        msg = AddHotkeyName( _( "Edit Circle Options" ), g_Libedit_Hokeys_Descr, HK_EDIT );        AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg,//.........这里部分代码省略.........
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:101,



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


C++ AddMessage函数代码示例
C++ AddMember函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。