Commit 6b52f247 authored by dickelbeck's avatar dickelbeck

ESC key support

parent 1195f382
...@@ -97,11 +97,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotPSFrame, wxDialog ) ...@@ -97,11 +97,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotPSFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_PlotPSFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PlotPSFrame, wxDialog )
////@begin WinEDA_PlotPSFrame event table entries ////@begin WinEDA_PlotPSFrame event table entries
EVT_INIT_DIALOG( WinEDA_PlotPSFrame::OnInitDialog )
EVT_BUTTON( ID_PLOT_PS_CURRENT_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick ) EVT_BUTTON( ID_PLOT_PS_CURRENT_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick )
EVT_BUTTON( ID_PLOT_PS_ALL_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick ) EVT_BUTTON( ID_PLOT_PS_ALL_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick )
EVT_BUTTON( wxID_CLOSE, WinEDA_PlotPSFrame::OnCloseClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_PlotPSFrame::OnCancelClick )
////@end WinEDA_PlotPSFrame event table entries ////@end WinEDA_PlotPSFrame event table entries
...@@ -135,7 +137,7 @@ bool WinEDA_PlotPSFrame::Create( wxWindow* parent, wxWindowID id, const wxString ...@@ -135,7 +137,7 @@ bool WinEDA_PlotPSFrame::Create( wxWindow* parent, wxWindowID id, const wxString
////@end WinEDA_PlotPSFrame member initialisation ////@end WinEDA_PlotPSFrame member initialisation
////@begin WinEDA_PlotPSFrame creation ////@begin WinEDA_PlotPSFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
...@@ -157,7 +159,7 @@ void WinEDA_PlotPSFrame::CreateControls() ...@@ -157,7 +159,7 @@ void WinEDA_PlotPSFrame::CreateControls()
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_PlotPSFrame content construction ////@begin WinEDA_PlotPSFrame content construction
// Generated by DialogBlocks, 22/01/2007 11:32:43 (unregistered) // Generated by DialogBlocks, Sat 22 Mar 2008 13:39:12 CDT (unregistered)
WinEDA_PlotPSFrame* itemDialog1 = this; WinEDA_PlotPSFrame* itemDialog1 = this;
...@@ -167,12 +169,11 @@ void WinEDA_PlotPSFrame::CreateControls() ...@@ -167,12 +169,11 @@ void WinEDA_PlotPSFrame::CreateControls()
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxString m_SizeOptionStrings[] = { wxArrayString m_SizeOptionStrings;
_("Auto"), m_SizeOptionStrings.Add(_("Auto"));
_("Page Size A4"), m_SizeOptionStrings.Add(_("Page Size A4"));
_("Page Size A") m_SizeOptionStrings.Add(_("Page Size A"));
}; m_SizeOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Plot page size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionStrings, 1, wxRA_SPECIFY_COLS );
m_SizeOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Plot page size:"), wxDefaultPosition, wxDefaultSize, 3, m_SizeOptionStrings, 1, wxRA_SPECIFY_COLS );
m_SizeOption->SetSelection(0); m_SizeOption->SetSelection(0);
itemBoxSizer3->Add(m_SizeOption, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(m_SizeOption, 0, wxGROW|wxALL, 5);
...@@ -182,11 +183,10 @@ void WinEDA_PlotPSFrame::CreateControls() ...@@ -182,11 +183,10 @@ void WinEDA_PlotPSFrame::CreateControls()
wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL); wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); itemBoxSizer3->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxString m_PlotPSColorOptionStrings[] = { wxArrayString m_PlotPSColorOptionStrings;
_("B/W"), m_PlotPSColorOptionStrings.Add(_("B/W"));
_("Color") m_PlotPSColorOptionStrings.Add(_("Color"));
}; m_PlotPSColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Plot Color:"), wxDefaultPosition, wxDefaultSize, m_PlotPSColorOptionStrings, 1, wxRA_SPECIFY_COLS );
m_PlotPSColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Plot Color:"), wxDefaultPosition, wxDefaultSize, 2, m_PlotPSColorOptionStrings, 1, wxRA_SPECIFY_COLS );
m_PlotPSColorOption->SetSelection(0); m_PlotPSColorOption->SetSelection(0);
itemStaticBoxSizer6->Add(m_PlotPSColorOption, 0, wxGROW|wxALL, 5); itemStaticBoxSizer6->Add(m_PlotPSColorOption, 0, wxGROW|wxALL, 5);
...@@ -207,7 +207,7 @@ void WinEDA_PlotPSFrame::CreateControls() ...@@ -207,7 +207,7 @@ void WinEDA_PlotPSFrame::CreateControls()
itemButton12->SetForegroundColour(wxColour(179, 0, 0)); itemButton12->SetForegroundColour(wxColour(179, 0, 0));
itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5); itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5);
wxButton* itemButton13 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton13 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton13->SetForegroundColour(wxColour(0, 0, 255)); itemButton13->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer10->Add(itemButton13, 0, wxGROW|wxALL, 5); itemBoxSizer10->Add(itemButton13, 0, wxGROW|wxALL, 5);
...@@ -294,13 +294,13 @@ int Select_PlotAll = TRUE; ...@@ -294,13 +294,13 @@ int Select_PlotAll = TRUE;
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/ */
void WinEDA_PlotPSFrame::OnCloseClick( wxCommandEvent& event ) void WinEDA_PlotPSFrame::OnCancelClick( wxCommandEvent& event )
{ {
InitOptVars(); InitOptVars();
Close(TRUE); EndModal(0);
} }
...@@ -517,3 +517,20 @@ wxPoint StartPos, EndPos; ...@@ -517,3 +517,20 @@ wxPoint StartPos, EndPos;
m_MsgBox->AppendText( wxT("Ok\n")); m_MsgBox->AppendText( wxT("Ok\n"));
} }
/*!
* wxEVT_INIT_DIALOG event handler for ID_DIALOG
*/
void WinEDA_PlotPSFrame::OnInitDialog( wxInitDialogEvent& event )
{
// make the ESC work
m_SizeOption->SetFocus();
////@begin wxEVT_INIT_DIALOG event handler for ID_DIALOG in WinEDA_PlotPSFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_INIT_DIALOG event handler for ID_DIALOG in WinEDA_PlotPSFrame.
}
...@@ -46,7 +46,7 @@ class wxBoxSizer; ...@@ -46,7 +46,7 @@ class wxBoxSizer;
#define ID_PLOT_PS_CURRENT_EXECUTE 10003 #define ID_PLOT_PS_CURRENT_EXECUTE 10003
#define ID_PLOT_PS_ALL_EXECUTE 10004 #define ID_PLOT_PS_ALL_EXECUTE 10004
#define ID_TEXTCTRL 10006 #define ID_TEXTCTRL 10006
#define SYMBOL_WINEDA_PLOTPSFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER #define SYMBOL_WINEDA_PLOTPSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PLOTPSFRAME_TITLE _("EESchema Plot PS") #define SYMBOL_WINEDA_PLOTPSFRAME_TITLE _("EESchema Plot PS")
#define SYMBOL_WINEDA_PLOTPSFRAME_IDNAME ID_DIALOG #define SYMBOL_WINEDA_PLOTPSFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PLOTPSFRAME_SIZE wxSize(400, 300) #define SYMBOL_WINEDA_PLOTPSFRAME_SIZE wxSize(400, 300)
...@@ -83,14 +83,17 @@ public: ...@@ -83,14 +83,17 @@ public:
////@begin WinEDA_PlotPSFrame event handler declarations ////@begin WinEDA_PlotPSFrame event handler declarations
/// wxEVT_INIT_DIALOG event handler for ID_DIALOG
void OnInitDialog( wxInitDialogEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_CURRENT_EXECUTE /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_CURRENT_EXECUTE
void OnPlotPsCurrentExecuteClick( wxCommandEvent& event ); void OnPlotPsCurrentExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_ALL_EXECUTE /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_ALL_EXECUTE
void OnPlotPsAllExecuteClick( wxCommandEvent& event ); void OnPlotPsAllExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCloseClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_PlotPSFrame event handler declarations ////@end WinEDA_PlotPSFrame event handler declarations
......
This diff is collapsed.
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