KiCad PCB EDA Suite
dialog_lib_edit_draw_item.cpp
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) 2006-2012 KiCad Developers, see change_log.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
29 
30 
32  const wxString& itemName ) :
34 {
35  SetTitle( itemName + wxT( " " ) + GetTitle() );
36 
37  // Required under wxGTK if we want to dismiss the dialog with the ESC key
38  SetFocus();
39  m_sdbSizer1OK->SetDefault();
40 
41  // Now all widgets have the size fixed, call FinishDialogSettings
43 }
44 
45 
46 void DIALOG_LIB_EDIT_DRAW_ITEM::SetWidth( const wxString& width )
47 {
48  m_textWidth->SetValue( width );
49 }
50 
51 
53 {
54  return m_textWidth->GetValue();
55 }
56 
57 
59 {
60  return m_checkApplyToAllConversions->IsChecked();
61 }
62 
63 
65 {
66  m_checkApplyToAllConversions->SetValue( applyToAll );
67 }
68 
69 
71 {
72  m_checkApplyToAllConversions->Enable( enable );
73 }
74 
75 
77 {
78  return m_checkApplyToAllUnits->IsChecked();
79 }
80 
81 
83 {
84  m_checkApplyToAllUnits->SetValue( applyToAll );
85 }
86 
87 
89 {
90  m_checkApplyToAllUnits->Enable( enable );
91 }
92 
93 
95 {
96  if( m_radioFillNone->GetValue() )
97  return 0;
98  if( m_radioFillForeground->GetValue() )
99  return 1;
100  if( m_radioFillBackground->GetValue() )
101  return 2;
102 
103  return 0;
104 }
105 
106 
108 {
109  if( fillStyle == 1 )
110  m_radioFillForeground->SetValue( true );
111  else if( fillStyle == 2 )
112  m_radioFillBackground->SetValue( true );
113  else
114  m_radioFillNone->SetValue( true );
115 }
116 
117 
119 {
120  m_radioFillNone->Enable( enable );
121  m_radioFillForeground->Enable( enable );
122  m_radioFillBackground->Enable( enable );
123 }
124 
125 
126 void DIALOG_LIB_EDIT_DRAW_ITEM::SetWidthUnits( const wxString& units )
127 {
128  m_staticWidthUnits->SetLabel( units );
129 }
void EnableFillStyle(bool enable=true)
void EnableApplyToAllConversions(bool enable=true)
Subclass of DIALOG_LIB_EDIT_DRAW_ITEM_BASE, which is generated by wxFormBuilder.
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetWidth(const wxString &width)
Class DIALOG_LIB_EDIT_DRAW_ITEM_BASE.
void SetApplyToAllConversions(bool applyToAll)
void EnableApplyToAllUnits(bool enable=true)
void SetWidthUnits(const wxString &units)
DIALOG_LIB_EDIT_DRAW_ITEM(wxWindow *parent, const wxString &itemName)
Constructor.
void SetApplyToAllUnits(bool applyToAll)