KiCad PCB EDA Suite
grid_menu.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) 2015 CERN
5 * @author Maciej Suminski <[email protected]>
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 2
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
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef GRID_MENU_H
26#define GRID_MENU_H
27
28#include <tool/action_menu.h>
29
30class EDA_DRAW_FRAME;
32
33class GRID_MENU : public ACTION_MENU
34{
35public:
36 GRID_MENU( EDA_DRAW_FRAME* aParent );
37
38 void UpdateTitle() override;
39
40 static void BuildChoiceList( wxArrayString* aGridsList, APP_SETTINGS_BASE* aCfg,
41 EDA_DRAW_FRAME* aParent );
42
43private:
44 ACTION_MENU* create() const override
45 {
46 return new GRID_MENU( m_parent );
47 }
48
49 OPT_TOOL_EVENT eventHandler( const wxMenuEvent& aEvent ) override;
50 void update() override;
51
53};
54
55#endif /* GRID_MENU_H */
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:49
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:101
The base class for create windows for drawing purpose.
ACTION_MENU * create() const override
< Return an instance of this class. It has to be overridden in inheriting classes.
Definition: grid_menu.h:44
OPT_TOOL_EVENT eventHandler(const wxMenuEvent &aEvent) override
Event handler stub.
Definition: grid_menu.cpp:54
void update() override
Update menu state stub.
Definition: grid_menu.cpp:68
void UpdateTitle() override
Used by some menus to just-in-time translate their titles.
Definition: grid_menu.cpp:62
GRID_MENU(EDA_DRAW_FRAME *aParent)
Definition: grid_menu.cpp:36
static void BuildChoiceList(wxArrayString *aGridsList, APP_SETTINGS_BASE *aCfg, EDA_DRAW_FRAME *aParent)
Definition: grid_menu.cpp:85
EDA_DRAW_FRAME * m_parent
Definition: grid_menu.h:52
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:550