KiCad PCB EDA Suite
panel_gal_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) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include <eda_draw_frame.h>
21 #include <view/view.h>
23 #include <widgets/paged_dialog.h>
24 
26 
27 #include <wx/treebook.h>
28 
29 
31  PAGED_DIALOG* aParent ) :
32  wxPanel( aParent->GetTreebook(), wxID_ANY ),
33  m_frame( aFrame )
34 {
35  auto mainSizer = new wxBoxSizer( wxHORIZONTAL );
36  SetSizer( mainSizer );
37 
38  // install GAL options pane
40  mainSizer->Add( m_galOptsPanel, 1, wxEXPAND | wxLEFT, 5 );
41 
42  // a spacer to take up the other half of the width
43  auto spacer = new wxPanel( this, wxID_ANY );
44  mainSizer->Add( spacer, 1, wxEXPAND | wxLEFT, 5 );
45 }
46 
47 
49 {
51  return true;
52 }
53 
54 
56 {
58 
59  // refresh view
60  KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
61  view->RecacheAllItems();
64 
65  return true;
66 }
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void RecacheAllItems()
Rebuild GAL display lists.
Definition: view.cpp:1389
The base class for create windows for drawing purpose.
Auxiliary rendering target (noncached)
Definition: definitions.h:49
bool TransferDataToWindow() override
Load the panel controls from the given opt.
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:609
PANEL_GAL_DISPLAY_OPTIONS(EDA_DRAW_FRAME *aFrame, PAGED_DIALOG *aParent)
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.