21 changed files with 843 additions and 1543 deletions
-
27common/footprint_info.cpp
-
39include/footprint_info.h
-
12include/pcb_base_frame.h
-
5pcbnew/CMakeLists.txt
-
256pcbnew/dialogs/dialog_choose_footprint.cpp
-
154pcbnew/dialogs/dialog_choose_footprint.h
-
157pcbnew/dialogs/dialog_get_footprint.cpp
-
82pcbnew/dialogs/dialog_get_footprint.h
-
100pcbnew/dialogs/dialog_get_footprint_base.cpp
-
849pcbnew/dialogs/dialog_get_footprint_base.fbp
-
67pcbnew/dialogs/dialog_get_footprint_base.h
-
2pcbnew/footprint_edit_frame.h
-
2pcbnew/footprint_editor_utils.cpp
-
2pcbnew/footprint_viewer_frame.cpp
-
75pcbnew/fp_tree_model_adapter.cpp
-
61pcbnew/fp_tree_model_adapter.h
-
141pcbnew/generate_footprint_info.cpp
-
35pcbnew/generate_footprint_info.h
-
306pcbnew/load_select_footprint.cpp
-
2pcbnew/onleftclick.cpp
-
2pcbnew/tools/pcb_editor_control.cpp
@ -0,0 +1,256 @@ |
|||||
|
/*
|
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2014 Henner Zeller <h.zeller@acm.org> |
||||
|
* Copyright (C) 2016-2018 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software; you can redistribute it and/or |
||||
|
* modify it under the terms of the GNU General Public License |
||||
|
* as published by the Free Software Foundation; either version 2 |
||||
|
* of the License, or (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program; if not, you may find one here: |
||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
|
* or you may write to the Free Software Foundation, Inc., |
||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
||||
|
*/ |
||||
|
|
||||
|
#include <dialog_choose_footprint.h>
|
||||
|
|
||||
|
#include <algorithm>
|
||||
|
#include <set>
|
||||
|
#include <wx/utils.h>
|
||||
|
|
||||
|
#include <wx/button.h>
|
||||
|
#include <wx/dataview.h>
|
||||
|
#include <wx/panel.h>
|
||||
|
#include <wx/sizer.h>
|
||||
|
#include <wx/splitter.h>
|
||||
|
#include <wx/timer.h>
|
||||
|
#include <wx/utils.h>
|
||||
|
|
||||
|
#include <pcb_base_frame.h>
|
||||
|
#include <fp_lib_table.h>
|
||||
|
#include <widgets/lib_tree.h>
|
||||
|
#include <widgets/footprint_preview_widget.h>
|
||||
|
#include <widgets/footprint_select_widget.h>
|
||||
|
|
||||
|
|
||||
|
wxSize DIALOG_CHOOSE_FOOTPRINT::m_last_dlg_size( -1, -1 ); |
||||
|
int DIALOG_CHOOSE_FOOTPRINT::m_h_sash_pos = 0; |
||||
|
int DIALOG_CHOOSE_FOOTPRINT::m_v_sash_pos = 0; |
||||
|
|
||||
|
|
||||
|
DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT( PCB_BASE_FRAME* aParent, |
||||
|
const wxString& aTitle, |
||||
|
FP_TREE_MODEL_ADAPTER::PTR& aAdapter, |
||||
|
bool aAllowBrowser ) |
||||
|
: DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize, |
||||
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), |
||||
|
m_browser_button( nullptr ), |
||||
|
m_hsplitter( nullptr ), |
||||
|
m_vsplitter( nullptr ), |
||||
|
m_parent( aParent ), |
||||
|
m_external_browser_requested( false ) |
||||
|
{ |
||||
|
auto sizer = new wxBoxSizer( wxVERTICAL ); |
||||
|
wxHtmlWindow* details = nullptr; |
||||
|
|
||||
|
m_vsplitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, |
||||
|
wxSP_LIVE_UPDATE | wxSP_3DSASH ); |
||||
|
|
||||
|
m_hsplitter = new wxSplitterWindow( m_vsplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, |
||||
|
wxSP_LIVE_UPDATE | wxSP_3DSASH ); |
||||
|
|
||||
|
//Avoid the splitter window being assigned as the Parent to additional windows
|
||||
|
m_hsplitter->SetExtraStyle( wxWS_EX_TRANSIENT ); |
||||
|
|
||||
|
auto detailsPanel = new wxPanel( m_vsplitter ); |
||||
|
auto detailsSizer = new wxBoxSizer( wxVERTICAL ); |
||||
|
detailsPanel->SetSizer( detailsSizer ); |
||||
|
|
||||
|
details = new wxHtmlWindow( detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, |
||||
|
wxHW_SCROLLBAR_AUTO | wxRAISED_BORDER ); |
||||
|
detailsSizer->Add( details, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 ); |
||||
|
detailsPanel->Layout(); |
||||
|
detailsSizer->Fit( detailsPanel ); |
||||
|
|
||||
|
m_vsplitter->SetSashGravity( 0.5 ); |
||||
|
m_vsplitter->SetMinimumPaneSize( 20 ); |
||||
|
m_vsplitter->SplitHorizontally( m_hsplitter, detailsPanel ); |
||||
|
|
||||
|
sizer->Add( m_vsplitter, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 5 ); |
||||
|
|
||||
|
m_tree = new LIB_TREE( m_hsplitter, Prj().PcbFootprintLibs(), aAdapter, |
||||
|
LIB_TREE::WIDGETS::ALL, details ); |
||||
|
|
||||
|
m_hsplitter->SetSashGravity( 0.8 ); |
||||
|
m_hsplitter->SetMinimumPaneSize( 20 ); |
||||
|
m_hsplitter->SplitVertically( m_tree, ConstructRightPanel( m_hsplitter ) ); |
||||
|
|
||||
|
m_dbl_click_timer = new wxTimer( this ); |
||||
|
|
||||
|
auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); |
||||
|
|
||||
|
if( aAllowBrowser ) |
||||
|
{ |
||||
|
m_browser_button = new wxButton( this, wxID_ANY, _( "Select with Browser" ) ); |
||||
|
buttonsSizer->Add( m_browser_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 10 ); |
||||
|
} |
||||
|
|
||||
|
auto sdbSizer = new wxStdDialogButtonSizer(); |
||||
|
auto okButton = new wxButton( this, wxID_OK ); |
||||
|
auto cancelButton = new wxButton( this, wxID_CANCEL ); |
||||
|
sdbSizer->AddButton( okButton ); |
||||
|
sdbSizer->AddButton( cancelButton ); |
||||
|
sdbSizer->Realize(); |
||||
|
|
||||
|
buttonsSizer->Add( sdbSizer, 1, wxALL, 5 ); |
||||
|
|
||||
|
sizer->Add( buttonsSizer, 0, wxEXPAND | wxLEFT, 5 ); |
||||
|
SetSizer( sizer ); |
||||
|
|
||||
|
Bind( wxEVT_TIMER, &DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer, this, m_dbl_click_timer->GetId() ); |
||||
|
Bind( COMPONENT_PRESELECTED, &DIALOG_CHOOSE_FOOTPRINT::OnComponentPreselected, this ); |
||||
|
Bind( COMPONENT_SELECTED, &DIALOG_CHOOSE_FOOTPRINT::OnComponentSelected, this ); |
||||
|
|
||||
|
if( m_browser_button ) |
||||
|
m_browser_button->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser, this ); |
||||
|
|
||||
|
Layout(); |
||||
|
|
||||
|
// We specify the width of the right window (m_symbol_view_panel), because specify
|
||||
|
// the width of the left window does not work as expected when SetSashGravity() is called
|
||||
|
m_hsplitter->SetSashPosition( m_h_sash_pos ? m_h_sash_pos : HorizPixelsFromDU( 220 ) ); |
||||
|
|
||||
|
if( m_vsplitter ) |
||||
|
m_vsplitter->SetSashPosition( m_v_sash_pos ? m_v_sash_pos : VertPixelsFromDU( 230 ) ); |
||||
|
|
||||
|
if( m_last_dlg_size == wxSize( -1, -1 ) ) |
||||
|
SetSizeInDU( 440, 340 ); |
||||
|
else |
||||
|
SetSize( m_last_dlg_size ); |
||||
|
|
||||
|
SetInitialFocus( m_tree ); |
||||
|
okButton->SetDefault(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
DIALOG_CHOOSE_FOOTPRINT::~DIALOG_CHOOSE_FOOTPRINT() |
||||
|
{ |
||||
|
Unbind( wxEVT_TIMER, &DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer, this ); |
||||
|
Unbind( COMPONENT_PRESELECTED, &DIALOG_CHOOSE_FOOTPRINT::OnComponentPreselected, this ); |
||||
|
Unbind( COMPONENT_SELECTED, &DIALOG_CHOOSE_FOOTPRINT::OnComponentSelected, this ); |
||||
|
|
||||
|
if( m_browser_button ) |
||||
|
m_browser_button->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser, this ); |
||||
|
|
||||
|
// I am not sure the following two lines are necessary,
|
||||
|
// but they will not hurt anyone
|
||||
|
m_dbl_click_timer->Stop(); |
||||
|
delete m_dbl_click_timer; |
||||
|
|
||||
|
m_last_dlg_size = GetSize(); |
||||
|
m_h_sash_pos = m_hsplitter->GetSashPosition(); |
||||
|
|
||||
|
if( m_vsplitter ) |
||||
|
m_v_sash_pos = m_vsplitter->GetSashPosition(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
wxPanel* DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel( wxWindow* aParent ) |
||||
|
{ |
||||
|
auto panel = new wxPanel( aParent ); |
||||
|
auto sizer = new wxBoxSizer( wxVERTICAL ); |
||||
|
|
||||
|
m_preview_ctrl = new FOOTPRINT_PREVIEW_WIDGET( panel, Kiway() ); |
||||
|
sizer->Add( m_preview_ctrl, 1, wxEXPAND | wxBOTTOM | wxRIGHT, 5 ); |
||||
|
|
||||
|
panel->SetSizer( sizer ); |
||||
|
panel->Layout(); |
||||
|
sizer->Fit( panel ); |
||||
|
|
||||
|
return panel; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
LIB_ID DIALOG_CHOOSE_FOOTPRINT::GetSelectedLibId() const |
||||
|
{ |
||||
|
return m_tree->GetSelectedLibId(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
void DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser( wxCommandEvent& aEvent ) |
||||
|
{ |
||||
|
m_external_browser_requested = true; |
||||
|
EndQuasiModal( wxID_OK ); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
void DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer( wxTimerEvent& aEvent ) |
||||
|
{ |
||||
|
// Hack handler because of eaten MouseUp event. See
|
||||
|
// DIALOG_CHOOSE_FOOTPRINT::OnComponentSelected for the beginning
|
||||
|
// of this spaghetti noodle.
|
||||
|
|
||||
|
auto state = wxGetMouseState(); |
||||
|
|
||||
|
if( state.LeftIsDown() ) |
||||
|
{ |
||||
|
// Mouse hasn't been raised yet, so fire the timer again. Otherwise the
|
||||
|
// purpose of this timer is defeated.
|
||||
|
m_dbl_click_timer->StartOnce( DIALOG_CHOOSE_FOOTPRINT::DblClickDelay ); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
EndQuasiModal( wxID_OK ); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
void DIALOG_CHOOSE_FOOTPRINT::OnComponentPreselected( wxCommandEvent& aEvent ) |
||||
|
{ |
||||
|
if( !m_preview_ctrl || !m_preview_ctrl->IsInitialized() ) |
||||
|
return; |
||||
|
|
||||
|
LIB_ID lib_id = m_tree->GetSelectedLibId(); |
||||
|
|
||||
|
if( !lib_id.IsValid() ) |
||||
|
{ |
||||
|
m_preview_ctrl->SetStatusText( _( "No footprint selected" ) ); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
m_preview_ctrl->ClearStatus(); |
||||
|
m_preview_ctrl->CacheFootprint( lib_id ); |
||||
|
m_preview_ctrl->DisplayFootprint( lib_id ); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
void DIALOG_CHOOSE_FOOTPRINT::OnComponentSelected( wxCommandEvent& aEvent ) |
||||
|
{ |
||||
|
if( m_tree->GetSelectedLibId().IsValid() ) |
||||
|
{ |
||||
|
// Got a selection. We can't just end the modal dialog here, because
|
||||
|
// wx leaks some events back to the parent window (in particular, the
|
||||
|
// MouseUp following a double click).
|
||||
|
//
|
||||
|
// NOW, here's where it gets really fun. wxTreeListCtrl eats MouseUp.
|
||||
|
// This isn't really feasible to bypass without a fully custom
|
||||
|
// wxDataViewCtrl implementation, and even then might not be fully
|
||||
|
// possible (docs are vague). To get around this, we use a one-shot
|
||||
|
// timer to schedule the dialog close.
|
||||
|
//
|
||||
|
// See DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer for the other end of this
|
||||
|
// spaghetti noodle.
|
||||
|
m_dbl_click_timer->StartOnce( DIALOG_CHOOSE_FOOTPRINT::DblClickDelay ); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,154 @@ |
|||||
|
/* -*- c++ -*- |
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2014 Henner Zeller <h.zeller@acm.org> |
||||
|
* Copyright (C) 2014-2018 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software; you can redistribute it and/or |
||||
|
* modify it under the terms of the GNU General Public License |
||||
|
* as published by the Free Software Foundation; either version 2 |
||||
|
* of the License, or (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program; if not, you may find one here: |
||||
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
||||
|
* or you may search the http://www.gnu.org website for the version 2 license, |
||||
|
* or you may write to the Free Software Foundation, Inc., |
||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
||||
|
*/ |
||||
|
#ifndef DIALOG_CHOOSE_FOOTPRINT_H |
||||
|
#define DIALOG_CHOOSE_FOOTPRINT_H |
||||
|
|
||||
|
#include "dialog_shim.h" |
||||
|
#include <fp_tree_model_adapter.h> |
||||
|
#include <footprint_info.h> |
||||
|
#include <widgets/footprint_preview_widget.h> |
||||
|
|
||||
|
class wxStaticBitmap; |
||||
|
class wxTextCtrl; |
||||
|
class wxStdDialogButtonSizer; |
||||
|
class wxDataViewCtrl; |
||||
|
class wxHtmlWindow; |
||||
|
class wxHtmlLinkEvent; |
||||
|
class wxPanel; |
||||
|
class wxChoice; |
||||
|
class wxButton; |
||||
|
class wxTimer; |
||||
|
|
||||
|
class PCB_BASE_FRAME; |
||||
|
class LIB_TREE; |
||||
|
class MODULE; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Dialog class to select a footprint from the libraries. This is the master |
||||
|
* View class in a Model-View-Adapter (mediated MVC) architecture. The other |
||||
|
* pieces are in: |
||||
|
* |
||||
|
* - Adapter: CMP_TREE_MODEL_ADAPTER in common/cmp_tree_model_adapter.h |
||||
|
* - Model: CMP_TREE_NODE and descendants in common/cmp_tree_model.h |
||||
|
* |
||||
|
* Because everything is tied together in the adapter class, see that file |
||||
|
* for thorough documentation. A simple example usage follows: |
||||
|
* |
||||
|
* // Create the adapter class |
||||
|
* auto adapter( FP_TREE_MODEL_ADAPTER::Create( Prj().PcbFootprintLibs() ) ); |
||||
|
* |
||||
|
* // Perform any configuration of adapter properties here |
||||
|
* adapter->SetPreselectNode( "LIB_NICKNAME", "FP_NAME", 2 ); |
||||
|
* |
||||
|
* // Initialize model from #FP_LIB_TABLE |
||||
|
* libNicknames = libs->GetLogicalLibs(); |
||||
|
* |
||||
|
* for( auto nickname : libNicknames ) |
||||
|
* { |
||||
|
* adapter->AddLibrary( nickname ); |
||||
|
* } |
||||
|
* |
||||
|
* // Create and display dialog |
||||
|
* DIALOG_CHOOSE_FOOTPRINT dlg( this, title, adapter, 1 ); |
||||
|
* bool selected = ( dlg.ShowModal() != wxID_CANCEL ); |
||||
|
* |
||||
|
* // Receive part |
||||
|
* if( selected ) |
||||
|
* { |
||||
|
* int unit; |
||||
|
* #LIB_ID id = dlg.GetSelectedAlias( &unit ); |
||||
|
* do_something( id, unit ); |
||||
|
* } |
||||
|
* |
||||
|
*/ |
||||
|
class DIALOG_CHOOSE_FOOTPRINT : public DIALOG_SHIM |
||||
|
{ |
||||
|
public: |
||||
|
/** |
||||
|
* Create dialog to choose component. |
||||
|
* |
||||
|
* @param aParent a PCB_BASE_FRAME parent window. |
||||
|
* @param aAdapter FP_TREE_MODEL_ADAPTER::PTR. See CMP_TREE_MODEL_ADAPTER |
||||
|
* for documentation. |
||||
|
*/ |
||||
|
DIALOG_CHOOSE_FOOTPRINT( PCB_BASE_FRAME* aParent, const wxString& aTitle, |
||||
|
FP_TREE_MODEL_ADAPTER::PTR& aAdapter, bool aAllowBrowser ); |
||||
|
|
||||
|
~DIALOG_CHOOSE_FOOTPRINT(); |
||||
|
|
||||
|
/** |
||||
|
* To be called after this dialog returns from ShowModal(). |
||||
|
* |
||||
|
* @return the #LIB_ID of the symbol that has been selected. |
||||
|
*/ |
||||
|
LIB_ID GetSelectedLibId() const; |
||||
|
|
||||
|
/** Function IsExternalBrowserSelected |
||||
|
* |
||||
|
* @return true, iff the user pressed the thumbnail view of the component to |
||||
|
* launch the component browser. |
||||
|
*/ |
||||
|
bool IsExternalBrowserSelected() const |
||||
|
{ |
||||
|
return m_external_browser_requested; |
||||
|
} |
||||
|
|
||||
|
protected: |
||||
|
static constexpr int DblClickDelay = 100; // milliseconds |
||||
|
|
||||
|
wxPanel* ConstructRightPanel( wxWindow* aParent ); |
||||
|
|
||||
|
void OnCloseTimer( wxTimerEvent& aEvent ); |
||||
|
void OnUseBrowser( wxCommandEvent& aEvent ); |
||||
|
|
||||
|
void OnComponentPreselected( wxCommandEvent& aEvent ); |
||||
|
|
||||
|
/** |
||||
|
* Handle the selection of an item. This is called when either the search |
||||
|
* box or the tree receive an Enter, or the tree receives a double click. |
||||
|
* If the item selected is a category, it is expanded or collapsed; if it |
||||
|
* is a component, the component is picked. |
||||
|
*/ |
||||
|
void OnComponentSelected( wxCommandEvent& aEvent ); |
||||
|
|
||||
|
wxTimer* m_dbl_click_timer; |
||||
|
wxButton* m_browser_button; |
||||
|
wxSplitterWindow* m_hsplitter; |
||||
|
wxSplitterWindow* m_vsplitter; |
||||
|
|
||||
|
static int m_h_sash_pos; // remember sash positions during a session |
||||
|
static int m_v_sash_pos; |
||||
|
|
||||
|
FOOTPRINT_PREVIEW_WIDGET* m_preview_ctrl; |
||||
|
LIB_TREE* m_tree; |
||||
|
|
||||
|
PCB_BASE_FRAME* m_parent; |
||||
|
bool m_external_browser_requested; |
||||
|
|
||||
|
// Remember the dialog size during a session |
||||
|
static wxSize m_last_dlg_size; |
||||
|
}; |
||||
|
|
||||
|
#endif /* DIALOG_CHOOSE_FOOTPRINT_H */ |
||||
@ -1,157 +0,0 @@ |
|||||
/*
|
|
||||
* This program source code file is part of KiCad, a free EDA CAD application. |
|
||||
* |
|
||||
* Copyright (C) 2010-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see CHANGELOG.TXT for contributors. |
|
||||
* |
|
||||
* This program is free software; you can redistribute it and/or |
|
||||
* modify it under the terms of the GNU General Public License |
|
||||
* as published by the Free Software Foundation; either version 2 |
|
||||
* of the License, or (at your option) any later version. |
|
||||
* |
|
||||
* This program is distributed in the hope that it will be useful, |
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
* GNU General Public License for more details. |
|
||||
* |
|
||||
* You should have received a copy of the GNU General Public License |
|
||||
* along with this program; if not, you may find one here: |
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
||||
* or you may write to the Free Software Foundation, Inc., |
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|
||||
*/ |
|
||||
|
|
||||
#include <fctsys.h>
|
|
||||
#include <common.h>
|
|
||||
#include <macros.h>
|
|
||||
#include <draw_frame.h>
|
|
||||
#include <dialogs/dialog_get_footprint.h>
|
|
||||
#include <lib_id.h>
|
|
||||
#include <pcb_base_frame.h>
|
|
||||
#include <lib_table_base.h>
|
|
||||
|
|
||||
|
|
||||
/****************************************************************************/ |
|
||||
/* Show a dialog frame to choose a name from an history list, or a new name */ |
|
||||
/* to select a module */ |
|
||||
/****************************************************************************/ |
|
||||
|
|
||||
static wxArrayString s_HistoryList; |
|
||||
static unsigned s_HistoryMaxCount = 8; // Max number of items displayed in history list
|
|
||||
|
|
||||
|
|
||||
DIALOG_GET_FOOTPRINT::DIALOG_GET_FOOTPRINT( PCB_BASE_FRAME* parent, bool aShowBrowseButton ) : |
|
||||
DIALOG_GET_FOOTPRINT_BASE( parent, -1 ), |
|
||||
m_frame( parent ) |
|
||||
{ |
|
||||
|
|
||||
m_Text = wxEmptyString; |
|
||||
m_selectByBrowser = false; |
|
||||
m_selectionIsKeyword = false; |
|
||||
|
|
||||
for( size_t ii = 0; ii < s_HistoryList.size(); ++ii ) |
|
||||
{ |
|
||||
LIB_ID fpid; |
|
||||
fpid.Parse( s_HistoryList[ ii ], LIB_ID::ID_PCB ); |
|
||||
|
|
||||
if( m_frame->CheckFootprint( fpid ) ) |
|
||||
m_historyList->Append( s_HistoryList[ ii ] ); |
|
||||
} |
|
||||
|
|
||||
m_buttonBrowse->Show( aShowBrowseButton ); |
|
||||
m_buttonBrowse->Enable( aShowBrowseButton ); |
|
||||
|
|
||||
m_sdbSizerOK->SetDefault(); |
|
||||
|
|
||||
m_textCmpNameCtrl->SetFocus(); |
|
||||
GetSizer()->Fit( this ); |
|
||||
GetSizer()->SetSizeHints( this ); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
void DIALOG_GET_FOOTPRINT::OnHistoryClick( wxCommandEvent& aEvent ) |
|
||||
{ |
|
||||
m_textCmpNameCtrl->SetValue( m_historyList->GetStringSelection() ); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
void DIALOG_GET_FOOTPRINT::Accept( wxCommandEvent& aEvent ) |
|
||||
{ |
|
||||
m_selectionIsKeyword = false; |
|
||||
switch( aEvent.GetId() ) |
|
||||
{ |
|
||||
case ID_SEL_BY_LISTBOX: |
|
||||
m_Text = m_historyList->GetStringSelection(); |
|
||||
break; |
|
||||
|
|
||||
case wxID_OK: |
|
||||
if( m_historyList->HasFocus() ) |
|
||||
m_Text = m_historyList->GetStringSelection(); |
|
||||
else |
|
||||
m_Text = m_textCmpNameCtrl->GetValue(); |
|
||||
break; |
|
||||
|
|
||||
case ID_ACCEPT_KEYWORD: |
|
||||
m_selectionIsKeyword = true; |
|
||||
m_Text = m_textCmpNameCtrl->GetValue(); |
|
||||
break; |
|
||||
|
|
||||
case ID_LIST_ALL: |
|
||||
m_Text = wxT( "*" ); |
|
||||
break; |
|
||||
|
|
||||
case ID_BROWSE: |
|
||||
m_Text = wxEmptyString; |
|
||||
m_selectByBrowser = true; |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
m_Text.Trim( false ); // Remove blanks at beginning
|
|
||||
m_Text.Trim( true ); // Remove blanks at end
|
|
||||
|
|
||||
// Put an wxID_OK event through the dialog infrastrucutre
|
|
||||
aEvent.SetEventType( wxEVT_COMMAND_BUTTON_CLICKED ); |
|
||||
aEvent.SetId( wxID_OK ); |
|
||||
aEvent.Skip(); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
// Return the component name selected by the dialog
|
|
||||
wxString DIALOG_GET_FOOTPRINT::GetComponentName( void ) |
|
||||
{ |
|
||||
return m_Text; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Initialize the default component name default choice
|
|
||||
*/ |
|
||||
void DIALOG_GET_FOOTPRINT::SetComponentName( const wxString& name ) |
|
||||
{ |
|
||||
if( m_textCmpNameCtrl ) |
|
||||
{ |
|
||||
m_textCmpNameCtrl->SetValue( name ); |
|
||||
m_textCmpNameCtrl->SetSelection( -1, -1 ); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/*
|
|
||||
* Add the string "aName" to the history list aHistoryList |
|
||||
*/ |
|
||||
void AddHistoryComponentName( const wxString& aName ) |
|
||||
{ |
|
||||
// Remove duplicates
|
|
||||
for( int ii = s_HistoryList.GetCount() - 1; ii >= 0; --ii ) |
|
||||
{ |
|
||||
if( s_HistoryList[ ii ] == aName ) |
|
||||
s_HistoryList.RemoveAt( (size_t) ii ); |
|
||||
} |
|
||||
|
|
||||
// Add the new name at the beginning of the history list
|
|
||||
s_HistoryList.Insert( aName, 0 ); |
|
||||
|
|
||||
// Remove extra names
|
|
||||
while( s_HistoryList.GetCount() >= s_HistoryMaxCount ) |
|
||||
s_HistoryList.RemoveAt( s_HistoryList.GetCount() - 1 ); |
|
||||
} |
|
||||
@ -1,82 +0,0 @@ |
|||||
/* |
|
||||
* This program source code file is part of KiCad, a free EDA CAD application. |
|
||||
* |
|
||||
* Copyright (C) 2010-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see CHANGELOG.TXT for contributors. |
|
||||
* |
|
||||
* This program is free software; you can redistribute it and/or |
|
||||
* modify it under the terms of the GNU General Public License |
|
||||
* as published by the Free Software Foundation; either version 2 |
|
||||
* of the License, or (at your option) any later version. |
|
||||
* |
|
||||
* This program is distributed in the hope that it will be useful, |
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
* GNU General Public License for more details. |
|
||||
* |
|
||||
* You should have received a copy of the GNU General Public License |
|
||||
* along with this program; if not, you may find one here: |
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|
||||
* or you may search the http://www.gnu.org website for the version 2 license, |
|
||||
* or you may write to the Free Software Foundation, Inc., |
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
#ifndef __INCLUDE_DIALOG_GET_COMPONENT_H__ |
|
||||
#define __INCLUDE_DIALOG_GET_COMPONENT_H__ |
|
||||
|
|
||||
#include "dialog_get_footprint_base.h" |
|
||||
|
|
||||
class PCB_BASE_FRAME; |
|
||||
|
|
||||
void AddHistoryComponentName( const wxString& Name ); |
|
||||
|
|
||||
|
|
||||
/* Dialog frame to choose a component name */ |
|
||||
class DIALOG_GET_FOOTPRINT : public DIALOG_GET_FOOTPRINT_BASE |
|
||||
{ |
|
||||
private: |
|
||||
PCB_BASE_FRAME* m_frame; |
|
||||
wxString m_Text; |
|
||||
bool m_selectionIsKeyword; |
|
||||
bool m_selectByBrowser; |
|
||||
|
|
||||
public: |
|
||||
// Constructor and destructor |
|
||||
DIALOG_GET_FOOTPRINT( PCB_BASE_FRAME* parent, bool aShowBrowseButton ); |
|
||||
~DIALOG_GET_FOOTPRINT() override {}; |
|
||||
|
|
||||
/** |
|
||||
* Function GetComponentName |
|
||||
* @return the selection (name or keyword) |
|
||||
*/ |
|
||||
wxString GetComponentName(); |
|
||||
|
|
||||
/** |
|
||||
* Function IsKeyword |
|
||||
* @return true if the returned string is a keyword |
|
||||
*/ |
|
||||
bool IsKeyword() |
|
||||
{ |
|
||||
return m_selectionIsKeyword; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Function SelectByBrowser |
|
||||
* @return true if the footprint browser should be shown to select the footprint |
|
||||
*/ |
|
||||
bool SelectByBrowser() |
|
||||
{ |
|
||||
return m_selectByBrowser; |
|
||||
} |
|
||||
|
|
||||
void SetComponentName( const wxString& name ); |
|
||||
|
|
||||
private: |
|
||||
void OnHistoryClick( wxCommandEvent& aEvent ) override; |
|
||||
void Accept( wxCommandEvent& aEvent ) override; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
#endif /* __INCLUDE_DIALOG_GET_COMPONENT_H__ */ |
|
||||
@ -1,100 +0,0 @@ |
|||||
///////////////////////////////////////////////////////////////////////////
|
|
||||
// C++ code generated with wxFormBuilder (version Apr 20 2018)
|
|
||||
// http://www.wxformbuilder.org/
|
|
||||
//
|
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
|
||||
///////////////////////////////////////////////////////////////////////////
|
|
||||
|
|
||||
#include "dialog_get_footprint_base.h"
|
|
||||
|
|
||||
///////////////////////////////////////////////////////////////////////////
|
|
||||
|
|
||||
DIALOG_GET_FOOTPRINT_BASE::DIALOG_GET_FOOTPRINT_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* bSizerMain; |
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL ); |
|
||||
|
|
||||
wxBoxSizer* bSizerUpper; |
|
||||
bSizerUpper = new wxBoxSizer( wxHORIZONTAL ); |
|
||||
|
|
||||
wxBoxSizer* bSizerLeft; |
|
||||
bSizerLeft = new wxBoxSizer( wxVERTICAL ); |
|
||||
|
|
||||
m_staticTextName = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
m_staticTextName->Wrap( -1 ); |
|
||||
bSizerLeft->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|
||||
|
|
||||
m_textCmpNameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
bSizerLeft->Add( m_textCmpNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|
||||
|
|
||||
m_staticTextHistory = new wxStaticText( this, wxID_ANY, _("History list:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
m_staticTextHistory->Wrap( -1 ); |
|
||||
bSizerLeft->Add( m_staticTextHistory, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|
||||
|
|
||||
m_historyList = new wxListBox( this, ID_SEL_BY_LISTBOX, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
|
||||
m_historyList->SetMinSize( wxSize( 200,100 ) ); |
|
||||
|
|
||||
bSizerLeft->Add( m_historyList, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|
||||
|
|
||||
|
|
||||
bSizerUpper->Add( bSizerLeft, 1, wxEXPAND, 5 ); |
|
||||
|
|
||||
wxBoxSizer* bSizerRight; |
|
||||
bSizerRight = new wxBoxSizer( wxVERTICAL ); |
|
||||
|
|
||||
m_buttonKW = new wxButton( this, ID_ACCEPT_KEYWORD, _("Search by Keyword"), wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
bSizerRight->Add( m_buttonKW, 0, wxALL|wxEXPAND, 5 ); |
|
||||
|
|
||||
m_buttonList = new wxButton( this, ID_LIST_ALL, _("List All"), wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
bSizerRight->Add( m_buttonList, 0, wxALL|wxEXPAND, 5 ); |
|
||||
|
|
||||
m_buttonBrowse = new wxButton( this, ID_BROWSE, _("Select by Browser"), wxDefaultPosition, wxDefaultSize, 0 ); |
|
||||
bSizerRight->Add( m_buttonBrowse, 0, wxALL|wxEXPAND, 5 ); |
|
||||
|
|
||||
|
|
||||
bSizerUpper->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); |
|
||||
|
|
||||
|
|
||||
bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 ); |
|
||||
|
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); |
|
||||
|
|
||||
m_sdbSizer = new wxStdDialogButtonSizer(); |
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK ); |
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK ); |
|
||||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); |
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel ); |
|
||||
m_sdbSizer->Realize(); |
|
||||
|
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 ); |
|
||||
|
|
||||
|
|
||||
this->SetSizer( bSizerMain ); |
|
||||
this->Layout(); |
|
||||
bSizerMain->Fit( this ); |
|
||||
|
|
||||
this->Centre( wxBOTH ); |
|
||||
|
|
||||
// Connect Events
|
|
||||
m_historyList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::OnHistoryClick ), NULL, this ); |
|
||||
m_historyList->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonKW->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonList->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
} |
|
||||
|
|
||||
DIALOG_GET_FOOTPRINT_BASE::~DIALOG_GET_FOOTPRINT_BASE() |
|
||||
{ |
|
||||
// Disconnect Events
|
|
||||
m_historyList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::OnHistoryClick ), NULL, this ); |
|
||||
m_historyList->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonKW->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonList->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GET_FOOTPRINT_BASE::Accept ), NULL, this ); |
|
||||
|
|
||||
} |
|
||||
@ -1,849 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|
||||
<wxFormBuilder_Project> |
|
||||
<FileVersion major="1" minor="13" /> |
|
||||
<object class="Project" expanded="1"> |
|
||||
<property name="class_decoration"></property> |
|
||||
<property name="code_generation">C++</property> |
|
||||
<property name="disconnect_events">1</property> |
|
||||
<property name="disconnect_mode">source_name</property> |
|
||||
<property name="disconnect_php_events">0</property> |
|
||||
<property name="disconnect_python_events">0</property> |
|
||||
<property name="embedded_files_path">res</property> |
|
||||
<property name="encoding">UTF-8</property> |
|
||||
<property name="event_generation">connect</property> |
|
||||
<property name="file">dialog_get_footprint_base</property> |
|
||||
<property name="first_id">1000</property> |
|
||||
<property name="help_provider">none</property> |
|
||||
<property name="indent_with_spaces"></property> |
|
||||
<property name="internationalize">1</property> |
|
||||
<property name="name">dialog_get_footprint_base</property> |
|
||||
<property name="namespace"></property> |
|
||||
<property name="path">.</property> |
|
||||
<property name="precompiled_header"></property> |
|
||||
<property name="relative_path">1</property> |
|
||||
<property name="skip_lua_events">1</property> |
|
||||
<property name="skip_php_events">1</property> |
|
||||
<property name="skip_python_events">1</property> |
|
||||
<property name="ui_table">UI</property> |
|
||||
<property name="use_enum">0</property> |
|
||||
<property name="use_microsoft_bom">0</property> |
|
||||
<object class="Dialog" expanded="1"> |
|
||||
<property name="aui_managed">0</property> |
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="center">wxBOTH</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="event_handler">impl_virtual</property> |
|
||||
<property name="extra_style"></property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="font"></property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">wxID_ANY</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">DIALOG_GET_FOOTPRINT_BASE</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="size">-1,-1</property> |
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> |
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> |
|
||||
<property name="title">Choose Footprint</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnActivate"></event> |
|
||||
<event name="OnActivateApp"></event> |
|
||||
<event name="OnAuiFindManager"></event> |
|
||||
<event name="OnAuiPaneButton"></event> |
|
||||
<event name="OnAuiPaneClose"></event> |
|
||||
<event name="OnAuiPaneMaximize"></event> |
|
||||
<event name="OnAuiPaneRestore"></event> |
|
||||
<event name="OnAuiRender"></event> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnClose"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnHibernate"></event> |
|
||||
<event name="OnIconize"></event> |
|
||||
<event name="OnIdle"></event> |
|
||||
<event name="OnInitDialog"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
<object class="wxBoxSizer" expanded="1"> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">bSizerMain</property> |
|
||||
<property name="orient">wxVERTICAL</property> |
|
||||
<property name="permission">none</property> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxEXPAND</property> |
|
||||
<property name="proportion">1</property> |
|
||||
<object class="wxBoxSizer" expanded="1"> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">bSizerUpper</property> |
|
||||
<property name="orient">wxHORIZONTAL</property> |
|
||||
<property name="permission">none</property> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxEXPAND</property> |
|
||||
<property name="proportion">1</property> |
|
||||
<object class="wxBoxSizer" expanded="1"> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">bSizerLeft</property> |
|
||||
<property name="orient">wxVERTICAL</property> |
|
||||
<property name="permission">none</property> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxStaticText" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">wxID_ANY</property> |
|
||||
<property name="label">Name:</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_staticTextName</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<property name="wrap">-1</property> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxTextCtrl" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">wxID_ANY</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="maxlength">0</property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_textCmpNameCtrl</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="validator_data_type"></property> |
|
||||
<property name="validator_style">wxFILTER_NONE</property> |
|
||||
<property name="validator_type">wxDefaultValidator</property> |
|
||||
<property name="validator_variable"></property> |
|
||||
<property name="value"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnText"></event> |
|
||||
<event name="OnTextEnter"></event> |
|
||||
<event name="OnTextMaxLen"></event> |
|
||||
<event name="OnTextURL"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxStaticText" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">wxID_ANY</property> |
|
||||
<property name="label">History list:</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_staticTextHistory</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<property name="wrap">-1</property> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> |
|
||||
<property name="proportion">1</property> |
|
||||
<object class="wxListBox" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="choices"></property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">ID_SEL_BY_LISTBOX</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size">200,100</property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_historyList</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="validator_data_type"></property> |
|
||||
<property name="validator_style">wxFILTER_NONE</property> |
|
||||
<property name="validator_type">wxDefaultValidator</property> |
|
||||
<property name="validator_variable"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnListBox">OnHistoryClick</event> |
|
||||
<event name="OnListBoxDClick">Accept</event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxBoxSizer" expanded="1"> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">bSizerRight</property> |
|
||||
<property name="orient">wxVERTICAL</property> |
|
||||
<property name="permission">none</property> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxALL|wxEXPAND</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxButton" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default">0</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">ID_ACCEPT_KEYWORD</property> |
|
||||
<property name="label">Search by Keyword</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_buttonKW</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="validator_data_type"></property> |
|
||||
<property name="validator_style">wxFILTER_NONE</property> |
|
||||
<property name="validator_type">wxDefaultValidator</property> |
|
||||
<property name="validator_variable"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnButtonClick">Accept</event> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxALL|wxEXPAND</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxButton" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default">0</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">ID_LIST_ALL</property> |
|
||||
<property name="label">List All</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_buttonList</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="validator_data_type"></property> |
|
||||
<property name="validator_style">wxFILTER_NONE</property> |
|
||||
<property name="validator_type">wxDefaultValidator</property> |
|
||||
<property name="validator_variable"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnButtonClick">Accept</event> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxALL|wxEXPAND</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxButton" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default">0</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">ID_BROWSE</property> |
|
||||
<property name="label">Select by Browser</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_buttonBrowse</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style"></property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="validator_data_type"></property> |
|
||||
<property name="validator_style">wxFILTER_NONE</property> |
|
||||
<property name="validator_type">wxDefaultValidator</property> |
|
||||
<property name="validator_variable"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnButtonClick">Accept</event> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxStaticLine" expanded="1"> |
|
||||
<property name="BottomDockable">1</property> |
|
||||
<property name="LeftDockable">1</property> |
|
||||
<property name="RightDockable">1</property> |
|
||||
<property name="TopDockable">1</property> |
|
||||
<property name="aui_layer"></property> |
|
||||
<property name="aui_name"></property> |
|
||||
<property name="aui_position"></property> |
|
||||
<property name="aui_row"></property> |
|
||||
<property name="best_size"></property> |
|
||||
<property name="bg"></property> |
|
||||
<property name="caption"></property> |
|
||||
<property name="caption_visible">1</property> |
|
||||
<property name="center_pane">0</property> |
|
||||
<property name="close_button">1</property> |
|
||||
<property name="context_help"></property> |
|
||||
<property name="context_menu">1</property> |
|
||||
<property name="default_pane">0</property> |
|
||||
<property name="dock">Dock</property> |
|
||||
<property name="dock_fixed">0</property> |
|
||||
<property name="docking">Left</property> |
|
||||
<property name="enabled">1</property> |
|
||||
<property name="fg"></property> |
|
||||
<property name="floatable">1</property> |
|
||||
<property name="font"></property> |
|
||||
<property name="gripper">0</property> |
|
||||
<property name="hidden">0</property> |
|
||||
<property name="id">wxID_ANY</property> |
|
||||
<property name="max_size"></property> |
|
||||
<property name="maximize_button">0</property> |
|
||||
<property name="maximum_size"></property> |
|
||||
<property name="min_size"></property> |
|
||||
<property name="minimize_button">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="moveable">1</property> |
|
||||
<property name="name">m_staticline1</property> |
|
||||
<property name="pane_border">1</property> |
|
||||
<property name="pane_position"></property> |
|
||||
<property name="pane_size"></property> |
|
||||
<property name="permission">protected</property> |
|
||||
<property name="pin_button">1</property> |
|
||||
<property name="pos"></property> |
|
||||
<property name="resize">Resizable</property> |
|
||||
<property name="show">1</property> |
|
||||
<property name="size"></property> |
|
||||
<property name="style">wxLI_HORIZONTAL</property> |
|
||||
<property name="subclass"></property> |
|
||||
<property name="toolbar_pane">0</property> |
|
||||
<property name="tooltip"></property> |
|
||||
<property name="window_extra_style"></property> |
|
||||
<property name="window_name"></property> |
|
||||
<property name="window_style"></property> |
|
||||
<event name="OnChar"></event> |
|
||||
<event name="OnEnterWindow"></event> |
|
||||
<event name="OnEraseBackground"></event> |
|
||||
<event name="OnKeyDown"></event> |
|
||||
<event name="OnKeyUp"></event> |
|
||||
<event name="OnKillFocus"></event> |
|
||||
<event name="OnLeaveWindow"></event> |
|
||||
<event name="OnLeftDClick"></event> |
|
||||
<event name="OnLeftDown"></event> |
|
||||
<event name="OnLeftUp"></event> |
|
||||
<event name="OnMiddleDClick"></event> |
|
||||
<event name="OnMiddleDown"></event> |
|
||||
<event name="OnMiddleUp"></event> |
|
||||
<event name="OnMotion"></event> |
|
||||
<event name="OnMouseEvents"></event> |
|
||||
<event name="OnMouseWheel"></event> |
|
||||
<event name="OnPaint"></event> |
|
||||
<event name="OnRightDClick"></event> |
|
||||
<event name="OnRightDown"></event> |
|
||||
<event name="OnRightUp"></event> |
|
||||
<event name="OnSetFocus"></event> |
|
||||
<event name="OnSize"></event> |
|
||||
<event name="OnUpdateUI"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
<object class="sizeritem" expanded="1"> |
|
||||
<property name="border">5</property> |
|
||||
<property name="flag">wxALL|wxEXPAND</property> |
|
||||
<property name="proportion">0</property> |
|
||||
<object class="wxStdDialogButtonSizer" expanded="1"> |
|
||||
<property name="Apply">0</property> |
|
||||
<property name="Cancel">1</property> |
|
||||
<property name="ContextHelp">0</property> |
|
||||
<property name="Help">0</property> |
|
||||
<property name="No">0</property> |
|
||||
<property name="OK">1</property> |
|
||||
<property name="Save">0</property> |
|
||||
<property name="Yes">0</property> |
|
||||
<property name="minimum_size"></property> |
|
||||
<property name="name">m_sdbSizer</property> |
|
||||
<property name="permission">protected</property> |
|
||||
<event name="OnApplyButtonClick"></event> |
|
||||
<event name="OnCancelButtonClick"></event> |
|
||||
<event name="OnContextHelpButtonClick"></event> |
|
||||
<event name="OnHelpButtonClick"></event> |
|
||||
<event name="OnNoButtonClick"></event> |
|
||||
<event name="OnOKButtonClick">Accept</event> |
|
||||
<event name="OnSaveButtonClick"></event> |
|
||||
<event name="OnYesButtonClick"></event> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</object> |
|
||||
</wxFormBuilder_Project> |
|
||||
@ -1,67 +0,0 @@ |
|||||
/////////////////////////////////////////////////////////////////////////// |
|
||||
// C++ code generated with wxFormBuilder (version Apr 20 2018) |
|
||||
// http://www.wxformbuilder.org/ |
|
||||
// |
|
||||
// PLEASE DO *NOT* EDIT THIS FILE! |
|
||||
/////////////////////////////////////////////////////////////////////////// |
|
||||
|
|
||||
#ifndef __DIALOG_GET_FOOTPRINT_BASE_H__ |
|
||||
#define __DIALOG_GET_FOOTPRINT_BASE_H__ |
|
||||
|
|
||||
#include <wx/artprov.h> |
|
||||
#include <wx/xrc/xmlres.h> |
|
||||
#include <wx/intl.h> |
|
||||
#include "dialog_shim.h" |
|
||||
#include <wx/string.h> |
|
||||
#include <wx/stattext.h> |
|
||||
#include <wx/gdicmn.h> |
|
||||
#include <wx/font.h> |
|
||||
#include <wx/colour.h> |
|
||||
#include <wx/settings.h> |
|
||||
#include <wx/textctrl.h> |
|
||||
#include <wx/listbox.h> |
|
||||
#include <wx/sizer.h> |
|
||||
#include <wx/button.h> |
|
||||
#include <wx/statline.h> |
|
||||
#include <wx/dialog.h> |
|
||||
|
|
||||
/////////////////////////////////////////////////////////////////////////// |
|
||||
|
|
||||
#define ID_SEL_BY_LISTBOX 1000 |
|
||||
#define ID_ACCEPT_KEYWORD 1001 |
|
||||
#define ID_LIST_ALL 1002 |
|
||||
#define ID_BROWSE 1003 |
|
||||
|
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
/// Class DIALOG_GET_FOOTPRINT_BASE |
|
||||
/////////////////////////////////////////////////////////////////////////////// |
|
||||
class DIALOG_GET_FOOTPRINT_BASE : public DIALOG_SHIM |
|
||||
{ |
|
||||
private: |
|
||||
|
|
||||
protected: |
|
||||
wxStaticText* m_staticTextName; |
|
||||
wxTextCtrl* m_textCmpNameCtrl; |
|
||||
wxStaticText* m_staticTextHistory; |
|
||||
wxListBox* m_historyList; |
|
||||
wxButton* m_buttonKW; |
|
||||
wxButton* m_buttonList; |
|
||||
wxButton* m_buttonBrowse; |
|
||||
wxStaticLine* m_staticline1; |
|
||||
wxStdDialogButtonSizer* m_sdbSizer; |
|
||||
wxButton* m_sdbSizerOK; |
|
||||
wxButton* m_sdbSizerCancel; |
|
||||
|
|
||||
// Virtual event handlers, overide them in your derived class |
|
||||
virtual void OnHistoryClick( wxCommandEvent& event ) { event.Skip(); } |
|
||||
virtual void Accept( wxCommandEvent& event ) { event.Skip(); } |
|
||||
|
|
||||
|
|
||||
public: |
|
||||
|
|
||||
DIALOG_GET_FOOTPRINT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Choose Footprint"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|
||||
~DIALOG_GET_FOOTPRINT_BASE(); |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
#endif //__DIALOG_GET_FOOTPRINT_BASE_H__ |
|
||||
@ -0,0 +1,75 @@ |
|||||
|
/*
|
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify it |
||||
|
* under the terms of the GNU General Public License as published by the |
||||
|
* Free Software Foundation, either version 3 of the License, or (at your |
||||
|
* option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, but |
||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
|
* General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License along |
||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
#include <wx/tokenzr.h>
|
||||
|
#include <wx/progdlg.h>
|
||||
|
|
||||
|
#include <eda_pattern_match.h>
|
||||
|
#include <fp_lib_table.h>
|
||||
|
#include <footprint_info.h>
|
||||
|
#include <generate_footprint_info.h>
|
||||
|
|
||||
|
#include "fp_tree_model_adapter.h"
|
||||
|
|
||||
|
|
||||
|
FP_TREE_MODEL_ADAPTER::PTR FP_TREE_MODEL_ADAPTER::Create( LIB_TABLE* aLibs ) |
||||
|
{ |
||||
|
return PTR( new FP_TREE_MODEL_ADAPTER( aLibs ) ); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
FP_TREE_MODEL_ADAPTER::FP_TREE_MODEL_ADAPTER( LIB_TABLE* aLibs ) |
||||
|
: m_libs( (FP_LIB_TABLE*) aLibs ) |
||||
|
{} |
||||
|
|
||||
|
|
||||
|
FP_TREE_MODEL_ADAPTER::~FP_TREE_MODEL_ADAPTER() |
||||
|
{} |
||||
|
|
||||
|
|
||||
|
void FP_TREE_MODEL_ADAPTER::AddLibraries( FOOTPRINT_LIST* aFootprintInfoList ) |
||||
|
{ |
||||
|
// Note: FOOTPRINT_INFO list must be sorted!
|
||||
|
|
||||
|
wxString currentLib; |
||||
|
std::vector<LIB_TREE_ITEM*> footprints; |
||||
|
|
||||
|
for( auto& footprint : aFootprintInfoList->GetList() ) |
||||
|
{ |
||||
|
if( footprint->GetNickname() != currentLib ) |
||||
|
{ |
||||
|
if( footprints.size() ) |
||||
|
DoAddLibrary( currentLib, m_libs->GetDescription( currentLib ), footprints ); |
||||
|
|
||||
|
footprints.clear(); |
||||
|
currentLib = footprint->GetNickname(); |
||||
|
} |
||||
|
|
||||
|
footprints.push_back( footprint.get() ); |
||||
|
} |
||||
|
|
||||
|
if( footprints.size() ) |
||||
|
DoAddLibrary( currentLib, m_libs->GetDescription( currentLib ), footprints ); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
wxString FP_TREE_MODEL_ADAPTER::GenerateInfo( LIB_ID const& aLibId, int aUnit ) |
||||
|
{ |
||||
|
return GenerateFootprintInfo( m_libs, aLibId ); |
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
/* |
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com> |
||||
|
* Copyright (C) 2014 Henner Zeller <h.zeller@acm.org> |
||||
|
* Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify it |
||||
|
* under the terms of the GNU General Public License as published by the |
||||
|
* Free Software Foundation, either version 3 of the License, or (at your |
||||
|
* option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, but |
||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
|
* General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License along |
||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
*/ |
||||
|
|
||||
|
#ifndef FP_TREE_MODEL_ADAPTER_H |
||||
|
#define FP_TREE_MODEL_ADAPTER_H |
||||
|
|
||||
|
#include <lib_tree_model_adapter.h> |
||||
|
#include <footprint_info.h> |
||||
|
|
||||
|
class LIB_TABLE; |
||||
|
class FP_LIB_TABLE; |
||||
|
|
||||
|
class FP_TREE_MODEL_ADAPTER : public LIB_TREE_MODEL_ADAPTER |
||||
|
{ |
||||
|
public: |
||||
|
/** |
||||
|
* Destructor. Do NOT delete this class manually; it is reference-counted by wxObject. |
||||
|
*/ |
||||
|
~FP_TREE_MODEL_ADAPTER(); |
||||
|
|
||||
|
/** |
||||
|
* Factory function: create a model adapter in a reference-counting container. |
||||
|
* |
||||
|
* @param aLibs library set from which parts will be loaded |
||||
|
*/ |
||||
|
static PTR Create( LIB_TABLE* aLibs ); |
||||
|
|
||||
|
void AddLibraries( FOOTPRINT_LIST* aFootprintInfoList ); |
||||
|
|
||||
|
wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override; |
||||
|
|
||||
|
protected: |
||||
|
|
||||
|
/** |
||||
|
* Constructor; takes a set of libraries to be included in the search. |
||||
|
*/ |
||||
|
FP_TREE_MODEL_ADAPTER( LIB_TABLE* aLibs ); |
||||
|
|
||||
|
private: |
||||
|
FP_LIB_TABLE* m_libs; |
||||
|
}; |
||||
|
|
||||
|
#endif // FP_TREE_MODEL_ADAPTER_H |
||||
@ -0,0 +1,141 @@ |
|||||
|
/*
|
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com> |
||||
|
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify it |
||||
|
* under the terms of the GNU General Public License as published by the |
||||
|
* Free Software Foundation, either version 3 of the License, or (at your |
||||
|
* option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, but |
||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
|
* General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License along |
||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
#include <generate_footprint_info.h>
|
||||
|
#include <kicad_string.h>
|
||||
|
#include <class_module.h>
|
||||
|
#include <fp_lib_table.h>
|
||||
|
|
||||
|
|
||||
|
static const wxString DescriptionFormat = |
||||
|
"<b>__NAME__</b>" |
||||
|
"<br>__DESC__" |
||||
|
"<hr><table border=0>" |
||||
|
"__FIELDS__" |
||||
|
"</table>"; |
||||
|
|
||||
|
static const wxString KeywordsFormat = |
||||
|
"<tr>" |
||||
|
" <td><b>" + _( "Keywords" ) + "</b></td>" |
||||
|
" <td>__KEYWORDS__</td>" |
||||
|
"</tr>"; |
||||
|
|
||||
|
static const wxString DocFormat = |
||||
|
"<tr>" |
||||
|
" <td><b>" + _( "Documentation" ) + "</b></td>" |
||||
|
" <td><a href=\"__HREF__\">__TEXT__</a></td>" |
||||
|
"</tr>"; |
||||
|
|
||||
|
|
||||
|
class FOOTPRINT_INFO_GENERATOR |
||||
|
{ |
||||
|
wxString m_html; |
||||
|
FP_LIB_TABLE* m_fp_lib_table; |
||||
|
LIB_ID const m_lib_id; |
||||
|
MODULE* m_module; |
||||
|
|
||||
|
public: |
||||
|
FOOTPRINT_INFO_GENERATOR( FP_LIB_TABLE* aFpLibTable, LIB_ID const& aLibId ) |
||||
|
: m_html( DescriptionFormat ), |
||||
|
m_fp_lib_table( aFpLibTable ), |
||||
|
m_lib_id( aLibId ), |
||||
|
m_module( nullptr ) |
||||
|
{ } |
||||
|
|
||||
|
/**
|
||||
|
* Generate the HTML internally. |
||||
|
*/ |
||||
|
void GenerateHtml() |
||||
|
{ |
||||
|
wxCHECK_RET( m_fp_lib_table, "Footprint library table pointer is not valid" ); |
||||
|
|
||||
|
if( !m_lib_id.IsValid() ) |
||||
|
return; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
m_module = m_fp_lib_table->FootprintLoad( m_lib_id.GetLibNickname(), |
||||
|
m_lib_id.GetLibItemName() ); |
||||
|
} |
||||
|
catch( const IO_ERROR& ioe ) |
||||
|
{ |
||||
|
wxLogError( wxString::Format( _( "Error loading footprint %s from library %s.\n\n%s" ), |
||||
|
m_lib_id.GetLibItemName().wx_str(), |
||||
|
m_lib_id.GetLibNickname().wx_str(), |
||||
|
ioe.What() ) ); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if( m_module ) |
||||
|
{ |
||||
|
wxString name = m_lib_id.GetLibItemName(); |
||||
|
wxString desc = m_module->GetDescription(); |
||||
|
wxString keywords = m_module->GetKeywords(); |
||||
|
wxString doc; |
||||
|
|
||||
|
// It is currently common practice to store a documentation link in the description.
|
||||
|
int idx = desc.find( wxT( "http:" ) ); |
||||
|
|
||||
|
if( idx >= 0 ) |
||||
|
{ |
||||
|
doc = desc.substr( (unsigned) idx ); |
||||
|
|
||||
|
desc = desc.substr( 0, (unsigned) idx ); |
||||
|
desc = desc.Trim( true ); |
||||
|
|
||||
|
if( desc.Last() == ',' ) |
||||
|
desc.RemoveLast( 1 ); |
||||
|
} |
||||
|
|
||||
|
m_html.Replace( "__NAME__", EscapedHTML( name ) ); |
||||
|
m_html.Replace( "__DESC__", EscapedHTML( desc ) ); |
||||
|
|
||||
|
wxString keywordsHtml = KeywordsFormat; |
||||
|
keywordsHtml.Replace( "__KEYWORDS__", EscapedHTML( keywords ) ); |
||||
|
|
||||
|
wxString docHtml = DocFormat; |
||||
|
docHtml.Replace( "__HREF__", EscapedHTML( doc ) ); |
||||
|
|
||||
|
if( doc.Length() > 75 ) |
||||
|
doc = doc.Left( 72 ) + wxT( "..." ); |
||||
|
|
||||
|
docHtml.Replace( "__TEXT__", EscapedHTML( doc ) ); |
||||
|
|
||||
|
m_html.Replace( "__FIELDS__", keywordsHtml + docHtml ); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/**
|
||||
|
* Return the generated HTML. |
||||
|
*/ |
||||
|
wxString GetHtml() |
||||
|
{ |
||||
|
return m_html; |
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
wxString GenerateFootprintInfo( FP_LIB_TABLE* aSymLibTable, LIB_ID const& aLibId ) |
||||
|
{ |
||||
|
FOOTPRINT_INFO_GENERATOR gen( aSymLibTable, aLibId ); |
||||
|
gen.GenerateHtml(); |
||||
|
return gen.GetHtml(); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
/* |
||||
|
* This program source code file is part of KiCad, a free EDA CAD application. |
||||
|
* |
||||
|
* Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com> |
||||
|
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors. |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify it |
||||
|
* under the terms of the GNU General Public License as published by the |
||||
|
* Free Software Foundation, either version 3 of the License, or (at your |
||||
|
* option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, but |
||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
|
* General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License along |
||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
*/ |
||||
|
|
||||
|
#ifndef GENERATE_FOOTPRINT_INFO_H |
||||
|
#define GENERATE_FOOTPRINT_INFO_H |
||||
|
|
||||
|
#include <wx/string.h> |
||||
|
|
||||
|
class LIB_ID; |
||||
|
class FP_LIB_TABLE; |
||||
|
|
||||
|
/** |
||||
|
* Return an HTML page describing a #LIB_ID in a #FP_LIB_TABLE. This is suitable for inclusion |
||||
|
* in a wxHtmlWindow. |
||||
|
*/ |
||||
|
wxString GenerateFootprintInfo( FP_LIB_TABLE* aFpLibTable, LIB_ID const& aLibId ); |
||||
|
|
||||
|
#endif // GENERATE_FOOTPRINT_INFO_H |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue