Commit 9b2c6f04 authored by charras's avatar charras

fixed problem in global track edition dialog (Column label too small under linux)

But needs wxWidgets >= 2.8.8
parent 3da78c5d
No preview for this file type
This diff is collapsed.
......@@ -16,7 +16,7 @@
#include "dialog_global_edit_tracks_and_vias.h"
/**
* DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE, derived from DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_BASE
* DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS, derived from DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_BASE
* @see dialog_global_edit_tracks_and_vias_base.h and dialog_global_edit_tracks_and_vias_base.cpp,
* automatically created by wxFormBuilder
*/
......@@ -29,7 +29,6 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(
m_Netcode = aNetcode;
m_OptionID = 0;
MyInit();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
Layout();
}
......@@ -56,7 +55,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
netclass = netclasses.Find( board->m_CurrentNetClassName );
}
// Disable the option "copy current to net" if we have only default netclass values
/* Disable the option "copy current to net" if we have only default netclass values
* i.e. when m_TrackWidthSelector and m_ViaSizeSelector are set to 0
*/
if( !board->m_TrackWidthSelector && !board->m_ViaSizeSelector )
{
m_Net2CurrValueButton->Enable( false );
......@@ -70,7 +71,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
}
// Display current values, and current netclass values:
int value = netclass->GetTrackWidth();
int value = netclass->GetTrackWidth(); // Display track width
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 0, msg );
if( board->m_TrackWidthSelector )
......@@ -82,9 +83,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 0, msg );
// recompute the column widths here, after setting texts
value = netclass->GetViaDiameter();
value = netclass->GetViaDiameter(); // Display via diameter
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 1, msg );
if( board->m_ViaSizeSelector )
......@@ -96,7 +95,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 1, msg );
value = netclass->GetViaDrill();
value = netclass->GetViaDrill(); // Display via drill
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 2, msg );
value = board->GetCurrentViaDrill();
......@@ -106,7 +105,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 2, msg );
value = netclass->GetuViaDiameter();
value = netclass->GetuViaDiameter(); // Display micro via diameter
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 3, msg );
#if 0 // Currently we use always the default netclass value
......@@ -116,7 +115,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 3, msg );
value = netclass->GetuViaDrill();
value = netclass->GetuViaDrill(); // Display micro via drill
msg = ReturnStringFromValue( g_UnitMetric, value, Internal_Unit, true );
m_gridDisplayCurrentSettings->SetCellValue( 0, 4, msg );
#if 0 // Currently we use always the default netclass value
......@@ -135,6 +134,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
m_gridDisplayCurrentSettings->SetReadOnly( ii, jj, true );
}
// needs wxWidgets version >= 2.8.8:
m_gridDisplayCurrentSettings->SetRowLabelSize(wxGRID_AUTOSIZE);
m_gridDisplayCurrentSettings->Fit();
}
......
......@@ -59,7 +59,7 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
fgSizeNetInfo->Add( m_CurrentNetclassName, 0, wxALL, 5 );
bSizerGrids->Add( fgSizeNetInfo, 1, wxEXPAND, 5 );
bSizerGrids->Add( fgSizeNetInfo, 0, wxEXPAND, 5 );
bSizerGrids->Add( 10, 10, 0, 0, 5 );
......@@ -70,8 +70,8 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
m_gridDisplayCurrentSettings->CreateGrid( 2, 5 );
m_gridDisplayCurrentSettings->EnableEditing( true );
m_gridDisplayCurrentSettings->EnableGridLines( true );
m_gridDisplayCurrentSettings->EnableDragGridSize( false );
m_gridDisplayCurrentSettings->SetMargins( 0, 0 );
m_gridDisplayCurrentSettings->EnableDragGridSize( true );
m_gridDisplayCurrentSettings->SetMargins( 10, 0 );
// Columns
m_gridDisplayCurrentSettings->AutoSizeColumns();
......@@ -97,13 +97,13 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
// Cell Defaults
m_gridDisplayCurrentSettings->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
bSizerGrids->Add( m_gridDisplayCurrentSettings, 0, wxALL|wxEXPAND, 5 );
bSizerGrids->Add( m_gridDisplayCurrentSettings, 1, wxALL|wxEXPAND, 5 );
bSizerCurrSettingsLeft->Add( bSizerGrids, 1, wxEXPAND, 5 );
bSizerCurrSettings->Add( bSizerCurrSettingsLeft, 1, wxEXPAND, 5 );
bMainSizer->Add( bSizerCurrSettings, 0, 0, 5 );
bMainSizer->Add( bSizerCurrSettings, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
......@@ -128,7 +128,8 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
wxBoxSizer* bSizerRadioButtons;
bSizerRadioButtons = new wxBoxSizer( wxVERTICAL );
m_Net2CurrValueButton = new wxRadioButton( this, ID_CURRENT_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the current value"), wxDefaultPosition, wxDefaultSize, 0 );
m_Net2CurrValueButton = new wxRadioButton( this, ID_CURRENT_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the current value"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_Net2CurrValueButton->SetValue( true );
bSizerRadioButtons->Add( m_Net2CurrValueButton, 0, wxALL, 5 );
m_NetUseNetclassValueButton = new wxRadioButton( this, ID_NETCLASS_VALUES_TO_CURRENT_NET, _("Set tracks and vias of the current Net to the Netclass value"), wxDefaultPosition, wxDefaultSize, 0 );
......
......@@ -77,7 +77,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
......@@ -166,7 +166,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
......@@ -398,7 +398,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="autosize_cols">1</property>
<property name="autosize_rows">1</property>
......@@ -417,7 +417,7 @@
<property name="context_help"></property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_grid_size">1</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
......@@ -431,7 +431,7 @@
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="margin_width">10</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_gridDisplayCurrentSettings</property>
......@@ -670,10 +670,10 @@
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_GROUP</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value">0</property>
<property name="value">1</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment