Commit cb24fb25 authored by charras's avatar charras

convert dialog_global_edit_tracks_and_vias to Gnome standards.

parent 507d49b2
......@@ -27,10 +27,11 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(
{
m_Parent = aParent;
m_Netcode = aNetcode;
m_OptionID = 0;
MyInit();
Layout();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
Layout();
}
......@@ -55,11 +56,17 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
netclass = netclasses.Find( board->m_CurrentNetClassName );
}
// Enable/disable the option "copy current to net" if we ause only default netclass values
// Disable the option "copy current to net" if we have only default netclass values
if( !board->m_TrackWidthSelector && !board->m_ViaSizeSelector )
{
m_Net2CurrValueButton->Enable( false );
m_Net2CurrValueText->Enable( false );
m_OptionID = ID_NETCLASS_VALUES_TO_CURRENT_NET;
m_NetUseNetclassValueButton->SetValue(true);
}
else
{
m_OptionID = ID_CURRENT_VALUES_TO_CURRENT_NET;
m_Net2CurrValueButton->SetValue(true);
}
// Display current values, and current netclass values:
......@@ -121,7 +128,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 4, msg );
// Set all cells Roead Only
// Set all cells Read Only
for( int ii = 0; ii < m_gridDisplayCurrentSettings->GetNumberRows(); ii++ )
{
for( int jj = 0; jj < m_gridDisplayCurrentSettings->GetNumberCols(); jj++ )
......@@ -138,7 +145,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
{
bool change = false;
switch( event.GetId() )
switch( m_OptionID )
{
case ID_CURRENT_VALUES_TO_CURRENT_NET:
if( !IsOK( this,
......
......@@ -36,12 +36,14 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS :
private:
WinEDA_PcbFrame* m_Parent;
int m_Netcode;
int m_OptionID;
public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( WinEDA_PcbFrame* aParent, int aNetcode );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {};
// Virtual event handlers, overided here
void OnSelectionClick( wxCommandEvent& event ){ m_OptionID = event.GetId(); }
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void MyInit();
......
......@@ -18,8 +18,8 @@
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/grid.h>
#include <wx/statbox.h>
#include <wx/statline.h>
#include <wx/radiobut.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -39,31 +39,34 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public wxDialog
private:
protected:
wxStaticText* m_staticText12;
wxStaticText* m_CurrentNetText;
wxStaticText* m_CurrentNetName;
wxStaticText* m_CurrentNetclassText;
wxStaticText* m_CurrentNetclassName;
wxGrid* m_gridDisplayCurrentSettings;
wxStaticLine* m_staticline1;
wxStaticText* m_Net2CurrValueText;
wxButton* m_Net2CurrValueButton;
wxStaticText* m_staticText5;
wxButton* m_button3;
wxStaticText* m_staticText6;
wxButton* m_button4;
wxStaticText* m_staticText7;
wxButton* m_button5;
wxStaticText* m_staticText8;
wxButton* m_button6;
wxButton* m_buttonCancel;
wxStaticText* m_staticText11;
wxRadioButton* m_Net2CurrValueButton;
wxRadioButton* m_NetUseNetclassValueButton;
wxRadioButton* m_radioBtn3;
wxRadioButton* m_radioBtn4;
wxRadioButton* m_radioBtn5;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSelectionClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 711,418 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global Edition of Tracks and Vias"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 711,376 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE();
};
......
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