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.dev/sumo
3 // Copyright (C) 2006-2024 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 
29 class GNEFrame;
30 class MFXButtonTooltip;
31 
33 class MFXGroupBoxModule : protected FXVerticalFrame {
34  FXDECLARE(MFXGroupBoxModule)
35 
36 public:
38  enum Options {
39  NOTHING = 1 << 0, // Basic GroupBox
40  COLLAPSIBLE = 1 << 1, // Collapsible groupBox
41  EXTENSIBLE = 1 << 2, // Extensible groupBox
42  SAVE = 1 << 3, // Save contents
43  LOAD = 1 << 4, // Load contents
44  };
45 
47  MFXGroupBoxModule(GNEFrame* frame, const std::string& text, const int options = Options::COLLAPSIBLE);
48 
50  MFXGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options = Options::NOTHING);
51 
54 
56  void setText(const std::string& text);
57 
59  FXVerticalFrame* getCollapsableFrame();
60 
62  long onPaint(FXObject*, FXSelector, void*);
63 
65  long onCmdCollapseButton(FXObject*, FXSelector, void*);
66 
68  long onCmdExtendButton(FXObject*, FXSelector, void*);
69 
71  long onCmdResetButton(FXObject*, FXSelector, void*);
72 
74  long onUpdResetButton(FXObject*, FXSelector, void*);
75 
77  long onCmdSaveButton(FXObject*, FXSelector, void*);
78 
80  long onCmdLoadButton(FXObject*, FXSelector, void*);
81 
82 protected:
85 
87  virtual bool saveContents() const;
88 
90  virtual bool loadContents() const;
91 
93  void toggleSaveButton(const bool value);
94 
95 private:
97  const int myOptions;
98 
101 
103  FXVerticalFrame* myCollapsableFrame = nullptr;
104 
106  FXLabel* myLabel = nullptr;
107 
109  FXButton* myCollapseButton = nullptr;
110 
113 
115  FXButton* myResetWidthButton = nullptr;
116 
118  FXButton* mySaveButton = nullptr;
119 
121  FXButton* myLoadButton = nullptr;
122 
125 };
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
MFXButtonTooltip * myExtendButton
button for extend elements
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.
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)