KiCad PCB EDA Suite
dialog_helpers.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2010 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
31 #ifndef DIALOG_HELPERS_H_
32 #define DIALOG_HELPERS_H_
33 
34 
35 #include <../common/dialogs/eda_list_dialog_base.h>
36 #include <eda_units.h>
37 
38 void ConvertMarkdown2Html( const wxString& aMarkdownInput, wxString& aHtmlOutput );
39 
40 class EDA_DRAW_FRAME;
41 
50 {
51 public:
52 
60  EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
61  const wxArrayString& aItemHeaders,
62  const std::vector<wxArrayString>& aItemList,
63  const wxString& aRefText );
64 
65  void SetListLabel( const wxString& aLabel );
66  void SetOKLabel( const wxString& aLabel );
67 
68  void Append( const wxArrayString& aItemStr );
69  void InsertItems( const std::vector<wxArrayString>& aItemList, int aPosition = 0 );
70 
77  wxString GetTextSelection( int aColumn = 0 );
78 
79 private:
80  void onListItemActivated( wxListEvent& event ) override;
81  void textChangeInFilterBox(wxCommandEvent& event) override;
82 
83  void initDialog( const wxArrayString& aItemHeaders, const wxString& aSelection);
84  void sortList();
85 
86 private:
87  const std::vector<wxArrayString>* m_itemsList;
88 };
89 
90 
95 {
96 public:
97  EDA_POSITION_CTRL( wxWindow* parent, const wxString& title, const wxPoint& pos_to_edit,
98  EDA_UNITS user_unit, wxBoxSizer* BoxSizer );
99 
101 
102  void Enable( bool x_win_on, bool y_win_on );
103  void SetValue( int x_value, int y_value );
104  wxPoint GetValue() const;
105 
107 
108  wxTextCtrl* m_FramePosX;
109  wxTextCtrl* m_FramePosY;
110 
111 private:
112  wxStaticText* m_TextX;
113  wxStaticText* m_TextY;
114 };
115 
116 
121 {
122 public:
123  EDA_SIZE_CTRL( wxWindow* parent, const wxString& title, const wxSize& size_to_edit,
124  EDA_UNITS user_unit, wxBoxSizer* BoxSizer );
125 
127 
128  wxSize GetValue() const;
129 };
130 
131 
132 #endif // DIALOG_HELPERS_H_
EDA_SIZE_CTRL(wxWindow *parent, const wxString &title, const wxSize &size_to_edit, EDA_UNITS user_unit, wxBoxSizer *BoxSizer)
void initDialog(const wxArrayString &aItemHeaders, const wxString &aSelection)
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void textChangeInFilterBox(wxCommandEvent &event) override
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
void Enable(bool x_win_on, bool y_win_on)
void SetOKLabel(const wxString &aLabel)
EDA_LIST_DIALOG(EDA_DRAW_FRAME *aParent, const wxString &aTitle, const wxArrayString &aItemHeaders, const std::vector< wxArrayString > &aItemList, const wxString &aRefText)
Object to edit/enter a coordinate (pair of values) ( INCHES or MM ) in dialog boxes.
void Append(const wxArrayString &aItemStr)
A dialog which shows:
wxSize GetValue() const
Object to edit/enter a size (pair of values for X and Y size ( INCHES or MM ) in dialog boxes.
The base class for create windows for drawing purpose.
Class EDA_LIST_DIALOG_BASE.
wxTextCtrl * m_FramePosX
EDA_POSITION_CTRL(wxWindow *parent, const wxString &title, const wxPoint &pos_to_edit, EDA_UNITS user_unit, wxBoxSizer *BoxSizer)
const std::vector< wxArrayString > * m_itemsList
EDA_UNITS
Definition: eda_units.h:38
wxPoint GetValue() const
wxTextCtrl * m_FramePosY
wxStaticText * m_TextX
void SetValue(int x_value, int y_value)
wxStaticText * m_TextY
void InsertItems(const std::vector< wxArrayString > &aItemList, int aPosition=0)
void onListItemActivated(wxListEvent &event) override
void SetListLabel(const wxString &aLabel)