KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_chooser_frame.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) 2023 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
24
25#ifndef SYMBOL_CHOOSER_FRAME_H
26#define SYMBOL_CHOOSER_FRAME_H
27
28#include <sch_base_frame.h>
29
31
32
37{
38public:
45 SYMBOL_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aParent );
46
48
55 bool ShowModal( wxString* aSymbol, wxWindow* aParent ) override;
56
64 void SetFilter( std::function<bool( LIB_TREE_NODE& aNode )>* aFilter );
65
66private:
67 void OnPaint( wxPaintEvent& aEvent );
68 void OnOK( wxCommandEvent& aEvent );
69
70 void doCloseWindow() override;
71 void CloseSymbolChooser( wxCommandEvent& aEvent );
72
74
75 DECLARE_EVENT_TABLE()
76
77private:
79
80 // On MacOS (at least) SetFocus() calls made in the constructor will fail because a
81 // window that isn't yet visible will return false to AcceptsFocus(). So we must delay
82 // the initial-focus SetFocus() call to the first paint event.
84};
85
86#endif // SYMBOL_CHOOSER_FRAME_H
87
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:284
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Symbol library viewer main window.
void OnOK(wxCommandEvent &aEvent)
void OnPaint(wxPaintEvent &aEvent)
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Return a pointer to the window settings for this frame.
bool ShowModal(wxString *aSymbol, wxWindow *aParent) override
Runs the symbol viewer as a modal dialog.
PANEL_SYMBOL_CHOOSER * m_chooserPanel
void SetFilter(std::function< bool(LIB_TREE_NODE &aNode)> *aFilter)
Set a filter to display only libraries and/or symbols which match the filter.
void CloseSymbolChooser(wxCommandEvent &aEvent)
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74