Add title to project file view and help strings to launcher icons.
This commit is contained in:
parent
5afc56e285
commit
bbe315bcb8
|
@ -42,13 +42,19 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
|
|||
m_toolsSizer->SetRows( 0 );
|
||||
}
|
||||
|
||||
wxFont titleFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||
titleFont.SetPointSize( titleFont.GetPointSize() + 2 );
|
||||
titleFont.SetWeight( wxFONTWEIGHT_BOLD );
|
||||
|
||||
wxFont helpFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
|
||||
helpFont.SetStyle( wxFONTSTYLE_ITALIC );
|
||||
|
||||
auto addLauncher =
|
||||
[&]( const TOOL_ACTION& aAction, const wxBitmap& aBitmap,
|
||||
const wxString& aHelpText = wxEmptyString )
|
||||
[&]( const TOOL_ACTION& aAction, const wxBitmap& aBitmap, const wxString& aHelpText )
|
||||
{
|
||||
BITMAP_BUTTON* btn = new BITMAP_BUTTON( this, wxID_ANY );
|
||||
btn->SetBitmap( aBitmap );
|
||||
btn->SetPadding( 5 );
|
||||
btn->SetPadding( 3 );
|
||||
btn->SetToolTip( aAction.GetDescription() );
|
||||
|
||||
auto handler =
|
||||
|
@ -59,54 +65,51 @@ void PANEL_KICAD_LAUNCHER::CreateLaunchers()
|
|||
m_toolManager->ProcessEvent( *evt );
|
||||
};
|
||||
|
||||
bool createHelp = !aHelpText.IsEmpty();
|
||||
|
||||
wxStaticText* label = new wxStaticText( this, wxID_ANY, aAction.GetLabel() );
|
||||
wxStaticText* help;
|
||||
|
||||
label->SetToolTip( aAction.GetDescription() );
|
||||
label->SetFont( titleFont );
|
||||
|
||||
if( createHelp )
|
||||
{
|
||||
help = new wxStaticText( this, wxID_ANY, aHelpText );
|
||||
help->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
|
||||
}
|
||||
help = new wxStaticText( this, wxID_ANY, aHelpText );
|
||||
help->SetFont( helpFont );
|
||||
|
||||
btn->Bind( wxEVT_BUTTON, handler );
|
||||
label->Bind( wxEVT_LEFT_UP, handler );
|
||||
|
||||
int row = m_toolsSizer->GetRows();
|
||||
int rowSpan = createHelp ? 2 : 1;
|
||||
int flags = createHelp ? wxALIGN_BOTTOM : wxALIGN_CENTER_VERTICAL;
|
||||
int row = m_toolsSizer->GetRows();
|
||||
|
||||
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( rowSpan, 1 ), 0, 0 );
|
||||
m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ), flags, 0 );
|
||||
|
||||
if( createHelp )
|
||||
{
|
||||
m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ),
|
||||
wxALIGN_TOP, 0 );
|
||||
}
|
||||
m_toolsSizer->Add( btn, wxGBPosition( row, 0 ), wxGBSpan( 2, 1 ), wxALL, 0 );
|
||||
m_toolsSizer->Add( label, wxGBPosition( row, 1 ), wxGBSpan( 1, 1 ), wxALIGN_BOTTOM, 0 );
|
||||
m_toolsSizer->Add( help, wxGBPosition( row + 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_TOP, 0 );
|
||||
};
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSchematic, KiScaledBitmap( icon_eeschema_xpm, this ) );
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSchematic, KiScaledBitmap( icon_eeschema_xpm, this ),
|
||||
_( "Edit the project schematic" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSymbols, KiScaledBitmap( icon_libedit_xpm, this ) );
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editSymbols, KiScaledBitmap( icon_libedit_xpm, this ),
|
||||
_( "Edit global and/or project schematic symbol libraries" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editPCB, KiScaledBitmap( icon_pcbnew_xpm, this ) );
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editPCB, KiScaledBitmap( icon_pcbnew_xpm, this ),
|
||||
_( "Edit the project PCB design" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editFootprints, KiScaledBitmap( icon_modedit_xpm, this ) );
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editFootprints, KiScaledBitmap( icon_modedit_xpm, this ),
|
||||
_( "Edit glabal and/or project PCB footprint libraries" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::viewGerbers, KiScaledBitmap( icon_gerbview_xpm, this ) );
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::viewGerbers, KiScaledBitmap( icon_gerbview_xpm, this ),
|
||||
_( "Preview Gerber files" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::convertImage,
|
||||
KiScaledBitmap( icon_bitmap2component_xpm, this ) );
|
||||
KiScaledBitmap( icon_bitmap2component_xpm, this ),
|
||||
_( "Convert bitmap images to schematic symbols or PCB footprints" ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::showCalculator,
|
||||
KiScaledBitmap( icon_pcbcalculator_xpm, this ) );
|
||||
KiScaledBitmap( icon_pcbcalculator_xpm, this ),
|
||||
_( "Show tools for calculating resistance, current capacity, etc." ) );
|
||||
|
||||
addLauncher( KICAD_MANAGER_ACTIONS::editWorksheet,
|
||||
KiScaledBitmap( icon_pagelayout_editor_xpm, this ) );
|
||||
KiScaledBitmap( icon_pagelayout_editor_xpm, this ),
|
||||
_( "Edit worksheet borders and title blocks for use in schematics and PCB designs" ) );
|
||||
|
||||
if( m_toolsSizer->IsColGrowable( 1 ) )
|
||||
m_toolsSizer->RemoveGrowableCol( 1 );
|
||||
|
|
|
@ -16,8 +16,8 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindow
|
|||
|
||||
m_mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_toolsSizer = new wxGridBagSizer( 5, 20 );
|
||||
m_toolsSizer->SetFlexibleDirection( wxBOTH );
|
||||
m_toolsSizer = new wxGridBagSizer( 3, 12 );
|
||||
m_toolsSizer->SetFlexibleDirection( wxHORIZONTAL );
|
||||
m_toolsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE );
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindow
|
|||
m_mainSizer->Add( 0, 20, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer2->Add( m_mainSizer, 1, wxEXPAND|wxLEFT, 24 );
|
||||
bSizer2->Add( m_mainSizer, 1, wxEXPAND|wxTOP|wxLEFT, 10 );
|
||||
|
||||
|
||||
this->SetSizer( bSizer2 );
|
||||
|
|
|
@ -55,8 +55,8 @@
|
|||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">24</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
|
@ -69,15 +69,15 @@
|
|||
<property name="proportion">0</property>
|
||||
<object class="wxGridBagSizer" expanded="1">
|
||||
<property name="empty_cell_size"></property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="flexible_direction">wxHORIZONTAL</property>
|
||||
<property name="growablecols"></property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="hgap">20</property>
|
||||
<property name="hgap">12</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_toolsSizer</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_NONE</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="vgap">5</property>
|
||||
<property name="vgap">3</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
|
|
|
@ -150,11 +150,11 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl
|
|||
// A trick is to use MinSize() to set the required pane width,
|
||||
// and after give a reasonable MinSize value
|
||||
m_auimgr.AddPane( m_leftWin, EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer( 1 )
|
||||
.CaptionVisible( false ).PaneBorder( true )
|
||||
.Caption( _( "Project Files" ) ).PaneBorder( true )
|
||||
.MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( m_launcher,
|
||||
EDA_PANE().Canvas().PaneBorder( false ).Name( "Launcher" ).Center()
|
||||
m_auimgr.AddPane( m_launcher, EDA_PANE().Canvas().Name( "Launcher" ).Center()
|
||||
.Caption( _( "Editors" ) ).PaneBorder( false )
|
||||
.MinSize( m_launcher->GetBestSize() ) );
|
||||
|
||||
m_auimgr.Update();
|
||||
|
|
|
@ -61,13 +61,13 @@ TOOL_ACTION KICAD_MANAGER_ACTIONS::closeProject( "kicad.Control.closeProject",
|
|||
TOOL_ACTION KICAD_MANAGER_ACTIONS::editSchematic( "kicad.Control.editSchematic",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'E', LEGACY_HK_NAME( "Run Eeschema" ),
|
||||
_( "Edit Schematic" ), _( "Edit Schematic" ),
|
||||
_( "Edit Schematic" ), _( "Edit schematic" ),
|
||||
icon_eeschema_24_xpm, AF_NONE, (void*) FRAME_SCH );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::editSymbols( "kicad.Control.editSymbols",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'L', LEGACY_HK_NAME( "Run LibEdit" ),
|
||||
_( "Edit Schematic Symbols" ), _( "Edit Schematic Symbols" ),
|
||||
_( "Edit Symbols" ), _( "Edit schematic symbols" ),
|
||||
icon_libedit_24_xpm, AF_NONE, (void*) FRAME_SCH_SYMBOL_EDITOR );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::editPCB( "kicad.Control.editPCB",
|
||||
|
@ -79,13 +79,13 @@ TOOL_ACTION KICAD_MANAGER_ACTIONS::editPCB( "kicad.Control.editPCB",
|
|||
TOOL_ACTION KICAD_MANAGER_ACTIONS::editFootprints( "kicad.Control.editFootprints",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'F', LEGACY_HK_NAME( "Run FpEditor" ),
|
||||
_( "Edit PCB Footprints" ), _( "Edit PCB Footprints" ),
|
||||
_( "Edit Footprints" ), _( "Edit PCB footprints" ),
|
||||
icon_modedit_24_xpm, AF_NONE, (void*) FRAME_FOOTPRINT_EDITOR );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::viewGerbers( "kicad.Control.viewGerbers",
|
||||
AS_GLOBAL,
|
||||
MD_CTRL + 'G', LEGACY_HK_NAME( "Run Gerbview" ),
|
||||
_( "View Gerber Files" ), _( "View Gerber Files" ),
|
||||
_( "View Gerbers" ), _( "Preview Gerber output files" ),
|
||||
icon_gerbview_24_xpm );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::convertImage( "kicad.Control.convertImage",
|
||||
|
|
Loading…
Reference in New Issue