31 while (w->numChildren() != 0) {
32 FXWindow* child = w->childAtIndex(0);
40 const FXString& file) {
41 if (!FXStat::exists(file)) {
45 FXMessageBox::question(parent, MBOX_YES_NO,
"File Exists",
"Overwrite '%s'?", file.text());
46 if (answer == MBOX_CLICKED_NO) {
55 return FXPath::name(filename);
61 if (filename.length() == 0) {
70 FXString ext = FXPath::extension(filename);
72 if (filename.rfind(
'.') == filename.length() - 1) {
73 return filename + defaultExtension;
75 return filename +
"." + defaultExtension;
83 const FXString& header,
const FXString& extension,
84 FXIcon* icon, FXString& currentFolder) {
86 FXFileDialog opendialog(parent, header);
87 opendialog.setIcon(icon);
88 opendialog.setSelectMode(SELECTFILE_ANY);
89 opendialog.setPatternList(
"*" + extension);
90 if (currentFolder.length() != 0) {
91 opendialog.setDirectory(currentFolder);
93 if (!opendialog.execute()) {
96 FXString file =
assureExtension(opendialog.getFilename(), extension.after(
'.')).text();
100 currentFolder = opendialog.getDirectory();
107 return RGBColor(FXREDVAL(col), FXGREENVAL(col), FXBLUEVAL(col), FXALPHAVAL(col));
static void deleteChildren(FXWindow *w)
Deletes all children of the given window.
static FXString getDocumentName(const FXString &filename)
Returns the document name.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependence to an optional file name.
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
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.
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
unsigned char red() const
Returns the red-amount of the color.
unsigned char alpha() const
Returns the alpha-amount of the color.
unsigned char green() const
Returns the green-amount of the color.
unsigned char blue() const
Returns the blue-amount of the color.