Eclipse SUMO - Simulation of Urban MObility
GUIDesigns.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-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 // File with the definitions of standard style of FXObjects in SUMO
19 /****************************************************************************/
20 
21 #include "GUIDesigns.h"
22 
24 
25 
26 // ===========================================================================
27 // Definitions
28 // ===========================================================================
29 
30 FXMenuTitle*
31 GUIDesigns::buildFXMenuTitle(FXComposite* p, const std::string& text, FXIcon* icon, FXMenuPane* menuPane) {
32  // create menu title
33  FXMenuTitle* menuTitle = new FXMenuTitle(p, text.c_str(), icon, menuPane, LAYOUT_FIX_HEIGHT);
34  // setheight (to avoid problems between Windows und Linux)
35  menuTitle->setHeight(GUIDesignHeight);
36  // return menuTitle
37  return menuTitle;
38 }
39 
40 
41 FXMenuCommand*
42 GUIDesigns::buildFXMenuCommand(FXComposite* p, const std::string& text, FXIcon* icon, FXObject* tgt, FXSelector sel) {
43  // build menu command
44  FXMenuCommand* menuCommand = new FXMenuCommand(p, text.c_str(), icon, tgt, sel, LAYOUT_FIX_HEIGHT);
45  // set width and height (to avoid problems between Windows und Linux)
46  menuCommand->setHeight(GUIDesignHeight);
47  // return menuCommand
48  return menuCommand;
49 }
50 
51 
52 FXMenuCommand*
53 GUIDesigns::buildFXMenuCommandShortcut(FXComposite* p, const std::string& text, const std::string& shortcut, const std::string& info, FXIcon* icon, FXObject* tgt, FXSelector sel) {
54  // build menu command with shortcut
55  FXMenuCommand* menuCommand = new FXMenuCommand(p, (text + "\t" + shortcut + "\t" + info).c_str(), icon, tgt, sel, LAYOUT_FIX_HEIGHT);
56  // set width and height (to avoid problems between Windows und Linux)
57  menuCommand->setHeight(GUIDesignHeight);
58  // return menuCommand
59  return menuCommand;
60 }
61 
62 
63 FXMenuCheck*
64 GUIDesigns::buildFXMenuCheckbox(FXComposite* p, const std::string& text, const std::string& info, FXObject* tgt, FXSelector sel) {
65  // build menu checkbox
66  FXMenuCheck* menuCheck = new FXMenuCheck(p, (text + "\t\t" + info).c_str(), tgt, sel, LAYOUT_FIX_HEIGHT);
67  // set height (to avoid problems between Windows und Linux)
68  menuCheck->setHeight(GUIDesignHeight);
69  // return menuCommand
70  return menuCheck;
71 }
72 
73 
75 GUIDesigns::buildFXMenuCheckboxIcon(FXComposite* p, const std::string& text, const std::string& shortcut, const std::string& info, FXIcon* icon, FXObject* tgt, FXSelector sel) {
76  // build menu checkbox
77  FXMenuCheckIcon* menuCheck = new FXMenuCheckIcon(p, (text + "\t" + shortcut + "\t" + info).c_str(), icon, tgt, sel, LAYOUT_FIX_HEIGHT);
78  // set height (to avoid problems between Windows und Linux)
79  menuCheck->setHeight(GUIDesignHeight);
80  // return menuCommand
81  return menuCheck;
82 }
83 
84 
85 FXMenuCommand*
86 GUIDesigns::buildFXMenuCommandRecentFile(FXComposite* p, const std::string& text, FXObject* tgt, FXSelector sel) {
87  // build rest of menu commands
88  FXMenuCommand* menuCommand = new FXMenuCommand(p, text.c_str(), nullptr, tgt, sel, LAYOUT_FIX_HEIGHT);
89  // set width and height (to avoid problems between Windows und Linux)
90  menuCommand->setHeight(GUIDesignHeight);
91  // return menuCommand
92  return menuCommand;
93 }
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
Definition: GUIDesigns.h:37
static FXMenuCheckIcon * buildFXMenuCheckboxIcon(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu checkbox with icon
Definition: GUIDesigns.cpp:75
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
Definition: GUIDesigns.cpp:31
static FXMenuCommand * buildFXMenuCommandRecentFile(FXComposite *p, const std::string &text, FXObject *tgt, FXSelector sel)
build menu command (for recent files)
Definition: GUIDesigns.cpp:86
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:42
static FXMenuCheck * buildFXMenuCheckbox(FXComposite *p, const std::string &text, const std::string &info, FXObject *tgt, FXSelector sel)
build menu checkbox
Definition: GUIDesigns.cpp:64
static FXMenuCommand * buildFXMenuCommandShortcut(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:53