Improve consistency and hotkey access in Appearances.

Added hotkey for cycling through net & netclass color modes.
Added hotkey for cycling through ratsnest layer visibilities.
Added code to display hotkey (if set) on the above and on high-contrast
cycle.

Fixes https://gitlab.com/kicad/code/kicad/issues/9312
This commit is contained in:
Jeff Young 2021-10-04 13:42:08 +01:00
parent 78ddb1408f
commit ffd6fde700
10 changed files with 236 additions and 212 deletions

View File

@ -530,14 +530,15 @@ TOOL_ACTION ACTIONS::toggleCursorStyle( "common.Control.toggleCursorStyle",
TOOL_ACTION ACTIONS::highContrastMode( "common.Control.highContrastMode",
AS_GLOBAL,
0, LEGACY_HK_NAME( "Toggle High Contrast Mode" ),
_( "Single Layer View Mode" ), _( "Toggle inactive layers between normal and dimmed" ),
_( "Inactive Layer View Mode" ),
_( "Toggle inactive layers between normal and dimmed" ),
BITMAPS::contrast_mode );
TOOL_ACTION ACTIONS::highContrastModeCycle( "common.Control.highContrastModeCycle",
AS_GLOBAL,
'H', "",
_( "Single Layer View Mode (3-state)" ),
_( "Toggle inactive layers between normal, dimmed, and hidden" ),
_( "Inactive Layer View Mode (3-state)" ),
_( "Cycle inactive layers between normal, dimmed, and hidden" ),
BITMAPS::contrast_mode );
TOOL_ACTION ACTIONS::selectionTool( "common.InteractiveSelection.selectionTool",

View File

@ -793,6 +793,16 @@ TOOL_ACTION PCB_ACTIONS::ratsnestLineMode( "pcbnew.Control.ratsnestLineMode",
_( "Curved Ratsnest Lines" ), _( "Show ratsnest with curved lines" ),
BITMAPS::curved_ratsnest );
TOOL_ACTION PCB_ACTIONS::ratsnestModeCycle( "pcbnew.Control.ratsnestModeCycle",
AS_GLOBAL, 0, "",
_( "Ratsnest Mode (3-state)" ),
_( "Cycle between showing ratsnests for all layers, just visible layers, and none" ) );
TOOL_ACTION PCB_ACTIONS::netColorModeCycle( "pcbnew.Control.netColorMode",
AS_GLOBAL, 0, "",
_( "Net Color Mode (3-state)" ),
_( "Cycle between using net and netclass colors for all nets, just ratsnests, and none" ) );
TOOL_ACTION PCB_ACTIONS::trackDisplayMode( "pcbnew.Control.trackDisplayMode",
AS_GLOBAL,
'K', LEGACY_HK_NAME( "Track Display Mode" ),

View File

@ -237,6 +237,8 @@ public:
// Display modes
static TOOL_ACTION showRatsnest;
static TOOL_ACTION ratsnestLineMode;
static TOOL_ACTION netColorModeCycle;
static TOOL_ACTION ratsnestModeCycle;
static TOOL_ACTION trackDisplayMode;
static TOOL_ACTION padDisplayMode;
static TOOL_ACTION viaDisplayMode;

View File

@ -284,10 +284,9 @@ int PCB_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent )
{
PCB_DISPLAY_OPTIONS opts = displayOptions();
opts.m_ContrastModeDisplay =
( opts.m_ContrastModeDisplay == HIGH_CONTRAST_MODE::NORMAL ) ?
HIGH_CONTRAST_MODE::DIMMED :
HIGH_CONTRAST_MODE::NORMAL;
opts.m_ContrastModeDisplay = opts.m_ContrastModeDisplay == HIGH_CONTRAST_MODE::NORMAL
? HIGH_CONTRAST_MODE::DIMMED
: HIGH_CONTRAST_MODE::NORMAL;
m_frame->SetDisplayOptions( opts );
@ -312,6 +311,47 @@ int PCB_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent )
}
int PCB_CONTROL::NetColorModeCycle( const TOOL_EVENT& aEvent )
{
PCB_DISPLAY_OPTIONS opts = displayOptions();
switch( opts.m_NetColorMode )
{
case NET_COLOR_MODE::ALL: opts.m_NetColorMode = NET_COLOR_MODE::RATSNEST; break;
case NET_COLOR_MODE::RATSNEST: opts.m_NetColorMode = NET_COLOR_MODE::OFF; break;
case NET_COLOR_MODE::OFF: opts.m_NetColorMode = NET_COLOR_MODE::ALL; break;
}
m_frame->SetDisplayOptions( opts );
return 0;
}
int PCB_CONTROL::RatsnestModeCycle( const TOOL_EVENT& aEvent )
{
PCB_DISPLAY_OPTIONS opts = displayOptions();
if( !opts.m_ShowGlobalRatsnest )
{
opts.m_ShowGlobalRatsnest = true;
opts.m_RatsnestMode = RATSNEST_MODE::ALL;
}
else if( opts.m_RatsnestMode == RATSNEST_MODE::ALL )
{
opts.m_RatsnestMode = RATSNEST_MODE::VISIBLE;
}
else
{
opts.m_ShowGlobalRatsnest = false;
}
m_frame->SetDisplayOptions( opts );
return 0;
}
int PCB_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent )
{
m_frame->SwitchLayer( nullptr, aEvent.Parameter<PCB_LAYER_ID>() );
@ -1238,6 +1278,8 @@ void PCB_CONTROL::setTransitions()
Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() );
Go( &PCB_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() );
Go( &PCB_CONTROL::HighContrastModeCycle, ACTIONS::highContrastModeCycle.MakeEvent() );
Go( &PCB_CONTROL::NetColorModeCycle, PCB_ACTIONS::netColorModeCycle.MakeEvent() );
Go( &PCB_CONTROL::RatsnestModeCycle, PCB_ACTIONS::ratsnestModeCycle.MakeEvent() );
Go( &PCB_CONTROL::FlipPcbView, PCB_ACTIONS::flipBoard.MakeEvent() );
// Layer control

View File

@ -65,8 +65,10 @@ public:
// Update the view with the new high-contrast mode from the display settings
int HighContrastMode( const TOOL_EVENT& aEvent );
// Rotate through the available high-contrast modes
// Rotate through the available high-contrast, net color and ratsnest color modes
int HighContrastModeCycle( const TOOL_EVENT& aEvent );
int NetColorModeCycle( const TOOL_EVENT& aEvent );
int RatsnestModeCycle( const TOOL_EVENT& aEvent );
// Layer control
int LayerSwitch( const TOOL_EVENT& aEvent );

View File

@ -431,7 +431,6 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_windowLayers->SetFont( infoFont );
m_windowObjects->SetFont( infoFont );
m_presetsLabel->SetFont( infoFont );
m_presetsHotkey->SetFont( infoFont );
createControls();
@ -542,12 +541,12 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
m_netsGrid->SetDefaultCellFont( font );
m_netsGrid->SetDefaultRowSize( font.GetPixelSize().y + rowHeightPadding );
m_netsGrid->GetGridWindow()->Bind( wxEVT_MOTION,
&APPEARANCE_CONTROLS::OnNetGridMouseEvent, this );
m_netsGrid->GetGridWindow()->Bind( wxEVT_MOTION, &APPEARANCE_CONTROLS::OnNetGridMouseEvent,
this );
// To handle middle click on color swatches
m_netsGrid->GetGridWindow()->Bind( wxEVT_MIDDLE_UP,
&APPEARANCE_CONTROLS::OnNetGridMouseEvent, this );
m_netsGrid->GetGridWindow()->Bind( wxEVT_MIDDLE_UP, &APPEARANCE_CONTROLS::OnNetGridMouseEvent,
this );
m_netsGrid->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT );
m_netclassScrolledWindow->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_DEFAULT );
@ -575,6 +574,10 @@ APPEARANCE_CONTROLS::~APPEARANCE_CONTROLS()
void APPEARANCE_CONTROLS::createControls()
{
int hotkey;
wxString msg;
wxFont infoFont = KIUI::GetInfoFont( this );
// Create layer display options
m_paneLayerDisplayOptions = new WX_COLLAPSIBLE_PANE( m_panelLayers, wxID_ANY,
_( "Layer Display Options" ) );
@ -586,34 +589,43 @@ void APPEARANCE_CONTROLS::createControls()
wxBoxSizer* layerDisplayOptionsSizer;
layerDisplayOptionsSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextContrastModeTitle = new wxStaticText( layerDisplayPane, wxID_ANY,
_( "Inactive layers:" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_staticTextContrastModeTitle->Wrap( -1 );
layerDisplayOptionsSizer->Add( m_staticTextContrastModeTitle, 0,
wxEXPAND | wxBOTTOM | wxLEFT, 2 );
hotkey = PCB_ACTIONS::highContrastModeCycle.GetHotKey();
if( hotkey )
msg = wxString::Format( _( "Inactive layers (%s):" ), KeyNameFromKeyCode( hotkey ) );
else
msg = _( "Inactive layers:" );
m_inactiveLayersLabel = new wxStaticText( layerDisplayPane, wxID_ANY, msg );
m_inactiveLayersLabel->SetFont( infoFont );
m_inactiveLayersLabel->Wrap( -1 );
layerDisplayOptionsSizer->Add( m_inactiveLayersLabel, 0, wxEXPAND | wxBOTTOM | wxLEFT, 2 );
wxBoxSizer* contrastModeSizer;
contrastModeSizer = new wxBoxSizer( wxHORIZONTAL );
m_rbHighContrastNormal = new wxRadioButton( layerDisplayPane, wxID_ANY, _( "Normal" ),
wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbHighContrastNormal->SetFont( infoFont );
m_rbHighContrastNormal->SetValue( true );
m_rbHighContrastNormal->SetToolTip( _( "Inactive layers will be shown in full color" ) );
contrastModeSizer->Add( m_rbHighContrastNormal, 0, wxRIGHT, 4 );
contrastModeSizer->Add( m_rbHighContrastNormal, 0, wxRIGHT, 5 );
contrastModeSizer->AddStretchSpacer();
m_rbHighContrastDim = new wxRadioButton( layerDisplayPane, wxID_ANY, _( "Dim" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_rbHighContrastDim = new wxRadioButton( layerDisplayPane, wxID_ANY, _( "Dim" ) );
m_rbHighContrastDim->SetFont( infoFont );
m_rbHighContrastDim->SetToolTip( _( "Inactive layers will be dimmed" ) );
contrastModeSizer->Add( m_rbHighContrastDim, 0, wxRIGHT | wxLEFT, 10 );
contrastModeSizer->Add( m_rbHighContrastDim, 0, wxRIGHT, 5 );
contrastModeSizer->AddStretchSpacer();
m_rbHighContrastOff = new wxRadioButton( layerDisplayPane, wxID_ANY, _( "Hide" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_rbHighContrastOff = new wxRadioButton( layerDisplayPane, wxID_ANY, _( "Hide" ) );
m_rbHighContrastOff->SetFont( infoFont );
m_rbHighContrastOff->SetToolTip( _( "Inactive layers will be hidden" ) );
contrastModeSizer->Add( m_rbHighContrastOff, 0, 0, 5 );
contrastModeSizer->AddStretchSpacer();
layerDisplayOptionsSizer->Add( contrastModeSizer, 0, wxEXPAND, 5 );
@ -621,8 +633,8 @@ void APPEARANCE_CONTROLS::createControls()
wxDefaultSize, wxLI_HORIZONTAL );
layerDisplayOptionsSizer->Add( m_layerDisplaySeparator, 0, wxEXPAND | wxTOP | wxBOTTOM, 5 );
m_cbFlipBoard = new wxCheckBox( layerDisplayPane, wxID_ANY, _( "Flip board view" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_cbFlipBoard = new wxCheckBox( layerDisplayPane, wxID_ANY, _( "Flip board view" ) );
m_cbFlipBoard->SetFont( infoFont );
layerDisplayOptionsSizer->Add( m_cbFlipBoard, 0, 0, 5 );
layerDisplayPane->SetSizer( layerDisplayOptionsSizer );
@ -652,8 +664,15 @@ void APPEARANCE_CONTROLS::createControls()
//// Net color mode
m_txtNetDisplayTitle = new wxStaticText( netDisplayPane, wxID_ANY, _( "Net colors:" ),
wxDefaultPosition, wxDefaultSize, 0 );
hotkey = PCB_ACTIONS::netColorModeCycle.GetHotKey();
if( hotkey )
msg = wxString::Format( _( "Net colors (%s):" ), KeyNameFromKeyCode( hotkey ) );
else
msg = _( "Net colors:" );
m_txtNetDisplayTitle = new wxStaticText( netDisplayPane, wxID_ANY, msg );
m_txtNetDisplayTitle->SetFont( infoFont );
m_txtNetDisplayTitle->Wrap( -1 );
m_txtNetDisplayTitle->SetToolTip( _( "Choose when to show net and netclass colors" ) );
@ -663,19 +682,22 @@ void APPEARANCE_CONTROLS::createControls()
m_rbNetColorAll = new wxRadioButton( netDisplayPane, wxID_ANY, _( "All" ), wxDefaultPosition,
wxDefaultSize, wxRB_GROUP );
m_rbNetColorAll->SetFont( infoFont );
m_rbNetColorAll->SetToolTip( _( "Net and netclass colors are shown on all copper items" ) );
netColorSizer->Add( m_rbNetColorAll, 0, wxRIGHT, 10 );
netColorSizer->Add( m_rbNetColorAll, 0, wxRIGHT, 5 );
netColorSizer->AddStretchSpacer();
m_rbNetColorRatsnest = new wxRadioButton( netDisplayPane, wxID_ANY, _( "Ratsnest" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_rbNetColorRatsnest = new wxRadioButton( netDisplayPane, wxID_ANY, _( "Ratsnest" ) );
m_rbNetColorRatsnest->SetFont( infoFont );
m_rbNetColorRatsnest->SetValue( true );
m_rbNetColorRatsnest->SetToolTip( _( "Net and netclass colors are shown on the ratsnest only" ) );
netColorSizer->Add( m_rbNetColorRatsnest, 0, wxRIGHT, 4 );
netColorSizer->Add( m_rbNetColorRatsnest, 0, wxRIGHT, 5 );
netColorSizer->AddStretchSpacer();
m_rbNetColorOff = new wxRadioButton( netDisplayPane, wxID_ANY, _( "None" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_rbNetColorOff = new wxRadioButton( netDisplayPane, wxID_ANY, _( "None" ) );
m_rbNetColorOff->SetFont( infoFont );
m_rbNetColorOff->SetToolTip( _( "Net and netclass colors are not shown" ) );
netColorSizer->Add( m_rbNetColorOff, 0, 0, 5 );
@ -684,27 +706,43 @@ void APPEARANCE_CONTROLS::createControls()
//// Ratsnest display
m_txtRatsnestVisibility = new wxStaticText( netDisplayPane, wxID_ANY, _( "Ratsnest display:" ),
wxDefaultPosition, wxDefaultSize, 0 );
hotkey = PCB_ACTIONS::ratsnestModeCycle.GetHotKey();
if( hotkey )
msg = wxString::Format( _( "Ratsnest display (%s):" ), KeyNameFromKeyCode( hotkey ) );
else
msg = _( "Ratsnest display:" );
m_txtRatsnestVisibility = new wxStaticText( netDisplayPane, wxID_ANY, msg );
m_txtRatsnestVisibility->SetFont( infoFont );
m_txtRatsnestVisibility->Wrap( -1 );
m_txtRatsnestVisibility->SetToolTip( _( "Choose what ratsnest lines to display" ) );
m_txtRatsnestVisibility->SetToolTip( _( "Choose which ratsnest lines to display" ) );
netDisplayOptionsSizer->Add( m_txtRatsnestVisibility, 0, wxEXPAND | wxBOTTOM | wxLEFT, 2 );
wxBoxSizer* ratsnestDisplayModeSizer = new wxBoxSizer( wxHORIZONTAL );
m_rbRatsnestAllLayers = new wxRadioButton( netDisplayPane, wxID_ANY, _( "All layers" ),
m_rbRatsnestAllLayers = new wxRadioButton( netDisplayPane, wxID_ANY, _( "All" ),
wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbRatsnestAllLayers->SetToolTip( _( "Ratsnest lines are shown to items on all layers" ) );
m_rbRatsnestAllLayers->SetFont( infoFont );
m_rbRatsnestAllLayers->SetValue( true );
m_rbRatsnestAllLayers->SetToolTip( _( "Show ratsnest lines to items on all layers" ) );
ratsnestDisplayModeSizer->Add( m_rbRatsnestAllLayers, 0, wxRIGHT, 10 );
ratsnestDisplayModeSizer->Add( m_rbRatsnestAllLayers, 0, wxRIGHT, 5 );
ratsnestDisplayModeSizer->AddStretchSpacer();
m_rbRatsnestVisibleLayers = new wxRadioButton( netDisplayPane, wxID_ANY, _( "Visible layers" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_rbRatsnestVisibleLayers->SetToolTip( _( "Ratsnest lines are shown to items on visible layers" ) );
m_rbRatsnestVisLayers = new wxRadioButton( netDisplayPane, wxID_ANY, _( "Visible layers" ) );
m_rbRatsnestVisLayers->SetFont( infoFont );
m_rbRatsnestVisLayers->SetToolTip( _( "Show ratsnest lines to items on visible layers" ) );
ratsnestDisplayModeSizer->Add( m_rbRatsnestVisibleLayers, 0, wxRIGHT, 4 );
ratsnestDisplayModeSizer->Add( m_rbRatsnestVisLayers, 0, wxRIGHT, 5 );
ratsnestDisplayModeSizer->AddStretchSpacer();
m_rbRatsnestNone = new wxRadioButton( netDisplayPane, wxID_ANY, _( "None" ) );
m_rbRatsnestNone->SetFont( infoFont );
m_rbRatsnestNone->SetToolTip( _( "Hide all ratsnest lines" ) );
ratsnestDisplayModeSizer->Add( m_rbRatsnestNone, 0, 0, 5 );
netDisplayOptionsSizer->Add( ratsnestDisplayModeSizer, 0, wxEXPAND | wxBOTTOM, 5 );
@ -726,15 +764,13 @@ void APPEARANCE_CONTROLS::createControls()
Thaw();
} );
m_rbNetColorAll->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onNetColorModeChanged, this );
m_rbNetColorOff->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onNetColorModeChanged, this );
m_rbNetColorRatsnest->Bind( wxEVT_RADIOBUTTON,
&APPEARANCE_CONTROLS::onNetColorModeChanged, this );
m_rbNetColorAll->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onNetColorMode, this );
m_rbNetColorOff->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onNetColorMode, this );
m_rbNetColorRatsnest->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onNetColorMode, this );
m_rbRatsnestAllLayers->Bind( wxEVT_RADIOBUTTON,
&APPEARANCE_CONTROLS::onRatsnestModeChanged, this );
m_rbRatsnestVisibleLayers->Bind( wxEVT_RADIOBUTTON,
&APPEARANCE_CONTROLS::onRatsnestModeChanged, this );
m_rbRatsnestAllLayers->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onRatsnestMode, this );
m_rbRatsnestVisLayers->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onRatsnestMode, this );
m_rbRatsnestNone->Bind( wxEVT_RADIOBUTTON, &APPEARANCE_CONTROLS::onRatsnestMode, this );
}
@ -842,11 +878,11 @@ void APPEARANCE_CONTROLS::OnNetGridRightClick( wxGridEvent& event )
wxString netName = m_netsGrid->GetCellValue( event.GetRow(), NET_GRID_TABLE::COL_LABEL );
wxMenu menu;
menu.Append( new wxMenuItem( &menu, ID_SET_NET_COLOR,
_( "Set Net Color" ), wxEmptyString, wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_SET_NET_COLOR, _( "Set Net Color" ), wxEmptyString,
wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_HIGHLIGHT_NET,
wxString::Format( _( "Highlight %s" ), netName ),
wxEmptyString, wxITEM_NORMAL ) );
wxString::Format( _( "Highlight %s" ), netName ), wxEmptyString,
wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_SELECT_NET,
wxString::Format( _( "Select Tracks and Vias in %s" ), netName ),
wxEmptyString, wxITEM_NORMAL ) );
@ -856,10 +892,10 @@ void APPEARANCE_CONTROLS::OnNetGridRightClick( wxGridEvent& event )
menu.AppendSeparator();
menu.Append( new wxMenuItem( &menu, ID_SHOW_ALL_NETS,
_( "Show All Nets" ), wxEmptyString, wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_HIDE_OTHER_NETS,
_( "Hide All Other Nets" ), wxEmptyString, wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_SHOW_ALL_NETS, _( "Show All Nets" ), wxEmptyString,
wxITEM_NORMAL ) );
menu.Append( new wxMenuItem( &menu, ID_HIDE_OTHER_NETS, _( "Hide All Other Nets" ),
wxEmptyString, wxITEM_NORMAL ) );
menu.Bind( wxEVT_COMMAND_MENU_SELECTED, &APPEARANCE_CONTROLS::onNetContextMenu, this );
@ -1268,10 +1304,12 @@ void APPEARANCE_CONTROLS::UpdateDisplayOptions()
if( !m_isFpEditor )
{
if( options.m_RatsnestMode == RATSNEST_MODE::ALL )
if( !options.m_ShowGlobalRatsnest )
m_rbRatsnestNone->SetValue( true );
else if( options.m_RatsnestMode == RATSNEST_MODE::ALL )
m_rbRatsnestAllLayers->SetValue( true );
else
m_rbRatsnestVisibleLayers->SetValue( true );
m_rbRatsnestVisLayers->SetValue( true );
wxASSERT( m_objectSettingsMap.count( LAYER_RATSNEST ) );
APPEARANCE_SETTING* ratsnest = m_objectSettingsMap.at( LAYER_RATSNEST );
@ -1598,7 +1636,8 @@ void APPEARANCE_CONTROLS::rebuildLayerContextMenu()
m_layerContextMenu->AppendSeparator();
AddMenuItem( m_layerContextMenu, ID_PRESET_FRONT_ASSEMBLY,
_( "Show Only Front Assembly Layers" ), KiBitmap( BITMAPS::show_front_assembly_layers ) );
_( "Show Only Front Assembly Layers" ),
KiBitmap( BITMAPS::show_front_assembly_layers ) );
AddMenuItem( m_layerContextMenu, ID_PRESET_FRONT, _( "Show Only Front Layers" ),
KiBitmap( BITMAPS::show_all_front_layers ) );
@ -2644,7 +2683,7 @@ wxString APPEARANCE_CONTROLS::netclassNameFromEvent( wxEvent& aEvent )
}
void APPEARANCE_CONTROLS::onNetColorModeChanged( wxCommandEvent& aEvent )
void APPEARANCE_CONTROLS::onNetColorMode( wxCommandEvent& aEvent )
{
PCB_DISPLAY_OPTIONS options = m_frame->GetDisplayOptions();
@ -2661,14 +2700,24 @@ void APPEARANCE_CONTROLS::onNetColorModeChanged( wxCommandEvent& aEvent )
}
void APPEARANCE_CONTROLS::onRatsnestModeChanged( wxCommandEvent& aEvent )
void APPEARANCE_CONTROLS::onRatsnestMode( wxCommandEvent& aEvent )
{
PCB_DISPLAY_OPTIONS options = m_frame->GetDisplayOptions();
if( m_rbRatsnestAllLayers->GetValue() )
{
options.m_ShowGlobalRatsnest = true;
options.m_RatsnestMode = RATSNEST_MODE::ALL;
else
}
else if( m_rbRatsnestVisLayers->GetValue() )
{
options.m_ShowGlobalRatsnest = true;
options.m_RatsnestMode = RATSNEST_MODE::VISIBLE;
}
else
{
options.m_ShowGlobalRatsnest = false;
}
m_frame->SetDisplayOptions( options );
m_frame->GetCanvas()->RedrawRatsnest();

View File

@ -345,9 +345,9 @@ private:
wxString netclassNameFromEvent( wxEvent& aEvent );
void onNetColorModeChanged( wxCommandEvent& aEvent );
void onNetColorMode( wxCommandEvent& aEvent );
void onRatsnestModeChanged( wxCommandEvent& aEvent );
void onRatsnestMode( wxCommandEvent& aEvent );
void onNetclassContextMenu( wxCommandEvent& aEvent );
@ -434,7 +434,7 @@ private:
// Layer display options controls
WX_COLLAPSIBLE_PANE* m_paneLayerDisplayOptions;
wxStaticText* m_staticTextContrastModeTitle;
wxStaticText* m_inactiveLayersLabel;
wxRadioButton* m_rbHighContrastNormal;
wxRadioButton* m_rbHighContrastDim;
wxRadioButton* m_rbHighContrastOff;
@ -449,7 +449,8 @@ private:
wxRadioButton* m_rbNetColorOff;
wxStaticText* m_txtRatsnestVisibility;
wxRadioButton* m_rbRatsnestAllLayers;
wxRadioButton* m_rbRatsnestVisibleLayers;
wxRadioButton* m_rbRatsnestVisLayers;
wxRadioButton* m_rbRatsnestNone;
enum POPUP_ID
{

View File

@ -158,19 +158,9 @@ APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* bPresets;
bPresets = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bPresetsLabels;
bPresetsLabels = new wxBoxSizer( wxHORIZONTAL );
m_presetsLabel = new wxStaticText( this, wxID_ANY, _("Presets:"), wxDefaultPosition, wxDefaultSize, 0 );
m_presetsLabel = new wxStaticText( this, wxID_ANY, _("Presets (Ctrl+Tab):"), wxDefaultPosition, wxDefaultSize, 0 );
m_presetsLabel->Wrap( -1 );
bPresetsLabels->Add( m_presetsLabel, 1, wxRIGHT|wxLEFT, 2 );
m_presetsHotkey = new wxStaticText( this, wxID_ANY, _("(Ctrl+Tab)"), wxDefaultPosition, wxDefaultSize, 0 );
m_presetsHotkey->Wrap( -1 );
bPresetsLabels->Add( m_presetsHotkey, 0, wxRIGHT|wxLEFT, 2 );
bPresets->Add( bPresetsLabels, 1, wxEXPAND|wxTOP, 7 );
bPresets->Add( m_presetsLabel, 1, wxRIGHT|wxLEFT, 2 );
wxString m_cbLayerPresetsChoices[] = { _("All Layers"), _("(unsaved)") };
int m_cbLayerPresetsNChoices = sizeof( m_cbLayerPresetsChoices ) / sizeof( wxString );

View File

@ -1125,15 +1125,6 @@
<property name="name">bPresets</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">7</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bPresetsLabels</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
<property name="flag">wxRIGHT|wxLEFT</property>
@ -1166,7 +1157,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Presets:</property>
<property name="label">Presets (Ctrl+Tab):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -1195,69 +1186,6 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">(Ctrl+Tab)</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_presetsHotkey</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
<property name="flag">wxALL|wxEXPAND</property>

View File

@ -64,7 +64,6 @@ class APPEARANCE_CONTROLS_BASE : public wxPanel
wxScrolledWindow* m_netclassScrolledWindow;
wxBoxSizer* m_netclassOuterSizer;
wxStaticText* m_presetsLabel;
wxStaticText* m_presetsHotkey;
wxChoice* m_cbLayerPresets;
// Virtual event handlers, overide them in your derived class