Eclipse SUMO - Simulation of Urban MObility
MFXUtils.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // Some helper functions for FOX
15 /****************************************************************************/
16 #ifndef MFXUtils_h
17 #define MFXUtils_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <fx.h>
26 
27 // ===========================================================================
28 // class declaration
29 // ===========================================================================
30 class RGBColor;
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 class MFXUtils {
40 public:
45  static void deleteChildren(FXWindow* w);
46 
47 
60  FXWindow* const parent, const FXString& file);
61 
62 
73  static FXString getTitleText(const FXString& appname,
74  FXString filename = "");
75 
76 
85  static FXString getDocumentName(const FXString& filename);
86 
87 
98  static FXString assureExtension(const FXString& filename, const FXString& defaultExtension);
99 
100 
118  static FXString getFilename2Write(FXWindow* parent,
119  const FXString& header, const FXString& extension,
120  FXIcon* icon, FXString& currentFolder);
121 
122 
124  static RGBColor getRGBColor(FXColor col);
125 
127  static FXColor getFXColor(const RGBColor& col);
128 
129 };
130 
131 
132 #endif
133 
134 /****************************************************************************/
135 
MFXUtils::getTitleText
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:61
MFXUtils::getFilename2Write
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:83
MFXUtils::getRGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:107
RGBColor
Definition: RGBColor.h:39
MFXUtils::assureExtension
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
Definition: MFXUtils.cpp:70
MFXUtils::getDocumentName
static FXString getDocumentName(const FXString &filename)
Returns the document name.
Definition: MFXUtils.cpp:55
config.h
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:113
MFXUtils::userPermitsOverwritingWhenFileExists
static FXbool userPermitsOverwritingWhenFileExists(FXWindow *const parent, const FXString &file)
Returns true if either the file given by its name does not exist or the user allows overwriting it.
Definition: MFXUtils.cpp:40
MFXUtils
Some helper functions for FOX.
Definition: MFXUtils.h:39
MFXUtils::deleteChildren
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:31