KiCad PCB EDA Suite
Loading...
Searching...
No Matches
button_row_panel.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 The 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
#pragma once
25
26
#include "wx/panel.h"
27
28
#include <vector>
29
#include <functional>
30
31
32
// Forward defs for private-only classes
33
class
wxBoxSizer;
34
35
39
class
BUTTON_ROW_PANEL
:
public
wxPanel
40
{
41
public
:
42
47
using
BTN_CALLBACK
= std::function< void( wxCommandEvent& ) >;
48
52
struct
BTN_DEF
53
{
58
wxWindowID
m_id
;
59
63
wxString
m_text
;
64
68
wxString
m_tooltip
;
69
74
BTN_CALLBACK
m_callback
;
75
};
76
80
using
BTN_DEF_LIST
= std::vector<BTN_DEF>;
81
88
BUTTON_ROW_PANEL
( wxWindow* aWindow,
const
BTN_DEF_LIST
& aLeftBtns,
const
BTN_DEF_LIST
& aRightBtns );
89
90
private
:
98
void
addButtons
(
bool
aLeft,
const
BTN_DEF_LIST
& aDefs );
99
100
private
:
101
wxBoxSizer*
m_sizer
;
102
};
BUTTON_ROW_PANEL::m_sizer
wxBoxSizer * m_sizer
Definition
button_row_panel.h:101
BUTTON_ROW_PANEL::BTN_CALLBACK
std::function< void(wxCommandEvent &) > BTN_CALLBACK
Callback function definition.
Definition
button_row_panel.h:47
BUTTON_ROW_PANEL::BUTTON_ROW_PANEL
BUTTON_ROW_PANEL(wxWindow *aWindow, const BTN_DEF_LIST &aLeftBtns, const BTN_DEF_LIST &aRightBtns)
Construct a SIMPLE_BUTTON_PANEL with a set of buttons on each side.
Definition
button_row_panel.cpp:31
BUTTON_ROW_PANEL::addButtons
void addButtons(bool aLeft, const BTN_DEF_LIST &aDefs)
Add a set of buttons to one side of the panel.
Definition
button_row_panel.cpp:49
BUTTON_ROW_PANEL::BTN_DEF_LIST
std::vector< BTN_DEF > BTN_DEF_LIST
A list of BTN_DEFs, used to group buttons into the left/right groups.
Definition
button_row_panel.h:80
BUTTON_ROW_PANEL::BTN_DEF
The information needed to instantiate a button on a BUTTON_ROW_PANEL.
Definition
button_row_panel.h:53
BUTTON_ROW_PANEL::BTN_DEF::m_tooltip
wxString m_tooltip
Button tooltip text - empty string for no tooltip.
Definition
button_row_panel.h:68
BUTTON_ROW_PANEL::BTN_DEF::m_id
wxWindowID m_id
The button ID.
Definition
button_row_panel.h:58
BUTTON_ROW_PANEL::BTN_DEF::m_text
wxString m_text
The button display text.
Definition
button_row_panel.h:63
BUTTON_ROW_PANEL::BTN_DEF::m_callback
BTN_CALLBACK m_callback
The callback fired when the button is clicked.
Definition
button_row_panel.h:74
src
include
widgets
button_row_panel.h
Generated on Tue Nov 11 2025 00:06:15 for KiCad PCB EDA Suite by
1.13.2