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-2012 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 <common.h> // EDA_UNITS
37 
38 void ConvertMarkdown2Html( const wxString& aMarkdownInput, wxString& aHtmlOutput );
39 
40 class EDA_DRAW_FRAME;
41 
52 {
53 public:
54 
63  EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
64  const wxArrayString& aItemHeaders,
65  const std::vector<wxArrayString>& aItemList,
66  const wxString& aRefText );
67 
68  // ~EDA_LIST_DIALOG() {}
69 
70  void SetListLabel( const wxString& aLabel );
71  void SetOKLabel( const wxString& aLabel );
72 
73  void Append( const wxArrayString& aItemStr );
74  void InsertItems( const std::vector<wxArrayString>& aItemList, int aPosition = 0 );
75 
83  wxString GetTextSelection( int aColumn = 0 );
84 
85 private:
86  void onListItemActivated( wxListEvent& event ) override;
87  void textChangeInFilterBox(wxCommandEvent& event) override;
88 
89  void initDialog( const wxArrayString& aItemHeaders, const wxString& aSelection);
90  void sortList();
91 
92 private:
93  const std::vector<wxArrayString>* m_itemsList;
94 };
95 
96 
97 /**************************************************************************/
98 /* Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in */
99 /* dialog boxes, */
100 /**************************************************************************/
102 {
103 public:
105 
106  wxTextCtrl* m_FramePosX;
107  wxTextCtrl* m_FramePosY;
108 
109 private:
110  wxStaticText* m_TextX, * m_TextY;
111 
112 public:
113  EDA_POSITION_CTRL( wxWindow* parent, const wxString& title, const wxPoint& pos_to_edit,
114  EDA_UNITS user_unit, wxBoxSizer* BoxSizer );
115 
117 
118  void Enable( bool x_win_on, bool y_win_on );
119  void SetValue( int x_value, int y_value );
120  wxPoint GetValue();
121 };
122 
123 
124 /*************************************************************
125  * Class to edit/enter a size (pair of values for X and Y size)
126  * ( INCHES or MM ) in dialog boxes
127  ***************************************************************/
129 {
130 public:
131  EDA_SIZE_CTRL( wxWindow* parent, const wxString& title, const wxSize& size_to_edit,
132  EDA_UNITS user_unit, wxBoxSizer* BoxSizer );
133 
135  wxSize GetValue();
136 };
137 
138 
139 
140 #endif // DIALOG_HELPERS_H_
EDA_UNITS
Definition: common.h:198
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)
Function GetTextSelection 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)
Constructor:
void Append(const wxArrayString &aItemStr)
EDA_LIST_DIALOG.
The base class for create windows for drawing purpose.
wxStaticText * m_TextY
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
wxSize GetValue()
wxTextCtrl * m_FramePosY
The common library.
wxStaticText * m_TextX
void SetValue(int x_value, int y_value)
void InsertItems(const std::vector< wxArrayString > &aItemList, int aPosition=0)
void onListItemActivated(wxListEvent &event) override
void SetListLabel(const wxString &aLabel)