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 /****************************************************************************/
15 // Some helper functions for FOX
16 /****************************************************************************/
17 #ifndef MFXUtils_h
18 #define MFXUtils_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
27 
28 // ===========================================================================
29 // class declaration
30 // ===========================================================================
31 class RGBColor;
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
40 class MFXUtils {
41 public:
46  static void deleteChildren(FXWindow* w);
47 
48 
61  FXWindow* const parent, const FXString& file);
62 
63 
74  static FXString getTitleText(const FXString& appname,
75  FXString filename = "");
76 
77 
86  static FXString getDocumentName(const FXString& filename);
87 
88 
99  static FXString assureExtension(const FXString& filename, const FXString& defaultExtension);
100 
101 
119  static FXString getFilename2Write(FXWindow* parent,
120  const FXString& header, const FXString& extension,
121  FXIcon* icon, FXString& currentFolder);
122 
123 
125  static RGBColor getRGBColor(FXColor col);
126 
128  static FXColor getFXColor(const RGBColor& col);
129 
130 };
131 
132 
133 #endif
134 
135 /****************************************************************************/
136 
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:108
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:41
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:32
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:84
Some helper functions for FOX.
Definition: MFXUtils.h:40
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
Definition: MFXUtils.cpp:71
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:62
static FXString getDocumentName(const FXString &filename)
Returns the document name.
Definition: MFXUtils.cpp:56