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( ...@@ -27,10 +27,11 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(
{ {
m_Parent = aParent; m_Parent = aParent;
m_Netcode = aNetcode; m_Netcode = aNetcode;
m_OptionID = 0;
MyInit(); MyInit();
Layout();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
Layout();
} }
...@@ -55,11 +56,17 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit() ...@@ -55,11 +56,17 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
netclass = netclasses.Find( board->m_CurrentNetClassName ); 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 ) if( !board->m_TrackWidthSelector && !board->m_ViaSizeSelector )
{ {
m_Net2CurrValueButton->Enable( false ); 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: // Display current values, and current netclass values:
...@@ -121,7 +128,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit() ...@@ -121,7 +128,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::MyInit()
msg = _( "Default" ); msg = _( "Default" );
m_gridDisplayCurrentSettings->SetCellValue( 1, 4, msg ); 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 ii = 0; ii < m_gridDisplayCurrentSettings->GetNumberRows(); ii++ )
{ {
for( int jj = 0; jj < m_gridDisplayCurrentSettings->GetNumberCols(); jj++ ) for( int jj = 0; jj < m_gridDisplayCurrentSettings->GetNumberCols(); jj++ )
...@@ -138,7 +145,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event ) ...@@ -138,7 +145,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
{ {
bool change = false; bool change = false;
switch( event.GetId() ) switch( m_OptionID )
{ {
case ID_CURRENT_VALUES_TO_CURRENT_NET: case ID_CURRENT_VALUES_TO_CURRENT_NET:
if( !IsOK( this, if( !IsOK( this,
......
...@@ -36,12 +36,14 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS : ...@@ -36,12 +36,14 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS :
private: private:
WinEDA_PcbFrame* m_Parent; WinEDA_PcbFrame* m_Parent;
int m_Netcode; int m_Netcode;
int m_OptionID;
public: public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( WinEDA_PcbFrame* aParent, int aNetcode ); DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( WinEDA_PcbFrame* aParent, int aNetcode );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {}; ~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS() {};
// Virtual event handlers, overided here // Virtual event handlers, overided here
void OnSelectionClick( wxCommandEvent& event ){ m_OptionID = event.GetId(); }
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void MyInit(); void MyInit();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/grid.h> #include <wx/grid.h>
#include <wx/statbox.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/radiobut.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -39,31 +39,34 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public wxDialog ...@@ -39,31 +39,34 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public wxDialog
private: private:
protected: protected:
wxStaticText* m_staticText12;
wxStaticText* m_CurrentNetText; wxStaticText* m_CurrentNetText;
wxStaticText* m_CurrentNetName; wxStaticText* m_CurrentNetName;
wxStaticText* m_CurrentNetclassText; wxStaticText* m_CurrentNetclassText;
wxStaticText* m_CurrentNetclassName; wxStaticText* m_CurrentNetclassName;
wxGrid* m_gridDisplayCurrentSettings; wxGrid* m_gridDisplayCurrentSettings;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxStaticText* m_Net2CurrValueText; wxStaticText* m_staticText11;
wxButton* m_Net2CurrValueButton;
wxStaticText* m_staticText5; wxRadioButton* m_Net2CurrValueButton;
wxButton* m_button3; wxRadioButton* m_NetUseNetclassValueButton;
wxStaticText* m_staticText6; wxRadioButton* m_radioBtn3;
wxButton* m_button4; wxRadioButton* m_radioBtn4;
wxStaticText* m_staticText7; wxRadioButton* m_radioBtn5;
wxButton* m_button5; wxStdDialogButtonSizer* m_sdbSizer1;
wxStaticText* m_staticText8; wxButton* m_sdbSizer1OK;
wxButton* m_button6; wxButton* m_sdbSizer1Cancel;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class // 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 OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public: 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(); ~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