diff --git a/pcbnew/dialog_freeroute_exchange.cpp b/pcbnew/dialog_freeroute_exchange.cpp index 9091027f15..2c0d1e83bd 100644 --- a/pcbnew/dialog_freeroute_exchange.cpp +++ b/pcbnew/dialog_freeroute_exchange.cpp @@ -1,12 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// + // Name: dialog_freeroute_exchange.cpp -// Purpose: +// Purpose: // Author: jean-pierre Charras -// Modified by: +// Modified by: // Created: 14/03/2008 09:19:27 -// RCS-ID: +// RCS-ID: // Copyright: kicad team -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 14/03/2008 09:19:27 @@ -34,18 +35,23 @@ ////@begin XPM images ////@end XPM images +#define FREEROUTE_URL_KEY wxT( "freeroute_url" ) +#define FREEROUTE_RUN_KEY wxT( "freeroute_command" ) /**********************************************************************/ void WinEDA_PcbFrame::Access_to_External_Tool( wxCommandEvent& event ) /**********************************************************************/ + /* Run an external tool (currently, only freeroute) -*/ + */ { - dialog_freeroute_exchange dialog( this ) ; - dialog.ShowModal(); + dialog_freeroute_exchange dialog( this ); + + dialog.ShowModal(); } + /*! * dialog_freeroute_exchange type definition */ @@ -60,15 +66,21 @@ IMPLEMENT_DYNAMIC_CLASS( dialog_freeroute_exchange, wxDialog ) BEGIN_EVENT_TABLE( dialog_freeroute_exchange, wxDialog ) ////@begin dialog_freeroute_exchange event table entries - EVT_BUTTON( ID_CREATE_EXPORT_DSN_FILE, dialog_freeroute_exchange::OnCreateExportDsnFileClick ) +EVT_CLOSE( dialog_freeroute_exchange::OnCloseWindow ) - EVT_BUTTON( ID_RUN_FREEROUTE, dialog_freeroute_exchange::OnRunFreerouteClick ) +EVT_BUTTON( ID_CREATE_EXPORT_DSN_FILE, dialog_freeroute_exchange::OnCreateExportDsnFileClick ) - EVT_BUTTON( ID_IMPORT_FREEROUTE_DSN_FILE, dialog_freeroute_exchange::OnImportFreerouteDsnFileClick ) +EVT_BUTTON( ID_RUN_FREEROUTE, dialog_freeroute_exchange::OnRunFreerouteClick ) - EVT_BUTTON( wxID_CLOSE, dialog_freeroute_exchange::OnCloseClick ) +EVT_BUTTON( ID_IMPORT_FREEROUTE_DSN_FILE, dialog_freeroute_exchange::OnImportFreerouteDsnFileClick ) - EVT_BUTTON( ID_GOTO_FREEROUTE_WEB_SITE, dialog_freeroute_exchange::OnGotoFreerouteWebSiteClick ) +EVT_BUTTON( wxID_CLOSE, dialog_freeroute_exchange::OnCloseClick ) + +EVT_BUTTON( ID_GOTO_FREEROUTE_WEB_SITE, dialog_freeroute_exchange::OnGotoFreerouteWebSiteClick ) + +EVT_TEXT( ID_TEXT_EDIT_FR_URL, dialog_freeroute_exchange::OnTextEditFrUrlUpdated ) + +EVT_TEXT( ID_TEXT_EDIT_FR_CMD, dialog_freeroute_exchange::OnTextEditFrCmdUpdated ) ////@end dialog_freeroute_exchange event table entries @@ -84,11 +96,17 @@ dialog_freeroute_exchange::dialog_freeroute_exchange() Init(); } -dialog_freeroute_exchange::dialog_freeroute_exchange( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) + +dialog_freeroute_exchange::dialog_freeroute_exchange( WinEDA_PcbFrame* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& pos, + const wxSize& size, + long style ) { - m_Parent = parent; + m_Parent = parent; Init(); - Create(parent, id, caption, pos, size, style); + Create( parent, id, caption, pos, size, style ); } @@ -96,18 +114,24 @@ dialog_freeroute_exchange::dialog_freeroute_exchange( WinEDA_PcbFrame* parent, w * dialog_freeroute_exchange creator */ -bool dialog_freeroute_exchange::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +bool dialog_freeroute_exchange::Create( wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& pos, + const wxSize& size, + long style ) { ////@begin dialog_freeroute_exchange creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); + SetExtraStyle( wxWS_EX_BLOCK_EVENTS ); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - if (GetSizer()) + if( GetSizer() ) { - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); } Centre(); + ////@end dialog_freeroute_exchange creation return true; } @@ -131,8 +155,10 @@ dialog_freeroute_exchange::~dialog_freeroute_exchange() void dialog_freeroute_exchange::Init() { ////@begin dialog_freeroute_exchange member initialisation + m_FreeRouteSetupChanged = false; m_FreerouteURLName = NULL; m_FreerouteURLCommandString = NULL; + ////@end dialog_freeroute_exchange member initialisation } @@ -142,64 +168,96 @@ void dialog_freeroute_exchange::Init() */ void dialog_freeroute_exchange::CreateControls() -{ +{ ////@begin dialog_freeroute_exchange content construction - // Generated by DialogBlocks, 14/03/2008 10:20:02 (unregistered) + // Generated by DialogBlocks, 14/03/2008 16:00:48 (unregistered) dialog_freeroute_exchange* itemDialog1 = this; - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); - itemDialog1->SetSizer(itemBoxSizer2); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemDialog1->SetSizer( itemBoxSizer2 ); - wxButton* itemButton4 = new wxButton( itemDialog1, ID_CREATE_EXPORT_DSN_FILE, _("Create Export Dsn File"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton4->SetHelpText(_("Create an export DNS file to freeroute")); - if (dialog_freeroute_exchange::ShowToolTips()) - itemButton4->SetToolTip(_("Create an export DNS file to freeroute")); - itemBoxSizer3->Add(itemButton4, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxVERTICAL ); + itemBoxSizer2->Add( itemBoxSizer3, 0, wxGROW | wxALL, 5 ); - wxButton* itemButton5 = new wxButton( itemDialog1, ID_RUN_FREEROUTE, _("Connect to FreeROUTE"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton5->SetHelpText(_("Run the WEb Based Freeroute Router")); - if (dialog_freeroute_exchange::ShowToolTips()) - itemButton5->SetToolTip(_("Run the WEb Based Freeroute Router")); - itemBoxSizer3->Add(itemButton5, 0, wxGROW|wxALL, 5); + wxButton* itemButton4 = new wxButton( itemDialog1, ID_CREATE_EXPORT_DSN_FILE, + _( + "Create Export Dsn File" ), wxDefaultPosition, + wxDefaultSize, 0 ); + itemButton4->SetHelpText( _( "Create an export DNS file to freeroute" ) ); + if( dialog_freeroute_exchange::ShowToolTips() ) + itemButton4->SetToolTip( _( "Create an export DNS file to freeroute" ) ); + itemBoxSizer3->Add( itemButton4, 0, wxGROW | wxALL, 5 ); - wxButton* itemButton6 = new wxButton( itemDialog1, ID_IMPORT_FREEROUTE_DSN_FILE, _("Read Design File"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton6->SetHelpText(_("Read the design file created by freeroute")); - if (dialog_freeroute_exchange::ShowToolTips()) - itemButton6->SetToolTip(_("Read the design file created by freeroute")); - itemBoxSizer3->Add(itemButton6, 0, wxGROW|wxALL, 5); + wxButton* itemButton5 = new wxButton( itemDialog1, ID_RUN_FREEROUTE, _( + "Connect to FreeROUTE" ), wxDefaultPosition, + wxDefaultSize, 0 ); + itemButton5->SetHelpText( _( "Run the WEb Based Freeroute Router" ) ); + if( dialog_freeroute_exchange::ShowToolTips() ) + itemButton5->SetToolTip( _( "Run the WEb Based Freeroute Router" ) ); + itemBoxSizer3->Add( itemButton5, 0, wxGROW | wxALL, 5 ); - wxButton* itemButton7 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer3->Add(itemButton7, 0, wxGROW|wxALL, 5); + wxButton* itemButton6 = new wxButton( itemDialog1, ID_IMPORT_FREEROUTE_DSN_FILE, + _( + "Read Design File" ), wxDefaultPosition, + wxDefaultSize, 0 ); + itemButton6->SetHelpText( _( "Read the design file created by freeroute" ) ); + if( dialog_freeroute_exchange::ShowToolTips() ) + itemButton6->SetToolTip( _( "Read the design file created by freeroute" ) ); + itemBoxSizer3->Add( itemButton6, 0, wxGROW | wxALL, 5 ); - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer8, 0, wxGROW|wxALL, 5); + wxButton* itemButton7 = new wxButton( itemDialog1, wxID_CLOSE, _( + "&Close" ), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer3->Add( itemButton7, 0, wxGROW | wxALL, 5 ); - wxButton* itemButton9 = new wxButton( itemDialog1, ID_GOTO_FREEROUTE_WEB_SITE, _("Access to FreeROUTE Web Site"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton9->SetHelpText(_("Run the WEb Based Freeroute Router")); - if (dialog_freeroute_exchange::ShowToolTips()) - itemButton9->SetToolTip(_("Run the WEb Based Freeroute Router")); - itemBoxSizer8->Add(itemButton9, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer8 = new wxBoxSizer( wxVERTICAL ); + itemBoxSizer2->Add( itemBoxSizer8, 1, wxGROW | wxALL, 5 ); - wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, _("FreeRoute URL"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(itemStaticText10, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + wxButton* itemButton9 = new wxButton( itemDialog1, ID_GOTO_FREEROUTE_WEB_SITE, + _( + "Access to FreeROUTE Web Site" ), + wxDefaultPosition, wxDefaultSize, 0 ); + itemButton9->SetHelpText( _( "Run the WEb Based Freeroute Router" ) ); + if( dialog_freeroute_exchange::ShowToolTips() ) + itemButton9->SetToolTip( _( "Run the WEb Based Freeroute Router" ) ); + itemBoxSizer8->Add( itemButton9, 0, wxGROW | wxALL, 5 ); - m_FreerouteURLName = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(m_FreerouteURLName, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, + _( + "FreeRoute URL" ), wxDefaultPosition, + wxDefaultSize, 0 ); + itemBoxSizer8->Add( itemStaticText10, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); - wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, _("FreeRoute Command"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(itemStaticText12, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + m_FreerouteURLName = new wxTextCtrl( itemDialog1, ID_TEXT_EDIT_FR_URL, _T( + "" ), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer8->Add( m_FreerouteURLName, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); - m_FreerouteURLCommandString = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(m_FreerouteURLCommandString, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, + _( + "FreeRoute Command" ), + wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer8->Add( itemStaticText12, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + + m_FreerouteURLCommandString = new wxTextCtrl( itemDialog1, ID_TEXT_EDIT_FR_CMD, _T( + "" ), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer8->Add( m_FreerouteURLCommandString, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); ////@end dialog_freeroute_exchange content construction - m_FreerouteURLName->SetValue(wxT("http://www.freerouting.net/")); - m_FreerouteURLCommandString->SetValue(wxT("http://www.freerouting.net/java/freeroute.jnlp")); + wxString msg; + m_Parent->m_Parent->m_EDA_Config->Read( FREEROUTE_URL_KEY, &msg ); + if( msg.IsEmpty() ) + m_FreerouteURLName->SetValue( wxT( "http://www.freerouting.net/" ) ); + else + m_FreerouteURLName->SetValue( msg ); + msg.Empty(); + m_Parent->m_Parent->m_EDA_Config->Read( FREEROUTE_RUN_KEY, &msg ); + if( msg.IsEmpty() ) + m_FreerouteURLCommandString->SetValue( wxT( + "http://www.freerouting.net/java/freeroute.jnlp" ) ); + else + m_FreerouteURLCommandString->SetValue( msg ); } @@ -212,6 +270,7 @@ bool dialog_freeroute_exchange::ShowToolTips() return true; } + /*! * Get bitmap resources */ @@ -220,11 +279,13 @@ wxBitmap dialog_freeroute_exchange::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin dialog_freeroute_exchange bitmap retrieval - wxUnusedVar(name); + wxUnusedVar( name ); return wxNullBitmap; + ////@end dialog_freeroute_exchange bitmap retrieval } + /*! * Get icon resources */ @@ -233,8 +294,9 @@ wxIcon dialog_freeroute_exchange::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin dialog_freeroute_exchange icon retrieval - wxUnusedVar(name); + wxUnusedVar( name ); return wxNullIcon; + ////@end dialog_freeroute_exchange icon retrieval } @@ -245,7 +307,7 @@ wxIcon dialog_freeroute_exchange::GetIconResource( const wxString& name ) void dialog_freeroute_exchange::OnCreateExportDsnFileClick( wxCommandEvent& event ) { - m_Parent->ExportToSpecctra( event ); + m_Parent->ExportToSpecctra( event ); } @@ -255,7 +317,7 @@ void dialog_freeroute_exchange::OnCreateExportDsnFileClick( wxCommandEvent& even void dialog_freeroute_exchange::OnImportFreerouteDsnFileClick( wxCommandEvent& event ) { - m_Parent->ImportSpecctraSession( event ); + m_Parent->ImportSpecctraSession( event ); } @@ -265,8 +327,9 @@ void dialog_freeroute_exchange::OnImportFreerouteDsnFileClick( wxCommandEvent& e void dialog_freeroute_exchange::OnRunFreerouteClick( wxCommandEvent& event ) { - wxString command = m_FreerouteURLCommandString->GetValue(); - wxLaunchDefaultBrowser(command); + wxString command = m_FreerouteURLCommandString->GetValue(); + + wxLaunchDefaultBrowser( command ); } @@ -276,8 +339,9 @@ void dialog_freeroute_exchange::OnRunFreerouteClick( wxCommandEvent& event ) void dialog_freeroute_exchange::OnGotoFreerouteWebSiteClick( wxCommandEvent& event ) { - wxString command = m_FreerouteURLName->GetValue(); - wxLaunchDefaultBrowser(command); + wxString command = m_FreerouteURLName->GetValue(); + + wxLaunchDefaultBrowser( command ); } @@ -290,3 +354,40 @@ void dialog_freeroute_exchange::OnCloseClick( wxCommandEvent& event ) Close(); } + +/*! + * wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_FREEROUTE_EXCHANGE + */ + +void dialog_freeroute_exchange::OnCloseWindow( wxCloseEvent& event ) +{ + if( m_FreeRouteSetupChanged ) // Save new config + { + m_Parent->m_Parent->m_EDA_Config->Write( FREEROUTE_URL_KEY, + m_FreerouteURLName->GetValue() ); + m_Parent->m_Parent->m_EDA_Config->Write( FREEROUTE_RUN_KEY, + m_FreerouteURLCommandString->GetValue() ); + } + + event.Skip(); +} + + +/*! + * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXT_EDIT_FR_URL + */ + +void dialog_freeroute_exchange::OnTextEditFrUrlUpdated( wxCommandEvent& event ) +{ + m_FreeRouteSetupChanged = true; +} + + +/*! + * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXT_EDIT_FR_CMD + */ + +void dialog_freeroute_exchange::OnTextEditFrCmdUpdated( wxCommandEvent& event ) +{ + m_FreeRouteSetupChanged = true; +} diff --git a/pcbnew/dialog_freeroute_exchange.h b/pcbnew/dialog_freeroute_exchange.h index 115ad37f6e..045aa776fa 100644 --- a/pcbnew/dialog_freeroute_exchange.h +++ b/pcbnew/dialog_freeroute_exchange.h @@ -1,12 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// + // Name: dialog_freeroute_exchange.h -// Purpose: +// Purpose: // Author: jean-pierre Charras -// Modified by: +// Modified by: // Created: 14/03/2008 09:19:27 -// RCS-ID: +// RCS-ID: // Copyright: kicad team -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 14/03/2008 09:19:27 @@ -34,18 +35,20 @@ */ ////@begin control identifiers -#define ID_DIALOG_FREEROUTE_EXCHANGE 10000 -#define ID_CREATE_EXPORT_DSN_FILE 10001 -#define ID_RUN_FREEROUTE 10002 -#define ID_IMPORT_FREEROUTE_DSN_FILE 10003 -#define ID_GOTO_FREEROUTE_WEB_SITE 10004 -#define ID_TEXTCTRL1 10005 -#define ID_TEXTCTRL 10006 -#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL -#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE _("dialog_freeroute_exchange") -#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME ID_DIALOG_FREEROUTE_EXCHANGE -#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE wxSize(400, 300) +#define ID_DIALOG_FREEROUTE_EXCHANGE 10000 +#define ID_CREATE_EXPORT_DSN_FILE 10001 +#define ID_RUN_FREEROUTE 10002 +#define ID_IMPORT_FREEROUTE_DSN_FILE 10003 +#define ID_GOTO_FREEROUTE_WEB_SITE 10004 +#define ID_TEXT_EDIT_FR_URL 10005 +#define ID_TEXT_EDIT_FR_CMD 10006 +#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE wxCAPTION | wxRESIZE_BORDER | wxTHICK_FRAME |\ + wxSYSTEM_MENU | wxCLOSE_BOX | wxTAB_TRAVERSAL +#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE _( "dialog_freeroute_exchange" ) +#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME ID_DIALOG_FREEROUTE_EXCHANGE +#define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE wxSize( 400, 300 ) #define SYMBOL_DIALOG_FREEROUTE_EXCHANGE_POSITION wxDefaultPosition + ////@end control identifiers @@ -53,66 +56,93 @@ * dialog_freeroute_exchange class declaration */ -class dialog_freeroute_exchange: public wxDialog -{ +class dialog_freeroute_exchange : public wxDialog +{ DECLARE_DYNAMIC_CLASS( dialog_freeroute_exchange ) DECLARE_EVENT_TABLE() public: + /// Constructors dialog_freeroute_exchange(); - dialog_freeroute_exchange( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME, const wxString& caption = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE, const wxPoint& pos = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_POSITION, const wxSize& size = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE, long style = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE ); + dialog_freeroute_exchange( WinEDA_PcbFrame* parent, + wxWindowID id = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME, + const wxString& caption = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE, + const wxPoint& pos = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_POSITION, + const wxSize& size = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE, + long style = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE ); /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME, const wxString& caption = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE, const wxPoint& pos = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_POSITION, const wxSize& size = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE, long style = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE ); + bool Create( wxWindow* parent, + wxWindowID id = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_IDNAME, + const wxString& caption = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_TITLE, + const wxPoint& pos = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_POSITION, + const wxSize& size = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_SIZE, + long style = SYMBOL_DIALOG_FREEROUTE_EXCHANGE_STYLE ); /// Destructor ~dialog_freeroute_exchange(); /// Initialises member variables - void Init(); + void Init(); /// Creates the controls and sizers - void CreateControls(); + void CreateControls(); ////@begin dialog_freeroute_exchange event handler declarations + /// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_FREEROUTE_EXCHANGE + void OnCloseWindow( wxCloseEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CREATE_EXPORT_DSN_FILE - void OnCreateExportDsnFileClick( wxCommandEvent& event ); + void OnCreateExportDsnFileClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RUN_FREEROUTE - void OnRunFreerouteClick( wxCommandEvent& event ); + void OnRunFreerouteClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_IMPORT_FREEROUTE_DSN_FILE - void OnImportFreerouteDsnFileClick( wxCommandEvent& event ); + void OnImportFreerouteDsnFileClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE - void OnCloseClick( wxCommandEvent& event ); + void OnCloseClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_GOTO_FREEROUTE_WEB_SITE - void OnGotoFreerouteWebSiteClick( wxCommandEvent& event ); + void OnGotoFreerouteWebSiteClick( wxCommandEvent& event ); + + /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXT_EDIT_FR_URL + void OnTextEditFrUrlUpdated( wxCommandEvent& event ); + + /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_TEXT_EDIT_FR_CMD + void OnTextEditFrCmdUpdated( wxCommandEvent& event ); ////@end dialog_freeroute_exchange event handler declarations ////@begin dialog_freeroute_exchange member function declarations + bool GetFreeRouteSetupChanged() const { return m_FreeRouteSetupChanged; } + void SetFreeRouteSetupChanged( bool value ) { m_FreeRouteSetupChanged = value; } + /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); + wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); + wxIcon GetIconResource( const wxString& name ); + ////@end dialog_freeroute_exchange member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin dialog_freeroute_exchange member variables - wxTextCtrl* m_FreerouteURLName; - wxTextCtrl* m_FreerouteURLCommandString; + wxTextCtrl* m_FreerouteURLName; + wxTextCtrl* m_FreerouteURLCommandString; +private: + bool m_FreeRouteSetupChanged; // Flag set to true if Freeroute config changed ////@end dialog_freeroute_exchange member variables - WinEDA_PcbFrame* m_Parent; + WinEDA_PcbFrame* m_Parent; }; #endif - // _DIALOG_FREEROUTE_EXCHANGE_H_ + +// _DIALOG_FREEROUTE_EXCHANGE_H_ diff --git a/pcbnew/dialog_freeroute_exchange.pjd b/pcbnew/dialog_freeroute_exchange.pjd index ec92f43024..35e4baddfe 100644 --- a/pcbnew/dialog_freeroute_exchange.pjd +++ b/pcbnew/dialog_freeroute_exchange.pjd @@ -210,6 +210,8 @@ "" 0 0 + "m_FreeRouteSetupChanged|bool|FreeRouteSetupChanged|false|2|0|Flag set to true if Freeroute config changed" + "wxEVT_CLOSE_WINDOW|OnCloseWindow|NONE||" "ID_DIALOG_FREEROUTE_EXCHANGE" 10000 "dialog_freeroute_exchange" @@ -240,6 +242,7 @@ 0 1 1 + 1 1 0 0 @@ -300,7 +303,7 @@ "Vertical" "" "Centre" - "Centre" + "Expand" 0 5 1 @@ -595,7 +598,7 @@ "" "Centre" "Expand" - 0 + 1 5 1 1 @@ -743,7 +746,7 @@ "" - "wxTextCtrl: ID_TEXTCTRL1" + "wxTextCtrl: ID_TEXT_EDIT_FR_URL" "dialog-control-document" "" "textctrl" @@ -753,7 +756,8 @@ 0 "14/3/2008" "wbTextCtrlProxy" - "ID_TEXTCTRL1" + "wxEVT_COMMAND_TEXT_UPDATED|OnTextEditFrUrlUpdated|NONE||dialog_freeroute_exchange" + "ID_TEXT_EDIT_FR_URL" 10005 "" "wxTextCtrl" @@ -895,7 +899,7 @@ "" - "wxTextCtrl: ID_TEXTCTRL" + "wxTextCtrl: ID_TEXT_EDIT_FR_CMD" "dialog-control-document" "" "textctrl" @@ -905,7 +909,8 @@ 0 "14/3/2008" "wbTextCtrlProxy" - "ID_TEXTCTRL" + "wxEVT_COMMAND_TEXT_UPDATED|OnTextEditFrCmdUpdated|NONE||dialog_freeroute_exchange" + "ID_TEXT_EDIT_FR_CMD" 10006 "" "wxTextCtrl"