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-2020 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 
23 
24 // ===========================================================================
25 // Definitions
26 // ===========================================================================
27 
28 FXMenuTitle*
29 GUIDesigns::buildFXMenuTitle(FXComposite* p, const std::string& text, FXIcon* icon, FXMenuPane* menuPane) {
30  // create menu title
31  FXMenuTitle* menuTitle = new FXMenuTitle(p, text.c_str(), icon, menuPane, LAYOUT_FIX_HEIGHT);
32  // setheight (to avoid problems between Windows und Linux)
33  menuTitle->setHeight(GUIDesignHeight);
34  // return menuTitle
35  return menuTitle;
36 }
37 
38 
39 FXMenuCommand*
40 GUIDesigns::buildFXMenuCommand(FXComposite* p, const std::string& text, FXIcon* icon, FXObject* tgt, FXSelector sel) {
41  // build menu command
42  FXMenuCommand* menuCommand = new FXMenuCommand(p, text.c_str(), icon, tgt, sel, LAYOUT_FIX_HEIGHT);
43  // set width and height (to avoid problems between Windows und Linux)
44  menuCommand->setHeight(GUIDesignHeight);
45  // return menuCommand
46  return menuCommand;
47 }
48 
49 
50 FXMenuCommand*
51 GUIDesigns::buildFXMenuCommandShortcut(FXComposite* p, const std::string& text, const std::string& shortcut, const std::string& info, FXIcon* icon, FXObject* tgt, FXSelector sel) {
52  // build menu command with shortcut
53  FXMenuCommand* menuCommand = new FXMenuCommand(p, (text + "\t" + shortcut + "\t" + info).c_str(), icon, tgt, sel, LAYOUT_FIX_HEIGHT);
54  // set width and height (to avoid problems between Windows und Linux)
55  menuCommand->setHeight(GUIDesignHeight);
56  // return menuCommand
57  return menuCommand;
58 }
59 
60 
61 FXMenuCommand*
62 GUIDesigns::buildFXMenuCommandRecentFile(FXComposite* p, const std::string& text, FXObject* tgt, FXSelector sel) {
63  // build rest of menu commands
64  FXMenuCommand* menuCommand = new FXMenuCommand(p, text.c_str(), nullptr, tgt, sel, LAYOUT_FIX_HEIGHT);
65  // set width and height (to avoid problems between Windows und Linux)
66  menuCommand->setHeight(GUIDesignHeight);
67  // return menuCommand
68  return menuCommand;
69 }
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
Definition: GUIDesigns.h:31
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
Definition: GUIDesigns.cpp:29
static FXMenuCommand * buildFXMenuCommandRecentFile(FXComposite *p, const std::string &text, FXObject *tgt, FXSelector sel)
build menu command (for recent files)
Definition: GUIDesigns.cpp:62
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
Definition: GUIDesigns.cpp:40
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:51