From 9208e9d0079b362fd73187c06ba29c2066d47f35 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 30 Sep 2001 12:30:13 +0000 Subject: Windows doesn't have case-sensitive filenames, so we can't have two fl_file_chooser.cxx's... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1620 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- Makefile | 6 ++-- src/Makefile | 6 ++-- src/fl_file_chooser.cxx | 94 ------------------------------------------------- src/fl_file_dir.cxx | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ src/makedepend | 19 +++++----- visualc/fltk.lib.dsp | 2 +- visualc/fltkdll.dsp | 2 +- 7 files changed, 112 insertions(+), 111 deletions(-) delete mode 100644 src/fl_file_chooser.cxx create mode 100644 src/fl_file_dir.cxx diff --git a/Makefile b/Makefile index 2e2325cf4..60f0c5be4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.12.2.6.2.5 2001/09/29 15:57:32 easysw Exp $" +# "$Id: Makefile,v 1.12.2.6.2.6 2001/09/30 12:30:13 easysw Exp $" # # Top-level makefile for the Fast Light Tool Kit (FLTK). # @@ -23,6 +23,8 @@ # Please report all bugs and problems to "fltk-bugs@fltk.org". # +include makeinclude + SHELL = /bin/sh DIRS = src fluid test @@ -71,5 +73,5 @@ configure: configure.in autoconf # -# End of "$Id: Makefile,v 1.12.2.6.2.5 2001/09/29 15:57:32 easysw Exp $". +# End of "$Id: Makefile,v 1.12.2.6.2.6 2001/09/30 12:30:13 easysw Exp $". # diff --git a/src/Makefile b/src/Makefile index a80060fa0..6e011ac6c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.18.2.14.2.11 2001/09/29 15:57:32 easysw Exp $" +# "$Id: Makefile,v 1.18.2.14.2.12 2001/09/30 12:30:13 easysw Exp $" # # Library makefile for the Fast Light Tool Kit (FLTK). # @@ -121,7 +121,7 @@ CPPFILES = \ fl_draw_image.cxx \ fl_draw_pixmap.cxx \ fl_engraved_label.cxx \ - fl_file_chooser.cxx \ + fl_file_dir.cxx \ fl_font.cxx \ fl_labeltype.cxx \ fl_line_style.cxx \ @@ -258,5 +258,5 @@ install: $(LIBNAME) $(DSONAME) $(GLLIBNAME) $(GLDSONAME) ln -s FL $(includedir)/Fl # -# End of "$Id: Makefile,v 1.18.2.14.2.11 2001/09/29 15:57:32 easysw Exp $". +# End of "$Id: Makefile,v 1.18.2.14.2.12 2001/09/30 12:30:13 easysw Exp $". # diff --git a/src/fl_file_chooser.cxx b/src/fl_file_chooser.cxx deleted file mode 100644 index a7e721824..000000000 --- a/src/fl_file_chooser.cxx +++ /dev/null @@ -1,94 +0,0 @@ -// -// "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.5 2001/09/29 14:38:59 easysw Exp $" -// -// File chooser widget for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2001 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "fltk-bugs@fltk.org". -// - -#include -#include -#include - -static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; -static void (*current_callback)(const char*) = 0; - - -static void callback(Fl_File_Chooser *, void*) { - if (current_callback) - (*current_callback)(fc->value(0)); -} - - -void fl_file_chooser_callback(void (*cb)(const char*)) { - current_callback = cb; -} - - -char* fl_file_chooser(const char* message, const char* pat, const char* fname) -{ - if (!fname || !*fname) fname = "."; - - if (!fc) { - fc = new Fl_File_Chooser(fname, pat, Fl_File_Chooser::CREATE, message); - fc->callback(callback, 0); - } else { - fc->type(Fl_File_Chooser::CREATE); - fc->filter(pat); - fc->value(fname); - fc->label(message); - } - - fc->show(); - - while (fc->visible()) - Fl::wait(); - - return ((char *)fc->value()); -} - - -char* fl_dir_chooser(const char* message, const char* fname) -{ - if (!fname || !*fname) fname = "."; - - if (!fc) { - fc = new Fl_File_Chooser(fname, "*", Fl_File_Chooser::CREATE | - Fl_File_Chooser::DIRECTORY, message); - fc->callback(callback, 0); - } else { - fc->type(Fl_File_Chooser::CREATE | Fl_File_Chooser::DIRECTORY); - fc->filter("*"); - fc->value(fname); - fc->label(message); - } - - fc->show(); - - while (fc->visible()) - Fl::wait(); - - return ((char *)fc->value()); -} - - -// -// End of "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.5 2001/09/29 14:38:59 easysw Exp $". -// diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx new file mode 100644 index 000000000..b61e4b4b7 --- /dev/null +++ b/src/fl_file_dir.cxx @@ -0,0 +1,94 @@ +// +// "$Id: fl_file_dir.cxx,v 1.1.2.1 2001/09/30 12:30:13 easysw Exp $" +// +// File chooser widget for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2001 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@fltk.org". +// + +#include +#include +#include + +static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; +static void (*current_callback)(const char*) = 0; + + +static void callback(Fl_File_Chooser *, void*) { + if (current_callback) + (*current_callback)(fc->value(0)); +} + + +void fl_file_chooser_callback(void (*cb)(const char*)) { + current_callback = cb; +} + + +char* fl_file_chooser(const char* message, const char* pat, const char* fname) +{ + if (!fname || !*fname) fname = "."; + + if (!fc) { + fc = new Fl_File_Chooser(fname, pat, Fl_File_Chooser::CREATE, message); + fc->callback(callback, 0); + } else { + fc->type(Fl_File_Chooser::CREATE); + fc->filter(pat); + fc->value(fname); + fc->label(message); + } + + fc->show(); + + while (fc->visible()) + Fl::wait(); + + return ((char *)fc->value()); +} + + +char* fl_dir_chooser(const char* message, const char* fname) +{ + if (!fname || !*fname) fname = "."; + + if (!fc) { + fc = new Fl_File_Chooser(fname, "*", Fl_File_Chooser::CREATE | + Fl_File_Chooser::DIRECTORY, message); + fc->callback(callback, 0); + } else { + fc->type(Fl_File_Chooser::CREATE | Fl_File_Chooser::DIRECTORY); + fc->filter("*"); + fc->value(fname); + fc->label(message); + } + + fc->show(); + + while (fc->visible()) + Fl::wait(); + + return ((char *)fc->value()); +} + + +// +// End of "$Id: fl_file_dir.cxx,v 1.1.2.1 2001/09/30 12:30:13 easysw Exp $". +// diff --git a/src/makedepend b/src/makedepend index 1b2f1adf2..2822f0087 100644 --- a/src/makedepend +++ b/src/makedepend @@ -277,16 +277,15 @@ fl_draw_pixmap.o: ../FL/Fl_Export.H ../FL/fl_draw.H ../FL/x.H fl_draw_pixmap.o: ../FL/Fl_Window.H fl_engraved_label.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H fl_engraved_label.o: ../FL/Fl_Widget.H ../FL/fl_draw.H -fl_file_chooser.o: ../config.h ../FL/fl_file_chooser.H ../FL/Enumerations.H -fl_file_chooser.o: ../FL/Fl_Export.H ../FL/Fl_File_Chooser.H ../FL/Fl.H -fl_file_chooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -fl_file_chooser.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H -fl_file_chooser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -fl_file_chooser.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H -fl_file_chooser.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H -fl_file_chooser.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H -fl_file_chooser.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -fl_file_chooser.o: ../FL/Fl_Menu_Item.H +fl_file_dir.o: ../config.h ../FL/fl_file_chooser.H ../FL/Enumerations.H +fl_file_dir.o: ../FL/Fl_Export.H ../FL/Fl_File_Chooser.H ../FL/Fl.H +fl_file_dir.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H +fl_file_dir.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H +fl_file_dir.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H +fl_file_dir.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Button.H +fl_file_dir.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/fl_ask.H +fl_file_dir.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H +fl_file_dir.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H fl_font.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H fl_font.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H Fl_Font.H fl_labeltype.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H diff --git a/visualc/fltk.lib.dsp b/visualc/fltk.lib.dsp index b1d93fda9..3f70995b8 100644 --- a/visualc/fltk.lib.dsp +++ b/visualc/fltk.lib.dsp @@ -255,7 +255,7 @@ SOURCE=..\src\fl_engraved_label.cxx # End Source File # Begin Source File -SOURCE=..\src\fl_file_chooser.cxx +SOURCE=..\src\fl_file_dir.cxx # End Source File # Begin Source File diff --git a/visualc/fltkdll.dsp b/visualc/fltkdll.dsp index 70db67840..5b573854d 100644 --- a/visualc/fltkdll.dsp +++ b/visualc/fltkdll.dsp @@ -645,7 +645,7 @@ DEP_CPP_FL_EN=\ # End Source File # Begin Source File -SOURCE=..\src\fl_file_chooser.cxx +SOURCE=..\src\fl_file_dir.cxx DEP_CPP_FL_FI=\ "..\fl\enumerations.h"\ "..\fl\fl.h"\ -- cgit v1.2.3