KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include <tool/action_menu.h>
25
26class EDA_DRAW_FRAME;
27struct WINDOW_SETTINGS;
28
29class GRID_MENU : public ACTION_MENU
30{
31public:
32 GRID_MENU( EDA_DRAW_FRAME* aParent );
33
34 void UpdateTitle() override;
35
36 static void BuildChoiceList( wxArrayString* aGridsList, WINDOW_SETTINGS* aCfg, EDA_DRAW_FRAME* aParent );
37
38private:
39 ACTION_MENU* create() const override
40 {
41 return new GRID_MENU( m_parent );
42 }
43
44 OPT_TOOL_EVENT eventHandler( const wxMenuEvent& aEvent ) override;
45 void update() override;
46
47private:
49};
ACTION_MENU(bool isContextMenu, TOOL_INTERACTIVE *aTool=nullptr)
Default constructor.
The base class for create windows for drawing purpose.
static void BuildChoiceList(wxArrayString *aGridsList, WINDOW_SETTINGS *aCfg, EDA_DRAW_FRAME *aParent)
Definition grid_menu.cpp:79
ACTION_MENU * create() const override
Return an instance of this class. It has to be overridden in inheriting classes.
Definition grid_menu.h:39
OPT_TOOL_EVENT eventHandler(const wxMenuEvent &aEvent) override
Event handler stub.
Definition grid_menu.cpp:42
void update() override
Update menu state stub.
Definition grid_menu.cpp:56
void UpdateTitle() override
Used by some menus to just-in-time translate their titles.
Definition grid_menu.cpp:50
GRID_MENU(EDA_DRAW_FRAME *aParent)
Definition grid_menu.cpp:32
EDA_DRAW_FRAME * m_parent
Definition grid_menu.h:48
Store the common settings that are saved and loaded for each window / frame.
std::optional< TOOL_EVENT > OPT_TOOL_EVENT
Definition tool_event.h:637