Commit 6ba5e406 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Fix a minor issue in fp lib wizard.

Remove a duplicate code for dialog select dir list.
parent 605a9bb5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ set( CVPCB_DIALOGS
    ../pcbnew/dialogs/dialog_fp_plugin_options_base.cpp
    ../pcbnew/dialogs/wizard_add_fplib_base.cpp
    ../pcbnew/dialogs/wizard_add_fplib.cpp
    ../pcbnew/dialogs/dialog_select_dirlist_base.cpp
    )

set( CVPCB_SRCS
+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ set( PCBNEW_DIALOGS
    dialogs/dialog_SVG_print_base.cpp
    dialogs/dialog_select_pretty_lib.cpp
    dialogs/dialog_select_pretty_lib_base.cpp
    dialogs/dialog_select_dirlist_base.cpp
    dialogs/dialog_set_grid.cpp
    dialogs/dialog_set_grid_base.cpp
    dialogs/dialog_target_properties_base.cpp
+9 −3
Original line number Diff line number Diff line
@@ -25,10 +25,12 @@ DIALOG_SELECT_DIRLIST_BASE::DIALOG_SELECT_DIRLIST_BASE( wxWindow* parent, wxWind
	m_dirCtrl = new wxGenericDirCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxDIRCTRL_DIR_ONLY|wxDIRCTRL_MULTIPLE|wxDIRCTRL_SHOW_FILTERS|wxSUNKEN_BORDER, _("*.pretty|*"), 0 );
	
	m_dirCtrl->ShowHidden( false );
	m_dirCtrl->SetMinSize( wxSize( 400,350 ) );
	
	bSizerMain->Add( m_dirCtrl, 1, wxEXPAND | wxALL, 5 );
	
	m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
	m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizerMain->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
	
	m_sdbSizer = new wxStdDialogButtonSizer();
	m_sdbSizerOK = new wxButton( this, wxID_OK );
@@ -37,7 +39,7 @@ DIALOG_SELECT_DIRLIST_BASE::DIALOG_SELECT_DIRLIST_BASE( wxWindow* parent, wxWind
	m_sdbSizer->AddButton( m_sdbSizerCancel );
	m_sdbSizer->Realize();
	
	bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT, 5 );
	bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 );
	
	
	this->SetSizer( bSizerMain );
@@ -48,6 +50,8 @@ DIALOG_SELECT_DIRLIST_BASE::DIALOG_SELECT_DIRLIST_BASE( wxWindow* parent, wxWind
	// Connect Events
	m_dirCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnSelectFolder ), NULL, this );
	m_dirCtrl->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnSelectFolder ), NULL, this );
	m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnCancelClick ), NULL, this );
	m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnOKClick ), NULL, this );
}

DIALOG_SELECT_DIRLIST_BASE::~DIALOG_SELECT_DIRLIST_BASE()
@@ -55,5 +59,7 @@ DIALOG_SELECT_DIRLIST_BASE::~DIALOG_SELECT_DIRLIST_BASE()
	// Disconnect Events
	m_dirCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnSelectFolder ), NULL, this );
	m_dirCtrl->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnSelectFolder ), NULL, this );
	m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnCancelClick ), NULL, this );
	m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SELECT_DIRLIST_BASE::OnOKClick ), NULL, this );
	
}
+7 −7
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
            <property name="minimum_size">400,300</property>
            <property name="name">DIALOG_SELECT_DIRLIST_BASE</property>
            <property name="pos"></property>
            <property name="size">400,300</property>
            <property name="size">400,321</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="title">Select Footprint Library Folder</property>
@@ -216,7 +216,7 @@
                        <property name="maximum_size"></property>
                        <property name="min_size"></property>
                        <property name="minimize_button">0</property>
                        <property name="minimum_size"></property>
                        <property name="minimum_size">400,350</property>
                        <property name="moveable">1</property>
                        <property name="name">m_dirCtrl</property>
                        <property name="pane_border">1</property>
@@ -280,7 +280,7 @@
                </object>
                <object class="sizeritem" expanded="1">
                    <property name="border">5</property>
                    <property name="flag">wxEXPAND | wxALL</property>
                    <property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
                    <property name="proportion">0</property>
                    <object class="wxStaticLine" expanded="1">
                        <property name="BottomDockable">1</property>
@@ -317,7 +317,7 @@
                        <property name="minimize_button">0</property>
                        <property name="minimum_size"></property>
                        <property name="moveable">1</property>
                        <property name="name">m_staticline1</property>
                        <property name="name">m_staticline</property>
                        <property name="pane_border">1</property>
                        <property name="pane_position"></property>
                        <property name="pane_size"></property>
@@ -361,7 +361,7 @@
                </object>
                <object class="sizeritem" expanded="1">
                    <property name="border">5</property>
                    <property name="flag">wxALIGN_RIGHT</property>
                    <property name="flag">wxALIGN_RIGHT|wxALL</property>
                    <property name="proportion">0</property>
                    <object class="wxStdDialogButtonSizer" expanded="1">
                        <property name="Apply">0</property>
@@ -376,11 +376,11 @@
                        <property name="name">m_sdbSizer</property>
                        <property name="permission">protected</property>
                        <event name="OnApplyButtonClick"></event>
                        <event name="OnCancelButtonClick"></event>
                        <event name="OnCancelButtonClick">OnCancelClick</event>
                        <event name="OnContextHelpButtonClick"></event>
                        <event name="OnHelpButtonClick"></event>
                        <event name="OnNoButtonClick"></event>
                        <event name="OnOKButtonClick"></event>
                        <event name="OnOKButtonClick">OnOKClick</event>
                        <event name="OnSaveButtonClick"></event>
                        <event name="OnYesButtonClick"></event>
                    </object>
+4 −2
Original line number Diff line number Diff line
@@ -39,18 +39,20 @@ class DIALOG_SELECT_DIRLIST_BASE : public DIALOG_SHIM
	protected:
		wxStaticText* m_staticText;
		wxGenericDirCtrl* m_dirCtrl;
		wxStaticLine* m_staticline1;
		wxStaticLine* m_staticline;
		wxStdDialogButtonSizer* m_sdbSizer;
		wxButton* m_sdbSizerOK;
		wxButton* m_sdbSizerCancel;
		
		// Virtual event handlers, overide them in your derived class
		virtual void OnSelectFolder( wxTreeEvent& event ) { event.Skip(); }
		virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
		
	
	public:
		
		DIALOG_SELECT_DIRLIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Footprint Library Folder"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,300 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		DIALOG_SELECT_DIRLIST_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Footprint Library Folder"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,321 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		~DIALOG_SELECT_DIRLIST_BASE();
	
};
Loading