Commit 625ed22f authored by dickelbeck's avatar dickelbeck

portable SetFocus() example

parent 10b14fea
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_track_options.cpp // Name: dialog_track_options.cpp
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 24/02/2006 20:58:54 // Created: 24/02/2006 20:58:54
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54 // Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54
...@@ -47,10 +47,12 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbTracksDialog, wxDialog ) ...@@ -47,10 +47,12 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbTracksDialog, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_PcbTracksDialog, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PcbTracksDialog, wxDialog )
////@begin WinEDA_PcbTracksDialog event table entries ////@begin WinEDA_PcbTracksDialog event table entries
EVT_BUTTON( wxID_OK, WinEDA_PcbTracksDialog::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_PcbTracksDialog::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_PcbTracksDialog::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_PcbTracksDialog::OnCancelClick )
EVT_ACTIVATE( WinEDA_PcbTracksDialog::OnActivate )
////@end WinEDA_PcbTracksDialog event table entries ////@end WinEDA_PcbTracksDialog event table entries
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -69,6 +71,22 @@ WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindo ...@@ -69,6 +71,22 @@ WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindo
Create(parent, id, caption, pos, size, style); Create(parent, id, caption, pos, size, style);
} }
/**
* Function OnActivate
* gets control when the dialog becomes activated.
* After creation, not during creation.
*/
void WinEDA_PcbTracksDialog::OnActivate( wxActivateEvent& event )
{
m_OptViaSize->SetFocus();
// deselect the existing text, seems SetFocus() wants to emulate Microsoft, which is not desireable here.
m_OptViaSize->SetSelection(0,0);
event.Skip();
}
/*! /*!
* WinEDA_PcbTracksDialog creator * WinEDA_PcbTracksDialog creator
*/ */
...@@ -108,9 +126,9 @@ bool WinEDA_PcbTracksDialog::Create( wxWindow* parent, wxWindowID id, const wxSt ...@@ -108,9 +126,9 @@ bool WinEDA_PcbTracksDialog::Create( wxWindow* parent, wxWindowID id, const wxSt
*/ */
void WinEDA_PcbTracksDialog::CreateControls() void WinEDA_PcbTracksDialog::CreateControls()
{ {
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_PcbTracksDialog content construction ////@begin WinEDA_PcbTracksDialog content construction
// Generated by DialogBlocks, 25/02/2006 08:02:26 (unregistered) // Generated by DialogBlocks, 25/02/2006 08:02:26 (unregistered)
...@@ -266,7 +284,7 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions(wxCommandEvent& event) ...@@ -266,7 +284,7 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions(wxCommandEvent& event)
ReturnValueFromTextCtrl(*m_OptCustomViaDrill, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl(*m_OptCustomViaDrill, m_Parent->m_InternalUnits);
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_CurrentTrackWidth =
ReturnValueFromTextCtrl(*m_OptTrackWidth, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl(*m_OptTrackWidth, m_Parent->m_InternalUnits);
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_TrackClearence =
ReturnValueFromTextCtrl(*m_OptTrackClearance, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl(*m_OptTrackClearance, m_Parent->m_InternalUnits);
g_DesignSettings.m_MaskMargin = g_DesignSettings.m_MaskMargin =
...@@ -367,7 +385,7 @@ void WinEDA_PcbTracksDialog::OnCancelClick( wxCommandEvent& event ) ...@@ -367,7 +385,7 @@ void WinEDA_PcbTracksDialog::OnCancelClick( wxCommandEvent& event )
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog.
// Before editing this code, remove the block markers. // Before editing this code, remove the block markers.
event.Skip(); event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog.
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_track_options.h // Name: dialog_track_options.h
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 24/02/2006 20:58:54 // Created: 24/02/2006 20:58:54
// RCS-ID: // RCS-ID:
// Copyright: License GNU // Copyright: License GNU
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54 // Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
*/ */
class WinEDA_PcbTracksDialog: public wxDialog class WinEDA_PcbTracksDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_PcbTracksDialog ) DECLARE_DYNAMIC_CLASS( WinEDA_PcbTracksDialog )
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
...@@ -88,6 +88,13 @@ public: ...@@ -88,6 +88,13 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
/**
* Function OnActivate
* gets control when the dialog becomes activated.
* After creation, not during creation.
*/
void OnActivate( wxActivateEvent& event );
////@end WinEDA_PcbTracksDialog event handler declarations ////@end WinEDA_PcbTracksDialog event handler declarations
////@begin WinEDA_PcbTracksDialog member function declarations ////@begin WinEDA_PcbTracksDialog member function declarations
......
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