Eclipse SUMO - Simulation of Urban MObility
MFXGroupBoxModule.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2006-2022 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
24#include "fxheader.h"
25
26#include <string>
27
29class GNEFrame;
30
32class MFXGroupBoxModule : protected FXVerticalFrame {
33 FXDECLARE(MFXGroupBoxModule)
34
35public:
37 enum Options {
38 NOTHING = 1 << 0, // Basic GroupBox
39 COLLAPSIBLE = 1 << 1, // Collapsible groupBox
40 EXTENSIBLE = 1 << 2, // Extensible groupBox
41 SAVE = 1 << 3, // Save contents
42 LOAD = 1 << 4, // Load contents
43 };
44
46 MFXGroupBoxModule(GNEFrame* frame, const std::string& text, const int options = Options::COLLAPSIBLE);
47
49 MFXGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options = Options::NOTHING);
50
53
55 void setText(const std::string& text);
56
58 FXVerticalFrame* getCollapsableFrame();
59
61 long onPaint(FXObject*, FXSelector, void*);
62
64 long onCmdCollapseButton(FXObject*, FXSelector, void*);
65
67 long onCmdExtendButton(FXObject*, FXSelector, void*);
68
70 long onCmdResetButton(FXObject*, FXSelector, void*);
71
73 long onUpdResetButton(FXObject*, FXSelector, void*);
74
76 long onCmdSaveButton(FXObject*, FXSelector, void*);
77
79 long onCmdLoadButton(FXObject*, FXSelector, void*);
80
81protected:
84
86 virtual bool saveContents() const;
87
89 virtual bool loadContents() const;
90
92 void toggleSaveButton(const bool value);
93
94private:
96 const int myOptions;
97
100
102 FXVerticalFrame* myCollapsableFrame = nullptr;
103
105 FXLabel* myLabel = nullptr;
106
108 FXButton* myCollapseButton = nullptr;
109
111 FXButton* myExtendButton = nullptr;
112
114 FXButton* myResetWidthButton = nullptr;
115
117 FXButton* mySaveButton = nullptr;
118
120 FXButton* myLoadButton = nullptr;
121
124};
MFXGroupBoxModule (based on FXGroupBox)
long onCmdSaveButton(FXObject *, FXSelector, void *)
save contents
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
long onCmdExtendButton(FXObject *, FXSelector, void *)
extends GroupBoxModule
MFXGroupBoxModule()
FOX need this.
FXButton * myResetWidthButton
button for reset frame width
long onCmdLoadButton(FXObject *, FXSelector, void *)
load contents
void setText(const std::string &text)
set text
long onPaint(FXObject *, FXSelector, void *)
draw MFXGroupBoxModule
FXButton * mySaveButton
button for save elements
long onCmdResetButton(FXObject *, FXSelector, void *)
reset GroupBoxModule
Options
GroupBoxModule options.
bool myCollapsed
flag to check if this groupbox is collapsed
long onCmdCollapseButton(FXObject *, FXSelector, void *)
collapse GroupBoxModule
long onUpdResetButton(FXObject *, FXSelector, void *)
update reset GroupBoxModule
FXLabel * myLabel
label used in non collapsable MFXGroupBoxModule
FXButton * myLoadButton
button for load elements
void toggleSaveButton(const bool value)
enable or disable save buttons
virtual bool loadContents() const
load contents (can be reimplemented in children)
~MFXGroupBoxModule()
destructor
GNEFrame * myFrameParent
GNEFrame in which this GroupBox is placed.
FXButton * myExtendButton
button for extend elements
FXVerticalFrame * myCollapsableFrame
vertical collapsable frame
FXButton * myCollapseButton
button for collapse elements
const int myOptions
GroupBoxModule options.
virtual bool saveContents() const
save contents (can be reimplemented in children)