示例#1
0
/**
 * @brief (Re)Create the horizontal toolbar
 */
void KICAD_MANAGER_FRAME::RecreateBaseHToolbar()
{
    if( m_mainToolBar )
        m_mainToolBar->Clear();
    else
        m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
                                          KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );

    // New
    m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
                            KiScaledBitmap( new_project_xpm, this ),
                            _( "Create new project" ) );

    m_mainToolBar->AddTool( ID_NEW_PROJECT_FROM_TEMPLATE, wxEmptyString,
                            KiScaledBitmap( new_project_with_template_xpm, this ),
                            _( "Create new project from template" ) );

    // Load
    m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
                            KiScaledBitmap( open_project_xpm, this ),
                            _( "Open existing project" ) );

    // Currently there is nothing to save
    // (Kicad manager does not save any info in .pro file)
#if 0
    // Save
    m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
                            KiScaledBitmap( save_project_xpm, this ),
                            _( "Save current project" ) );
#endif

    KiScaledSeparator( m_mainToolBar, this );

    // Archive
    m_mainToolBar->AddTool( ID_SAVE_AND_ZIP_FILES, wxEmptyString,
                            KiScaledBitmap( zip_xpm, this ),
                            _( "Archive all project files" ) );

    // Unarchive
    m_mainToolBar->AddTool( ID_READ_ZIP_ARCHIVE, wxEmptyString,
                            KiScaledBitmap( unzip_xpm, this ),
                            _( "Unarchive project files from zip archive" ) );

    KiScaledSeparator( m_mainToolBar, this );

    // Refresh project tree
    m_mainToolBar->AddTool( ID_PROJECT_TREE_REFRESH, wxEmptyString,
                            KiScaledBitmap( reload_xpm, this ),
                            _( "Refresh project tree" ) );

    // Acces to the system file manager
    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_BROWSE_IN_FILE_EXPLORER, wxEmptyString,
                            KiScaledBitmap( directory_browser_xpm, this ),
                            _( "Open project directory in file explorer" ) );

    // Create m_mainToolBar
    m_mainToolBar->Realize();
}
void PCB_EDIT_FRAME::AddActionPluginTools()
{
    bool need_separator = true;
    const auto& orderedPlugins = GetOrderedActionPlugins();

    for( const auto& ap : orderedPlugins )
    {
        if( GetActionPluginButtonVisible( ap->GetPluginPath(), ap->GetShowToolbarButton() ) )
        {

            if ( need_separator )
            {
                KiScaledSeparator( m_mainToolBar, this );
                need_separator = false;
            }

            // Add button
            wxBitmap bitmap;

            if ( ap->iconBitmap.IsOk() )
                bitmap = KiScaledBitmap( ap->iconBitmap, this );
            else
                bitmap = KiScaledBitmap( hammer_xpm, this );

            wxAuiToolBarItem* button = m_mainToolBar->AddTool(
                    wxID_ANY, wxEmptyString, bitmap, ap->GetName() );

            Connect( button->GetId(), wxEVT_COMMAND_MENU_SELECTED,
                    (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &
                    PCB_EDIT_FRAME::OnActionPluginButton );

            // Link action plugin to button
            ACTION_PLUGINS::SetActionButton( ap, button->GetId() );
        }
    }
}
void LIB_EDIT_FRAME::ReCreateHToolbar()
{
    wxString msg;

    if( m_mainToolBar )
        m_mainToolBar->Clear();
    else
        m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
                                          KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );

    // Set up toolbar
    m_mainToolBar->AddTool( ID_LIBEDIT_NEW_LIBRARY, wxEmptyString,
                            KiScaledBitmap( new_library_xpm, this ),
                            _( "Create a new library" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_ADD_LIBRARY, wxEmptyString,
                            KiScaledBitmap( add_library_xpm, this ),
                            _( "Add an existing library" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_SAVE_ALL_LIBS, wxEmptyString,
                            KiScaledBitmap( save_library_xpm, this ),
                            _( "Save all libraries" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_LIBEDIT_NEW_PART, wxEmptyString,
                            KiScaledBitmap( new_component_xpm, this ),
                            _( "Create new symbol" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_SAVE_PART, wxEmptyString,
                            KiScaledBitmap( save_part_xpm, this ),
                            _( "Save current symbol" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_IMPORT_PART, wxEmptyString,
                            KiScaledBitmap( import_part_xpm, this ),
                            _( "Import symbol" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_EXPORT_PART, wxEmptyString,
                            KiScaledBitmap( export_part_xpm, this ),
                            _( "Export symbol" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiScaledBitmap( paste_xpm, this ),
                            _( "Paste" ) );

    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( HELP_UNDO, g_Libedit_Hokeys_Descr, HK_UNDO, IS_COMMENT );
    m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiScaledBitmap( undo_xpm, this ), msg );

    msg = AddHotkeyName( HELP_REDO, g_Libedit_Hokeys_Descr, HK_REDO, IS_COMMENT );
    m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiScaledBitmap( redo_xpm, this ), msg );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_PART, wxEmptyString,
                            KiScaledBitmap( part_properties_xpm, this ),
                            _( "Edit symbol properties" ) );

    m_mainToolBar->AddTool( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, wxEmptyString,
                            KiScaledBitmap( text_xpm, this ),
                            _( "Edit field properties" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_LIBEDIT_CHECK_PART, wxEmptyString, KiScaledBitmap( erc_xpm, this ),
                            _( "Check duplicate and off grid pins" ) );

    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
                            KiScaledBitmap( zoom_redraw_xpm, this ), msg );

    msg = AddHotkeyName( HELP_ZOOM_IN, g_Libedit_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiScaledBitmap( zoom_in_xpm, this ), msg );

    msg = AddHotkeyName( HELP_ZOOM_OUT, g_Libedit_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg );

    msg = AddHotkeyName( _( "Zoom to fit symbol" ), g_Libedit_Hokeys_Descr,
                         HK_ZOOM_AUTO, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
                            KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );

    m_mainToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiScaledBitmap( zoom_area_xpm, this ),
                            _( "Zoom to selection" ), wxITEM_CHECK );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_DE_MORGAN_NORMAL_BUTT, wxEmptyString,
                            KiScaledBitmap( morgan1_xpm, this ),
                            _( "Show as \"De Morgan\" normal symbol" ), wxITEM_CHECK );
    m_mainToolBar->AddTool( ID_DE_MORGAN_CONVERT_BUTT, wxEmptyString,
                            KiScaledBitmap( morgan2_xpm, this ),
                            _( "Show as \"De Morgan\" convert symbol" ), wxITEM_CHECK );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_LIBEDIT_VIEW_DOC, wxEmptyString,
                            KiScaledBitmap( datasheet_xpm, this ),
                            _( "Show associated datasheet or document" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_partSelectBox = new wxComboBox( m_mainToolBar,
                                      ID_LIBEDIT_SELECT_PART_NUMBER,
                                      wxEmptyString,
                                      wxDefaultPosition,
                                      wxSize( LISTBOX_WIDTH, -1 ),
                                      0, nullptr, wxCB_READONLY );
    m_mainToolBar->AddControl( m_partSelectBox );

    m_aliasSelectBox = new wxComboBox( m_mainToolBar,
                                       ID_LIBEDIT_SELECT_ALIAS,
                                       wxEmptyString,
                                       wxDefaultPosition,
                                       wxSize( LISTBOX_WIDTH, -1 ),
                                       0, nullptr, wxCB_READONLY );
    m_mainToolBar->AddControl( m_aliasSelectBox );

    m_mainToolBar->AddSeparator();
    KiScaledSeparator( m_mainToolBar, this );
    msg = _( "Synchronized pin edit mode\n"
             "Synchronized pin edit mode propagates to other units all pin changes except pin number modification.\n"
             "Enabled by default for multiunit parts with interchangeable units." );
    m_mainToolBar->AddTool( ID_LIBEDIT_SYNC_PIN_EDIT, wxEmptyString,
                            KiScaledBitmap( pin2pin_xpm, this ), msg, wxITEM_CHECK );
    m_mainToolBar->AddTool( ID_LIBEDIT_EDIT_PIN_BY_TABLE, wxEmptyString,
                            KiScaledBitmap( pin_table_xpm, this ),
                            _( "Show pin table" ) );

    // after adding the buttons to the toolbar, must call Realize() to reflect the changes
    m_mainToolBar->Realize();
}
/* Create  the main Horizontal Toolbar for the schematic editor
 */
void SCH_EDIT_FRAME::ReCreateHToolbar()
{
    if( m_mainToolBar )
        m_mainToolBar->Clear();
    else
        m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
                                          KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );

    wxString msg;

    // Set up toolbar
    if( Kiface().IsSingle() )   // not when under a project mgr
    {
        // These 2 menus have meaning only outside a project, i.e. not under a project manager:
        m_mainToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
                                KiScaledBitmap( new_document_xpm, this ),
                                _( "New schematic" ) );

        m_mainToolBar->AddTool( ID_LOAD_PROJECT, wxEmptyString,
                                KiScaledBitmap( open_document_xpm, this ),
                                _( "Open schematic" ) );
    }

    m_mainToolBar->AddTool( ID_SAVE_PROJECT, wxEmptyString,
                            KiScaledBitmap( save_xpm, this ),
                            _( "Save (all sheets)" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_SHEET_SET, wxEmptyString, KiScaledBitmap( sheetset_xpm, this ),
                            _( "Edit Page settings" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( wxID_PRINT, wxEmptyString, KiScaledBitmap( print_button_xpm, this ),
                            _( "Print schematic" ) );

    m_mainToolBar->AddTool( ID_GEN_PLOT_SCHEMATIC, wxEmptyString, KiScaledBitmap( plot_xpm, this ),
                            _( "Plot schematic" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( wxID_PASTE, wxEmptyString, KiScaledBitmap( paste_xpm, this ),
                            _( "Paste" ) );


    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( HELP_UNDO, g_Schematic_Hokeys_Descr, HK_UNDO, IS_COMMENT );
    m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiScaledBitmap( undo_xpm, this ), msg );

    msg = AddHotkeyName( HELP_REDO, g_Schematic_Hokeys_Descr, HK_REDO, IS_COMMENT );
    m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiScaledBitmap( redo_xpm, this ), msg );


    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( HELP_FIND, g_Schematic_Hokeys_Descr, HK_FIND_ITEM, IS_COMMENT );
    m_mainToolBar->AddTool( ID_FIND_ITEMS, wxEmptyString, KiScaledBitmap( find_xpm, this ), msg );

    m_mainToolBar->AddTool( wxID_REPLACE, wxEmptyString, KiScaledBitmap( find_replace_xpm, this ),
                            wxNullBitmap, wxITEM_NORMAL, _( "Find and replace text" ),
                            HELP_REPLACE, nullptr );


    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
                            KiScaledBitmap( zoom_redraw_xpm, this ), msg );

    msg = AddHotkeyName( HELP_ZOOM_IN, g_Schematic_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiScaledBitmap( zoom_in_xpm, this ), msg );

    msg = AddHotkeyName( HELP_ZOOM_OUT, g_Schematic_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg );

    msg = AddHotkeyName( HELP_ZOOM_FIT, g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO, IS_COMMENT );
    m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
                            KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );

    m_mainToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiScaledBitmap( zoom_area_xpm, this ),
                            _( "Zoom to selection" ), wxITEM_CHECK );


    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_HIERARCHY, wxEmptyString, KiScaledBitmap( hierarchy_nav_xpm, this ),
                            _( "Navigate schematic hierarchy" ) );


    m_mainToolBar->AddTool( ID_POPUP_SCH_LEAVE_SHEET, wxEmptyString,
                            KiScaledBitmap( leave_sheet_xpm, this ), _( "Leave sheet" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_RUN_LIBRARY, wxEmptyString, KiScaledBitmap( libedit_xpm, this ),
                            HELP_RUN_LIB_EDITOR );

    m_mainToolBar->AddTool( ID_TO_LIBVIEW, wxEmptyString,
                            KiScaledBitmap( library_browse_xpm, this ), HELP_RUN_LIB_VIEWER );

    // modedit is with libedit in a "library section" because the user must have footprints before
    // they can be assigned.
    m_mainToolBar->AddTool( ID_RUN_PCB_MODULE_EDITOR, wxEmptyString,
                            KiScaledBitmap( module_editor_xpm, this ),
                            _( "Footprint Editor - Create/edit footprints" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_GET_ANNOTATE, wxEmptyString, KiScaledBitmap( annotate_xpm, this ),
                            HELP_ANNOTATE );

    m_mainToolBar->AddTool( ID_GET_ERC, wxEmptyString, KiScaledBitmap( erc_xpm, this ),
                            _( "Perform electrical rules check" ) );

    m_mainToolBar->AddTool( ID_RUN_CVPCB, wxEmptyString, KiScaledBitmap( cvpcb_xpm, this ),
                            _( "Run CvPcb to associate footprints to symbols" ) );

    m_mainToolBar->AddTool( ID_GET_NETLIST, wxEmptyString, KiScaledBitmap( netlist_xpm, this ),
                            _( "Generate netlist" ) );

    m_mainToolBar->AddTool( ID_OPEN_CMP_TABLE, wxEmptyString,
                            KiScaledBitmap( spreadsheet_xpm, this ), _( "Edit symbol fields"  ) );


    m_mainToolBar->AddTool( ID_GET_TOOLS, wxEmptyString, KiScaledBitmap( bom_xpm, this ),
                            HELP_GENERATE_BOM );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_RUN_PCB, wxEmptyString, KiScaledBitmap( pcbnew_xpm, this ),
                            _( "Run Pcbnew to layout printed circuit board" ) );

    m_mainToolBar->AddTool( ID_BACKANNO_ITEMS, wxEmptyString,
                            KiScaledBitmap( import_footprint_names_xpm, this ),
                            HELP_IMPORT_FOOTPRINTS );

    // after adding the tools to the toolbar, must call Realize() to reflect the changes
    m_mainToolBar->Realize();
}
void CVPCB_MAINFRAME::ReCreateHToolbar()
{
    if( m_mainToolBar )
        m_mainToolBar->Clear();
    else
        m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
                                          KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );

    m_mainToolBar->AddTool( ID_CVPCB_LIB_TABLE_EDIT, wxEmptyString,
                            KiScaledBitmap( config_xpm, this ),
                            _( "Edit footprint library table" ) );

    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_CVPCB_CREATE_SCREENCMP, wxEmptyString,
                            KiScaledBitmap( show_footprint_xpm, this ),
                            _( "View selected footprint" ) );

    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
                            KiScaledBitmap( left_xpm, this ),
                            _( "Select previous unlinked symbol" ) );

    m_mainToolBar->AddTool( ID_CVPCB_GOTO_FIRSTNA, wxEmptyString,
                            KiScaledBitmap( right_xpm, this ),
                            _( "Select next unlinked symbol" ) );

    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
                            KiScaledBitmap( auto_associe_xpm, this ),
                            _( "Perform automatic footprint association" ) );

    m_mainToolBar->AddTool( ID_CVPCB_DEL_ASSOCIATIONS, wxEmptyString,
                            KiScaledBitmap( delete_association_xpm, this ),
                            _( "Delete all footprint associations" ) );

    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
                            KiScaledBitmap( module_filtered_list_xpm, this ),
                            wxNullBitmap,
                            true, NULL,
                            _( "Filter footprint list by schematic symbol keywords" ),
                            wxEmptyString );

    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
                            KiScaledBitmap( module_pin_filtered_list_xpm, this ),
                            wxNullBitmap,
                            true, NULL,
                            _( "Filter footprint list by pin count" ),
                            wxEmptyString );

    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_LIBRARY_LIST,
                            KiScaledBitmap( module_library_list_xpm, this ),
                            wxNullBitmap, true, NULL,
                            _( "Filter footprint list by library" ),
                            wxEmptyString );

    KiScaledSeparator( m_mainToolBar, this );
    m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_BY_NAME,
                            KiScaledBitmap( module_name_filtered_list_xpm, this ),
                            wxNullBitmap, true, NULL,
                            _( "Filter footprint list using a partial name or a pattern" ),
                            wxEmptyString );

    m_tcFilterString = new wxTextCtrl( m_mainToolBar, ID_CVPCB_FILTER_TEXT_EDIT );

    m_mainToolBar->AddControl( m_tcFilterString );


    // after adding the buttons to the toolbar, must call Realize() to reflect the changes
    m_mainToolBar->Realize();
}
示例#6
0
void FOOTPRINT_VIEWER_FRAME::ReCreateHToolbar()
{
    wxString msg;

    if( m_mainToolBar )
        m_mainToolBar->Clear();
    else
        m_mainToolBar = new wxAuiToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                                          KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT
                                            | wxAUI_TB_OVERFLOW );

    // Set up toolbar
    m_mainToolBar->AddTool( ID_MODVIEW_SELECT_LIB, wxEmptyString,
                            KiScaledBitmap( library_xpm, this ),
                            _( "Select library to browse" ) );

    m_mainToolBar->AddTool( ID_MODVIEW_SELECT_PART, wxEmptyString,
                            KiScaledBitmap( module_xpm, this ),
                            _( "Select footprint to browse" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_MODVIEW_PREVIOUS, wxEmptyString,
                            KiScaledBitmap( lib_previous_xpm, this ),
                            _( "Display previous footprint" ) );

    m_mainToolBar->AddTool( ID_MODVIEW_NEXT, wxEmptyString,
                            KiScaledBitmap( lib_next_xpm, this ),
                            _( "Display next footprint" ) );

    KiScaledSeparator( m_mainToolBar, this );

    m_mainToolBar->AddTool( ID_MODVIEW_SHOW_3D_VIEW, wxEmptyString,
                            KiScaledBitmap( three_d_xpm, this ),
                            _( "Show footprint in 3D viewer" ) );

    KiScaledSeparator( m_mainToolBar, this );

    msg = AddHotkeyName( _( "Zoom in" ), g_Module_Viewer_Hokeys_Descr,
                            HK_ZOOM_IN, IS_COMMENT );
    m_mainToolBar->AddTool( ID_VIEWER_ZOOM_IN, wxEmptyString,
                            KiScaledBitmap( zoom_in_xpm, this ), msg );

    msg = AddHotkeyName( _( "Zoom out" ), g_Module_Viewer_Hokeys_Descr,
                            HK_ZOOM_OUT, IS_COMMENT );
    m_mainToolBar->AddTool( ID_VIEWER_ZOOM_OUT, wxEmptyString,
                            KiScaledBitmap( zoom_out_xpm, this ), msg );

    msg = AddHotkeyName( _( "Redraw view" ), g_Module_Viewer_Hokeys_Descr,
                            HK_ZOOM_REDRAW );
    m_mainToolBar->AddTool( ID_VIEWER_ZOOM_REDRAW, wxEmptyString,
                            KiScaledBitmap( zoom_redraw_xpm, this ), msg );

    msg = AddHotkeyName( _( "Zoom auto" ), g_Module_Viewer_Hokeys_Descr,
                            HK_ZOOM_AUTO );
    m_mainToolBar->AddTool( ID_VIEWER_ZOOM_PAGE, wxEmptyString,
                            KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );

    if( IsModal() )
    {
        KiScaledSeparator( m_mainToolBar, this );
        m_mainToolBar->AddTool( ID_MODVIEW_FOOTPRINT_EXPORT_TO_BOARD, wxEmptyString,
                                KiScaledBitmap( export_footprint_names_xpm, this ),
                                _( "Insert footprint in board" ) );
    }

    // after adding the buttons to the toolbar, must call Realize() to
    // reflect the changes
    m_mainToolBar->Realize();
    m_mainToolBar->Refresh();
}