Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEGroupBoxModule.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2006-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18//
19/****************************************************************************/
20
21#pragma once
22#include <config.h>
23#include <string>
24
26
27// ===========================================================================
28// class declarations
29// ===========================================================================
30class GNEFrame;
32
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
38class GNEGroupBoxModule : protected FXVerticalFrame {
39 FXDECLARE(GNEGroupBoxModule)
40
41public:
43 enum Options {
44 NOTHING = 1 << 0, // Basic GroupBox
45 COLLAPSIBLE = 1 << 1, // Collapsible groupBox
46 EXTENSIBLE = 1 << 2, // Extensible groupBox
47 SAVE = 1 << 3, // Save contents
48 LOAD = 1 << 4, // Load contents
49 };
50
52 GNEGroupBoxModule(GNEFrame* frame, const std::string& text, const int options = Options::COLLAPSIBLE);
53
55 GNEGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options = Options::NOTHING);
56
59
61 void setText(const std::string& text);
62
64 FXVerticalFrame* getCollapsableFrame();
65
67 long onPaint(FXObject*, FXSelector, void*);
68
70 long onCmdCollapseButton(FXObject*, FXSelector, void*);
71
73 long onCmdExtendButton(FXObject*, FXSelector, void*);
74
76 long onCmdResetButton(FXObject*, FXSelector, void*);
77
79 long onUpdResetButton(FXObject*, FXSelector, void*);
80
82 long onCmdSaveButton(FXObject*, FXSelector, void*);
83
85 long onCmdLoadButton(FXObject*, FXSelector, void*);
86
87protected:
90
92 virtual bool saveContents() const;
93
95 virtual bool loadContents() const;
96
98 void toggleSaveButton(const bool value);
99
100private:
102 const int myOptions;
103
106
108 FXVerticalFrame* myCollapsableFrame = nullptr;
109
111 FXLabel* myLabel = nullptr;
112
114 FXButton* myCollapseButton = nullptr;
115
118
120 FXButton* myResetWidthButton = nullptr;
121
123 FXButton* mySaveButton = nullptr;
124
126 FXButton* myLoadButton = nullptr;
127
130};
GNEGroupBoxModule (based on FXGroupBox)
FXButton * mySaveButton
button for save elements
FXLabel * myLabel
label used in non collapsable GNEGroupBoxModule
long onCmdExtendButton(FXObject *, FXSelector, void *)
extends GroupBoxModule
void setText(const std::string &text)
set text
long onCmdCollapseButton(FXObject *, FXSelector, void *)
collapse GroupBoxModule
FXVerticalFrame * myCollapsableFrame
vertical collapsable frame
long onCmdSaveButton(FXObject *, FXSelector, void *)
save contents
Options
GroupBoxModule options.
const int myOptions
GroupBoxModule options.
long onUpdResetButton(FXObject *, FXSelector, void *)
update reset GroupBoxModule
FXButton * myLoadButton
button for load elements
bool myCollapsed
flag to check if this groupbox is collapsed
long onCmdResetButton(FXObject *, FXSelector, void *)
reset GroupBoxModule
virtual bool saveContents() const
save contents (can be reimplemented in children)
FXButton * myCollapseButton
button for collapse elements
long onPaint(FXObject *, FXSelector, void *)
draw GNEGroupBoxModule
GNEFrame * myFrameParent
GNEFrame in which this GroupBox is placed.
FXButton * myResetWidthButton
button for reset frame width
void toggleSaveButton(const bool value)
enable or disable save buttons
MFXButtonTooltip * myExtendButton
button for extend elements
long onCmdLoadButton(FXObject *, FXSelector, void *)
load contents
GNEGroupBoxModule()
FOX need this.
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
virtual bool loadContents() const
load contents (can be reimplemented in children)