diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-09-29 14:38:59 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-09-29 14:38:59 +0000 |
| commit | 6a4714ce12d546c8131389853fe5593555c73b77 (patch) | |
| tree | 158726de167a805d6aaa325f8250b89bf3a2db08 /FL | |
| parent | de6c7f66eeaeeae52ca33221db885ae6cd7ea114 (diff) | |
Fl_FileXYZ -> Fl_File_XYZ
Fl_HelpXYZ -> Fl_Help_XYZ
Fl_File_Chooser now supports directory choosing.
Added fl_dir_chooser() function.
Now set FLTK_DOCDIR env var in test/demo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1612 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_File_Browser.H (renamed from FL/Fl_FileBrowser.H) | 22 | ||||
| -rw-r--r-- | FL/Fl_File_Chooser.H (renamed from FL/Fl_FileChooser.H) | 22 | ||||
| -rw-r--r-- | FL/Fl_File_Icon.H (renamed from FL/Fl_FileIcon.H) | 28 | ||||
| -rw-r--r-- | FL/Fl_Help_Dialog.H (renamed from FL/Fl_HelpDialog.H) | 18 | ||||
| -rw-r--r-- | FL/Fl_Help_View.H (renamed from FL/Fl_HelpView.H) | 66 | ||||
| -rw-r--r-- | FL/fl_file_chooser.H | 5 |
6 files changed, 81 insertions, 80 deletions
diff --git a/FL/Fl_FileBrowser.H b/FL/Fl_File_Browser.H index 9add8e088..41f0ae0a1 100644 --- a/FL/Fl_FileBrowser.H +++ b/FL/Fl_File_Browser.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_FileBrowser.H,v 1.4.2.3 2001/09/04 13:13:29 easysw Exp $" +// "$Id: Fl_File_Browser.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $" // // FileBrowser definitions. // @@ -27,21 +27,19 @@ // Include necessary header files... // -#ifndef _Fl_FileBrowser_H_ -# define _Fl_FileBrowser_H_ +#ifndef _Fl_File_Browser_H_ +# define _Fl_File_Browser_H_ # include "Fl_Browser.H" -# include "Fl_FileIcon.H" +# include "Fl_File_Icon.H" // -// Fl_FileBrowser class... +// Fl_File_Browser class... // -class Fl_FileBrowser : public Fl_Browser +class Fl_File_Browser : public Fl_Browser { - enum { FILES, DIRECTORIES }; - int filetype_; const char *directory_; uchar iconsize_; @@ -54,7 +52,9 @@ class Fl_FileBrowser : public Fl_Browser int incr_height() const { return (item_height(0)); } public: - FL_EXPORT Fl_FileBrowser(int, int, int, int, const char * = 0); + enum { FILES, DIRECTORIES }; + + FL_EXPORT Fl_File_Browser(int, int, int, int, const char * = 0); uchar iconsize() const { return (iconsize_); }; void iconsize(uchar s) { iconsize_ = s; redraw(); }; @@ -71,8 +71,8 @@ public: void filetype(int t) { filetype_ = t; load(directory_); }; }; -#endif // !_Fl_FileBrowser_H_ +#endif // !_Fl_File_Browser_H_ // -// End of "$Id: Fl_FileBrowser.H,v 1.4.2.3 2001/09/04 13:13:29 easysw Exp $". +// End of "$Id: Fl_File_Browser.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $". // diff --git a/FL/Fl_FileChooser.H b/FL/Fl_File_Chooser.H index e12edac89..b04953e2f 100644 --- a/FL/Fl_FileChooser.H +++ b/FL/Fl_File_Chooser.H @@ -1,30 +1,30 @@ // generated by Fast Light User Interface Designer (fluid) version 1.0100 -#ifndef Fl_FileChooser_H -#define Fl_FileChooser_H +#ifndef Fl_File_Chooser_H +#define Fl_File_Chooser_H #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <FL/Fl_FileBrowser.H> +#include <FL/Fl_File_Browser.H> #include <FL/Fl_Button.H> #include <FL/Fl_Return_Button.H> #include <FL/fl_ask.H> #include <FL/Fl_Input.H> #include <FL/Fl_Choice.H> -class Fl_FileChooser { +class Fl_File_Chooser { public: - enum { SINGLE, MULTI, CREATE }; - Fl_FileChooser(const char *d, const char *p, int t, const char *title); + enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; + Fl_File_Chooser(const char *d, const char *p, int t, const char *title); private: Fl_Window *window; inline void cb_window_i(Fl_Window*, void*); static void cb_window(Fl_Window*, void*); - Fl_FileBrowser *fileList; - inline void cb_fileList_i(Fl_FileBrowser*, void*); - static void cb_fileList(Fl_FileBrowser*, void*); + Fl_File_Browser *fileList; + inline void cb_fileList_i(Fl_File_Browser*, void*); + static void cb_fileList(Fl_File_Browser*, void*); inline void cb_Cancel_i(Fl_Button*, void*); static void cb_Cancel(Fl_Button*, void*); Fl_Return_Button *okButton; @@ -44,7 +44,7 @@ private: static void cb_dirMenu(Fl_Choice*, void*); inline void cb__i(Fl_Button*, void*); static void cb_(Fl_Button*, void*); - void (*callback_)(Fl_FileChooser*, void *); + void (*callback_)(Fl_File_Chooser*, void *); void *data_; char directory_[1024]; int type_; @@ -53,7 +53,7 @@ private: void newdir(); void up(); public: - void callback(void (*cb)(Fl_FileChooser *, void *), void *d); + void callback(void (*cb)(Fl_File_Chooser *, void *), void *d); void color(Fl_Color c); Fl_Color color(); int count(); diff --git a/FL/Fl_FileIcon.H b/FL/Fl_File_Icon.H index 791907ffa..0bdbe7870 100644 --- a/FL/Fl_FileIcon.H +++ b/FL/Fl_File_Icon.H @@ -1,7 +1,7 @@ // -// "$Id: Fl_FileIcon.H,v 1.1.2.2 2001/08/11 14:49:51 easysw Exp $" +// "$Id: Fl_File_Icon.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $" // -// Fl_FileIcon definitions. +// Fl_File_Icon definitions. // // Copyright 1999-2001 by Michael Sweet. // @@ -27,20 +27,20 @@ // Include necessary header files... // -#ifndef _Fl_Fl_FileIcon_H_ -# define _Fl_Fl_FileIcon_H_ +#ifndef _Fl_Fl_File_Icon_H_ +# define _Fl_Fl_File_Icon_H_ # include "Fl.H" // -// Fl_FileIcon class... +// Fl_File_Icon class... // -class Fl_FileIcon //// Icon data +class Fl_File_Icon //// Icon data { - FL_EXPORT static Fl_FileIcon *first_; // Pointer to first icon/filetype - Fl_FileIcon *next_; // Pointer to next icon/filetype + FL_EXPORT static Fl_File_Icon *first_; // Pointer to first icon/filetype + Fl_File_Icon *next_; // Pointer to next icon/filetype const char *pattern_; // Pattern string int type_; // Match only if directory or file? int num_data_; // Number of data elements @@ -70,8 +70,8 @@ class Fl_FileIcon //// Icon data VERTEX // Followed by scaled X,Y }; - FL_EXPORT Fl_FileIcon(const char *p, int t, int nd = 0, short *d = 0); - FL_EXPORT ~Fl_FileIcon(); + FL_EXPORT Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0); + FL_EXPORT ~Fl_File_Icon(); FL_EXPORT short *add(short d); short *add_color(short c) @@ -93,13 +93,13 @@ class Fl_FileIcon //// Icon data int type() { return (type_); } short *value() { return (data_); } - FL_EXPORT static Fl_FileIcon *find(const char *filename, int filetype = ANY); - static Fl_FileIcon *first() { return (first_); } + FL_EXPORT static Fl_File_Icon *find(const char *filename, int filetype = ANY); + static Fl_File_Icon *first() { return (first_); } FL_EXPORT static void load_system_icons(void); }; -#endif // !_Fl_Fl_FileIcon_H_ +#endif // !_Fl_Fl_File_Icon_H_ // -// End of "$Id: Fl_FileIcon.H,v 1.1.2.2 2001/08/11 14:49:51 easysw Exp $". +// End of "$Id: Fl_File_Icon.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $". // diff --git a/FL/Fl_HelpDialog.H b/FL/Fl_Help_Dialog.H index cd8ee2154..549646ebb 100644 --- a/FL/Fl_HelpDialog.H +++ b/FL/Fl_Help_Dialog.H @@ -1,25 +1,25 @@ // generated by Fast Light User Interface Designer (fluid) version 1.0100 -#ifndef Fl_HelpDialog_H -#define Fl_HelpDialog_H +#ifndef Fl_Help_Dialog_H +#define Fl_Help_Dialog_H #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <string.h> -#include <FL/Fl_HelpView.H> +#include <FL/Fl_Help_View.H> #include <FL/Fl_Button.H> -class Fl_HelpDialog { +class Fl_Help_Dialog { int index_; int max_; int line_[100]; char file_[100][256]; public: - Fl_HelpDialog(); + Fl_Help_Dialog(); private: Fl_Double_Window *window_; - Fl_HelpView *view_; - inline void cb_view__i(Fl_HelpView*, void*); - static void cb_view_(Fl_HelpView*, void*); + Fl_Help_View *view_; + inline void cb_view__i(Fl_Help_View*, void*); + static void cb_view_(Fl_Help_View*, void*); inline void cb_Close_i(Fl_Button*, void*); static void cb_Close(Fl_Button*, void*); Fl_Button *back_; @@ -35,7 +35,7 @@ private: inline void cb_larger__i(Fl_Button*, void*); static void cb_larger_(Fl_Button*, void*); public: - ~Fl_HelpDialog(); + ~Fl_Help_Dialog(); int h(); void hide(); void load(const char *f); diff --git a/FL/Fl_HelpView.H b/FL/Fl_Help_View.H index eea75ea04..9207a2a1d 100644 --- a/FL/Fl_HelpView.H +++ b/FL/Fl_Help_View.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_HelpView.H,v 1.1.2.3 2001/09/10 03:09:43 easysw Exp $" +// "$Id: Fl_Help_View.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $" // // Help Viewer widget definitions. // @@ -24,8 +24,8 @@ // Please report all bugs and problems to "fltk-bugs@fltk.org". // -#ifndef _Fl_HelpView_H_ -# define _Fl_HelpView_H_ +#ifndef _Fl_Help_View_H_ +# define _Fl_Help_View_H_ // // Include necessary header files... @@ -39,18 +39,18 @@ // -// Fl_HelpFunc type - link callback function for files... +// Fl_Help_Func type - link callback function for files... // -typedef const char *(Fl_HelpFunc)(const char *); +typedef const char *(Fl_Help_Func)(const char *); // -// Fl_HelpBlock structure... +// Fl_Help_Block structure... // -struct Fl_HelpBlock +struct Fl_Help_Block { const char *start, // Start of text *end; // End of text @@ -65,10 +65,10 @@ struct Fl_HelpBlock }; // -// Fl_HelpLink structure... +// Fl_Help_Link structure... // -struct Fl_HelpLink +struct Fl_Help_Link { char filename[192], // Reference filename name[32]; // Link target (blank if none) @@ -79,22 +79,22 @@ struct Fl_HelpLink }; // -// Fl_HelpTarget structure... +// Fl_Help_Target structure... // -struct Fl_HelpTarget +struct Fl_Help_Target { char name[32]; // Target name int y; // Y offset of target }; // -// Fl_HelpImage structure... +// Fl_Help_Image structure... // class Fl_Image; -struct Fl_HelpImage +struct Fl_Help_Image { char *name, // Path and name of the image wattr[8], // Width attribute @@ -106,10 +106,10 @@ struct Fl_HelpImage }; // -// Fl_HelpView class... +// Fl_Help_View class... // -class Fl_HelpView : public Fl_Group //// Help viewer widget +class Fl_Help_View : public Fl_Group //// Help viewer widget { enum { RIGHT = -1, CENTER, LEFT }; // Alignments @@ -124,20 +124,20 @@ class Fl_HelpView : public Fl_Group //// Help viewer widget int nblocks_, // Number of blocks/paragraphs ablocks_; // Allocated blocks - Fl_HelpBlock *blocks_; // Blocks + Fl_Help_Block *blocks_; // Blocks int nfonts_; // Number of fonts in stack uchar fonts_[100][2]; // Font stack - Fl_HelpFunc *link_; // Link transform function + Fl_Help_Func *link_; // Link transform function int nlinks_, // Number of links alinks_; // Allocated links - Fl_HelpLink *links_; // Links + Fl_Help_Link *links_; // Links int ntargets_, // Number of targets atargets_; // Allocated targets - Fl_HelpTarget *targets_; // Targets + Fl_Help_Target *targets_; // Targets char directory_[1024]; // Directory for current file char filename_[1024]; // Current filename @@ -147,22 +147,22 @@ class Fl_HelpView : public Fl_Group //// Help viewer widget int nimage_, // Number of images in a page aimage_; // Allocated blocks - Fl_HelpImage *image_; // list of image descriptors + Fl_Help_Image *image_; // list of image descriptors - Fl_HelpImage *add_image(const char *name, const char *wattr, + Fl_Help_Image *add_image(const char *name, const char *wattr, const char *hattr, int make = 1); - Fl_HelpImage *find_image(const char *name, const char *wattr, + Fl_Help_Image *find_image(const char *name, const char *wattr, const char *hattr); - int load_gif(Fl_HelpImage *img, FILE *fp); - int load_jpeg(Fl_HelpImage *img, FILE *fp); - int load_png(Fl_HelpImage *img, FILE *fp); + int load_gif(Fl_Help_Image *img, FILE *fp); + int load_jpeg(Fl_Help_Image *img, FILE *fp); + int load_png(Fl_Help_Image *img, FILE *fp); - Fl_HelpBlock *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); + Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); static int compare_blocks(const void *a, const void *b); void add_link(const char *n, int xx, int yy, int ww, int hh); void add_target(const char *n, int yy); - static int compare_targets(const Fl_HelpTarget *t0, const Fl_HelpTarget *t1); - int do_align(Fl_HelpBlock *block, int line, int xx, int a, int &l); + static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1); + int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l); void draw(); void format(); void format_table(int *table_width, int *columns, const char *table); @@ -183,13 +183,13 @@ class Fl_HelpView : public Fl_Group //// Help viewer widget public: - Fl_HelpView(int xx, int yy, int ww, int hh, const char *l = 0); - ~Fl_HelpView(); + Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0); + ~Fl_Help_View(); const char *directory() const { if (directory_[0]) return (directory_); else return ((const char *)0); } const char *filename() const { if (filename_[0]) return (filename_); else return ((const char *)0); } - void link(Fl_HelpFunc *fn) { link_ = fn; } + void link(Fl_Help_Func *fn) { link_ = fn; } int load(const char *f); void resize(int,int,int,int); int size() const { return (size_); } @@ -207,8 +207,8 @@ class Fl_HelpView : public Fl_Group //// Help viewer widget const char *value() const { return (value_); } }; -#endif // !_Fl_HelpView_H_ +#endif // !_Fl_Help_View_H_ // -// End of "$Id: Fl_HelpView.H,v 1.1.2.3 2001/09/10 03:09:43 easysw Exp $". +// End of "$Id: Fl_Help_View.H,v 1.1.2.1 2001/09/29 14:38:58 easysw Exp $". // diff --git a/FL/fl_file_chooser.H b/FL/fl_file_chooser.H index e0ff9e027..0a2183eed 100644 --- a/FL/fl_file_chooser.H +++ b/FL/fl_file_chooser.H @@ -1,5 +1,5 @@ // -// "$Id: fl_file_chooser.H,v 1.5.2.3.2.2 2001/08/04 12:21:33 easysw Exp $" +// "$Id: fl_file_chooser.H,v 1.5.2.3.2.3 2001/09/29 14:38:58 easysw Exp $" // // File chooser header file for the Fast Light Tool Kit (FLTK). // @@ -28,11 +28,12 @@ #include "Enumerations.H" +FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname); FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname); FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*)); #endif // -// End of "$Id: fl_file_chooser.H,v 1.5.2.3.2.2 2001/08/04 12:21:33 easysw Exp $". +// End of "$Id: fl_file_chooser.H,v 1.5.2.3.2.3 2001/09/29 14:38:58 easysw Exp $". // |
