Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MFXUtils.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2006-2024 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#pragma once
21#include <config.h>
22
23#include "fxheader.h"
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28class RGBColor;
29
30// ===========================================================================
31// class definitions
32// ===========================================================================
37class MFXUtils {
38public:
43 static void deleteChildren(FXWindow* w);
44
45
58 FXWindow* const parent, const FXString& file);
59
60
71 static FXString getTitleText(const FXString& appname,
72 FXString filename = "");
73
74
83 static FXString getDocumentName(const FXString& filename);
84
85
96 static FXString assureExtension(const FXString& filename, const FXString& defaultExtension);
97
98
116 static FXString getFilename2Write(FXWindow* parent,
117 const FXString& header, const FXString& extension,
118 FXIcon* icon, FXString& currentFolder);
119
120
122 static RGBColor getRGBColor(FXColor col);
123
125 static FXColor getFXColor(const RGBColor& col);
126
127};
Some helper functions for FOX.
Definition MFXUtils.h:37
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 dependence 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