Commit 9e32b2ab authored by g_harland's avatar g_harland

Assorted changes; see change_log.txt

parent ee68d20e
...@@ -4,6 +4,54 @@ Started 2007-June-11 ...@@ -4,6 +4,54 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2007-Oct-07 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ all
* Various dialog boxes can now (otherwise) be cancelled by pressing the "Esc" key.
(Some dialog boxes still require attention in that regard though, so that task
is not yet complete.) And the captions of the "OK" button within various dialog
boxes have been fully capitalised (meaning that an icon is now provided within
each of those buttons within the Linux version of KiCad).
* DIALOG_STYLE (defined within include/wxstruct.h) now includes MAYBE_RESIZE_BORDER
field. (Refer to 2007-Oct-2 UPDATE notes for the relevance of this.)
* Beautification and house keeping.
+ eeschema
* The editpart.cpp and editpart.cpp files (which are no longer used) have been
removed, and replaced with editpart.cpp.notused and editpart.cpp.notused
+ cvpcb
* Additional "OK", "Cancel", and "Apply" buttons have now been provided for the
"Options" dialog box which lists various display options for footprints.
+ pcbnew
* Invoking the "Select Layer Pair:" dialog box is no longer possible whenever only
one (copper) layer is currently enabled. And it is no longer possible to select
the same layer to be both the Top Layer and Bottom Layer (for any Layer Pair).
* Deselecting layers during the "Swap layers" command is now more user-friendly,
due to the provision of an additional "(Deselect)" radiobutton within the (child)
"Select Layer:" dialog box (which is always invoked whenever a different
radiobutton within the "Swap Layers:" dialog box is clicked on). (It had
previously been necessary to cancel the "Select Layer:" dialog box before being
able to click on the "Deselect" button within the "Swap Layers:" dialog box.)
* Definition for NB_LAYERS changed from (EDGE_N + 1) to (LAST_NO_COPPER_LAYER + 1)
(Although EDGE_N is currently the "last" layer, that wouldn't necessarily still
be true if any additional layers are ever defined in the future.) And comparisons
to 29 (or 28) have been replaced with comparisons to NB_LAYERS (when appropriate).
+ gerbview
* The previously provided "Exit" button within the "GerbView Layer Colors" dialog
box has been replaced with "OK", "Cancel", and "Apply" buttons; and both the
visibility and color of the Grid layer can now be edited from the same dialog.
* Deselecting (Gerber) layers during the "Export to Pcbnew" command is now more
user-friendly, due to the provision of an additional "(Deselect)" radiobutton
within the (child) "Select Layer:" dialog box (which is always invoked whenever
a different radiobutton within the "Layer selection:" dialog box is clicked on).
(It had previously been necessary to cancel the "Select Layer:" dialog box before
being able to click on the "Deselect" button within the "Layer selection:" dialog
box.)
* The "Export to Pcbnew" command now requires at least one Gerber file to have been
already loaded. And Gerber files can now be loaded into any of the 32 (Gerber)
layers provided. (It had previously been necessary to avoid having any gaps within
the sequence of used Gerber layers.)
2007-Oct-6 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2007-Oct-6 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+ pcbnew + pcbnew
...@@ -11,7 +59,6 @@ email address. ...@@ -11,7 +59,6 @@ email address.
move RemoteCommand() and SendMessageToEESCHEMA() to cross-probing.cpp move RemoteCommand() and SendMessageToEESCHEMA() to cross-probing.cpp
2007-Oct-3 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Oct-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+ pcbnew + pcbnew
......
...@@ -16,14 +16,12 @@ ...@@ -16,14 +16,12 @@
/***********************/ /***********************/
enum listbox { enum listbox {
ID_LISTBOX_CANCEL = 8000, ID_LISTBOX_LIST = 8000
ID_LISTBOX_LIST,
ID_LISTBOX_OK
}; };
BEGIN_EVENT_TABLE(WinEDAListBox, wxDialog) BEGIN_EVENT_TABLE(WinEDAListBox, wxDialog)
EVT_BUTTON(ID_LISTBOX_OK, WinEDAListBox::Ok) EVT_BUTTON(wxID_OK, WinEDAListBox::OnOkClick)
EVT_BUTTON(ID_LISTBOX_CANCEL, WinEDAListBox::Cancel) EVT_BUTTON(wxID_CANCEL, WinEDAListBox::OnCancelClick)
EVT_LISTBOX(ID_LISTBOX_LIST, WinEDAListBox::ClickOnList) EVT_LISTBOX(ID_LISTBOX_LIST, WinEDAListBox::ClickOnList)
EVT_LISTBOX_DCLICK(ID_LISTBOX_LIST, WinEDAListBox::D_ClickOnList) EVT_LISTBOX_DCLICK(ID_LISTBOX_LIST, WinEDAListBox::D_ClickOnList)
EVT_CHAR(WinEDAListBox::OnKeyEvent) EVT_CHAR(WinEDAListBox::OnKeyEvent)
...@@ -98,11 +96,11 @@ int ii; ...@@ -98,11 +96,11 @@ int ii;
m_List->Append(*names); m_List->Append(*names);
} }
wxButton * butt = new wxButton(this, ID_LISTBOX_OK, _("Ok")); wxButton * butt = new wxButton(this, wxID_OK, _("OK"));
RightBoxSizer->Add(butt, 0, wxGROW|wxALL, 5); RightBoxSizer->Add(butt, 0, wxGROW|wxALL, 5);
butt->SetDefault(); butt->SetDefault();
butt = new wxButton(this, ID_LISTBOX_CANCEL, _("Cancel")); butt = new wxButton(this, wxID_CANCEL, _("Cancel"));
RightBoxSizer->Add(butt, 0, wxGROW|wxALL, 5); RightBoxSizer->Add(butt, 0, wxGROW|wxALL, 5);
if (m_MoveFct ) if (m_MoveFct )
...@@ -110,7 +108,7 @@ int ii; ...@@ -110,7 +108,7 @@ int ii;
size.x = -1; size.y = 60; size.x = -1; size.y = 60;
m_WinMsg = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, size, m_WinMsg = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, size,
wxTE_READONLY|wxTE_MULTILINE); wxTE_READONLY|wxTE_MULTILINE);
GeneralBoxSizer->Add(m_WinMsg, 0, wxGROW|wxALL, 5); GeneralBoxSizer->Add(m_WinMsg, 0, wxGROW|wxALL, 5);
} }
GetSizer()->Fit(this); GetSizer()->Fit(this);
...@@ -174,7 +172,7 @@ void WinEDAListBox::InsertItems(const wxArrayString & itemlist, int position) ...@@ -174,7 +172,7 @@ void WinEDAListBox::InsertItems(const wxArrayString & itemlist, int position)
} }
/************************************************/ /************************************************/
void WinEDAListBox::Cancel(wxCommandEvent& event) void WinEDAListBox::OnCancelClick(wxCommandEvent& event)
/************************************************/ /************************************************/
{ {
EndModal(-1); EndModal(-1);
...@@ -205,7 +203,7 @@ int ii = m_List->GetSelection(); ...@@ -205,7 +203,7 @@ int ii = m_List->GetSelection();
/***********************************************/ /***********************************************/
void WinEDAListBox::Ok(wxCommandEvent& event) void WinEDAListBox::OnOkClick(wxCommandEvent& event)
/***********************************************/ /***********************************************/
{ {
int ii = m_List->GetSelection(); int ii = m_List->GetSelection();
...@@ -224,8 +222,8 @@ void WinEDAListBox::OnClose(wxCloseEvent& event) ...@@ -224,8 +222,8 @@ void WinEDAListBox::OnClose(wxCloseEvent& event)
static int SortItems( const wxString ** ptr1, const wxString ** ptr2 ) static int SortItems( const wxString ** ptr1, const wxString ** ptr2 )
/********************************************************************/ /********************************************************************/
/* Routines de comparaison pour le tri tri alphabetique, /* Routines de comparaison pour le tri tri alphabetique,
avec traitement des nombres en tant que valeur numerique * avec traitement des nombres en tant que valeur numerique
*/ */
{ {
return StrNumICmp( (*ptr1)->GetData(), (*ptr2)->GetData() ); return StrNumICmp( (*ptr1)->GetData(), (*ptr2)->GetData() );
} }
......
...@@ -47,7 +47,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event) ...@@ -47,7 +47,8 @@ void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event)
/* Creation de la fenetre d'options de la fenetre de visu */ /* Creation de la fenetre d'options de la fenetre de visu */
{ {
KiDisplayOptionsFrame * OptionWindow = new KiDisplayOptionsFrame(this); KiDisplayOptionsFrame * OptionWindow = new KiDisplayOptionsFrame(this);
OptionWindow->ShowModal(); OptionWindow->Destroy(); OptionWindow->ShowModal();
OptionWindow->Destroy();
} }
...@@ -65,15 +66,13 @@ IMPLEMENT_DYNAMIC_CLASS( KiDisplayOptionsFrame, wxDialog ) ...@@ -65,15 +66,13 @@ IMPLEMENT_DYNAMIC_CLASS( KiDisplayOptionsFrame, wxDialog )
BEGIN_EVENT_TABLE( KiDisplayOptionsFrame, wxDialog ) BEGIN_EVENT_TABLE( KiDisplayOptionsFrame, wxDialog )
////@begin KiDisplayOptionsFrame event table entries ////@begin KiDisplayOptionsFrame event table entries
EVT_CHECKBOX( PADNUM_OPT, KiDisplayOptionsFrame::OnPadnumOptClick )
EVT_BUTTON( ID_SAVE_CONFIG, KiDisplayOptionsFrame::OnSaveConfigClick ) EVT_BUTTON( ID_SAVE_CONFIG, KiDisplayOptionsFrame::OnSaveConfigClick )
EVT_CHECKBOX( PADFILL_OPT, KiDisplayOptionsFrame::OnPadfillOptClick ) EVT_BUTTON( wxID_OK, KiDisplayOptionsFrame::OnOkClick )
EVT_RADIOBOX( EDGE_SELECT, KiDisplayOptionsFrame::OnEdgeSelectSelected ) EVT_BUTTON( wxID_CANCEL, KiDisplayOptionsFrame::OnCancelClick )
EVT_RADIOBOX( TEXT_SELECT, KiDisplayOptionsFrame::OnTextSelectSelected ) EVT_BUTTON( wxID_APPLY, KiDisplayOptionsFrame::OnApplyClick )
////@end KiDisplayOptionsFrame event table entries ////@end KiDisplayOptionsFrame event table entries
...@@ -101,10 +100,10 @@ KiDisplayOptionsFrame::KiDisplayOptionsFrame( WinEDA_BasePcbFrame* parent, wxWin ...@@ -101,10 +100,10 @@ KiDisplayOptionsFrame::KiDisplayOptionsFrame( WinEDA_BasePcbFrame* parent, wxWin
bool KiDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool KiDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{ {
////@begin KiDisplayOptionsFrame member initialisation ////@begin KiDisplayOptionsFrame member initialisation
m_IsShowPadNum = NULL;
m_IsShowPadFill = NULL;
m_EdgesDisplayOption = NULL; m_EdgesDisplayOption = NULL;
m_TextDisplayOption = NULL; m_TextDisplayOption = NULL;
m_IsShowPadNum = NULL;
m_IsShowPadFill = NULL;
////@end KiDisplayOptionsFrame member initialisation ////@end KiDisplayOptionsFrame member initialisation
////@begin KiDisplayOptionsFrame creation ////@begin KiDisplayOptionsFrame creation
...@@ -132,24 +131,16 @@ void KiDisplayOptionsFrame::CreateControls() ...@@ -132,24 +131,16 @@ void KiDisplayOptionsFrame::CreateControls()
KiDisplayOptionsFrame* itemDialog1 = this; KiDisplayOptionsFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2); itemDialog1->SetSizer(itemBoxSizer2);
wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(3, 2, 0, 0); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); // itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_TOP|wxALL, 5);
m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Pad &Num"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
m_IsShowPadNum->SetValue(false); // itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemFlexGridSizer3->Add(m_IsShowPadNum, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer2->Add(itemBoxSizer4, 0, wxGROW|wxALIGN_TOP|wxALL, 5);
wxButton* itemButton5 = new wxButton( itemDialog1, ID_SAVE_CONFIG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer3->Add(itemButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT, _("&Pad Fill"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_IsShowPadFill->SetValue(false);
itemFlexGridSizer3->Add(m_IsShowPadFill, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
wxString m_EdgesDisplayOptionStrings[] = { wxString m_EdgesDisplayOptionStrings[] = {
_("&Filaire"), _("&Filaire"),
...@@ -157,7 +148,8 @@ void KiDisplayOptionsFrame::CreateControls() ...@@ -157,7 +148,8 @@ void KiDisplayOptionsFrame::CreateControls()
_("&Sketch") _("&Sketch")
}; };
m_EdgesDisplayOption = new wxRadioBox( itemDialog1, EDGE_SELECT, _("Edges:"), wxDefaultPosition, wxDefaultSize, 3, m_EdgesDisplayOptionStrings, 1, wxRA_SPECIFY_COLS ); m_EdgesDisplayOption = new wxRadioBox( itemDialog1, EDGE_SELECT, _("Edges:"), wxDefaultPosition, wxDefaultSize, 3, m_EdgesDisplayOptionStrings, 1, wxRA_SPECIFY_COLS );
itemFlexGridSizer3->Add(m_EdgesDisplayOption, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); // itemBoxSizer3->Add(m_EdgesDisplayOption, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(m_EdgesDisplayOption, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_TextDisplayOptionStrings[] = { wxString m_TextDisplayOptionStrings[] = {
_("&Filaire"), _("&Filaire"),
...@@ -165,13 +157,54 @@ void KiDisplayOptionsFrame::CreateControls() ...@@ -165,13 +157,54 @@ void KiDisplayOptionsFrame::CreateControls()
_("&Sketch") _("&Sketch")
}; };
m_TextDisplayOption = new wxRadioBox( itemDialog1, TEXT_SELECT, _("Texts:"), wxDefaultPosition, wxDefaultSize, 3, m_TextDisplayOptionStrings, 1, wxRA_SPECIFY_COLS ); m_TextDisplayOption = new wxRadioBox( itemDialog1, TEXT_SELECT, _("Texts:"), wxDefaultPosition, wxDefaultSize, 3, m_TextDisplayOptionStrings, 1, wxRA_SPECIFY_COLS );
itemFlexGridSizer3->Add(m_TextDisplayOption, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); // itemBoxSizer3->Add(m_TextDisplayOption, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(m_TextDisplayOption, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
// itemBoxSizer3->Add(itemBoxSizer5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer3->Add(itemBoxSizer5, 0, wxGROW|wxALL, 0);
// Provide a spacer to improve appearance of dialog box
itemBoxSizer5->AddSpacer(5);
m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Pad &Num"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_IsShowPadNum->SetValue(false);
// itemBoxSizer5->Add(m_IsShowPadNum, 0, wxGROW|wxALL, 5);
itemBoxSizer5->Add(m_IsShowPadNum, 0, wxALIGN_TOP|wxALL, 5);
m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT, _("&Pad Fill"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_IsShowPadFill->SetValue(false);
// itemBoxSizer5->Add(m_IsShowPadFill, 0, wxGROW|wxALL, 5);
itemBoxSizer5->Add(m_IsShowPadFill, 0, wxALIGN_TOP|wxALL, 5);
// Provide a stretch spacer to improve appearance of dialog box
itemBoxSizer5->AddStretchSpacer();
wxButton* itemButton6 = new wxButton( itemDialog1, ID_SAVE_CONFIG, _("Save Cfg..."), wxDefaultPosition, wxDefaultSize, 0 );
// itemBoxSizer5->Add(itemButton6, 0, wxGROW|wxALL, 5);
itemBoxSizer5->Add(itemButton6, 0, wxALIGN_BOTTOM|wxALL, 5);
// itemBoxSizer4->AddStretchSpacer();
wxButton* itemButton7 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton7->SetForegroundColour(*wxRED);
// itemBoxSizer4->Add(itemButton7, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(itemButton7, 0, wxALIGN_RIGHT|wxALL, 5);
wxButton* itemButton8 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton8->SetForegroundColour(*wxBLUE);
// itemBoxSizer4->Add(itemButton8, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(itemButton8, 0, wxALIGN_RIGHT|wxALL, 5);
wxButton* itemButton9 = new wxButton( itemDialog1, wxID_APPLY, _("Apply"), wxDefaultPosition, wxDefaultSize, 0 );
// itemBoxSizer4->Add(itemButton9, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(itemButton9, 0, wxALIGN_RIGHT|wxALL, 5);
// Set validators // Set validators
m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) );
m_IsShowPadFill->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadFill) );
m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) ); m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) );
m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) ); m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) );
m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) );
m_IsShowPadFill->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadFill) );
////@end KiDisplayOptionsFrame content construction ////@end KiDisplayOptionsFrame content construction
} }
...@@ -210,57 +243,65 @@ wxIcon KiDisplayOptionsFrame::GetIconResource( const wxString& name ) ...@@ -210,57 +243,65 @@ wxIcon KiDisplayOptionsFrame::GetIconResource( const wxString& name )
////@end KiDisplayOptionsFrame icon retrieval ////@end KiDisplayOptionsFrame icon retrieval
} }
/*! /*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for PADFILL_OPT * Update settings related to edges, text strings, and pads
*/ */
void KiDisplayOptionsFrame::OnPadfillOptClick( wxCommandEvent& event ) void KiDisplayOptionsFrame::UpdateObjectSettings()
{ {
// Update settings
////@begin KiDisplayOptionsFrame update settings
DisplayOpt.DisplayModEdge = m_Parent->m_DisplayModEdge =
m_EdgesDisplayOption->GetSelection();
DisplayOpt.DisplayModText = m_Parent->m_DisplayModText =
m_TextDisplayOption->GetSelection();
DisplayOpt.DisplayPadNum = m_Parent->m_DisplayPadNum =
m_IsShowPadNum->GetValue();
DisplayOpt.DisplayPadFill = m_Parent->m_DisplayPadFill = DisplayOpt.DisplayPadFill = m_Parent->m_DisplayPadFill =
m_IsShowPadFill->GetValue(); m_IsShowPadFill->GetValue();
m_Parent->ReDrawPanel(); m_Parent->ReDrawPanel();
////@end KiDisplayOptionsFrame update settings
} }
/*! /*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for PADNUM_OPT * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG
*/ */
void KiDisplayOptionsFrame::OnPadnumOptClick( wxCommandEvent& event ) void KiDisplayOptionsFrame::OnSaveConfigClick( wxCommandEvent& event )
{ {
DisplayOpt.DisplayPadNum = m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue(); Save_Config(this);
m_Parent->ReDrawPanel();
} }
/*! /*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for EDGE_SELECT * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/ */
void KiDisplayOptionsFrame::OnEdgeSelectSelected( wxCommandEvent& event ) void KiDisplayOptionsFrame::OnOkClick( wxCommandEvent& event )
{ {
DisplayOpt.DisplayModEdge = m_Parent->m_DisplayModEdge = UpdateObjectSettings();
m_EdgesDisplayOption->GetSelection(); EndModal( 1 );
m_Parent->ReDrawPanel();
} }
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/ */
void KiDisplayOptionsFrame::OnSaveConfigClick( wxCommandEvent& event ) void KiDisplayOptionsFrame::OnCancelClick( wxCommandEvent& event )
{ {
Save_Config(this); EndModal( -1 );
} }
/*! /*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for TEXT_SELECT * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
*/ */
void KiDisplayOptionsFrame::OnTextSelectSelected( wxCommandEvent& event ) void KiDisplayOptionsFrame::OnApplyClick( wxCommandEvent& event )
{ {
DisplayOpt.DisplayModText = m_Parent->m_DisplayModText = UpdateObjectSettings();
m_TextDisplayOption->GetSelection();
m_Parent->ReDrawPanel();
} }
...@@ -81,20 +81,17 @@ public: ...@@ -81,20 +81,17 @@ public:
////@begin KiDisplayOptionsFrame event handler declarations ////@begin KiDisplayOptionsFrame event handler declarations
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for PADNUM_OPT
void OnPadnumOptClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SAVE_CONFIG
void OnSaveConfigClick( wxCommandEvent& event ); void OnSaveConfigClick( wxCommandEvent& event );
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for PADFILL_OPT /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnPadfillOptClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for EDGE_SELECT /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnEdgeSelectSelected( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for TEXT_SELECT /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
void OnTextSelectSelected( wxCommandEvent& event ); void OnApplyClick( wxCommandEvent& event );
////@end KiDisplayOptionsFrame event handler declarations ////@end KiDisplayOptionsFrame event handler declarations
...@@ -105,16 +102,19 @@ public: ...@@ -105,16 +102,19 @@ public:
/// Retrieves icon resources /// Retrieves icon resources
wxIcon GetIconResource( const wxString& name ); wxIcon GetIconResource( const wxString& name );
/// Updates settings related to edges, text strings, and pads
void UpdateObjectSettings();
////@end KiDisplayOptionsFrame member function declarations ////@end KiDisplayOptionsFrame member function declarations
/// Should we show tooltips? /// Should we show tooltips?
static bool ShowToolTips(); static bool ShowToolTips();
////@begin KiDisplayOptionsFrame member variables ////@begin KiDisplayOptionsFrame member variables
wxCheckBox* m_IsShowPadNum;
wxCheckBox* m_IsShowPadFill;
wxRadioBox* m_EdgesDisplayOption; wxRadioBox* m_EdgesDisplayOption;
wxRadioBox* m_TextDisplayOption; wxRadioBox* m_TextDisplayOption;
wxCheckBox* m_IsShowPadNum;
wxCheckBox* m_IsShowPadFill;
////@end KiDisplayOptionsFrame member variables ////@end KiDisplayOptionsFrame member variables
WinEDA_BasePcbFrame * m_Parent; WinEDA_BasePcbFrame * m_Parent;
......
...@@ -194,7 +194,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame( ...@@ -194,7 +194,7 @@ WinEDA_ComponentPropertiesFrame::WinEDA_ComponentPropertiesFrame(
pos.x += MButton->GetDefaultSize().x + 10; pos.x += MButton->GetDefaultSize().x + 10;
wxButton* Button = new wxButton( this, ID_ACCEPT_CMP_PROPERTIES, wxButton* Button = new wxButton( this, ID_ACCEPT_CMP_PROPERTIES,
_( "Ok" ), pos ); _( "OK" ), pos );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
c = new wxLayoutConstraints; c = new wxLayoutConstraints;
c->left.SameAs( MButton, wxRight, 20 ); c->left.SameAs( MButton, wxRight, 20 );
......
...@@ -232,7 +232,7 @@ WinEDA_PartPropertiesFrame::WinEDA_PartPropertiesFrame( WinEDA_LibeditFrame* par ...@@ -232,7 +232,7 @@ WinEDA_PartPropertiesFrame::WinEDA_PartPropertiesFrame( WinEDA_LibeditFrame* par
pos.x += Button->GetDefaultSize().x + 70; pos.x += Button->GetDefaultSize().x + 70;
Button = new wxButton( this, ID_ACCEPT_PART_PROPERTIES, Button = new wxButton( this, ID_ACCEPT_PART_PROPERTIES,
_( "Ok" ), pos ); _( "OK" ), pos );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
c = new wxLayoutConstraints; c = new wxLayoutConstraints;
......
...@@ -30,11 +30,6 @@ static wxString shape_list[NBSHAPES] = ...@@ -30,11 +30,6 @@ static wxString shape_list[NBSHAPES] =
wxT( "Input" ), wxT( "Output" ), wxT( "Bidi" ), wxT( "TriState" ), wxT( "Passive" ) wxT( "Input" ), wxT( "Output" ), wxT( "Bidi" ), wxT( "TriState" ), wxT( "Passive" )
}; };
enum id_Textdit {
ID_ACCEPT_PINSHEET_PROPERTIES = 1970,
ID_CANCEL_PINSHEET_PROPERTIES
};
/*****************************************************/ /*****************************************************/
class WinEDA_PinSheetPropertiesFrame : public wxDialog class WinEDA_PinSheetPropertiesFrame : public wxDialog
...@@ -57,16 +52,15 @@ public: ...@@ -57,16 +52,15 @@ public:
~WinEDA_PinSheetPropertiesFrame() { }; ~WinEDA_PinSheetPropertiesFrame() { };
private: private:
void PinSheetPropertiesAccept( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE( WinEDA_PinSheetPropertiesFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PinSheetPropertiesFrame, wxDialog )
EVT_BUTTON( ID_ACCEPT_PINSHEET_PROPERTIES, EVT_BUTTON( wxID_OK, WinEDA_PinSheetPropertiesFrame::OnOkClick )
WinEDA_PinSheetPropertiesFrame::PinSheetPropertiesAccept ) EVT_BUTTON( wxID_CANCEL, WinEDA_PinSheetPropertiesFrame::OnCancelClick )
EVT_BUTTON( ID_CANCEL_PINSHEET_PROPERTIES, WinEDA_PinSheetPropertiesFrame::OnQuit )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -96,13 +90,11 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame( ...@@ -96,13 +90,11 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
m_CurrentPinSheet = curr_pinsheet; m_CurrentPinSheet = curr_pinsheet;
/* Creation des boutons de commande */ /* Creation des boutons de commande */
Button = new wxButton( this, ID_ACCEPT_PINSHEET_PROPERTIES, Button = new wxButton( this, wxID_OK, _( "OK" ) );
_( "Ok" ) );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_CANCEL_PINSHEET_PROPERTIES, Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
_( "Cancel" ) );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
...@@ -123,23 +115,22 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame( ...@@ -123,23 +115,22 @@ WinEDA_PinSheetPropertiesFrame::WinEDA_PinSheetPropertiesFrame(
/************************************************************************/ /************************************************************************/
void WinEDA_PinSheetPropertiesFrame::OnQuit( wxCommandEvent& WXUNUSED (event) ) void WinEDA_PinSheetPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/************************************************************************/ /************************************************************************/
{ {
// true is to force the frame to close EndModal( -1 );
Close( true );
} }
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_PinSheetPropertiesFrame::PinSheetPropertiesAccept( wxCommandEvent& event ) void WinEDA_PinSheetPropertiesFrame::OnOkClick( wxCommandEvent& event )
/***********************************************************************************/ /***********************************************************************************/
{ {
m_CurrentPinSheet->m_Text = m_TextWin->GetText(); m_CurrentPinSheet->m_Text = m_TextWin->GetText();
m_CurrentPinSheet->m_Size.x = m_CurrentPinSheet->m_Size.y = m_TextWin->GetTextSize(); m_CurrentPinSheet->m_Size.x = m_CurrentPinSheet->m_Size.y = m_TextWin->GetTextSize();
m_CurrentPinSheet->m_Shape = m_PinSheetShape->GetSelection(); m_CurrentPinSheet->m_Shape = m_PinSheetShape->GetSelection();
Close( TRUE ); EndModal( 0 );
} }
......
...@@ -25,6 +25,23 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event ) ...@@ -25,6 +25,23 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
/* Export data in pcbnew format /* Export data in pcbnew format
*/ */
{ {
int ii = 0;
bool no_used_layers = true; // Changed to false if any used layer found
// Check whether any of the Gerber layers are actually currently used
while( no_used_layers && ii < 32 )
{
if( g_GERBER_Descr_List[ii] != NULL )
no_used_layers = false;
ii++;
}
if( no_used_layers )
{
DisplayInfo( this, _( "None of the Gerber layers contain any data" ) );
return;
}
wxString FullFileName, msg; wxString FullFileName, msg;
wxString PcbExt( wxT( ".brd" ) ); wxString PcbExt( wxT( ".brd" ) );
......
...@@ -211,7 +211,7 @@ wxString list_scales[2] = { _("format: 2.3"), _("format 3.4") }; ...@@ -211,7 +211,7 @@ wxString list_scales[2] = { _("format: 2.3"), _("format 3.4") };
void WinEDA_GerberGeneralOptionsFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event)) void WinEDA_GerberGeneralOptionsFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event))
/************************************************************************/ /************************************************************************/
{ {
EndModal(0); EndModal( -1 );
} }
...@@ -227,7 +227,7 @@ void WinEDA_GerberGeneralOptionsFrame::OnOkClick(wxCommandEvent& event) ...@@ -227,7 +227,7 @@ void WinEDA_GerberGeneralOptionsFrame::OnOkClick(wxCommandEvent& event)
g_Default_GERBER_Format = g_Default_GERBER_Format =
(m_GerberDefaultScale->GetSelection() == 0) ? 23 : 34; (m_GerberDefaultScale->GetSelection() == 0) ? 23 : 34;
EndModal(1); EndModal( 1 );
} }
...@@ -334,7 +334,7 @@ wxString list_opt3[3] = { _("Sketch"), _("Filled"), _("Line") }; ...@@ -334,7 +334,7 @@ wxString list_opt3[3] = { _("Sketch"), _("Filled"), _("Line") };
void WinEDA_LookFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event)) void WinEDA_LookFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event))
/**************************************************************/ /**************************************************************/
{ {
EndModal(0); EndModal( -1 );
} }
...@@ -363,7 +363,7 @@ void WinEDA_LookFrame::OnOkClick(wxCommandEvent& event) ...@@ -363,7 +363,7 @@ void WinEDA_LookFrame::OnOkClick(wxCommandEvent& event)
m_Parent->GetScreen()->SetRefreshReq(); m_Parent->GetScreen()->SetRefreshReq();
EndModal(1); EndModal( 1 );
} }
...@@ -395,4 +395,3 @@ void WinEDA_GerberFrame::InstallPcbOptionsFrame(const wxPoint & pos, int id) ...@@ -395,4 +395,3 @@ void WinEDA_GerberFrame::InstallPcbOptionsFrame(const wxPoint & pos, int id)
break; break;
} }
} }
...@@ -154,7 +154,7 @@ void WinEDA_ConfigFrame::OnOkClick(wxCommandEvent& WXUNUSED(event)) ...@@ -154,7 +154,7 @@ void WinEDA_ConfigFrame::OnOkClick(wxCommandEvent& WXUNUSED(event))
g_PhotoFilenameExt = TextPhotoExt->GetValue(); g_PhotoFilenameExt = TextPhotoExt->GetValue();
g_PenFilenameExt = TextPenExt->GetValue(); g_PenFilenameExt = TextPenExt->GetValue();
EndModal(1); EndModal( 1 );
} }
...@@ -162,7 +162,7 @@ void WinEDA_ConfigFrame::OnOkClick(wxCommandEvent& WXUNUSED(event)) ...@@ -162,7 +162,7 @@ void WinEDA_ConfigFrame::OnOkClick(wxCommandEvent& WXUNUSED(event))
void WinEDA_ConfigFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event)) void WinEDA_ConfigFrame::OnCancelClick(wxCommandEvent& WXUNUSED(event))
/******************************************************************/ /******************************************************************/
{ {
EndModal(0); EndModal( -1 );
} }
...@@ -172,4 +172,3 @@ void WinEDA_ConfigFrame::SaveCfg(wxCommandEvent& event) ...@@ -172,4 +172,3 @@ void WinEDA_ConfigFrame::SaveCfg(wxCommandEvent& event)
{ {
m_Parent->Update_config(); m_Parent->Update_config();
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
#define ECO2_N 27 #define ECO2_N 27
#define EDGE_N 28 #define EDGE_N 28
#define LAST_NO_COPPER_LAYER 28 #define LAST_NO_COPPER_LAYER 28
#define NB_LAYERS (EDGE_N + 1) #define NB_LAYERS (LAST_NO_COPPER_LAYER + 1)
#define LAYER_COUNT 32 #define LAYER_COUNT 32
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#endif #endif
// Option d'affichage des fenetres de dialogue // Option d'affichage des fenetres de dialogue
//#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP // #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT|wxSTAY_ON_TOP
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT #define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
#define EDA_DRAW_PANEL wxScrolledWindow #define EDA_DRAW_PANEL wxScrolledWindow
...@@ -274,8 +274,8 @@ public: ...@@ -274,8 +274,8 @@ public:
void OnPanning( int direction ); void OnPanning( int direction );
void OnGrid( int grid_type ); void OnGrid( int grid_type );
void Recadre_Trace( bool ToMouse ); void Recadre_Trace( bool ToMouse );
void PutOnGrid( wxPoint* coord );/* corrige la valeur de la coordonnee coord void PutOnGrid( wxPoint* coord ); /* corrige la valeur de la coordonnee coord
* pour etre sur le point de grille le plus proche */ * pour etre sur le point de grille le plus proche */
void Zoom_Automatique( bool move_mouse_cursor ); void Zoom_Automatique( bool move_mouse_cursor );
/* Affiche le schema au meilleur zoom au meilleur centrage pour le dessin /* Affiche le schema au meilleur zoom au meilleur centrage pour le dessin
...@@ -303,7 +303,7 @@ public: ...@@ -303,7 +303,7 @@ public:
virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0; virtual void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) = 0;
virtual void ToolOnRightClick( wxCommandEvent& event ); virtual void ToolOnRightClick( wxCommandEvent& event );
void AdjustScrollBars(); void AdjustScrollBars();
void Affiche_Status_Box();/* Affichage des coord curseur, zoom .. */ void Affiche_Status_Box(); /* Affichage des coord curseur, zoom .. */
void DisplayUnitsMsg(); void DisplayUnitsMsg();
/* Gestion generale des operations sur block */ /* Gestion generale des operations sur block */
...@@ -494,7 +494,7 @@ public: ...@@ -494,7 +494,7 @@ public:
MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC ); MODULE* Load_Module_From_Library( const wxString& library, wxDC* DC );
// Gestion des chevelus (ratsnest) // Gestion des chevelus (ratsnest)
void Compile_Ratsnest( wxDC* DC, bool affiche );/* Recalcul complet du chevelu */ void Compile_Ratsnest( wxDC* DC, bool affiche ); /* Recalcul complet du chevelu */
void ReCompile_Ratsnest_After_Changes( wxDC* DC ); void ReCompile_Ratsnest_After_Changes( wxDC* DC );
int Test_1_Net_Ratsnest( wxDC* DC, int net_code ); int Test_1_Net_Ratsnest( wxDC* DC, int net_code );
char* build_ratsnest_module( wxDC* DC, MODULE* Module ); char* build_ratsnest_module( wxDC* DC, MODULE* Module );
...@@ -502,8 +502,8 @@ public: ...@@ -502,8 +502,8 @@ public:
void Build_Board_Ratsnest( wxDC* DC ); void Build_Board_Ratsnest( wxDC* DC );
void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 ); void DrawGeneralRatsnest( wxDC* DC, int net_code = 0 );
void trace_ratsnest_pad( wxDC* DC ); void trace_ratsnest_pad( wxDC* DC );
void recalcule_pad_net_code();/* Routine de void recalcule_pad_net_code(); /* Routine de
* calcul et de mise a jour des net_codes des PADS */ * calcul et de mise a jour des net_codes des PADS */
void build_liste_pads(); void build_liste_pads();
int* build_ratsnest_pad( EDA_BaseStruct* ref, const wxPoint& refpos, bool init ); int* build_ratsnest_pad( EDA_BaseStruct* ref, const wxPoint& refpos, bool init );
...@@ -539,7 +539,9 @@ public: ...@@ -539,7 +539,9 @@ public:
void DelLimitesZone( wxDC* DC, bool Redraw ); void DelLimitesZone( wxDC* DC, bool Redraw );
// Gestion des layers: // Gestion des layers:
int SelectLayer( int default_layer, int min_layer, int max_layer ); // (See pcbnew/sel_layer.cpp for description of why null_layer parameter is provided)
int SelectLayer( int default_layer, int min_layer, int max_layer,
bool null_layer = false );
void SelectLayerPair(); void SelectLayerPair();
virtual void SwitchLayer( wxDC* DC, int layer ); virtual void SwitchLayer( wxDC* DC, int layer );
...@@ -1620,8 +1622,8 @@ public: ...@@ -1620,8 +1622,8 @@ public:
private: private:
void OnClose( wxCloseEvent& event ); void OnClose( wxCloseEvent& event );
void Cancel( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void Ok( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void ClickOnList( wxCommandEvent& event ); void ClickOnList( wxCommandEvent& event );
void D_ClickOnList( wxCommandEvent& event ); void D_ClickOnList( wxCommandEvent& event );
void OnKeyEvent( wxKeyEvent& event ); void OnKeyEvent( wxKeyEvent& event );
......
...@@ -153,7 +153,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, ...@@ -153,7 +153,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent,
m_button2 = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0 ); m_button2 = new wxButton( this, wxID_CANCEL, _( "Cancel" ), wxDefaultPosition, wxDefaultSize, 0 );
m_button2->SetForegroundColour( *wxBLUE ); m_button2->SetForegroundColour( *wxBLUE );
fgSizer2->Add( m_button2, 0, wxALL, 5 ); fgSizer2->Add( m_button2, 0, wxALL, 5 );
m_button1 = new wxButton( this, wxID_OK, _( "Ok" ), wxDefaultPosition, wxDefaultSize, 0 ); m_button1 = new wxButton( this, wxID_OK, _( "OK" ), wxDefaultPosition, wxDefaultSize, 0 );
m_button1->SetForegroundColour( *wxRED ); m_button1->SetForegroundColour( *wxRED );
m_button1->SetDefault(); m_button1->SetDefault();
fgSizer2->Add( m_button1, 0, wxALL, 5 ); fgSizer2->Add( m_button1, 0, wxALL, 5 );
...@@ -169,7 +169,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, ...@@ -169,7 +169,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent,
void WinEDA_ExecBlockCmdFrame::Cancel( wxCommandEvent& WXUNUSED (event) ) void WinEDA_ExecBlockCmdFrame::Cancel( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/ /**********************************************************************/
{ {
EndModal( 1 ); EndModal( -1 );
} }
......
...@@ -343,7 +343,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -343,7 +343,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre( frame, -1, wxEmptyString, _( "Yes" ), DARKGREEN ); Affiche_1_Parametre( frame, -1, wxEmptyString, _( "Yes" ), DARKGREEN );
ii = m_Layer; ii = m_Layer;
if( ii <= 28 ) if( ii < NB_LAYERS )
Affiche_1_Parametre( frame, 28, _( "Layer" ), ReturnPcbLayerName( ii ), DARKGREEN ); Affiche_1_Parametre( frame, 28, _( "Layer" ), ReturnPcbLayerName( ii ), DARKGREEN );
else else
{ {
......
...@@ -36,9 +36,7 @@ static int status_cotation; /* = 0 : pas de cotation en cours ...@@ -36,9 +36,7 @@ static int status_cotation; /* = 0 : pas de cotation en cours
enum id_Cotation_properties { enum id_Cotation_properties {
ID_ACCEPT_COTATION_PROPERTIES = 1900, ID_TEXTPCB_SELECT_LAYER = 1900
ID_CLOSE_COTATION_PROPERTIES,
ID_TEXTPCB_SELECT_LAYER
}; };
/************************************/ /************************************/
...@@ -69,17 +67,15 @@ public: ...@@ -69,17 +67,15 @@ public:
private: private:
void OnQuit( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void CotationPropertiesAccept( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE( WinEDA_CotationPropertiesFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_CotationPropertiesFrame, wxDialog )
EVT_BUTTON( ID_ACCEPT_COTATION_PROPERTIES, EVT_BUTTON( wxID_OK, WinEDA_CotationPropertiesFrame::OnOkClick )
WinEDA_CotationPropertiesFrame::CotationPropertiesAccept ) EVT_BUTTON( wxID_CANCEL, WinEDA_CotationPropertiesFrame::OnCancelClick )
EVT_BUTTON( ID_CLOSE_COTATION_PROPERTIES,
WinEDA_CotationPropertiesFrame::OnQuit )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -106,13 +102,11 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* ...@@ -106,13 +102,11 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
/* Creation des boutons de commande */ /* Creation des boutons de commande */
Button = new wxButton( this, ID_ACCEPT_COTATION_PROPERTIES, Button = new wxButton( this, wxID_OK, _( "OK" ) );
_( "Ok" ) );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_CLOSE_COTATION_PROPERTIES, Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
_( "Cancel" ) );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
...@@ -142,7 +136,7 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* ...@@ -142,7 +136,7 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
wxDefaultPosition, wxDefaultSize ); wxDefaultPosition, wxDefaultSize );
LeftBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); LeftBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
int ii; int ii;
for( ii = CMP_N + 1; ii < 29; ii++ ) for( ii = CMP_N + 1; ii < NB_LAYERS; ii++ )
{ {
m_SelLayerBox->Append( ReturnPcbLayerName( ii ) ); m_SelLayerBox->Append( ReturnPcbLayerName( ii ) );
} }
...@@ -155,15 +149,15 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* ...@@ -155,15 +149,15 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
/**********************************************************************/ /**********************************************************************/
void WinEDA_CotationPropertiesFrame::OnQuit( wxCommandEvent& WXUNUSED (event) ) void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/ /**********************************************************************/
{ {
Close( true ); // true is to force the frame to close EndModal( -1 );
} }
/***********************************************************************************/ /***********************************************************************************/
void WinEDA_CotationPropertiesFrame::CotationPropertiesAccept( wxCommandEvent& event ) void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
/***********************************************************************************/ /***********************************************************************************/
{ {
if( m_DC ) // Effacement ancien texte if( m_DC ) // Effacement ancien texte
...@@ -193,7 +187,7 @@ void WinEDA_CotationPropertiesFrame::CotationPropertiesAccept( wxCommandEvent& e ...@@ -193,7 +187,7 @@ void WinEDA_CotationPropertiesFrame::CotationPropertiesAccept( wxCommandEvent& e
} }
m_Parent->m_CurrentScreen->SetModify(); m_Parent->m_CurrentScreen->SetModify();
Close( TRUE ); EndModal( 1 );
} }
...@@ -208,7 +202,7 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC ) ...@@ -208,7 +202,7 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
if( Cotation->m_Flags & IS_NEW ) if( Cotation->m_Flags & IS_NEW )
{ {
Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation ->DeleteStructure(); Cotation->DeleteStructure();
} }
else else
{ {
...@@ -365,7 +359,8 @@ void WinEDA_PcbFrame::Install_Edit_Cotation( COTATION* Cotation, ...@@ -365,7 +359,8 @@ void WinEDA_PcbFrame::Install_Edit_Cotation( COTATION* Cotation,
WinEDA_CotationPropertiesFrame* frame = new WinEDA_CotationPropertiesFrame( this, WinEDA_CotationPropertiesFrame* frame = new WinEDA_CotationPropertiesFrame( this,
Cotation, DC, pos ); Cotation, DC, pos );
frame->ShowModal(); frame->Destroy(); frame->ShowModal();
frame->Destroy();
} }
...@@ -378,7 +373,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC ) ...@@ -378,7 +373,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
if( DC ) if( DC )
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
Cotation ->DeleteStructure(); Cotation->DeleteStructure();
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
} }
......
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
/**************************************/ /**************************************/
BEGIN_EVENT_TABLE( WinEDA_ModulePropertiesFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_ModulePropertiesFrame, wxDialog )
EVT_BUTTON( ID_ACCEPT_MODULE_PROPERTIES, EVT_BUTTON( wxID_OK, WinEDA_ModulePropertiesFrame::OnOkClick )
WinEDA_ModulePropertiesFrame::ModulePropertiesAccept ) EVT_BUTTON( wxID_CANCEL, WinEDA_ModulePropertiesFrame::OnCancelClick )
EVT_BUTTON( ID_CLOSE_MODULE_PROPERTIES, WinEDA_ModulePropertiesFrame::OnQuit )
EVT_BUTTON( ID_MODULE_EDIT_ADD_TEXT, WinEDA_ModulePropertiesFrame::CreateTextModule ) EVT_BUTTON( ID_MODULE_EDIT_ADD_TEXT, WinEDA_ModulePropertiesFrame::CreateTextModule )
EVT_BUTTON( ID_MODULE_EDIT_EDIT_TEXT, WinEDA_ModulePropertiesFrame::EditOrDelTextModule ) EVT_BUTTON( ID_MODULE_EDIT_EDIT_TEXT, WinEDA_ModulePropertiesFrame::EditOrDelTextModule )
EVT_BUTTON( ID_MODULE_EDIT_DELETE_TEXT, WinEDA_ModulePropertiesFrame::EditOrDelTextModule ) EVT_BUTTON( ID_MODULE_EDIT_DELETE_TEXT, WinEDA_ModulePropertiesFrame::EditOrDelTextModule )
...@@ -115,13 +114,11 @@ void WinEDA_ModulePropertiesFrame::CreateControls() ...@@ -115,13 +114,11 @@ void WinEDA_ModulePropertiesFrame::CreateControls()
wxBoxSizer* ButtonsBoxSizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* ButtonsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
m_GeneralBoxSizer->Add( ButtonsBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 ); m_GeneralBoxSizer->Add( ButtonsBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
Button = new wxButton( this, ID_ACCEPT_MODULE_PROPERTIES, Button = new wxButton( this, wxID_OK, _( "OK" ) );
_( "Ok" ) );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
Button = new wxButton( this, ID_CLOSE_MODULE_PROPERTIES, Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
_( "Cancel" ) );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); ButtonsBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
} }
...@@ -486,15 +483,15 @@ void Panel3D_Ctrl::Browse3DLib( wxCommandEvent& event ) ...@@ -486,15 +483,15 @@ void Panel3D_Ctrl::Browse3DLib( wxCommandEvent& event )
/**********************************************************************/ /**********************************************************************/
void WinEDA_ModulePropertiesFrame::OnQuit( wxCommandEvent& WXUNUSED (event) ) void WinEDA_ModulePropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/ /**********************************************************************/
{ {
Close( true ); // true is to force the frame to close EndModal( -1 );
} }
/******************************************************************************/ /******************************************************************************/
void WinEDA_ModulePropertiesFrame::ModulePropertiesAccept( wxCommandEvent& event ) void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
/******************************************************************************/ /******************************************************************************/
{ {
bool change_layer = FALSE; bool change_layer = FALSE;
...@@ -590,7 +587,7 @@ void WinEDA_ModulePropertiesFrame::ModulePropertiesAccept( wxCommandEvent& event ...@@ -590,7 +587,7 @@ void WinEDA_ModulePropertiesFrame::ModulePropertiesAccept( wxCommandEvent& event
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
Close( TRUE ); EndModal( 1 );
if( m_DC ) if( m_DC )
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
enum id_Module_properties enum id_Module_properties
{ {
ID_ACCEPT_MODULE_PROPERTIES = 1900, ID_GOTO_MODULE_EDITOR =1900,
ID_CLOSE_MODULE_PROPERTIES,
ID_GOTO_MODULE_EDITOR,
ID_MODULE_PROPERTIES_EXCHANGE, ID_MODULE_PROPERTIES_EXCHANGE,
ID_MODULE_EDIT_ADD_TEXT, ID_MODULE_EDIT_ADD_TEXT,
ID_MODULE_EDIT_EDIT_TEXT, ID_MODULE_EDIT_EDIT_TEXT,
...@@ -59,8 +57,8 @@ public: ...@@ -59,8 +57,8 @@ public:
private: private:
void CreateControls(); void CreateControls();
void OnQuit(wxCommandEvent& event); void OnCancelClick(wxCommandEvent& event);
void ModulePropertiesAccept(wxCommandEvent& event); void OnOkClick(wxCommandEvent& event);
void CreateTextModule(wxCommandEvent& event); void CreateTextModule(wxCommandEvent& event);
void EditOrDelTextModule(wxCommandEvent& event); void EditOrDelTextModule(wxCommandEvent& event);
void SelectTextListBox(wxCommandEvent& event); void SelectTextListBox(wxCommandEvent& event);
......
...@@ -284,10 +284,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type ) ...@@ -284,10 +284,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
/**************** Polygon Shapes ***********************/ /**************** Polygon Shapes ***********************/
enum id_mw_cmd { enum id_mw_cmd {
ID_ACCEPT_OPT = 1000, ID_READ_SHAPE_FILE = 1000
ID_CANCEL_OPT,
ID_READ_SHAPE_FILE
}; };
/*************************************************/ /*************************************************/
...@@ -309,8 +306,8 @@ public: ...@@ -309,8 +306,8 @@ public:
~WinEDA_SetParamShapeFrame() { }; ~WinEDA_SetParamShapeFrame() { };
private: private:
void OnCloseWindow( wxCloseEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void ReadDataShapeDescr( wxCommandEvent& event ); void ReadDataShapeDescr( wxCommandEvent& event );
void AcceptOptions( wxCommandEvent& event ); void AcceptOptions( wxCommandEvent& event );
...@@ -318,8 +315,8 @@ private: ...@@ -318,8 +315,8 @@ private:
}; };
/* Construction de la table des evenements pour WinEDA_SetParamShapeFrame */ /* Construction de la table des evenements pour WinEDA_SetParamShapeFrame */
BEGIN_EVENT_TABLE( WinEDA_SetParamShapeFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_SetParamShapeFrame, wxDialog )
EVT_BUTTON( ID_ACCEPT_OPT, WinEDA_SetParamShapeFrame::AcceptOptions ) EVT_BUTTON( wxID_OK, WinEDA_SetParamShapeFrame::OnOkClick )
EVT_BUTTON( ID_CANCEL_OPT, WinEDA_SetParamShapeFrame::OnCancel ) EVT_BUTTON( wxID_CANCEL, WinEDA_SetParamShapeFrame::OnCancelClick )
EVT_BUTTON( ID_READ_SHAPE_FILE, WinEDA_SetParamShapeFrame::ReadDataShapeDescr ) EVT_BUTTON( ID_READ_SHAPE_FILE, WinEDA_SetParamShapeFrame::ReadDataShapeDescr )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -348,21 +345,21 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, ...@@ -348,21 +345,21 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent,
MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 ); MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 );
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxButton* Button = new wxButton( this, ID_ACCEPT_OPT, _( "Ok" ) ); wxButton* Button = new wxButton( this, wxID_OK, _( "OK" ) );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_CANCEL_OPT, _( "Cancel" ) ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button = new wxButton( this, ID_READ_SHAPE_FILE, _( "Read Shape Descr File" ) ); Button = new wxButton( this, ID_READ_SHAPE_FILE, _( "Read Shape Descr File..." ) );
Button->SetForegroundColour( wxColor( 0, 100, 0 ) ); Button->SetForegroundColour( wxColor( 0, 100, 0 ) );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
wxString shapelist[3] = { _( "Normal" ), _( "Symmetrical" ), _( "mirrored" ) }; wxString shapelist[3] = { _( "Normal" ), _( "Symmetrical" ), _( "Mirrored" ) };
m_ShapeOptionCtrl = new wxRadioBox( this, -1, _( m_ShapeOptionCtrl = new wxRadioBox( this, -1, _(
"ShapeOption" ), "Shape Option" ),
wxDefaultPosition, wxDefaultSize, 3, shapelist, 1, wxDefaultPosition, wxDefaultSize, 3, shapelist, 1,
wxRA_SPECIFY_COLS ); wxRA_SPECIFY_COLS );
LeftBoxSizer->Add( m_ShapeOptionCtrl, 0, wxGROW | wxALL, 5 ); LeftBoxSizer->Add( m_ShapeOptionCtrl, 0, wxGROW | wxALL, 5 );
...@@ -371,26 +368,25 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent, ...@@ -371,26 +368,25 @@ WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( WinEDA_PcbFrame* parent,
ShapeSize, ShapeSize,
g_UnitMetric, LeftBoxSizer, PCB_INTERNAL_UNIT ); g_UnitMetric, LeftBoxSizer, PCB_INTERNAL_UNIT );
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
/**********************************************************************/ /**********************************************************************/
void WinEDA_SetParamShapeFrame::OnCancel( wxCommandEvent& WXUNUSED (event) ) void WinEDA_SetParamShapeFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/ /**********************************************************************/
{ {
if( PolyEdges ) if( PolyEdges )
free( PolyEdges ); free( PolyEdges );
PolyEdges = NULL; PolyEdges = NULL;
PolyEdgesCount = 0; PolyEdgesCount = 0;
EndModal( 0 ); EndModal( -1 );
} }
/*******************************************************************/ /*******************************************************************/
void WinEDA_SetParamShapeFrame::AcceptOptions( wxCommandEvent& event ) void WinEDA_SetParamShapeFrame::OnOkClick( wxCommandEvent& event )
/*******************************************************************/ /*******************************************************************/
{ {
ShapeSize = m_SizeCtrl->GetValue(); ShapeSize = m_SizeCtrl->GetValue();
......
...@@ -577,7 +577,7 @@ wxString ext; ...@@ -577,7 +577,7 @@ wxString ext;
int mask = 1; int mask = 1;
s_SelectedLayers = 0; s_SelectedLayers = 0;
for( layer_to_plot = 0; layer_to_plot < 29; layer_to_plot++, mask <<= 1 ) for( layer_to_plot = 0; layer_to_plot < NB_LAYERS; layer_to_plot++, mask <<= 1 )
{ {
if( m_BoxSelecLayer[layer_to_plot]->GetValue() ) if( m_BoxSelecLayer[layer_to_plot]->GetValue() )
{ {
......
...@@ -21,9 +21,7 @@ static wxPoint old_pos; // position originelle du texte selecte ...@@ -21,9 +21,7 @@ static wxPoint old_pos; // position originelle du texte selecte
enum id_TextPCB_properties { enum id_TextPCB_properties {
ID_ACCEPT_TEXTE_PCB_PROPERTIES = 1900, ID_TEXTPCB_SELECT_LAYER = 1900
ID_CLOSE_TEXTE_PCB_PROPERTIES,
ID_TEXTPCB_SELECT_LAYER
}; };
/************************************/ /************************************/
...@@ -56,17 +54,15 @@ public: ...@@ -56,17 +54,15 @@ public:
private: private:
void TextPCBPropertiesAccept( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnQuit( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE( WinEDA_TextPCBPropertiesFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_TextPCBPropertiesFrame, wxDialog )
EVT_BUTTON( ID_ACCEPT_TEXTE_PCB_PROPERTIES, EVT_BUTTON( wxID_OK, WinEDA_TextPCBPropertiesFrame::OnOkClick )
WinEDA_TextPCBPropertiesFrame::TextPCBPropertiesAccept ) EVT_BUTTON( wxID_CANCEL, WinEDA_TextPCBPropertiesFrame::OnCancelClick )
EVT_BUTTON( ID_CLOSE_TEXTE_PCB_PROPERTIES,
WinEDA_TextPCBPropertiesFrame::OnQuit )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -78,7 +74,8 @@ void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, ...@@ -78,7 +74,8 @@ void WinEDA_PcbFrame::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB,
DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = TRUE;
WinEDA_TextPCBPropertiesFrame* frame = new WinEDA_TextPCBPropertiesFrame( this, WinEDA_TextPCBPropertiesFrame* frame = new WinEDA_TextPCBPropertiesFrame( this,
TextPCB, DC, pos ); TextPCB, DC, pos );
frame->ShowModal(); frame->Destroy(); frame->ShowModal();
frame->Destroy();
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE; DrawPanel->m_IgnoreMouseEvents = FALSE;
} }
...@@ -111,12 +108,12 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p ...@@ -111,12 +108,12 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 ); MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
/* Creation des boutons de commande */ /* Creation des boutons de commande */
Button = new wxButton( this, ID_ACCEPT_TEXTE_PCB_PROPERTIES, _( "Ok" ) ); Button = new wxButton( this, wxID_OK, _( "OK" ) );
Button->SetForegroundColour( *wxRED ); Button->SetForegroundColour( *wxRED );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
Button->SetDefault(); Button->SetDefault();
Button = new wxButton( this, ID_CLOSE_TEXTE_PCB_PROPERTIES, _( "Cancel" ) ); Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
Button->SetForegroundColour( *wxBLUE ); Button->SetForegroundColour( *wxBLUE );
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 ); RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
...@@ -143,7 +140,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p ...@@ -143,7 +140,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
MiddleBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxALL, 5 ); MiddleBoxSizer->Add( m_SelLayerBox, 0, wxGROW | wxALL, 5 );
int ii; int ii;
for( ii = 0; ii < 29; ii++ ) for( ii = 0; ii < NB_LAYERS; ii++ )
{ {
m_SelLayerBox->Append( ReturnPcbLayerName( ii ) ); m_SelLayerBox->Append( ReturnPcbLayerName( ii ) );
} }
...@@ -181,7 +178,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p ...@@ -181,7 +178,7 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
wxDefaultPosition, wxSize( -1, -1 ), 2, display_msg, wxDefaultPosition, wxSize( -1, -1 ), 2, display_msg,
1, wxRA_SPECIFY_COLS ); 1, wxRA_SPECIFY_COLS );
if( !TextPCB->m_Miroir ) if( !TextPCB->m_Miroir )
m_Mirror->SetSelection( 1 );; m_Mirror->SetSelection( 1 );
MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 ); MiddleBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 );
GetSizer()->Fit( this ); GetSizer()->Fit( this );
...@@ -190,16 +187,15 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p ...@@ -190,16 +187,15 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
/**********************************************************************/ /**********************************************************************/
void WinEDA_TextPCBPropertiesFrame::OnQuit( wxCommandEvent& WXUNUSED (event) ) void WinEDA_TextPCBPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) )
/**********************************************************************/ /**********************************************************************/
{ {
// true is to force the frame to close EndModal( -1 );
Close( true );
} }
/**************************************************************************************/ /**************************************************************************************/
void WinEDA_TextPCBPropertiesFrame::TextPCBPropertiesAccept( wxCommandEvent& event ) void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
/**************************************************************************************/ /**************************************************************************************/
{ {
if( m_DC ) // Effacement ancien texte if( m_DC ) // Effacement ancien texte
...@@ -224,7 +220,7 @@ void WinEDA_TextPCBPropertiesFrame::TextPCBPropertiesAccept( wxCommandEvent& eve ...@@ -224,7 +220,7 @@ void WinEDA_TextPCBPropertiesFrame::TextPCBPropertiesAccept( wxCommandEvent& eve
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR );
} }
m_Parent->m_CurrentScreen->SetModify(); m_Parent->m_CurrentScreen->SetModify();
Close( TRUE ); EndModal( 1 );
} }
......
This diff is collapsed.
...@@ -11,12 +11,10 @@ ...@@ -11,12 +11,10 @@
#include "protos.h" #include "protos.h"
/* Variables locales */ /* Variables locales */
static int New_Layer[32]; static int New_Layer[NB_LAYERS];
enum swap_layer_id { enum swap_layer_id {
ID_SWAP_LAYER_EXECUTE = 1800, ID_SWAP_LAYER_BUTTON_SELECT = 1800,
ID_SWAP_LAYER_CANCEL,
ID_SWAP_LAYER_BUTTON_SELECT,
ID_SWAP_LAYER_DESELECT, ID_SWAP_LAYER_DESELECT,
ID_SWAP_LAYER_SELECT ID_SWAP_LAYER_SELECT
}; };
...@@ -40,15 +38,16 @@ public: ...@@ -40,15 +38,16 @@ public:
private: private:
void Sel_Layer( wxCommandEvent& event ); void Sel_Layer( wxCommandEvent& event );
void Cancel( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void Execute( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
/* Table des evenements pour WinEDA_SwapLayerFrame */ /* Table des evenements pour WinEDA_SwapLayerFrame */
BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_SwapLayerFrame, wxDialog )
EVT_BUTTON( ID_SWAP_LAYER_EXECUTE, WinEDA_SwapLayerFrame::Execute ) EVT_BUTTON( wxID_OK, WinEDA_SwapLayerFrame::OnOkClick )
EVT_BUTTON( ID_SWAP_LAYER_CANCEL, WinEDA_SwapLayerFrame::Cancel ) EVT_BUTTON( wxID_CANCEL, WinEDA_SwapLayerFrame::OnCancelClick )
EVT_BUTTON( ID_SWAP_LAYER_DESELECT, WinEDA_SwapLayerFrame::Sel_Layer ) EVT_BUTTON( ID_SWAP_LAYER_DESELECT, WinEDA_SwapLayerFrame::Sel_Layer )
EVT_BUTTON( ID_SWAP_LAYER_BUTTON_SELECT, WinEDA_SwapLayerFrame::Sel_Layer ) EVT_BUTTON( ID_SWAP_LAYER_BUTTON_SELECT, WinEDA_SwapLayerFrame::Sel_Layer )
EVT_RADIOBOX( ID_SWAP_LAYER_SELECT, WinEDA_SwapLayerFrame::Sel_Layer ) EVT_RADIOBOX( ID_SWAP_LAYER_SELECT, WinEDA_SwapLayerFrame::Sel_Layer )
...@@ -65,7 +64,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : ...@@ -65,7 +64,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
wxButton* Button; wxButton* Button;
int ii; int ii;
wxPoint pos; wxPoint pos;
wxString g_Layer_Name_Pair[32]; wxString g_Layer_Name_Pair[NB_LAYERS];
wxSize winsize; wxSize winsize;
m_Parent = parent; m_Parent = parent;
...@@ -76,42 +75,38 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) : ...@@ -76,42 +75,38 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
g_Layer_Name_Pair[ii] = ReturnPcbLayerName( ii ) + wxT( " -> " ) + _( "No Change" ); g_Layer_Name_Pair[ii] = ReturnPcbLayerName( ii ) + wxT( " -> " ) + _( "No Change" );
} }
pos.x = 5; pos.y = START_Y; pos.x = 5;
pos.y = START_Y;
m_LayerList = new wxRadioBox( this, ID_SWAP_LAYER_SELECT, _( "Layers" ), m_LayerList = new wxRadioBox( this, ID_SWAP_LAYER_SELECT, _( "Layers" ),
pos, pos, wxSize( -1, -1 ),
wxSize( -1, -1 ), 29, g_Layer_Name_Pair, 16, wxRA_SPECIFY_ROWS ); NB_LAYERS, g_Layer_Name_Pair, 16, wxRA_SPECIFY_ROWS );
winsize.y = m_LayerList->GetRect().GetBottom(); winsize.y = m_LayerList->GetRect().GetBottom();
pos.x = m_LayerList->GetRect().GetRight() + 12; pos.x = m_LayerList->GetRect().GetRight() + 12;
Button = new wxButton( this, ID_SWAP_LAYER_CANCEL,
_( "Cancel" ), pos );
Button->SetForegroundColour( *wxRED ); Button = new wxButton(this, ID_SWAP_LAYER_BUTTON_SELECT, _("Select..."), pos );
winsize.x = MAX( winsize.x, Button->GetRect().GetRight() ); Button->SetForegroundColour(wxColour(0,100,100));
pos.y += Button->GetSize().y + 5; pos.y += Button->GetSize().y + 10;
Button = new wxButton( this, ID_SWAP_LAYER_EXECUTE,
_( "OK" ), pos );
Button->SetForegroundColour( *wxBLUE ); Button = new wxButton(this, ID_SWAP_LAYER_DESELECT, _("Deselect"), pos );
winsize.x = MAX( winsize.x, Button->GetRect().GetRight() ); Button->SetForegroundColour(wxColour(0,100,0));
pos.y += Button->GetSize().y + 15; pos.y = winsize.y - 2 * Button->GetSize().y - 10;
Button = new wxButton( this, ID_SWAP_LAYER_DESELECT,
_( "Deselect" ), pos );
Button->SetForegroundColour( wxColour( 0, 100, 0 ) ); Button = new wxButton(this, wxID_OK, _("OK"), pos );
winsize.x = MAX( winsize.x, Button->GetRect().GetRight() ); Button->SetForegroundColour(*wxRED);
pos.y += Button->GetSize().y + 5; pos.y += Button->GetSize().y + 10;
Button = new wxButton( this, ID_SWAP_LAYER_BUTTON_SELECT,
_( "Select" ), pos );
Button->SetForegroundColour( wxColour( 0, 100, 100 ) ); Button = new wxButton(this, wxID_CANCEL, _("Cancel"), pos );
winsize.x = MAX( winsize.x, Button->GetRect().GetRight() ); Button->SetForegroundColour(*wxBLUE);
winsize.x += 10; winsize.y += 10; winsize.x = MAX( winsize.x, Button->GetRect().GetRight() );
winsize.y = MAX( winsize.y, Button->GetRect().GetBottom() );
winsize.x += 10;
winsize.y += 10;
SetClientSize( winsize ); SetClientSize( winsize );
} }
...@@ -127,26 +122,49 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event ) ...@@ -127,26 +122,49 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
switch( event.GetId() ) switch( event.GetId() )
{ {
case ID_SWAP_LAYER_DESELECT: case ID_SWAP_LAYER_DESELECT:
if( New_Layer[ii] != -1 ) if( New_Layer[ii] != NB_LAYERS )
{ {
New_Layer[ii] = -1; New_Layer[ii] = NB_LAYERS;
m_LayerList->SetString( ii, ReturnPcbLayerName( ii ) + m_LayerList->SetString( ii, ReturnPcbLayerName( ii )
+ wxT( " -> " ) + _( "No Change" ) ); + wxT( " -> " ) + _( "No Change" ) );
} }
break; break;
case ID_SWAP_LAYER_BUTTON_SELECT: case ID_SWAP_LAYER_BUTTON_SELECT:
case ID_SWAP_LAYER_SELECT: case ID_SWAP_LAYER_SELECT:
jj = m_Parent->SelectLayer( ii, -1, -1 ); jj = New_Layer[ii];
if( (jj < 0) || (jj >= 29) ) if( (jj < 0) || (jj > NB_LAYERS) )
jj = NB_LAYERS; // (Defaults to "No Change".)
jj = m_Parent->SelectLayer( jj, -1, -1, true );
if( (jj < 0) || (jj > NB_LAYERS) )
return;
// No change if the selected layer matches the layer being edited.
// (Hence the only way to restore a layer to the "No Change"
// state is by specifically deselecting it; any attempt
// to select the same layer (instead) will be ignored.)
if( jj == ii )
{
wxString msg;
msg = _( "Deselect this layer to restore its No Change state" );
DisplayInfo( this, msg );
return; return;
}
if( ii != jj ) if( jj != New_Layer[ii] )
{ {
New_Layer[ii] = jj; New_Layer[ii] = jj;
m_LayerList->SetString( ii, if( jj == NB_LAYERS )
ReturnPcbLayerName( ii ) + wxT( " -> " ) + m_LayerList->SetString( ii,
ReturnPcbLayerName( jj ) ); ReturnPcbLayerName( ii )
+ wxT( " -> " )
+ _( "No Change" ) );
else
m_LayerList->SetString( ii,
ReturnPcbLayerName( ii )
+ wxT( " -> " )
+ ReturnPcbLayerName( jj ) );
} }
break; break;
} }
...@@ -154,7 +172,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event ) ...@@ -154,7 +172,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
/*********************************************************/ /*********************************************************/
void WinEDA_SwapLayerFrame::Cancel( wxCommandEvent& event ) void WinEDA_SwapLayerFrame::OnCancelClick( wxCommandEvent& event )
/*********************************************************/ /*********************************************************/
{ {
EndModal( -1 ); EndModal( -1 );
...@@ -162,7 +180,7 @@ void WinEDA_SwapLayerFrame::Cancel( wxCommandEvent& event ) ...@@ -162,7 +180,7 @@ void WinEDA_SwapLayerFrame::Cancel( wxCommandEvent& event )
/*********************************************************/ /*********************************************************/
void WinEDA_SwapLayerFrame::Execute( wxCommandEvent& event ) void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event )
/*********************************************************/ /*********************************************************/
{ {
EndModal( 1 ); EndModal( 1 );
...@@ -181,15 +199,16 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event ) ...@@ -181,15 +199,16 @@ void WinEDA_PcbFrame::Swap_Layers( wxCommandEvent& event )
/* Init default values */ /* Init default values */
for( ii = 0; ii < 32; ii++ ) for( ii = 0; ii < NB_LAYERS; ii++ )
New_Layer[ii] = -1; New_Layer[ii] = NB_LAYERS;
WinEDA_SwapLayerFrame* frame = new WinEDA_SwapLayerFrame( this ); WinEDA_SwapLayerFrame* frame = new WinEDA_SwapLayerFrame( this );
ii = frame->ShowModal(); frame->Destroy(); ii = frame->ShowModal();
frame->Destroy();
if( ii != 1 ) if( ii != 1 )
return; return; // (Cancelled dialog box returns -1 instead)
/* Modifications des pistes */ /* Modifications des pistes */
pt_segm = (TRACK*) m_Pcb->m_Track; pt_segm = (TRACK*) m_Pcb->m_Track;
......
/*****************************************************************/ /*****************************************************************/
/* too_modeit.cpp: construction du menu de l'editeur de modules */ /* tool_modeit.cpp: construction du menu de l'editeur de modules */
/*****************************************************************/ /*****************************************************************/
#include "fctsys.h" #include "fctsys.h"
......
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