diff options
| author | Greg Ercolano <erco@seriss.com> | 2020-07-10 21:49:00 -0700 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-14 12:52:56 +0200 |
| commit | 0693c70f577624e66fd660a888f2d2bcd3fc180b (patch) | |
| tree | e3b4161c0516ebacaf84e9b58852f48d4e4b6357 /src/Fl_File_Chooser.fl | |
| parent | 9925b0f12852dc37fb7fb773a525486c258d2c62 (diff) | |
First pass at fixing issue 99
A lot of code touched because low level functions needed to pass up
error messages reliably, and this had to propagate up the entire
driver hierarchy.
Tested OK *in English* on:
> Linux
> OSX 10.10.x
> Windows VS2017
> Windows mingw64
I have no way to test on Android, but it might work.
TODO: Needs testing in other languages to verify proper UTF8 error messages,
esp. with Windows VS, due to complexities with FormatMessage() -- see get_ms_errmsg()
Diffstat (limited to 'src/Fl_File_Chooser.fl')
| -rw-r--r-- | src/Fl_File_Chooser.fl | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index d222bd1c8..7cf01e1c7 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -66,7 +66,8 @@ class FL_EXPORT Fl_File_Chooser {open } decl {void update_preview();} {private local } - Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {} { + Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {open + } { code {if (!prefs_) { prefs_ = new Fl_Preferences(Fl_Preferences::CORE_USER, "fltk.org", "filechooser"); }} {} @@ -77,11 +78,11 @@ class FL_EXPORT Fl_File_Chooser {open fileList->deselect(); Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); window->hide();} open - private xywh {507 327 490 380} type Double hide resizable + private xywh {1171 438 490 380} type Double resizable code0 {if (title) window->label(title);} code1 {\#include <stdio.h>} code2 {\#include <stdlib.h>} - code3 {\#include <string.h>} modal + code3 {\#include <string.h>} modal visible } { Fl_Group {} {open private xywh {10 10 470 25} @@ -106,14 +107,18 @@ window->hide();} open } } Fl_Tile {} { - callback {update_preview();} + callback {update_preview();} open private xywh {10 45 470 225} resizable } { Fl_File_Browser fileList { callback {fileListCB();} - private xywh {10 45 295 225} type Hold hotspot + private xywh {10 45 295 225} type Hold box DOWN_BOX hotspot code0 {\#include <FL/Fl_File_Browser.H>} } + Fl_Box errorBox { + label {dynamic error display} selected + private xywh {10 45 295 225} box DOWN_BOX color 7 labelsize 18 labelcolor 1 align 149 hide + } Fl_Box previewBox { label {?} private xywh {305 45 175 225} box DOWN_BOX labelsize 100 align 80 @@ -349,7 +354,7 @@ okButton->parent()->init_sizes();} {} } { code {fileList->textfont(f);} {} } - Function {textfont()} {selected return_type Fl_Font + Function {textfont()} {return_type Fl_Font } { code {return (fileList->textfont());} {} } @@ -475,6 +480,18 @@ window->resizable(svres);} {} } code {return ret;} {} } + Function {show_error_box(int val)} { + comment {Show error box if val=1, hide if val=0} open protected return_type void + } { + code {if ( val ) { + errorBox->color(fileList->color()); // inherit fileList's bg color + errorBox->show(); + fileList->hide(); +} else { + errorBox->hide(); + fileList->show(); +}} {} + } } decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public local |
