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-2022 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// Some helper functions for FOX
19/****************************************************************************/
20#ifndef MFXUtils_h
21#define MFXUtils_h
22#include <config.h>
23
24#include "fxheader.h"
25
26// ===========================================================================
27// class declaration
28// ===========================================================================
29class RGBColor;
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
38class MFXUtils {
39public:
44 static void deleteChildren(FXWindow* w);
45
46
59 FXWindow* const parent, const FXString& file);
60
61
72 static FXString getTitleText(const FXString& appname,
73 FXString filename = "");
74
75
84 static FXString getDocumentName(const FXString& filename);
85
86
97 static FXString assureExtension(const FXString& filename, const FXString& defaultExtension);
98
99
117 static FXString getFilename2Write(FXWindow* parent,
118 const FXString& header, const FXString& extension,
119 FXIcon* icon, FXString& currentFolder);
120
121
123 static RGBColor getRGBColor(FXColor col);
124
126 static FXColor getFXColor(const RGBColor& col);
127
128};
129
130
131#endif
Some helper functions for FOX.
Definition: MFXUtils.h:38
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
Definition: MFXUtils.cpp:30
static FXString getDocumentName(const FXString &filename)
Returns the document name.
Definition: MFXUtils.cpp:54
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:82
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:112
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:60
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:106
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:39
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
Definition: MFXUtils.cpp:69