Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIDesigns.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 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
30FXMenuTitle*
31GUIDesigns::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
41FXMenuCommand*
42GUIDesigns::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
52FXMenuCommand*
53GUIDesigns::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
63FXMenuCheck*
64GUIDesigns::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 + std::string("\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
75GUIDesigns::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 MFXMenuCheckIcon* menuCheck = new MFXMenuCheckIcon(p, text, shortcut, info, 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
85FXMenuCommand*
86GUIDesigns::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 MFXMenuCheckIcon * 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
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
static FXMenuCommand * buildFXMenuCommandRecentFile(FXComposite *p, const std::string &text, FXObject *tgt, FXSelector sel)
build menu command (for recent files)
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static FXMenuCheck * buildFXMenuCheckbox(FXComposite *p, const std::string &text, const std::string &info, FXObject *tgt, FXSelector sel)
build menu checkbox
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