33 while (w->numChildren() != 0) {
34 FXWindow* child = w->childAtIndex(0);
42 const FXString& file) {
43 if (!FXStat::exists(file)) {
47 FXMessageBox::question(parent, MBOX_YES_NO,
"File Exists",
"Overwrite '%s'?", file.text());
48 if (answer == MBOX_CLICKED_NO) {
57 return FXPath::name(filename);
63 if (filename.length() == 0) {
72 FXString ext = FXPath::extension(filename);
74 if (filename.rfind(
'.') == filename.length() - 1) {
75 return filename + defaultExtension;
77 return filename +
"." + defaultExtension;
85 const FXString& header,
const FXString& extension,
86 FXIcon* icon, FXString& currentFolder) {
88 FXFileDialog opendialog(parent, header);
89 opendialog.setIcon(icon);
90 opendialog.setSelectMode(SELECTFILE_ANY);
91 opendialog.setPatternList(
"*" + extension);
92 if (currentFolder.length() != 0) {
93 opendialog.setDirectory(currentFolder);
95 if (!opendialog.execute()) {
98 FXString file =
assureExtension(opendialog.getFilename(), extension.after(
'.')).text();
102 currentFolder = opendialog.getDirectory();
109 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.