KiCad PCB EDA Suite
dialog_libedit_options.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) 2009 Wayne Stambaugh <stambaughw@verizon.net>
5  * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
6  * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #include <fctsys.h>
31 #include <class_base_screen.h>
32 
33 #include <dialog_libedit_options.h>
34 #include <libeditframe.h>
35 
36 
39 {
40  m_sdbSizerOK->SetDefault();
41 
42  SetRepeatLabelInc( Parent()->GetRepeatDeltaLabel() );
43  SetItemRepeatStep( Parent()->GetRepeatStep() );
44  SetPinRepeatStep( Parent()->GetRepeatPinStep() );
45 
46  // Now all widgets have the size fixed, call FinishDialogSettings
48 }
49 
50 void DIALOG_LIBEDIT_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id )
51 {
52  wxASSERT( grid_sizes.size() > 0 );
53 
54  int select = wxNOT_FOUND;
55 
56  for( size_t i = 0; i < grid_sizes.size(); i++ )
57  {
58  wxString tmp;
59  tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x );
60  m_choiceGridSize->Append( tmp );
61 
62  if( grid_sizes[i].m_CmdId == grid_id )
63  select = (int) i;
64  }
65 
66  m_choiceGridSize->SetSelection( select );
67 }
void SetRepeatLabelInc(int aValue)
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
DIALOG_LIBEDIT_OPTIONS(LIB_EDIT_FRAME *parent)
void SetItemRepeatStep(wxPoint aValue)
std::vector< GRID_TYPE > GRIDS
void SetGridSizes(const GRIDS &grid_sizes, int grid_id)
Subclass of DIALOG_LIBEDIT_OPTIONS_BASE, which is generated by wxFormBuilder.
Class DIALOG_LIBEDIT_OPTIONS_BASE.
The component library editor main window.
Definition: libeditframe.h:51
BASE_SCREEN class implementation.
void SetPinRepeatStep(int aValue)
Definition of class LIB_EDIT_FRAME.