KiCad PCB EDA Suite
dialog_modedit_display_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) 2017 KiCad Developers, see AUTHORS.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 
25 
26 #include <class_drawpanel.h>
27 #include <module_editor_frame.h>
28 
29 #include <view/view.h>
30 
32 
33 
35 {
36  DIALOG_MODEDIT_DISPLAY_OPTIONS dlg( aCaller );
37 
38  int ret = dlg.ShowModal();
39 
40  return ret == wxID_OK;
41 }
42 
43 
45  DIALOG_SHIM( &aParent, wxID_ANY, _( "Display Options" ) ),
46  m_parent( aParent )
47 {
48  auto mainSizer = new wxBoxSizer( wxVERTICAL );
49  SetSizer( mainSizer );
50 
51  // install GAL options pane
53 
54  m_galOptsPanel = new GAL_OPTIONS_PANEL( this, galOptions );
55  mainSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
56 
57  auto btnSizer = new wxStdDialogButtonSizer();
58  mainSizer->Add( btnSizer, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 5 );
59 
60  btnSizer->AddButton( new wxButton( this, wxID_OK ) );
61  btnSizer->AddButton( new wxButton( this, wxID_CANCEL ) );
62 
63  btnSizer->Realize();
64 
65  GetSizer()->SetSizeHints( this );
66  Centre();
67 }
68 
69 
71 {
72  // update GAL options
74 }
75 
76 
78 {
79  // update GAL options
81 
82  // refresh view
84  view->RecacheAllItems();
87 
88  return true;
89 }
Definition of class FOOTPRINT_EDIT_FRAME.
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for render...
Definition: draw_frame.h:824
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
Definition: view.cpp:1253
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:60
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Auxiliary rendering target (noncached)
Definition: definitions.h:42
bool TransferDataToWindow() override
Load the panel controls from the given opt.
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:575
static bool Invoke(FOOTPRINT_EDIT_FRAME &aCaller)
DIALOG_MODEDIT_DISPLAY_OPTIONS(FOOTPRINT_EDIT_FRAME &aParent)
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Class VIEW.
Definition: view.h:58
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.