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
|
|
|
|
* Copyright (C) 1992-2014 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
|
|
|
|
*/
|
|
|
|
|
2009-01-19 19:08:42 +00:00
|
|
|
/**
|
|
|
|
* This file is part of the common libary.
|
2010-11-20 10:59:59 +00:00
|
|
|
* @file dialog_get_component.h
|
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
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <../common/dialogs/dialog_get_component_base.h>
|
2009-01-19 19:08:42 +00:00
|
|
|
|
2009-10-16 17:18:23 +00:00
|
|
|
void AddHistoryComponentName( wxArrayString& HistoryList,
|
|
|
|
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 */
|
2010-11-20 10:59:59 +00:00
|
|
|
class DIALOG_GET_COMPONENT : public DIALOG_GET_COMPONENT_BASE
|
2009-10-16 17:18:23 +00:00
|
|
|
{
|
|
|
|
private:
|
2010-11-20 10:59:59 +00:00
|
|
|
bool m_auxToolSelector;
|
2009-10-16 17:18:23 +00:00
|
|
|
wxString m_Text;
|
2012-02-19 19:53:11 +00:00
|
|
|
bool m_selectionIsKeyword;
|
2009-10-16 17:18:23 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool m_GetExtraFunction;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Constructor and destructor
|
2013-01-10 12:18:43 +00:00
|
|
|
DIALOG_GET_COMPONENT( EDA_DRAW_FRAME* parent,
|
2011-01-21 19:30:59 +00:00
|
|
|
wxArrayString& HistoryList, const wxString& Title,
|
|
|
|
bool show_extra_tool );
|
2010-11-20 10:59:59 +00:00
|
|
|
~DIALOG_GET_COMPONENT() {};
|
2009-01-19 19:08:42 +00:00
|
|
|
|
2012-02-19 19:53:11 +00:00
|
|
|
/**
|
|
|
|
* Function GetComponentName
|
|
|
|
* @return the selection (name or keyword)
|
|
|
|
*/
|
2009-10-16 17:18:23 +00:00
|
|
|
wxString GetComponentName( void );
|
2012-02-19 19:53:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function IsKeyword
|
|
|
|
* @return true if the returned string is a keyword
|
|
|
|
*/
|
|
|
|
bool IsKeyword( void )
|
|
|
|
{
|
|
|
|
return m_selectionIsKeyword;
|
|
|
|
}
|
|
|
|
|
2009-10-16 17:18:23 +00:00
|
|
|
void SetComponentName( const wxString& name );
|
|
|
|
|
|
|
|
private:
|
2010-11-20 10:59:59 +00:00
|
|
|
void initDialog( wxArrayString& aHistoryList );
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnCancel( wxCommandEvent& event ) override;
|
|
|
|
void Accept( wxCommandEvent& event ) override;
|
|
|
|
void GetExtraSelection( wxCommandEvent& event ) override;
|
2009-10-16 17:18:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-11-20 10:59:59 +00:00
|
|
|
#endif /* __INCLUDE_DIALOG_GET_COMPONENT_H__ */
|