Commit 698bd331 authored by jean-pierre charras's avatar jean-pierre charras

Dialog enum pads: fix incorrect use of sizers.

parent 80f6a4f2
......@@ -27,6 +27,10 @@
DIALOG_ENUM_PADS::DIALOG_ENUM_PADS( wxWindow* aParent ) :
DIALOG_ENUM_PADS_BASE( aParent )
{
// Calling SetSizeHints after all widgets are built is mandatory
// to set the correct size of the dialog
GetSizer()->SetSizeHints( this );
Center();
}
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -9,43 +9,46 @@
///////////////////////////////////////////////////////////////////////////
DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bPrefixSizer;
bPrefixSizer = new wxBoxSizer( wxHORIZONTAL );
m_lblInfo = new wxStaticText( this, wxID_ANY, _("Pad names are restricted to 4 characters (including number)."), wxDefaultPosition, wxDefaultSize, 0 );
m_lblInfo->Wrap( -1 );
bMainSizer->Add( m_lblInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
bMainSizer->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 );
wxFlexGridSizer* fgSizer;
fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer->AddGrowableCol( 1 );
fgSizer->SetFlexibleDirection( wxBOTH );
fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_lblPadPrefix = new wxStaticText( this, wxID_ANY, _("Pad name prefix:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblPadPrefix->Wrap( -1 );
bPrefixSizer->Add( m_lblPadPrefix, 1, wxALL, 5 );
fgSizer->Add( m_lblPadPrefix, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_padPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_padPrefix->SetMaxLength( 4 );
bPrefixSizer->Add( m_padPrefix, 0, wxALL, 5 );
bMainSizer->Add( bPrefixSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bPadNumSizer;
bPadNumSizer = new wxBoxSizer( wxHORIZONTAL );
fgSizer->Add( m_padPrefix, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_lblPadStartNum = new wxStaticText( this, wxID_ANY, _("First pad number:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblPadStartNum->Wrap( -1 );
bPadNumSizer->Add( m_lblPadStartNum, 1, wxALL, 5 );
fgSizer->Add( m_lblPadStartNum, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_padStartNum = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999, 1 );
bPadNumSizer->Add( m_padStartNum, 0, wxALL, 5 );
fgSizer->Add( m_padStartNum, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bPadNumSizer, 1, wxEXPAND, 5 );
bMainSizer->Add( fgSizer, 1, wxEXPAND|wxALL, 5 );
m_lblInfo = new wxStaticText( this, wxID_ANY, _("Pad names are restricted to 4 characters (including number)."), wxDefaultPosition, wxDefaultSize, 0 );
m_lblInfo->Wrap( 320 );
bMainSizer->Add( m_lblInfo, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK );
......@@ -54,7 +57,7 @@ DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, c
m_stdButtons->AddButton( m_stdButtonsCancel );
m_stdButtons->Realize();
bMainSizer->Add( m_stdButtons, 2, wxEXPAND, 5 );
bMainSizer->Add( m_stdButtons, 0, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -11,6 +11,9 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
......@@ -18,8 +21,9 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
......@@ -29,23 +33,24 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ENUM_PADS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_ENUM_PADS_BASE : public wxDialog
class DIALOG_ENUM_PADS_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_lblInfo;
wxStaticText* m_lblPadPrefix;
wxTextCtrl* m_padPrefix;
wxStaticText* m_lblPadStartNum;
wxSpinCtrl* m_padStartNum;
wxStaticText* m_lblInfo;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel;
public:
DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad enumeration settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,240 ), long style = wxDEFAULT_DIALOG_STYLE );
DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad enumeration settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,187 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ENUM_PADS_BASE();
};
......
......@@ -315,9 +315,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
Zoom_Automatique( false );
}
if( IsGalCanvasActive() )
updateView();
updateView();
m_canvas->Refresh();
GetScreen()->ClrModify();
......@@ -562,10 +560,10 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( m_Draw3DFrame )
m_Draw3DFrame->NewDisplay();
m_canvas->Refresh();
GetScreen()->ClrModify();
updateView();
m_canvas->Refresh();
break;
......
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