KiCad PCB EDA Suite
dialog_regulator_form.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) 1992-2011 jean-pierre.charras
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 3
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 along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
29 #ifndef DIALOG_REGULATOR_FORM_H
30 #define DIALOG_REGULATOR_FORM_H
31 
33 
35 class REGULATOR_DATA;
36 
38 {
39 public:
40  DIALOG_REGULATOR_FORM( PCB_CALCULATOR_FRAME* parent, const wxString& aRegName )
41  : DIALOG_REGULATOR_FORM_BASE( parent )
42  {
43  m_textCtrlName->SetValue( aRegName );
44  m_textCtrlName->Enable( aRegName.IsEmpty() );
45  UpdateDialog();
46 
47  m_sdbSizerOK->SetDefault();
48 
49  // Now all widgets have the size fixed, call FinishDialogSettings
51  }
52 
54 
55  // Event called functions:
56  void OnOKClick( wxCommandEvent& event ) override;
57 
62  bool IsOK();
63 
70 
77 
82  void UpdateDialog();
83 
87  void OnRegTypeSelection( wxCommandEvent& event ) override
88  {
89  UpdateDialog();
90  }
91 };
92 
93 #endif // DIALOG_REGULATOR_FORM_H
REGULATOR_DATA * BuildRegulatorFromData()
Function BuildRegulatorFromData Creates a new REGULATOR_DATA from dialog.
DIALOG_REGULATOR_FORM(PCB_CALCULATOR_FRAME *parent, const wxString &aRegName)
void UpdateDialog()
Enable/disable Iadj realted widgets, according to the regulator type.
void OnRegTypeSelection(wxCommandEvent &event) override
called when the current regulator type is changed
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void OnOKClick(wxCommandEvent &event) override
Class DIALOG_REGULATOR_FORM_BASE.
void CopyRegulatorDataToDialog(REGULATOR_DATA *aItem)
Function CopyRegulatorDataToDialog Transfert data from dialog to aItem.
bool IsOK()
Function IsOK()