39 while (w->numChildren() != 0) {
40 FXWindow* child = w->childAtIndex(0);
48 const FXString& file) {
49 if (!FXStat::exists(file)) {
53 FXMessageBox::question(parent, MBOX_YES_NO,
"File Exists",
"Overwrite '%s'?", file.text());
54 if (answer == MBOX_CLICKED_NO) {
63 return FXPath::name(filename);
69 if (filename.length() == 0) {
78 FXString ext = FXPath::extension(filename);
80 if (filename.rfind(
'.') == filename.length() - 1) {
81 return filename + defaultExtension;
83 return filename +
"." + defaultExtension;
91 const FXString& header,
const FXString& extension,
92 FXIcon* icon, FXString& currentFolder) {
94 FXFileDialog opendialog(parent, header);
95 opendialog.setIcon(icon);
96 opendialog.setSelectMode(SELECTFILE_ANY);
97 opendialog.setPatternList(
"*" + extension);
98 if (currentFolder.length() != 0) {
99 opendialog.setDirectory(currentFolder);
101 if (!opendialog.execute()) {
104 FXString file =
assureExtension(opendialog.getFilename(), extension.after(
'.')).text();
108 currentFolder = opendialog.getDirectory();
115 return RGBColor(FXREDVAL(col), FXGREENVAL(col), FXBLUEVAL(col), FXALPHAVAL(col));
unsigned char alpha() const
Returns the alpha-amount of the color.
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 void deleteChildren(FXWindow *w)
Deletes all children of the given window.
unsigned char blue() const
Returns the blue-amount of the color.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
unsigned char green() const
Returns the green-amount of the color.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
unsigned char red() const
Returns the red-amount of the color.
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
static FXString getDocumentName(const FXString &filename)
Returns the document name.