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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Some helper functions for FOX
18 /****************************************************************************/
19 #ifndef MFXUtils_h
20 #define MFXUtils_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <fx.h>
33 
34 // ===========================================================================
35 // class declaration
36 // ===========================================================================
37 class RGBColor;
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 class MFXUtils {
47 public:
52  static void deleteChildren(FXWindow* w);
53 
54 
67  FXWindow* const parent, const FXString& file);
68 
69 
80  static FXString getTitleText(const FXString& appname,
81  FXString filename = "");
82 
83 
92  static FXString getDocumentName(const FXString& filename);
93 
94 
105  static FXString assureExtension(const FXString& filename, const FXString& defaultExtension);
106 
107 
125  static FXString getFilename2Write(FXWindow* parent,
126  const FXString& header, const FXString& extension,
127  FXIcon* icon, FXString& currentFolder);
128 
129 
131  static RGBColor getRGBColor(FXColor col);
132 
134  static FXColor getFXColor(const RGBColor& col);
135 
136 };
137 
138 
139 #endif
140 
141 /****************************************************************************/
142 
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
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:47
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:38
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:90
Some helper functions for FOX.
Definition: MFXUtils.h:46
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
Definition: MFXUtils.cpp:77
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:120
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:68
static FXString getDocumentName(const FXString &filename)
Returns the document name.
Definition: MFXUtils.cpp:62