2014-10-22 15:51:34 +00:00
|
|
|
/*
|
|
|
|
* 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
|
2018-04-27 14:24:12 +00:00
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see CHANGELOG.TXT for contributors.
|
2014-10-22 15:51:34 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2009-01-19 19:08:42 +00:00
|
|
|
|
2010-11-20 10:59:59 +00:00
|
|
|
#ifndef __INCLUDE_DIALOG_GET_COMPONENT_H__
|
|
|
|
#define __INCLUDE_DIALOG_GET_COMPONENT_H__
|
2009-01-19 19:08:42 +00:00
|
|
|
|
2018-04-27 14:24:12 +00:00
|
|
|
#include "dialog_get_footprint_base.h"
|
|
|
|
|
|
|
|
class PCB_BASE_FRAME;
|
|
|
|
|
|
|
|
void AddHistoryComponentName( const wxString& Name );
|
2009-01-19 19:08:42 +00:00
|
|
|
|
|
|
|
|
2009-10-16 17:18:23 +00:00
|
|
|
/* Dialog frame to choose a component name */
|
2018-04-27 14:24:12 +00:00
|
|
|
class DIALOG_GET_FOOTPRINT : public DIALOG_GET_FOOTPRINT_BASE
|
2009-10-16 17:18:23 +00:00
|
|
|
{
|
|
|
|
private:
|
2018-04-27 14:24:12 +00:00
|
|
|
PCB_BASE_FRAME* m_frame;
|
|
|
|
wxString m_Text;
|
|
|
|
bool m_selectionIsKeyword;
|
|
|
|
bool m_selectByBrowser;
|
2009-10-16 17:18:23 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// Constructor and destructor
|
2018-04-27 14:24:12 +00:00
|
|
|
DIALOG_GET_FOOTPRINT( PCB_BASE_FRAME* parent, bool aShowBrowseButton );
|
|
|
|
~DIALOG_GET_FOOTPRINT() override {};
|
2009-01-19 19:08:42 +00:00
|
|
|
|
2012-02-19 19:53:11 +00:00
|
|
|
/**
|
|
|
|
* Function GetComponentName
|
|
|
|
* @return the selection (name or keyword)
|
|
|
|
*/
|
2018-04-27 14:24:12 +00:00
|
|
|
wxString GetComponentName();
|
2012-02-19 19:53:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsKeyword
|
|
|
|
* @return true if the returned string is a keyword
|
|
|
|
*/
|
2018-04-27 14:24:12 +00:00
|
|
|
bool IsKeyword()
|
2012-02-19 19:53:11 +00:00
|
|
|
{
|
|
|
|
return m_selectionIsKeyword;
|
|
|
|
}
|
|
|
|
|
2018-04-27 14:24:12 +00:00
|
|
|
/**
|
|
|
|
* 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 );
|
2009-10-16 17:18:23 +00:00
|
|
|
|
|
|
|
private:
|
2018-05-01 22:26:38 +00:00
|
|
|
void OnHistoryClick( wxCommandEvent& aEvent ) override;
|
2018-04-27 14:24:12 +00:00
|
|
|
void Accept( wxCommandEvent& aEvent ) override;
|
2009-10-16 17:18:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-11-20 10:59:59 +00:00
|
|
|
#endif /* __INCLUDE_DIALOG_GET_COMPONENT_H__ */
|