34 #ifdef CHECK_MEMORY_LEAKS 36 #endif // CHECK_MEMORY_LEAKS 44 while (w->numChildren() != 0) {
45 FXWindow* child = w->childAtIndex(0);
53 const FXString& file) {
54 if (!FXStat::exists(file)) {
58 FXMessageBox::question(parent, MBOX_YES_NO,
"File Exists",
"Overwrite '%s'?", file.text());
59 if (answer == MBOX_CLICKED_NO) {
68 return FXPath::name(filename);
74 if (filename.length() == 0) {
83 FXString ext = FXPath::extension(filename);
85 if (filename.rfind(
'.') == filename.length() - 1) {
86 return filename + defaultExtension;
88 return filename +
"." + defaultExtension;
96 const FXString& header,
const FXString& extension,
97 FXIcon* icon, FXString& currentFolder) {
99 FXFileDialog opendialog(parent, header);
100 opendialog.setIcon(icon);
101 opendialog.setSelectMode(SELECTFILE_ANY);
102 opendialog.setPatternList(
"*" + extension);
103 if (currentFolder.length() != 0) {
104 opendialog.setDirectory(currentFolder);
106 if (!opendialog.execute()) {
109 FXString file =
assureExtension(opendialog.getFilename(), extension.after(
'.')).text();
113 currentFolder = opendialog.getDirectory();
120 return RGBColor(FXREDVAL(col), FXGREENVAL(col), FXBLUEVAL(col), FXALPHAVAL(col));
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.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
unsigned char blue() const
Returns the blue-amount of the color.
unsigned char alpha() const
Returns the alpha-amount of the color.
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
unsigned char green() const
Returns the green-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.
unsigned char red() const
Returns the red-amount of the color.