summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2007-02-21 20:23:03 +0000
committerMatthias Melcher <fltk@matthiasm.com>2007-02-21 20:23:03 +0000
commite954c5d4337746150d880d37f0016c378b065735 (patch)
treee7f27f5ccd3f28c9929dd04ddfb09b9bc8cb1e06 /src
parentd1f1f1f26ffd7a6649257c0d8e7bb9bf98e22a2c (diff)
Fixed file chooser to behave transparently to the current group setting
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5704 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_File_Chooser.cxx2
-rw-r--r--src/Fl_File_Chooser.fl14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index 5522d4f75..01dd78fd7 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -159,6 +159,7 @@ void Fl_File_Chooser::cb_favOkButton(Fl_Return_Button* o, void* v) {
}
Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) {
+ Fl_Group *prev_current = Fl_Group::current();
{ window = new Fl_Double_Window(490, 380, "Choose File");
window->callback((Fl_Callback*)cb_window, (void*)(this));
{ Fl_Group* o = new Fl_Group(10, 10, 470, 25);
@@ -296,6 +297,7 @@ type(t);
int e;
prefs_.get("preview", e, 1);
preview(e);
+Fl_Group::current(prev_current);
}
Fl_File_Chooser::~Fl_File_Chooser() {
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index d45e63b55..22b529483 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -33,7 +33,7 @@ comment {//
decl {\#include <FL/fl_draw.H>} {}
-class FL_EXPORT Fl_File_Chooser {open selected
+class FL_EXPORT Fl_File_Chooser {open
} {
decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public
}
@@ -53,14 +53,16 @@ class FL_EXPORT Fl_File_Chooser {open selected
decl {void showChoiceCB();} {}
decl {void update_favorites();} {}
decl {void update_preview();} {}
- 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 {Fl_Group *prev_current = Fl_Group::current();} {}
Fl_Window window {
label {Choose File}
callback {fileName->value("");
fileList->deselect();
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
window->hide();}
- private xywh {403 284 490 380} type Double resizable
+ private xywh {388 284 490 380} type Double resizable
code0 {if (title) window->label(title);}
code1 {\#include <stdio.h>}
code2 {\#include <stdlib.h>}
@@ -159,7 +161,7 @@ window->hide();}
}
Fl_Window favWindow {
label {Manage Favorites}
- private xywh {421 56 355 150} type Double resizable
+ private xywh {413 100 355 150} type Double resizable
code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible
} {
Fl_File_Browser favList {
@@ -217,7 +219,9 @@ value(d);
type(t);
int e;
prefs_.get("preview", e, 1);
-preview(e);} {}
+preview(e);
+Fl_Group::current(prev_current);} {selected
+ }
}
Function {~Fl_File_Chooser()} {} {
code {Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);