summaryrefslogtreecommitdiff
path: root/src/Fl_File_Chooser.cxx
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2020-07-14 11:34:18 -0700
committerGreg Ercolano <erco@seriss.com>2020-07-14 11:34:18 -0700
commit54425030774eb04b29c749ffa85d224c8bbfcc34 (patch)
treef6e8b0c9fd46f5bcf160de82d613e7799288e277 /src/Fl_File_Chooser.cxx
parent58296c373a79ac404e86f8a4b20a5309db2f00de (diff)
parentda76085fe71d2271847f95f5aa0694a9373fbba0 (diff)
Merge branch 'issue-99a': add OS error messages to Fl_File_Chooser
Pulling in Greg & Albrecht's work on PR #99 and PR #103. This includes supporting operating system error messages in the user's local language, which took some extra effort.
Diffstat (limited to 'src/Fl_File_Chooser.cxx')
-rw-r--r--src/Fl_File_Chooser.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index 8036ffaed..22fadf57f 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -197,9 +197,18 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
o->callback((Fl_Callback*)cb_);
{ fileList = new Fl_File_Browser(10, 45, 295, 225);
fileList->type(2);
+ fileList->box(FL_DOWN_BOX);
fileList->callback((Fl_Callback*)cb_fileList);
fileList->window()->hotspot(fileList);
} // Fl_File_Browser* fileList
+ { errorBox = new Fl_Box(10, 45, 295, 225, "dynamic error display");
+ errorBox->box(FL_DOWN_BOX);
+ errorBox->color(FL_BACKGROUND2_COLOR);
+ errorBox->labelsize(18);
+ errorBox->labelcolor((Fl_Color)1);
+ errorBox->align(Fl_Align(133|FL_ALIGN_INSIDE));
+ errorBox->hide();
+ } // Fl_Box* errorBox
{ previewBox = new Fl_Box(305, 45, 175, 225, "?");
previewBox->box(FL_DOWN_BOX);
previewBox->labelsize(100);
@@ -471,3 +480,17 @@ Fl_Widget* Fl_File_Chooser::add_extra(Fl_Widget* gr) {
}
return ret;
}
+
+/**
+ Show error box if val=1, hide if val=0
+*/
+void Fl_File_Chooser::show_error_box(int val) {
+ if ( val ) {
+ errorBox->color(fileList->color()); // inherit fileList's bg color
+ errorBox->show();
+ fileList->hide();
+ } else {
+ errorBox->hide();
+ fileList->show();
+ }
+}