From 6a4714ce12d546c8131389853fe5593555c73b77 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 29 Sep 2001 14:38:59 +0000 Subject: [PATCH] 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 --- CHANGES | 7 +- FL/{Fl_FileBrowser.H => Fl_File_Browser.H} | 22 +- FL/{Fl_FileChooser.H => Fl_File_Chooser.H} | 22 +- FL/{Fl_FileIcon.H => Fl_File_Icon.H} | 28 +- FL/{Fl_HelpDialog.H => Fl_Help_Dialog.H} | 18 +- FL/{Fl_HelpView.H => Fl_Help_View.H} | 66 ++--- FL/fl_file_chooser.H | 5 +- documentation/Fl_FileBrowser.html | 76 ------ documentation/Fl_FileChooser.html | 162 ----------- documentation/Fl_FileIcon.html | 153 ----------- documentation/Fl_File_Browser.html | 76 ++++++ ...Fl_FileChooser.gif => Fl_File_Chooser.gif} | Bin documentation/Fl_File_Chooser.html | 162 +++++++++++ documentation/Fl_File_Icon.html | 153 +++++++++++ documentation/Fl_HelpDialog.html | 89 ------ documentation/Fl_HelpView.html | 130 --------- .../{Fl_HelpDialog.gif => Fl_Help_Dialog.gif} | Bin documentation/Fl_Help_Dialog.html | 77 ++++++ documentation/Fl_Help_View.html | 123 +++++++++ documentation/fltk.book | 10 +- documentation/widgets.html | 20 +- fluid/factory.cxx | 48 ++-- fluid/fluid.cxx | 10 +- fluid/makedepend | 33 +-- ...Fl_FileBrowser.cxx => Fl_File_Browser.cxx} | 72 ++--- ...Fl_FileChooser.cxx => Fl_File_Chooser.cxx} | 110 ++++---- src/{Fl_FileChooser.fl => Fl_File_Chooser.fl} | 28 +- ..._FileChooser2.cxx => Fl_File_Chooser2.cxx} | 89 +++--- src/{Fl_FileIcon.cxx => Fl_File_Icon.cxx} | 160 +++++------ src/{Fl_HelpDialog.cxx => Fl_Help_Dialog.cxx} | 72 ++--- src/{Fl_HelpDialog.fl => Fl_Help_Dialog.fl} | 12 +- src/{Fl_HelpView.cxx => Fl_Help_View.cxx} | 258 +++++++++--------- src/Makefile | 16 +- src/fl_file_chooser.cxx | 37 ++- src/makedepend | 83 +++--- test/demo.cxx | 5 +- test/file_chooser.cxx | 8 +- test/help.cxx | 12 +- test/makedepend | 11 +- 39 files changed, 1236 insertions(+), 1227 deletions(-) rename FL/{Fl_FileBrowser.H => Fl_File_Browser.H} (81%) rename FL/{Fl_FileChooser.H => Fl_File_Chooser.H} (79%) rename FL/{Fl_FileIcon.H => Fl_File_Icon.H} (79%) rename FL/{Fl_HelpDialog.H => Fl_Help_Dialog.H} (81%) rename FL/{Fl_HelpView.H => Fl_Help_View.H} (76%) delete mode 100644 documentation/Fl_FileBrowser.html delete mode 100644 documentation/Fl_FileChooser.html delete mode 100644 documentation/Fl_FileIcon.html create mode 100644 documentation/Fl_File_Browser.html rename documentation/{Fl_FileChooser.gif => Fl_File_Chooser.gif} (100%) create mode 100644 documentation/Fl_File_Chooser.html create mode 100644 documentation/Fl_File_Icon.html delete mode 100644 documentation/Fl_HelpDialog.html delete mode 100644 documentation/Fl_HelpView.html rename documentation/{Fl_HelpDialog.gif => Fl_Help_Dialog.gif} (100%) create mode 100644 documentation/Fl_Help_Dialog.html create mode 100644 documentation/Fl_Help_View.html rename src/{Fl_FileBrowser.cxx => Fl_File_Browser.cxx} (83%) rename src/{Fl_FileChooser.cxx => Fl_File_Chooser.cxx} (56%) rename src/{Fl_FileChooser.fl => Fl_File_Chooser.fl} (87%) rename src/{Fl_FileChooser2.cxx => Fl_File_Chooser2.cxx} (86%) rename src/{Fl_FileIcon.cxx => Fl_File_Icon.cxx} (82%) rename src/{Fl_HelpDialog.cxx => Fl_Help_Dialog.cxx} (64%) rename src/{Fl_HelpDialog.fl => Fl_Help_Dialog.fl} (95%) rename src/{Fl_HelpView.cxx => Fl_Help_View.cxx} (90%) diff --git a/CHANGES b/CHANGES index 12db70560..932e079de 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,3 @@ -TODO - Documentation updates. - - CHANGES IN FLTK 1.1.0b2 - Fixed image/text label handling; in b1 the label @@ -47,6 +44,10 @@ CHANGES IN FLTK 1.1.0b2 - FLUID now provides on-line help. + - Changed Fl_FileXYZ to Fl_File_XYZ. + + - Changed Fl_HelpXYZ to Fl_Help_XYZ. + CHANGES IN FLTK 1.1.0b1 diff --git a/FL/Fl_FileBrowser.H b/FL/Fl_File_Browser.H similarity index 81% rename from FL/Fl_FileBrowser.H rename to 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 similarity index 79% rename from FL/Fl_FileChooser.H rename to 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 #include #include #include #include -#include +#include #include #include #include #include #include -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 similarity index 79% rename from FL/Fl_FileIcon.H rename to 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 similarity index 81% rename from FL/Fl_HelpDialog.H rename to 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 #include #include -#include +#include #include -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 similarity index 76% rename from FL/Fl_HelpView.H rename to 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 $". // diff --git a/documentation/Fl_FileBrowser.html b/documentation/Fl_FileBrowser.html deleted file mode 100644 index 2c9e1da00..000000000 --- a/documentation/Fl_FileBrowser.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - -

class Fl_FileBrowser

- -
- -

Class Hierarchy

- - - -

Include Files

- -
    -#include <FL/Fl_FileBrowser.H>
    -
- -

Description

- -

The Fl_FileBrowser widget displays a list of filenames, -optionally with file-specific icons. - -

Methods

- - - -

Fl_FileBrowser(int xx, int yy, int ww, int hh, const char *l = 0)

- -

The constructor creates the Fl_FileBrowser widget at the specified -position and size. - -

~Fl_FileBrowser()

- -

The destructor destroys the widget and frees all memory that has been -allocated. - -

void iconsize(uchar s)
-uchar iconsize() const

- -

Sets or gets the size of the icons. The default size is 20 pixels. - -

void filter(const char *pattern)
-const char *filter() const

- -

Sets or gets the filename filter. The pattern matching uses the -filename_match() function in FLTK. - -

void filetype(int type)
-int filetype() const

- -

Sets or gets the file browser type, FILES or -DIRECTORIES. When set to FILES, both -files and directories are shown. Otherwise only directories are -shown. - -

int load(const char *directory)

- -

Loads the specified directory into the browser. If icons have been -loaded then the correct icon is associated with each file in the list. - - - diff --git a/documentation/Fl_FileChooser.html b/documentation/Fl_FileChooser.html deleted file mode 100644 index 13846c34d..000000000 --- a/documentation/Fl_FileChooser.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - -

class Fl_FileChooser

- -
- -

Class Hierarchy

- - - -

Include Files

- -
    -#include <FL/Fl_FileChooser.H>
    -
- -

Description

- -

The Fl_FileChooser widget displays a standard file selection -dialog that supports various selection modes. - -

Fl_FileChooser widget
- -

Methods

- - - -

Fl_FileChooser(const char *pathname, const char *pattern, -int type, const char *title)

- -

The constructor creates the Fl_FileChooser dialog pictured -above. The pathname argument can be a directory name or a -complete file name (in which case the corresponding file is highlighted -in the list and in the filename input field.) - -

The pattern argument can be a NULL string or -"*" to list all files. See the FLTK documentation on -filename_match() for other kinds of patterns. - -

The type argument can be one of the following: - -

    -
  • SINGLE - allows the user to select a - single, existing file. -
  • MULTI - allows the user to select one - or more existing files. -
  • CREATE - allows the user to select a - single, existing file or specify a new filename. -
  • DIRECTORY - allows the user to select a - single, existing directory. -
- -

The title argument is used to set the title bar text for the -Fl_FileChooser window. - -

~Fl_FileChooser()

- -

Destroys the widget and frees all memory used by it. - -

void color(Fl_Color c)
-Fl_Color color()

- -

Sets or gets the background color of the FileBrowser list. - -

int count()

- -

Returns the number of selected files. - -

void directory(const char *pathname)
-const char *directory()

- -

Sets or gets the current directory. - -

void filter(const char *pattern)
-const char *filter()

- -

Sets or gets the current filename filter pattern. - -

void hide()

- -

Hides the Fl_FileChooser window. - -

void iconsize(uchar s)
-uchar iconsize()

- -

Sets or gets the size of the icons in the FileBrowser. By -default the icon size is set to 1.5 times the textsize(). - -

void label(const char *l)
-const char *label()

- -

Sets or gets the title bar text for the Fl_FileChooser. - -

void rescan()

- -

Reloads the current directory in the FileBrowser. - -

void show()

- -

Shows the Fl_FileChooser window. - -

void textcolor(Fl_Color c)
-Fl_Color textcolor()

- -

Sets or gets the current FileBrowser text color. - -

void textfont(uchar f)
-uchar textfont()

- -

Sets or gets the current FileBrowser text font. - -

void textsize(uchar s)
-uchar textsize()

- -

Sets or gets the current FileBrowser text size. - -

void type(int t)
-int type()

- -

Sets or gets the current type of Fl_FileChooser. - -

const char *value(const char *pathname)
-const char *value(int file)
-const char *value()

- -

Sets or gets the current value of the selected file. - -

int visible()

- -

Returns 1 if the Fl_FileChooser window is visible. - -


- - - - diff --git a/documentation/Fl_FileIcon.html b/documentation/Fl_FileIcon.html deleted file mode 100644 index 51c80f68c..000000000 --- a/documentation/Fl_FileIcon.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - -

class Fl_FileIcon

- -
- -

Class Hierarchy

- -
    -Fl_FileIcon
    -
- -

Include Files

- -
    -#include <FL/Fl_FileIcon.H>
    -
- -

Description

- -

The Fl_FileIcon class manages icon images that can be -used as labels in other widgets and as icons in the FileBrowser -widget. - -

Methods

- - - -

Fl_FileIcon()

- -

The constructor creates a new Fl_FileIcon with the specified -information. - -

~Fl_FileIcon()

- -

The destructor destroys the icon and frees all memory that has been -allocated for it. - -

short *add(short d)

- -

Adds a keyword value to the icon array, returning a pointer to it. - -

short *add_color(short c)

- -

Adds a color value to the icon array, returning a pointer to it. - -

short *add_vertex(int x, int y)
-short *add_vertex(float x, float y)

- -

Adds a vertex value to the icon array, returning a pointer to it. -The integer version accepts coordinates from 0 to 10000, while the -floating point version goes from 0.0 to 1.0. The origin (0.0) is in -the lower-lefthand corner of the icon. - -

void clear()

- -

Clears all icon data from the icon. - -

void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1)

- -

Draws the icon in the indicated area. - -

static Fl_FileIcon *find(const char *filename, int filetype = ANY);

- -

Finds an icon that matches the given filename and file type. - -

static Fl_FileIcon *first()

- -

Returns a pointer to the first icon in the list. - -

void label(Fl_Widget *w)

- -

Applies the icon to the widget, registering the Fl_FileIcon -label type as needed. - -

static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a)

- -

The labeltype function for icons. - -

void load(const char *f)

- -

Loads the specified icon image. The format is deduced from the filename. - -

void load_fti(const char *fti)

- -

Loads an SGI icon file. - -

static void load_system_icons(void)

- -

Loads all system-defined icons. This call is useful when using the -FileChooser widget and should be used when the application -starts: - -

    -Fl_FileIcon::load_system_icons();
    -
- -

void load_xpm(const char *xpm)

- -

Loads an XPM icon file. - -

const char *pattern()

- -

Returns the filename matching pattern for the icon. - -

int size()

- -

Returns the number of words of data used by the icon. - -

int type()

- -

Returns the filetype associated with the icon, which can be one of the -following: - -

    -
  • Fl_FileIcon::ANY, any kind of file. -
  • Fl_FileIcon::PLAIN, plain files. -
  • Fl_FileIcon::FIFO, named pipes. -
  • Fl_FileIcon::DEVICE, character and block devices. -
  • Fl_FileIcon::LINK, symbolic links. -
  • Fl_FileIcon::DIRECTORY, directories. -
- -

short *value()

- -

Returns the data array for the icon. - - - diff --git a/documentation/Fl_File_Browser.html b/documentation/Fl_File_Browser.html new file mode 100644 index 000000000..6b8cbadc2 --- /dev/null +++ b/documentation/Fl_File_Browser.html @@ -0,0 +1,76 @@ + + + + +

class Fl_File_Browser

+ +
+ +

Class Hierarchy

+ + + +

Include Files

+ +
    +#include <FL/Fl_File_Browser.H>
    +
+ +

Description

+ +

The Fl_File_Browser widget displays a list of filenames, +optionally with file-specific icons. + +

Methods

+ + + +

Fl_File_Browser(int xx, int yy, int ww, int hh, const char *l = 0)

+ +

The constructor creates the Fl_File_Browser widget at the specified +position and size. + +

~Fl_File_Browser()

+ +

The destructor destroys the widget and frees all memory that has been +allocated. + +

void iconsize(uchar s)
+uchar iconsize() const

+ +

Sets or gets the size of the icons. The default size is 20 pixels. + +

void filter(const char *pattern)
+const char *filter() const

+ +

Sets or gets the filename filter. The pattern matching uses the +filename_match() function in FLTK. + +

void filetype(int type)
+int filetype() const

+ +

Sets or gets the file browser type, FILES or +DIRECTORIES. When set to FILES, both +files and directories are shown. Otherwise only directories are +shown. + +

int load(const char *directory)

+ +

Loads the specified directory into the browser. If icons have been +loaded then the correct icon is associated with each file in the list. + + + diff --git a/documentation/Fl_FileChooser.gif b/documentation/Fl_File_Chooser.gif similarity index 100% rename from documentation/Fl_FileChooser.gif rename to documentation/Fl_File_Chooser.gif diff --git a/documentation/Fl_File_Chooser.html b/documentation/Fl_File_Chooser.html new file mode 100644 index 000000000..9a2d4a4e7 --- /dev/null +++ b/documentation/Fl_File_Chooser.html @@ -0,0 +1,162 @@ + + + + +

class Fl_File_Chooser

+ +
+ +

Class Hierarchy

+ + + +

Include Files

+ +
    +#include <FL/Fl_File_Chooser.H>
    +
+ +

Description

+ +

The Fl_File_Chooser widget displays a standard file selection +dialog that supports various selection modes. + +

Fl_File_Chooser widget
+ +

Methods

+ + + +

Fl_File_Chooser(const char *pathname, const char *pattern, +int type, const char *title)

+ +

The constructor creates the Fl_File_Chooser dialog pictured +above. The pathname argument can be a directory name or a +complete file name (in which case the corresponding file is highlighted +in the list and in the filename input field.) + +

The pattern argument can be a NULL string or +"*" to list all files. See the FLTK documentation on +filename_match() for other kinds of patterns. + +

The type argument can be one of the following: + +

    +
  • SINGLE - allows the user to select a + single, existing file. +
  • MULTI - allows the user to select one + or more existing files. +
  • CREATE - allows the user to select a + single, existing file or specify a new filename. +
  • DIRECTORY - allows the user to select a + single, existing directory. +
+ +

The title argument is used to set the title bar text for the +Fl_File_Chooser window. + +

~Fl_File_Chooser()

+ +

Destroys the widget and frees all memory used by it. + +

void color(Fl_Color c)
+Fl_Color color()

+ +

Sets or gets the background color of the Fl_File_Browser list. + +

int count()

+ +

Returns the number of selected files. + +

void directory(const char *pathname)
+const char *directory()

+ +

Sets or gets the current directory. + +

void filter(const char *pattern)
+const char *filter()

+ +

Sets or gets the current filename filter pattern. + +

void hide()

+ +

Hides the Fl_File_Chooser window. + +

void iconsize(uchar s)
+uchar iconsize()

+ +

Sets or gets the size of the icons in the Fl_File_Browser. By +default the icon size is set to 1.5 times the textsize(). + +

void label(const char *l)
+const char *label()

+ +

Sets or gets the title bar text for the Fl_File_Chooser. + +

void rescan()

+ +

Reloads the current directory in the Fl_File_Browser. + +

void show()

+ +

Shows the Fl_File_Chooser window. + +

void textcolor(Fl_Color c)
+Fl_Color textcolor()

+ +

Sets or gets the current Fl_File_Browser text color. + +

void textfont(uchar f)
+uchar textfont()

+ +

Sets or gets the current Fl_File_Browser text font. + +

void textsize(uchar s)
+uchar textsize()

+ +

Sets or gets the current Fl_File_Browser text size. + +

void type(int t)
+int type()

+ +

Sets or gets the current type of Fl_File_Chooser. + +

const char *value(const char *pathname)
+const char *value(int file)
+const char *value()

+ +

Sets or gets the current value of the selected file. + +

int visible()

+ +

Returns 1 if the Fl_File_Chooser window is visible. + +


+ + + + diff --git a/documentation/Fl_File_Icon.html b/documentation/Fl_File_Icon.html new file mode 100644 index 000000000..0536161e2 --- /dev/null +++ b/documentation/Fl_File_Icon.html @@ -0,0 +1,153 @@ + + + + +

class Fl_File_Icon

+ +
+ +

Class Hierarchy

+ +
    +Fl_File_Icon
    +
+ +

Include Files

+ +
    +#include <FL/Fl_File_Icon.H>
    +
+ +

Description

+ +

The Fl_File_Icon class manages icon images that can be +used as labels in other widgets and as icons in the FileBrowser +widget. + +

Methods

+ + + +

Fl_File_Icon()

+ +

The constructor creates a new Fl_File_Icon with the specified +information. + +

~Fl_File_Icon()

+ +

The destructor destroys the icon and frees all memory that has been +allocated for it. + +

short *add(short d)

+ +

Adds a keyword value to the icon array, returning a pointer to it. + +

short *add_color(short c)

+ +

Adds a color value to the icon array, returning a pointer to it. + +

short *add_vertex(int x, int y)
+short *add_vertex(float x, float y)

+ +

Adds a vertex value to the icon array, returning a pointer to it. +The integer version accepts coordinates from 0 to 10000, while the +floating point version goes from 0.0 to 1.0. The origin (0.0) is in +the lower-lefthand corner of the icon. + +

void clear()

+ +

Clears all icon data from the icon. + +

void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1)

+ +

Draws the icon in the indicated area. + +

static Fl_File_Icon *find(const char *filename, int filetype = ANY);

+ +

Finds an icon that matches the given filename and file type. + +

static Fl_File_Icon *first()

+ +

Returns a pointer to the first icon in the list. + +

void label(Fl_Widget *w)

+ +

Applies the icon to the widget, registering the Fl_File_Icon +label type as needed. + +

static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a)

+ +

The labeltype function for icons. + +

void load(const char *f)

+ +

Loads the specified icon image. The format is deduced from the filename. + +

void load_fti(const char *fti)

+ +

Loads an SGI icon file. + +

static void load_system_icons(void)

+ +

Loads all system-defined icons. This call is useful when using the +FileChooser widget and should be used when the application +starts: + +

    +Fl_File_Icon::load_system_icons();
    +
+ +

void load_xpm(const char *xpm)

+ +

Loads an XPM icon file. + +

const char *pattern()

+ +

Returns the filename matching pattern for the icon. + +

int size()

+ +

Returns the number of words of data used by the icon. + +

int type()

+ +

Returns the filetype associated with the icon, which can be one of the +following: + +

    +
  • Fl_File_Icon::ANY, any kind of file. +
  • Fl_File_Icon::PLAIN, plain files. +
  • Fl_File_Icon::FIFO, named pipes. +
  • Fl_File_Icon::DEVICE, character and block devices. +
  • Fl_File_Icon::LINK, symbolic links. +
  • Fl_File_Icon::DIRECTORY, directories. +
+ +

short *value()

+ +

Returns the data array for the icon. + + + diff --git a/documentation/Fl_HelpDialog.html b/documentation/Fl_HelpDialog.html deleted file mode 100644 index 5fd28c7e6..000000000 --- a/documentation/Fl_HelpDialog.html +++ /dev/null @@ -1,89 +0,0 @@ - - - HelpDialog - ESP Widget Set for FLTK - - - Widget Set Home Page - Widget Set Documentation - Download Widget Set - ESP Home Page - FLTK Home Page - - - - - - -

class HelpDialog

- -
- -

Class Hierarchy

- -
    -Fl_Group
    -   |
    -   +----HelpDialog
    -
- -

Include Files

- -
    -#include "HelpDialog.h"
    -
- -

Description

- -

The HelpDialog widget displays a standard help dialog window -using the HelpView widget. - -

HelpDialog Window
- -

Methods

- - - -

HelpDialog()

- -

The constructor creates the dialog pictured above. - -

~HelpView()

- -

The destructor destroys the widget and frees all memory that has been -allocated for the current file. - -

void hide()

- -

Hides the HelpDialog window. - -

void load(const char *f)

- -

Loads the specified HTML file into the HelpView widget. -The filename can also contain a target name ("filename.html#target"). - -

void show()

- -

Shows the HelpDialog window. - -

void topline(const char *n)
-void topline(int n)

- -

Sets the top line in the HelpView widget to the named or -numbered line. - -

int visible()

- -

Returns 1 if the HelpDialog window is visible. - - - diff --git a/documentation/Fl_HelpView.html b/documentation/Fl_HelpView.html deleted file mode 100644 index e9e5b8a85..000000000 --- a/documentation/Fl_HelpView.html +++ /dev/null @@ -1,130 +0,0 @@ - - - HelpView - ESP Widget Set for FLTK - - - - - - -

class HelpView

- -
- -

Class Hierarchy

- -
    -Fl_Group
    -   |
    -   +----HelpView
    -
- -

Include Files

- -
    -#include "HelpView.h"
    -
- -

Description

- -

The HelpView widget displays HTML text. Most HTML 2.0 -elements are supported, as well as a primitive implementation of tables. -GIF, JPEG, and PNG images are displayed inline. - -

Methods

- - - -

HelpView(int xx, int yy, int ww, int hh, const char *l = 0)

- -

The constructor creates the HelpView widget at the specified -position and size. - -

~HelpView()

- -

The destructor destroys the widget and frees all memory that has been -allocated for the current file. - -

const char *directory() const

- -

This method returns the current directory (base) path for the file -in the buffer. - -

const char *filename() const

- -

This method returns the current filename for the text in the buffer. - -

void link(HelpFunc *fn)

- -

This method assigns a callback function to use when a link is -followed or a file is loaded (via HelpView::load()) that -requires a different file or path. The callback function receives the -full pathname for the file in question and must return a pathname that -can be opened as a local file. This is used by the -HelpApp widget to support WWW -addresses. - -

int load(const char *f)

- -

This method loads the specified file or URL. - -

int size() const

- -

This method returns the length of the buffer text in pixels. - -

void textcolor(Fl_Color c)
-Fl_Color textcolor() const

- -

The first form sets the default text color. The second returns -the current default text color. - -

void textfont(uchar f)
-uchar textfont() const

- -

The first form sets the default text font. The second returns -the current default text font. - -

void textsize(uchar s)
-uchar textsize() const

- -

The first form sets the default text size. The second returns -the current default text size. - -

const char *title()

- -

This method returns the current document title, or NULL if there -is no title. - -

void topline(const char *n)
-void topline(int)
-int topline() const

- -

The first two forms scroll the text to the indicated position, either -with a named destination or by pixel line. - -

The second form returns the current top line in pixels. - -

void value(const char *v)
-const char *value() const

- -

The first form sets the current buffer to the string provided and -reformats the text. The second form returns the current buffer contents. - - - diff --git a/documentation/Fl_HelpDialog.gif b/documentation/Fl_Help_Dialog.gif similarity index 100% rename from documentation/Fl_HelpDialog.gif rename to documentation/Fl_Help_Dialog.gif diff --git a/documentation/Fl_Help_Dialog.html b/documentation/Fl_Help_Dialog.html new file mode 100644 index 000000000..d344cc0fc --- /dev/null +++ b/documentation/Fl_Help_Dialog.html @@ -0,0 +1,77 @@ + + + + +

class Fl_Help_Dialog

+ +
+ +

Class Hierarchy

+ +
    +Fl_Group
    +   |
    +   +----Fl_Help_Dialog
    +
+ +

Include Files

+ +
    +#include "Fl_Help_Dialog.h"
    +
+ +

Description

+ +

The Fl_Help_Dialog widget displays a standard help dialog window +using the Fl_Help_View widget. + +

Fl_Help_Dialog Window
+ +

Methods

+ + + +

Fl_Help_Dialog()

+ +

The constructor creates the dialog pictured above. + +

~Fl_Help_View()

+ +

The destructor destroys the widget and frees all memory that has been +allocated for the current file. + +

void hide()

+ +

Hides the Fl_Help_Dialog window. + +

void load(const char *f)

+ +

Loads the specified HTML file into the Fl_Help_View widget. +The filename can also contain a target name ("filename.html#target"). + +

void show()

+ +

Shows the Fl_Help_Dialog window. + +

void topline(const char *n)
+void topline(int n)

+ +

Sets the top line in the Fl_Help_View widget to the named or +numbered line. + +

int visible()

+ +

Returns 1 if the Fl_Help_Dialog window is visible. + + + diff --git a/documentation/Fl_Help_View.html b/documentation/Fl_Help_View.html new file mode 100644 index 000000000..fb7a88d75 --- /dev/null +++ b/documentation/Fl_Help_View.html @@ -0,0 +1,123 @@ + + +

class Fl_Help_View

+ +
+ +

Class Hierarchy

+ +
    +Fl_Group
    +   |
    +   +----Fl_Help_View
    +
+ +

Include Files

+ +
    +#include "Fl_Help_View.h"
    +
+ +

Description

+ +

The Fl_Help_View widget displays HTML text. Most HTML 2.0 +elements are supported, as well as a primitive implementation of tables. +GIF, JPEG, and PNG images are displayed inline. + +

Methods

+ + + +

Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0)

+ +

The constructor creates the Fl_Help_View widget at the specified +position and size. + +

~Fl_Help_View()

+ +

The destructor destroys the widget and frees all memory that has been +allocated for the current file. + +

const char *directory() const

+ +

This method returns the current directory (base) path for the file +in the buffer. + +

const char *filename() const

+ +

This method returns the current filename for the text in the buffer. + +

void link(Fl_Help_Func *fn)

+ +

This method assigns a callback function to use when a link is +followed or a file is loaded (via Fl_Help_View::load()) that +requires a different file or path. The callback function receives the +full pathname for the file in question and must return a pathname that +can be opened as a local file. This is used by the +Fl_Help_App widget to support WWW +addresses. + +

int load(const char *f)

+ +

This method loads the specified file or URL. + +

int size() const

+ +

This method returns the length of the buffer text in pixels. + +

void textcolor(Fl_Color c)
+Fl_Color textcolor() const

+ +

The first form sets the default text color. The second returns +the current default text color. + +

void textfont(uchar f)
+uchar textfont() const

+ +

The first form sets the default text font. The second returns +the current default text font. + +

void textsize(uchar s)
+uchar textsize() const

+ +

The first form sets the default text size. The second returns +the current default text size. + +

const char *title()

+ +

This method returns the current document title, or NULL if there +is no title. + +

void topline(const char *n)
+void topline(int)
+int topline() const

+ +

The first two forms scroll the text to the indicated position, either +with a named destination or by pixel line. + +

The second form returns the current top line in pixels. + +

void value(const char *v)
+const char *value() const

+ +

The first form sets the current buffer to the string provided and +reformats the text. The second form returns the current buffer contents. + + + diff --git a/documentation/fltk.book b/documentation/fltk.book index 394663b64..e8d0dc22c 100644 --- a/documentation/fltk.book +++ b/documentation/fltk.book @@ -25,15 +25,15 @@ Fl_Counter.html Fl_Dial.html Fl_Double_Window.html Fl_End.html -Fl_FileBrowser.html -Fl_FileChooser.html -Fl_FileIcon.html +Fl_File_Browser.html +Fl_File_Chooser.html +Fl_File_Icon.html Fl_Float_Input.html Fl_Free.html Fl_Gl_Window.html Fl_Group.html -Fl_HelpDialog.html -Fl_HelpView.html +Fl_Help_Dialog.html +Fl_Help_View.html Fl_Hold_Browser.html Fl_Input.html Fl_Input_.html diff --git a/documentation/widgets.html b/documentation/widgets.html index 076e579a0..bf4100968 100644 --- a/documentation/widgets.html +++ b/documentation/widgets.html @@ -24,15 +24,15 @@ see Appendix B. Fl_Dial
Fl_Double_Window
Fl_End
-Fl_FileBrowser
-Fl_FileChooser
-Fl_FileIcon
+Fl_File_Browser
+Fl_File_Chooser
+Fl_File_Icon
Fl_Float_Input
Fl_Free
Fl_Gl_Window
Fl_Group
-Fl_HelpDialog
-Fl_HelpView
+Fl_Help_Dialog
+Fl_Help_View
Fl_Hold_Browser
Fl_Input
Fl_Input_
@@ -78,7 +78,7 @@ see Appendix B.

  • Fl_End -
  • Fl_FileIcon +
  • Fl_File_Icon
  • Fl_Menu_Item
  • Fl_Widget
      @@ -87,7 +87,7 @@ see Appendix B.
      • Fl_Browser
          -
        • Fl_FileBrowser +
        • Fl_File_Browser
        • Fl_Hold_Browser
        • Fl_Multi_Browser
        • Fl_Select_Browser @@ -107,9 +107,9 @@ see Appendix B.
        • Fl_Group
          • Fl_Color_Chooser -
          • Fl_FileChooser -
          • Fl_HelpDialog -
          • Fl_HelpView +
          • Fl_File_Chooser +
          • Fl_Help_Dialog +
          • Fl_Help_View
          • Fl_Pack
          • Fl_Scroll
          • Fl_Tabs diff --git a/fluid/factory.cxx b/fluid/factory.cxx index 4456c744d..181a626d4 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -1,5 +1,5 @@ // -// "$Id: factory.cxx,v 1.4.2.11.2.1 2001/08/11 16:09:26 easysw Exp $" +// "$Id: factory.cxx,v 1.4.2.11.2.2 2001/09/29 14:38:59 easysw Exp $" // // Widget factory code for the Fast Light Tool Kit (FLTK). // @@ -174,7 +174,7 @@ extern int compile_only; #include #include -#include +#include static Fl_Menu_Item browser_type_menu[] = { {"No Select",0,0,(void*)FL_NORMAL_BROWSER}, @@ -250,30 +250,26 @@ int Fl_Check_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { return 1; } -class Fl_FileBrowser_Type : public Fl_Widget_Type { +class Fl_File_Browser_Type : public Fl_Widget_Type { Fl_Menu_Item *subtypes() {return browser_type_menu;} int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c); public: - virtual const char *type_name() {return "Fl_FileBrowser";} + virtual const char *type_name() {return "Fl_File_Browser";} Fl_Widget *widget(int x,int y,int w,int h) { - Fl_FileBrowser* b = new Fl_FileBrowser(x,y,w,h); - // Fl_FileBrowser::add calls fl_height(), which requires the X display open. + Fl_File_Browser* b = new Fl_File_Browser(x,y,w,h); + // Fl_File_Browser::add calls fl_height(), which requires the X display open. // Avoid this when compiling so it works w/o a display: if (!compile_only) { - char buffer[20]; - for (int i = 1; i <= 20; i++) { - sprintf(buffer,"Browser Line %d",i); - b->add(buffer); - } + b->load("."); } return b; } - Fl_Widget_Type *_make() {return new Fl_FileBrowser_Type();} + Fl_Widget_Type *_make() {return new Fl_File_Browser_Type();} }; -static Fl_FileBrowser_Type Fl_FileBrowser_type; +static Fl_File_Browser_Type Fl_File_Browser_type; -int Fl_FileBrowser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { - Fl_FileBrowser *myo = (Fl_FileBrowser*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); +int Fl_File_Browser_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) { + Fl_File_Browser *myo = (Fl_File_Browser*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o); switch (w) { case 4: case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break; @@ -419,18 +415,18 @@ static Fl_Clock_Type Fl_Clock_type; //////////////////////////////////////////////////////////////// -#include -class Fl_HelpView_Type : public Fl_Widget_Type { +#include +class Fl_Help_View_Type : public Fl_Widget_Type { public: - virtual const char *type_name() {return "Fl_HelpView";} + virtual const char *type_name() {return "Fl_Help_View";} Fl_Widget *widget(int x,int y,int w,int h) { - Fl_HelpView *myo = new Fl_HelpView(x,y,w,h); - myo->value("

            Fl_HelpView Widget

            " - "

            This is a Fl_HelpView widget.

            "); + Fl_Help_View *myo = new Fl_Help_View(x,y,w,h); + myo->value("

            Fl_Help_View Widget

            " + "

            This is a Fl_Help_View widget.

            "); return myo;} - Fl_Widget_Type *_make() {return new Fl_HelpView_Type();} + Fl_Widget_Type *_make() {return new Fl_Help_View_Type();} }; -static Fl_HelpView_Type Fl_HelpView_type; +static Fl_Help_View_Type Fl_Help_View_type; //////////////////////////////////////////////////////////////// @@ -715,12 +711,12 @@ Fl_Menu_Item New_Menu[] = { {"browsers",0,0,0,FL_SUBMENU}, {0,0,cb,(void*)&Fl_Browser_type}, {0,0,cb,(void*)&Fl_Check_Browser_type}, - {0,0,cb,(void*)&Fl_FileBrowser_type}, + {0,0,cb,(void*)&Fl_File_Browser_type}, {0}, {"other",0,0,0,FL_SUBMENU}, {0,0,cb,(void*)&Fl_Box_type}, {0,0,cb,(void*)&Fl_Clock_type}, - {0,0,cb,(void*)&Fl_HelpView_type}, + {0,0,cb,(void*)&Fl_Help_View_type}, {0,0,cb,(void*)&Fl_Progress_type}, {0}, {0}}; @@ -891,5 +887,5 @@ int lookup_symbol(const char *name, int &v, int numberok) { } // -// End of "$Id: factory.cxx,v 1.4.2.11.2.1 2001/08/11 16:09:26 easysw Exp $". +// End of "$Id: factory.cxx,v 1.4.2.11.2.2 2001/09/29 14:38:59 easysw Exp $". // diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 6f053f9f9..d8cd82cc9 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -1,5 +1,5 @@ // -// "$Id: fluid.cxx,v 1.15.2.13.2.5 2001/09/23 13:08:02 easysw Exp $" +// "$Id: fluid.cxx,v 1.15.2.13.2.6 2001/09/29 14:38:59 easysw Exp $" // // FLUID main entry for the Fast Light Tool Kit (FLTK). // @@ -48,7 +48,7 @@ const char *copyright = #include #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ extern int snprintf(char* str, size_t size, const char* fmt, ...); #include "Fl_Type.h" -static Fl_HelpDialog *help_dialog = 0; +static Fl_Help_Dialog *help_dialog = 0; //////////////////////////////////////////////////////////////// @@ -350,7 +350,7 @@ void show_help(const char *name) { const char *docdir; char filename[1024]; - if (!help_dialog) help_dialog = new Fl_HelpDialog(); + if (!help_dialog) help_dialog = new Fl_Help_Dialog(); if ((docdir = getenv("FLTK_DOCDIR")) == NULL) docdir = FLTK_DOCDIR; @@ -518,5 +518,5 @@ int main(int argc,char **argv) { } // -// End of "$Id: fluid.cxx,v 1.15.2.13.2.5 2001/09/23 13:08:02 easysw Exp $". +// End of "$Id: fluid.cxx,v 1.15.2.13.2.6 2001/09/29 14:38:59 easysw Exp $". // diff --git a/fluid/makedepend b/fluid/makedepend index ca3b5e71c..a39e1cce6 100644 --- a/fluid/makedepend +++ b/fluid/makedepend @@ -91,11 +91,11 @@ factory.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Light_Button.H factory.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H factory.o: ../FL/Fl_Round_Button.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H factory.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -factory.o: ../FL/Fl_Check_Browser.H ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H -factory.o: ../FL/Fl_FileIcon.H ../FL/Fl_Counter.H ../FL/Fl_Input.H -factory.o: ../FL/Fl_Input_.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H -factory.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H -factory.o: ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H ../FL/Fl_HelpView.H +factory.o: ../FL/Fl_Check_Browser.H ../FL/Fl_File_Browser.H +factory.o: ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H ../FL/Fl_Counter.H +factory.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Text_Display.H +factory.o: ../FL/fl_draw.H ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H +factory.o: ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H ../FL/Fl_Help_View.H factory.o: ../FL/Fl_Scrollbar.H ../FL/fl_draw.H ../FL/Fl_Progress.H factory.o: ../FL/Fl_Adjuster.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H factory.o: ../FL/Fl_Output.H ../FL/Fl_Value_Input.H ../FL/Fl_Input.H @@ -110,13 +110,13 @@ file.o: ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H ../FL/Fl_Wizard.H file.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H ../FL/Fl_Menu_Bar.H fluid.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H fluid.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H -fluid.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_HelpDialog.H -fluid.o: ../FL/Fl_Window.H ../FL/Fl_HelpView.H ../FL/Fl_Group.H -fluid.o: ../FL/Fl_Scrollbar.H ../FL/fl_draw.H ../FL/Fl_Hold_Browser.H -fluid.o: ../FL/Fl_Browser.H ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H -fluid.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_ask.H -fluid.o: ../FL/fl_file_chooser.H ../FL/fl_message.H ../FL/fl_ask.H -fluid.o: ../FL/filename.H ../config.h about_panel.h ../FL/Fl_Return_Button.H +fluid.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/Fl_Help_Dialog.H +fluid.o: ../FL/Fl_Help_View.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H +fluid.o: ../FL/fl_draw.H ../FL/Fl_Hold_Browser.H ../FL/Fl_Browser.H +fluid.o: ../FL/Fl_Menu_Bar.H ../FL/Fl_Menu_.H ../FL/Fl_Input.H +fluid.o: ../FL/Fl_Input_.H ../FL/fl_ask.H ../FL/fl_file_chooser.H +fluid.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/filename.H ../config.h +fluid.o: about_panel.h ../FL/Fl_Window.H ../FL/Fl_Return_Button.H fluid.o: ../FL/Fl_Button.H Fl_Type.h ../FL/Fl_Widget.H ../FL/Fl_Menu.H fluid.o: ../FL/Fl_Menu_Item.H Fluid_Image.h ../FL/Fl_Tabs.H ../FL/Fl_Pack.H fluid.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H @@ -127,11 +127,12 @@ about_panel.o: ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/Fl_Button.H about_panel.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H widget_panel.o: widget_panel.h ../FL/Fl.H ../FL/Enumerations.H widget_panel.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H -widget_panel.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Light_Button.H -widget_panel.o: ../FL/Fl_Button.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H +widget_panel.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Input.H +widget_panel.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H widget_panel.o: ../FL/Fl_Button.H ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H -widget_panel.o: ../FL/Fl_Input.H Shortcut_Button.h ../FL/Fl_Group.H -widget_panel.o: ../FL/Fl_Box.H ../FL/Fl_Return_Button.H +widget_panel.o: ../FL/Fl_Input.H ../FL/Fl_Box.H Shortcut_Button.h +widget_panel.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H +widget_panel.o: ../FL/Fl_Return_Button.H alignment_panel.o: alignment_panel.h ../FL/Fl.H ../FL/Enumerations.H alignment_panel.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H alignment_panel.o: ../FL/Fl_Box.H ../FL/Fl_Input.H ../FL/Fl_Input_.H diff --git a/src/Fl_FileBrowser.cxx b/src/Fl_File_Browser.cxx similarity index 83% rename from src/Fl_FileBrowser.cxx rename to src/Fl_File_Browser.cxx index 63587bcf4..d1a5af82f 100644 --- a/src/Fl_FileBrowser.cxx +++ b/src/Fl_File_Browser.cxx @@ -1,7 +1,7 @@ // -// "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $" +// "$Id: Fl_File_Browser.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" // -// Fl_FileBrowser routines. +// Fl_File_Browser routines. // // Copyright 1999-2001 by Michael Sweet. // @@ -24,20 +24,20 @@ // // Contents: // -// Fl_FileBrowser::full_height() - Return the height of the list. -// Fl_FileBrowser::item_height() - Return the height of a list item. -// Fl_FileBrowser::item_width() - Return the width of a list item. -// Fl_FileBrowser::item_draw() - Draw a list item. -// Fl_FileBrowser::Fl_FileBrowser() - Create a Fl_FileBrowser widget. -// Fl_FileBrowser::load() - Load a directory into the browser. -// Fl_FileBrowser::filter() - Set the filename filter. +// Fl_File_Browser::full_height() - Return the height of the list. +// Fl_File_Browser::item_height() - Return the height of a list item. +// Fl_File_Browser::item_width() - Return the width of a list item. +// Fl_File_Browser::item_draw() - Draw a list item. +// Fl_File_Browser::Fl_File_Browser() - Create a Fl_File_Browser widget. +// Fl_File_Browser::load() - Load a directory into the browser. +// Fl_File_Browser::filter() - Set the filename filter. // // // Include necessary header files... // -#include +#include #include #include #include @@ -82,11 +82,11 @@ struct FL_BLINE // data is in a linked list of these // -// 'Fl_FileBrowser::full_height()' - Return the height of the list. +// 'Fl_File_Browser::full_height()' - Return the height of the list. // int // O - Height in pixels -Fl_FileBrowser::full_height() const +Fl_File_Browser::full_height() const { int i, // Looping var th; // Total height of list. @@ -100,11 +100,11 @@ Fl_FileBrowser::full_height() const // -// 'Fl_FileBrowser::item_height()' - Return the height of a list item. +// 'Fl_File_Browser::item_height()' - Return the height of a list item. // int // O - Height in pixels -Fl_FileBrowser::item_height(void *p) const // I - List item data +Fl_File_Browser::item_height(void *p) const // I - List item data { FL_BLINE *line; // Pointer to line char *text; // Pointer into text @@ -128,7 +128,7 @@ Fl_FileBrowser::item_height(void *p) const // I - List item data height += textheight; // If we have enabled icons then add space for them... - if (Fl_FileIcon::first() != NULL && height < iconsize_) + if (Fl_File_Icon::first() != NULL && height < iconsize_) height = iconsize_; // Add space for the selection border.. @@ -140,11 +140,11 @@ Fl_FileBrowser::item_height(void *p) const // I - List item data // -// 'Fl_FileBrowser::item_width()' - Return the width of a list item. +// 'Fl_File_Browser::item_width()' - Return the width of a list item. // int // O - Width in pixels -Fl_FileBrowser::item_width(void *p) const // I - List item data +Fl_File_Browser::item_width(void *p) const // I - List item data { int i; // Looping var FL_BLINE *line; // Pointer to line @@ -228,7 +228,7 @@ Fl_FileBrowser::item_width(void *p) const // I - List item data } // If we have enabled icons then add space for them... - if (Fl_FileIcon::first() != NULL) + if (Fl_File_Icon::first() != NULL) width += iconsize_ + 8; // Add space for the selection border.. @@ -240,11 +240,11 @@ Fl_FileBrowser::item_width(void *p) const // I - List item data // -// 'Fl_FileBrowser::item_draw()' - Draw a list item. +// 'Fl_File_Browser::item_draw()' - Draw a list item. // void -Fl_FileBrowser::item_draw(void *p, // I - List item data +Fl_File_Browser::item_draw(void *p, // I - List item data int x, // I - Upper-lefthand X coordinate int y, // I - Upper-lefthand Y coordinate int w, // I - Width of item @@ -277,7 +277,7 @@ Fl_FileBrowser::item_draw(void *p, // I - List item data else c = textcolor(); - if (Fl_FileIcon::first() == NULL) + if (Fl_File_Icon::first() == NULL) { // No icons, just draw the text... x ++; @@ -287,7 +287,7 @@ Fl_FileBrowser::item_draw(void *p, // I - List item data { // Draw the icon if it is set... if (line->data) - ((Fl_FileIcon *)line->data)->draw(x, y, iconsize_, iconsize_, + ((Fl_File_Icon *)line->data)->draw(x, y, iconsize_, iconsize_, (line->flags & SELECTED) ? FL_YELLOW : FL_LIGHT2, active_r()); @@ -368,10 +368,10 @@ Fl_FileBrowser::item_draw(void *p, // I - List item data // -// 'Fl_FileBrowser::Fl_FileBrowser()' - Create a Fl_FileBrowser widget. +// 'Fl_File_Browser::Fl_File_Browser()' - Create a Fl_File_Browser widget. // -Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate +Fl_File_Browser::Fl_File_Browser(int x, // I - Upper-lefthand X coordinate int y, // I - Upper-lefthand Y coordinate int w, // I - Width in pixels int h, // I - Height in pixels @@ -387,20 +387,20 @@ Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate // -// 'Fl_FileBrowser::load()' - Load a directory into the browser. +// 'Fl_File_Browser::load()' - Load a directory into the browser. // int // O - Number of files loaded -Fl_FileBrowser::load(const char *directory)// I - Directory to load +Fl_File_Browser::load(const char *directory)// I - Directory to load { int i; // Looping var int num_files; // Number of files in directory int num_dirs; // Number of directories in list char filename[4096]; // Current file - Fl_FileIcon *icon; // Icon to use + Fl_File_Icon *icon; // Icon to use -// printf("Fl_FileBrowser::load(\"%s\")\n", directory); +// printf("Fl_File_Browser::load(\"%s\")\n", directory); clear(); directory_ = directory; @@ -413,8 +413,8 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load // num_files = 0; - if ((icon = Fl_FileIcon::find("any", Fl_FileIcon::DEVICE)) == NULL) - icon = Fl_FileIcon::find("any", Fl_FileIcon::DIRECTORY); + if ((icon = Fl_File_Icon::find("any", Fl_File_Icon::DEVICE)) == NULL) + icon = Fl_File_Icon::find("any", Fl_File_Icon::DIRECTORY); #if defined(WIN32) DWORD drives; // Drive available bits @@ -478,7 +478,7 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load strncat(filename, "/", sizeof(filename) - 1); -// printf("Fl_FileBrowser::load() - adding \"%s\" to list...\n", filename); +// printf("Fl_File_Browser::load() - adding \"%s\" to list...\n", filename); add(filename, icon); num_files ++; } @@ -530,11 +530,11 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load snprintf(name, sizeof(name), "%s/", files[i]->d_name); num_dirs ++; - insert(num_dirs, name, Fl_FileIcon::find(filename)); + insert(num_dirs, name, Fl_File_Icon::find(filename)); } else if (filetype_ == FILES && filename_match(files[i]->d_name, pattern_)) - add(files[i]->d_name, Fl_FileIcon::find(filename)); + add(files[i]->d_name, Fl_File_Icon::find(filename)); } free(files[i]); @@ -548,11 +548,11 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load // -// 'Fl_FileBrowser::filter()' - Set the filename filter. +// 'Fl_File_Browser::filter()' - Set the filename filter. // void -Fl_FileBrowser::filter(const char *pattern) // I - Pattern string +Fl_File_Browser::filter(const char *pattern) // I - Pattern string { // If pattern is NULL set the pattern to "*"... if (pattern) @@ -566,5 +566,5 @@ Fl_FileBrowser::filter(const char *pattern) // I - Pattern string // -// End of "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $". +// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". // diff --git a/src/Fl_FileChooser.cxx b/src/Fl_File_Chooser.cxx similarity index 56% rename from src/Fl_FileChooser.cxx rename to src/Fl_File_Chooser.cxx index 724324f8c..42e4747a0 100644 --- a/src/Fl_FileChooser.cxx +++ b/src/Fl_File_Chooser.cxx @@ -1,55 +1,55 @@ // generated by Fast Light User Interface Designer (fluid) version 1.0100 -#include "../FL/Fl_FileChooser.H" +#include "../FL/Fl_File_Chooser.H" -inline void Fl_FileChooser::cb_window_i(Fl_Window*, void*) { +inline void Fl_File_Chooser::cb_window_i(Fl_Window*, void*) { fileList->deselect(); fileName->value(""); window->hide(); } -void Fl_FileChooser::cb_window(Fl_Window* o, void* v) { - ((Fl_FileChooser*)(o->user_data()))->cb_window_i(o,v); +void Fl_File_Chooser::cb_window(Fl_Window* o, void* v) { + ((Fl_File_Chooser*)(o->user_data()))->cb_window_i(o,v); } -inline void Fl_FileChooser::cb_fileList_i(Fl_FileBrowser*, void*) { +inline void Fl_File_Chooser::cb_fileList_i(Fl_File_Browser*, void*) { fileListCB(); } -void Fl_FileChooser::cb_fileList(Fl_FileBrowser* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_fileList_i(o,v); +void Fl_File_Chooser::cb_fileList(Fl_File_Browser* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_fileList_i(o,v); } -inline void Fl_FileChooser::cb_Cancel_i(Fl_Button*, void*) { +inline void Fl_File_Chooser::cb_Cancel_i(Fl_Button*, void*) { fileList->deselect(); fileName->value(""); window->hide(); } -void Fl_FileChooser::cb_Cancel(Fl_Button* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_Cancel_i(o,v); +void Fl_File_Chooser::cb_Cancel(Fl_Button* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_Cancel_i(o,v); } -inline void Fl_FileChooser::cb_okButton_i(Fl_Return_Button*, void*) { +inline void Fl_File_Chooser::cb_okButton_i(Fl_Return_Button*, void*) { // Do any callback that is registered... if (callback_) (*callback_)(this, data_); window->hide(); } -void Fl_FileChooser::cb_okButton(Fl_Return_Button* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_okButton_i(o,v); +void Fl_File_Chooser::cb_okButton(Fl_Return_Button* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_okButton_i(o,v); } -inline void Fl_FileChooser::cb_fileName_i(Fl_Input*, void*) { +inline void Fl_File_Chooser::cb_fileName_i(Fl_Input*, void*) { fileNameCB(); } -void Fl_FileChooser::cb_fileName(Fl_Input* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_fileName_i(o,v); +void Fl_File_Chooser::cb_fileName(Fl_Input* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_fileName_i(o,v); } -inline void Fl_FileChooser::cb_upButton_i(Fl_Button*, void*) { +inline void Fl_File_Chooser::cb_upButton_i(Fl_Button*, void*) { up(); } -void Fl_FileChooser::cb_upButton(Fl_Button* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_upButton_i(o,v); +void Fl_File_Chooser::cb_upButton(Fl_Button* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_upButton_i(o,v); } #include @@ -58,11 +58,11 @@ static unsigned char bits_up[] = \200\1\200\377\377\0\0"; static Fl_Bitmap bitmap_up(bits_up, 16, 16); -inline void Fl_FileChooser::cb_newButton_i(Fl_Button*, void*) { +inline void Fl_File_Chooser::cb_newButton_i(Fl_Button*, void*) { newdir(); } -void Fl_FileChooser::cb_newButton(Fl_Button* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_newButton_i(o,v); +void Fl_File_Chooser::cb_newButton(Fl_Button* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_newButton_i(o,v); } static unsigned char bits_new[] = @@ -70,7 +70,7 @@ static unsigned char bits_new[] = \200\1\200\377\377\0\0"; static Fl_Bitmap bitmap_new(bits_new, 16, 16); -inline void Fl_FileChooser::cb_dirMenu_i(Fl_Choice*, void*) { +inline void Fl_File_Chooser::cb_dirMenu_i(Fl_Choice*, void*) { char pathname[1024]; int i; @@ -79,11 +79,11 @@ for (i = 1; i <= dirMenu->value(); i ++) strcat(pathname, dirMenu->text(i)); directory(pathname); } -void Fl_FileChooser::cb_dirMenu(Fl_Choice* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb_dirMenu_i(o,v); +void Fl_File_Chooser::cb_dirMenu(Fl_Choice* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb_dirMenu_i(o,v); } -inline void Fl_FileChooser::cb__i(Fl_Button*, void*) { +inline void Fl_File_Chooser::cb__i(Fl_Button*, void*) { const char *f; if ((f = fl_input("New Filter?", fileList->filter())) != NULL) @@ -92,21 +92,21 @@ if ((f = fl_input("New Filter?", rescan(); }; } -void Fl_FileChooser::cb_(Fl_Button* o, void* v) { - ((Fl_FileChooser*)(o->parent()->user_data()))->cb__i(o,v); +void Fl_File_Chooser::cb_(Fl_Button* o, void* v) { + ((Fl_File_Chooser*)(o->parent()->user_data()))->cb__i(o,v); } static unsigned char bits_allfiles[] = "\374?\4 \4 \4 \204!\244%\304#\364/\364/\304#\244%\204!\4 \4 \4 \374?"; static Fl_Bitmap bitmap_allfiles(bits_allfiles, 16, 16); -Fl_FileChooser::Fl_FileChooser(const char *d, const char *p, int t, const char *title) { +Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) { Fl_Window* w; { Fl_Window* o = window = new Fl_Window(375, 315, "Pick a File"); w = o; o->callback((Fl_Callback*)cb_window, (void*)(this)); w->hotspot(o); - { Fl_FileBrowser* o = fileList = new Fl_FileBrowser(10, 45, 355, 180); + { Fl_File_Browser* o = fileList = new Fl_File_Browser(10, 45, 355, 180); o->type(2); o->callback((Fl_Callback*)cb_fileList); Fl_Group::current()->resizable(o); @@ -159,97 +159,101 @@ callback_ = 0; data_ = 0; } -void Fl_FileChooser::callback(void (*cb)(Fl_FileChooser *, void *), void *d) { +void Fl_File_Chooser::callback(void (*cb)(Fl_File_Chooser *, void *), void *d) { callback_ = cb; data_ = d; } -void Fl_FileChooser::color(Fl_Color c) { +void Fl_File_Chooser::color(Fl_Color c) { fileList->color(c); } -Fl_Color Fl_FileChooser::color() { +Fl_Color Fl_File_Chooser::color() { return (fileList->color()); } -char * Fl_FileChooser::directory() { +char * Fl_File_Chooser::directory() { return directory_; } -void Fl_FileChooser::filter(const char *p) { +void Fl_File_Chooser::filter(const char *p) { fileList->filter(p); rescan(); } -const char * Fl_FileChooser::filter() { +const char * Fl_File_Chooser::filter() { return (fileList->filter()); } -void Fl_FileChooser::hide() { +void Fl_File_Chooser::hide() { window->hide(); } -void Fl_FileChooser::iconsize(uchar s) { +void Fl_File_Chooser::iconsize(uchar s) { fileList->iconsize(s); } -uchar Fl_FileChooser::iconsize() { +uchar Fl_File_Chooser::iconsize() { return (fileList->iconsize()); } -void Fl_FileChooser::label(const char *l) { +void Fl_File_Chooser::label(const char *l) { window->label(l); } -const char * Fl_FileChooser::label() { +const char * Fl_File_Chooser::label() { return (window->label()); } -void Fl_FileChooser::show() { +void Fl_File_Chooser::show() { window->show(); fileList->deselect(); } -void Fl_FileChooser::textcolor(Fl_Color c) { +void Fl_File_Chooser::textcolor(Fl_Color c) { fileList->textcolor(c); } -Fl_Color Fl_FileChooser::textcolor() { +Fl_Color Fl_File_Chooser::textcolor() { return (fileList->textcolor()); } -void Fl_FileChooser::textfont(uchar f) { +void Fl_File_Chooser::textfont(uchar f) { fileList->textfont(f); } -uchar Fl_FileChooser::textfont() { +uchar Fl_File_Chooser::textfont() { return (fileList->textfont()); } -void Fl_FileChooser::textsize(uchar s) { +void Fl_File_Chooser::textsize(uchar s) { fileList->textsize(s); } -uchar Fl_FileChooser::textsize() { +uchar Fl_File_Chooser::textsize() { return (fileList->textsize()); } -void Fl_FileChooser::type(int t) { +void Fl_File_Chooser::type(int t) { type_ = t; -if (t == MULTI) +if (t & MULTI) fileList->type(FL_MULTI_BROWSER); else fileList->type(FL_HOLD_BROWSER); -if (t != CREATE) +if (t & CREATE) newButton->deactivate(); else newButton->activate(); +if (t & DIRECTORY) + fileList->filetype(Fl_File_Browser::DIRECTORIES); +else + fileList->filetype(Fl_File_Browser::FILES); } -int Fl_FileChooser::type() { +int Fl_File_Chooser::type() { return (type_); } -int Fl_FileChooser::visible() { +int Fl_File_Chooser::visible() { return window->visible(); } diff --git a/src/Fl_FileChooser.fl b/src/Fl_File_Chooser.fl similarity index 87% rename from src/Fl_FileChooser.fl rename to src/Fl_File_Chooser.fl index ac11c961b..1302d773f 100644 --- a/src/Fl_FileChooser.fl +++ b/src/Fl_File_Chooser.fl @@ -1,15 +1,15 @@ # data file for the Fltk User Interface Designer (fluid) version 1.0100 -header_name {../FL/Fl_FileChooser.H} +header_name {../FL/Fl_File_Chooser.H} code_name {.cxx} gridx 5 gridy 5 snap 3 -class Fl_FileChooser {open +class Fl_File_Chooser {open } { - decl {enum { SINGLE, MULTI, CREATE };} {public + decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {selected public } - Function {Fl_FileChooser(const char *d, const char *p, int t, const char *title)} {open + Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {open } { Fl_Window window { label {Pick a File} @@ -25,8 +25,8 @@ window->hide();} open Fl_Browser fileList { callback {fileListCB();} private xywh {10 45 355 180} type Hold resizable hotspot - code0 {\#include } - class Fl_FileBrowser + code0 {\#include } + class Fl_File_Browser } Fl_Button {} { label Cancel @@ -54,7 +54,7 @@ window->hide();} code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);} } Fl_Button upButton { - callback {up();} selected + callback {up();} private image {up.xbm} xywh {280 10 25 25} labelsize 8 } Fl_Button newButton { @@ -91,7 +91,7 @@ value(d); callback_ = 0; data_ = 0;} {} } - decl {void (*callback_)(Fl_FileChooser*, void *);} {} + decl {void (*callback_)(Fl_File_Chooser*, void *);} {} decl {void *data_;} {} decl {char directory_[1024];} {} decl {int type_;} {} @@ -99,7 +99,7 @@ data_ = 0;} {} decl {void fileNameCB();} {} decl {void newdir();} {} decl {void up();} {} - Function {callback(void (*cb)(Fl_FileChooser *, void *), void *d)} {return_type void + Function {callback(void (*cb)(Fl_File_Chooser *, void *), void *d)} {return_type void } { code {callback_ = cb; data_ = d;} {} @@ -182,14 +182,18 @@ fileList->deselect();} {} Function {type(int t)} {return_type void } { code {type_ = t; -if (t == MULTI) +if (t & MULTI) fileList->type(FL_MULTI_BROWSER); else fileList->type(FL_HOLD_BROWSER); -if (t != CREATE) +if (t & CREATE) newButton->deactivate(); else - newButton->activate();} {} + newButton->activate(); +if (t & DIRECTORY) + fileList->filetype(Fl_File_Browser::DIRECTORIES); +else + fileList->filetype(Fl_File_Browser::FILES);} {} } Function {type()} {return_type int } { diff --git a/src/Fl_FileChooser2.cxx b/src/Fl_File_Chooser2.cxx similarity index 86% rename from src/Fl_FileChooser2.cxx rename to src/Fl_File_Chooser2.cxx index e353f56f2..801c6050d 100644 --- a/src/Fl_FileChooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1,7 +1,7 @@ // -// "$Id: Fl_FileChooser2.cxx,v 1.15.2.2 2001/08/04 12:21:33 easysw Exp $" +// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" // -// More Fl_FileChooser routines. +// More Fl_File_Chooser routines. // // Copyright 1999-2001 by Michael Sweet. // @@ -24,22 +24,22 @@ // // Contents: // -// Fl_FileChooser::directory() - Set the directory in the file chooser. -// Fl_FileChooser::count() - Return the number of selected files. -// Fl_FileChooser::value() - Return a selected filename. -// Fl_FileChooser::up() - Go up one directory. -// Fl_FileChooser::newdir() - Make a new directory. -// Fl_FileChooser::rescan() - Rescan the current directory. -// Fl_FileChooser::fileListCB() - Handle clicks (and double-clicks) in the +// Fl_File_Chooser::directory() - Set the directory in the file chooser. +// Fl_File_Chooser::count() - Return the number of selected files. +// Fl_File_Chooser::value() - Return a selected filename. +// Fl_File_Chooser::up() - Go up one directory. +// Fl_File_Chooser::newdir() - Make a new directory. +// Fl_File_Chooser::rescan() - Rescan the current directory. +// Fl_File_Chooser::fileListCB() - Handle clicks (and double-clicks) in the // FileBrowser. -// Fl_FileChooser::fileNameCB() - Handle text entry in the FileBrowser. +// Fl_File_Chooser::fileNameCB() - Handle text entry in the FileBrowser. // // // Include necessary headers. // -#include +#include #include #include #include @@ -63,11 +63,11 @@ // -// 'Fl_FileChooser::directory()' - Set the directory in the file chooser. +// 'Fl_File_Chooser::directory()' - Set the directory in the file chooser. // void -Fl_FileChooser::directory(const char *d) // I - Directory to change to +Fl_File_Chooser::directory(const char *d) // I - Directory to change to { char pathname[1024], // Full path of directory *pathptr, // Pointer into full path @@ -75,7 +75,7 @@ Fl_FileChooser::directory(const char *d) // I - Directory to change to int levels; // Number of levels in directory -// printf("Fl_FileChooser::directory(\"%s\")\n", d == NULL ? "(null)" : d); +// printf("Fl_File_Chooser::directory(\"%s\")\n", d == NULL ? "(null)" : d); // NULL == current directory if (d == NULL) @@ -148,11 +148,11 @@ Fl_FileChooser::directory(const char *d) // I - Directory to change to // -// 'Fl_FileChooser::count()' - Return the number of selected files. +// 'Fl_File_Chooser::count()' - Return the number of selected files. // int // O - Number of selected files -Fl_FileChooser::count() +Fl_File_Chooser::count() { int i; // Looping var int count; // Number of selected files @@ -160,7 +160,7 @@ Fl_FileChooser::count() char pathname[1024]; // Full path to file - if (type_ != MULTI) + if (!(type_ & MULTI)) { // Check to see if the file name input field is blank... filename = fileName->value(); @@ -204,11 +204,11 @@ Fl_FileChooser::count() // -// 'Fl_FileChooser::value()' - Return a selected filename. +// 'Fl_File_Chooser::value()' - Return a selected filename. // const char * // O - Filename or NULL -Fl_FileChooser::value(int f) // I - File number +Fl_File_Chooser::value(int f) // I - File number { int i; // Looping var int count; // Number of selected files @@ -216,7 +216,7 @@ Fl_FileChooser::value(int f) // I - File number static char pathname[1024]; // Filename + directory - if (type_ != MULTI) + if (!(type_ & MULTI)) { name = fileName->value(); if (name[0] == '\0') @@ -247,11 +247,11 @@ Fl_FileChooser::value(int f) // I - File number // -// 'Fl_FileChooser::value()' - Set the current filename. +// 'Fl_File_Chooser::value()' - Set the current filename. // void -Fl_FileChooser::value(const char *filename) // I - Filename + directory +Fl_File_Chooser::value(const char *filename) // I - Filename + directory { int i, // Looping var count; // Number of items in list @@ -259,7 +259,7 @@ Fl_FileChooser::value(const char *filename) // I - Filename + directory char pathname[1024]; // Local copy of filename -// printf("Fl_FileChooser::value(\"%s\")\n", filename == NULL ? "(null)" : filename); +// printf("Fl_File_Chooser::value(\"%s\")\n", filename == NULL ? "(null)" : filename); // See if the filename is actually a directory... if (filename == NULL || !filename[0] || filename_isdir(filename)) @@ -270,7 +270,7 @@ Fl_FileChooser::value(const char *filename) // I - Filename + directory } // Switch to single-selection mode as needed - if (type_ == MULTI) + if (type_ & MULTI) type(SINGLE); // See if there is a directory in there... @@ -307,11 +307,11 @@ Fl_FileChooser::value(const char *filename) // I - Filename + directory // -// 'Fl_FileChooser::up()' - Go up one directory. +// 'Fl_File_Chooser::up()' - Go up one directory. // void -Fl_FileChooser::up() +Fl_File_Chooser::up() { char *slash; // Trailing slash @@ -335,11 +335,11 @@ Fl_FileChooser::up() // -// 'Fl_FileChooser::newdir()' - Make a new directory. +// 'Fl_File_Chooser::newdir()' - Make a new directory. // void -Fl_FileChooser::newdir() +Fl_File_Chooser::newdir() { const char *dir; // New directory name char pathname[1024]; // Full path of directory @@ -380,13 +380,13 @@ Fl_FileChooser::newdir() // -// 'Fl_FileChooser::rescan()' - Rescan the current directory. +// 'Fl_File_Chooser::rescan()' - Rescan the current directory. // void -Fl_FileChooser::rescan() +Fl_File_Chooser::rescan() { -// printf("Fl_FileChooser::rescan(); directory = \"%s\"\n", directory_); +// printf("Fl_File_Chooser::rescan(); directory = \"%s\"\n", directory_); // Clear the current filename fileName->value(""); @@ -398,12 +398,12 @@ Fl_FileChooser::rescan() // -// 'Fl_FileChooser::fileListCB()' - Handle clicks (and double-clicks) in the +// 'Fl_File_Chooser::fileListCB()' - Handle clicks (and double-clicks) in the // FileBrowser. // void -Fl_FileChooser::fileListCB() +Fl_File_Chooser::fileListCB() { char *filename, // New filename pathname[1024]; // Full pathname to file @@ -444,18 +444,18 @@ Fl_FileChooser::fileListCB() { fileName->value(filename); - if (!filename_isdir(pathname)) + if (!filename_isdir(pathname) || (type_ & DIRECTORY)) okButton->activate(); } } // -// 'Fl_FileChooser::fileNameCB()' - Handle text entry in the FileBrowser. +// 'Fl_File_Chooser::fileNameCB()' - Handle text entry in the FileBrowser. // void -Fl_FileChooser::fileNameCB() +Fl_File_Chooser::fileNameCB() { char *filename, // New filename *slash, // Pointer to trailing slash @@ -542,11 +542,11 @@ Fl_FileChooser::fileNameCB() if (filename_isdir(pathname)) #endif /* WIN32 || __EMX__ */ directory(pathname); - else if (type_ == CREATE || access(pathname, 0) == 0) + else if ((type_ & CREATE) || access(pathname, 0) == 0) { // New file or file exists... If we are in multiple selection mode, // switch to single selection mode... - if (type_ == MULTI) + if (type_ & MULTI) type(SINGLE); // Do any callback that is registered... @@ -559,13 +559,6 @@ Fl_FileChooser::fileNameCB() else { // File doesn't exist, so beep at and alert the user... - // TODO: NEED TO ADD fl_beep() FUNCTION TO 2.0! -#ifdef WIN32 - MessageBeep(MB_ICONEXCLAMATION); -#else - XBell(fl_display, 100); -#endif // WIN32 - fl_alert("Please choose an existing file!"); } } @@ -681,8 +674,8 @@ Fl_FileChooser::fileNameCB() // See if we need to enable the OK button... sprintf(pathname, "%s/%s", directory_, fileName->value()); - if ((type_ == CREATE || access(pathname, 0) == 0) && - !filename_isdir(pathname)) + if ((type_ & CREATE || access(pathname, 0) == 0) && + (!filename_isdir(pathname) || type_ & DIRECTORY)) okButton->activate(); else okButton->deactivate(); @@ -691,5 +684,5 @@ Fl_FileChooser::fileNameCB() // -// End of "$Id: Fl_FileChooser2.cxx,v 1.15.2.2 2001/08/04 12:21:33 easysw Exp $". +// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". // diff --git a/src/Fl_FileIcon.cxx b/src/Fl_File_Icon.cxx similarity index 82% rename from src/Fl_FileIcon.cxx rename to src/Fl_File_Icon.cxx index dc0273d95..5c711235a 100644 --- a/src/Fl_FileIcon.cxx +++ b/src/Fl_File_Icon.cxx @@ -1,7 +1,7 @@ // -// "$Id: Fl_FileIcon.cxx,v 1.10.2.1 2001/08/02 16:17:04 easysw Exp $" +// "$Id: Fl_File_Icon.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" // -// Fl_FileIcon routines. +// Fl_File_Icon routines. // // KDE icon code donated by Maarten De Boer. // @@ -26,17 +26,17 @@ // // Contents: // -// Fl_FileIcon::Fl_FileIcon() - Create a new file icon. -// Fl_FileIcon::~Fl_FileIcon() - Remove a file icon. -// Fl_FileIcon::add() - Add data to an icon. -// Fl_FileIcon::find() - Find an icon based upon a given file. -// Fl_FileIcon::draw() - Draw an icon. -// Fl_FileIcon::label() - Set the widgets label to an icon. -// Fl_FileIcon::labeltype() - Draw the icon label. -// Fl_FileIcon::load() - Load an icon file... -// Fl_FileIcon::load_fti() - Load an SGI-format FTI file... -// Fl_FileIcon::load_xpm() - Load an XPM icon file... -// Fl_FileIcon::load_system_icons() - Load the standard system icons/filetypes. +// Fl_File_Icon::Fl_File_Icon() - Create a new file icon. +// Fl_File_Icon::~Fl_File_Icon() - Remove a file icon. +// Fl_File_Icon::add() - Add data to an icon. +// Fl_File_Icon::find() - Find an icon based upon a given file. +// Fl_File_Icon::draw() - Draw an icon. +// Fl_File_Icon::label() - Set the widgets label to an icon. +// Fl_File_Icon::labeltype() - Draw the icon label. +// Fl_File_Icon::load() - Load an icon file... +// Fl_File_Icon::load_fti() - Load an SGI-format FTI file... +// Fl_File_Icon::load_xpm() - Load an XPM icon file... +// Fl_File_Icon::load_system_icons() - Load the standard system icons/filetypes. // // @@ -63,7 +63,7 @@ # include #endif /* WIN32 || __EMX__ */ -#include +#include #include #include #include @@ -86,7 +86,7 @@ // Icon cache... // -Fl_FileIcon *Fl_FileIcon::first_ = (Fl_FileIcon *)0; +Fl_File_Icon *Fl_File_Icon::first_ = (Fl_File_Icon *)0; // @@ -100,10 +100,10 @@ static char *get_kde_val(char *str, const char *key); // -// 'Fl_FileIcon::Fl_FileIcon()' - Create a new file icon. +// 'Fl_File_Icon::Fl_File_Icon()' - Create a new file icon. // -Fl_FileIcon::Fl_FileIcon(const char *p, /* I - Filename pattern */ +Fl_File_Icon::Fl_File_Icon(const char *p, /* I - Filename pattern */ int t, /* I - File type */ int nd, /* I - Number of data values */ short *d) /* I - Data values */ @@ -133,18 +133,18 @@ Fl_FileIcon::Fl_FileIcon(const char *p, /* I - Filename pattern */ // -// 'Fl_FileIcon::~Fl_FileIcon()' - Remove a file icon. +// 'Fl_File_Icon::~Fl_File_Icon()' - Remove a file icon. // -Fl_FileIcon::~Fl_FileIcon() +Fl_File_Icon::~Fl_File_Icon() { - Fl_FileIcon *current, // Current icon in list + Fl_File_Icon *current, // Current icon in list *prev; // Previous icon in list // Find the icon in the list... - for (current = first_, prev = (Fl_FileIcon *)0; - current != this && current != (Fl_FileIcon *)0; + for (current = first_, prev = (Fl_File_Icon *)0; + current != this && current != (Fl_File_Icon *)0; prev = current, current = current->next_); // Remove the icon from the list as needed... @@ -163,11 +163,11 @@ Fl_FileIcon::~Fl_FileIcon() // -// 'Fl_FileIcon::add()' - Add data to an icon. +// 'Fl_File_Icon::add()' - Add data to an icon. // short * // O - Pointer to new data value -Fl_FileIcon::add(short d) // I - Data to add +Fl_File_Icon::add(short d) // I - Data to add { short *dptr; // Pointer to new data value @@ -197,14 +197,14 @@ Fl_FileIcon::add(short d) // I - Data to add // -// 'Fl_FileIcon::find()' - Find an icon based upon a given file. +// 'Fl_File_Icon::find()' - Find an icon based upon a given file. // -Fl_FileIcon * // O - Matching file icon or NULL -Fl_FileIcon::find(const char *filename, // I - Name of file */ +Fl_File_Icon * // O - Matching file icon or NULL +Fl_File_Icon::find(const char *filename, // I - Name of file */ int filetype) // I - Enumerated file type { - Fl_FileIcon *current; // Current file in list + Fl_File_Icon *current; // Current file in list struct stat fileinfo; // Information on file @@ -232,7 +232,7 @@ Fl_FileIcon::find(const char *filename, // I - Name of file */ // Loop through the available file types and return any match that // is found... - for (current = first_; current != (Fl_FileIcon *)0; current = current->next_) + for (current = first_; current != (Fl_File_Icon *)0; current = current->next_) if ((current->type_ == filetype || current->type_ == ANY) && filename_match(filename, current->pattern_)) break; @@ -243,11 +243,11 @@ Fl_FileIcon::find(const char *filename, // I - Name of file */ // -// 'Fl_FileIcon::draw()' - Draw an icon. +// 'Fl_File_Icon::draw()' - Draw an icon. // void -Fl_FileIcon::draw(int x, // I - Upper-lefthand X +Fl_File_Icon::draw(int x, // I - Upper-lefthand X int y, // I - Upper-lefthand Y int w, // I - Width of bounding box int h, // I - Height of bounding box @@ -434,11 +434,11 @@ Fl_FileIcon::draw(int x, // I - Upper-lefthand X // -// 'Fl_FileIcon::label()' - Set the widget's label to an icon. +// 'Fl_File_Icon::label()' - Set the widget's label to an icon. // void -Fl_FileIcon::label(Fl_Widget *w) // I - Widget to label +Fl_File_Icon::label(Fl_Widget *w) // I - Widget to label { Fl::set_labeltype(_FL_ICON_LABEL, labeltype, 0); w->label(_FL_ICON_LABEL, (const char*)this); @@ -446,41 +446,41 @@ Fl_FileIcon::label(Fl_Widget *w) // I - Widget to label // -// 'Fl_FileIcon::labeltype()' - Draw the icon label. +// 'Fl_File_Icon::labeltype()' - Draw the icon label. // void -Fl_FileIcon::labeltype(const Fl_Label *o, // I - Label data +Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data int x, // I - X position of label int y, // I - Y position of label int w, // I - Width of label int h, // I - Height of label Fl_Align a) // I - Label alignment (not used) { - Fl_FileIcon *icon; // Pointer to icon data + Fl_File_Icon *icon; // Pointer to icon data (void)a; - icon = (Fl_FileIcon *)(o->value); + icon = (Fl_File_Icon *)(o->value); icon->draw(x, y, w, h, (Fl_Color)(o->color)); } // -// 'Fl_FileIcon::load()' - Load an icon file... +// 'Fl_File_Icon::load()' - Load an icon file... // void -Fl_FileIcon::load(const char *f) // I - File to read from +Fl_File_Icon::load(const char *f) // I - File to read from { const char *ext; // File extension if ((ext = filename_ext(f)) == NULL) { - fprintf(stderr, "Fl_FileIcon::load(): Unknown file type for \"%s\".\n", f); + fprintf(stderr, "Fl_File_Icon::load(): Unknown file type for \"%s\".\n", f); return; } @@ -494,18 +494,18 @@ Fl_FileIcon::load(const char *f) // I - File to read from #endif /* 0 */ else { - fprintf(stderr, "Fl_FileIcon::load(): Unknown file type for \"%s\".\n", f); + fprintf(stderr, "Fl_File_Icon::load(): Unknown file type for \"%s\".\n", f); return; } } // -// 'Fl_FileIcon::load_fti()' - Load an SGI-format FTI file... +// 'Fl_File_Icon::load_fti()' - Load an SGI-format FTI file... // void -Fl_FileIcon::load_fti(const char *fti) // I - File to read from +Fl_File_Icon::load_fti(const char *fti) // I - File to read from { FILE *fp; // File pointer int ch; // Current character @@ -518,7 +518,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // Try to open the file... if ((fp = fopen(fti, "rb")) == NULL) { - fprintf(stderr, "Fl_FileIcon::load_fti(): Unable to open \"%s\" - %s\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Unable to open \"%s\" - %s\n", fti, strerror(errno)); return; } @@ -548,7 +548,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // OK, this character better be a letter... if (!isalpha(ch)) { - fprintf(stderr, "Fl_FileIcon::load_fti(): Expected a letter at file position %ld (saw '%c')\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Expected a letter at file position %ld (saw '%c')\n", ftell(fp) - 1, ch); break; } @@ -570,7 +570,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // Make sure we stopped on a parenthesis... if (ch != '(') { - fprintf(stderr, "Fl_FileIcon::load_fti(): Expected a ( at file position %ld (saw '%c')\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Expected a ( at file position %ld (saw '%c')\n", ftell(fp) - 1, ch); break; } @@ -591,7 +591,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // Make sure we stopped on a parenthesis... if (ch != ')') { - fprintf(stderr, "Fl_FileIcon::load_fti(): Expected a ) at file position %ld (saw '%c')\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Expected a ) at file position %ld (saw '%c')\n", ftell(fp) - 1, ch); break; } @@ -599,7 +599,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // Make sure the next character is a semicolon... if ((ch = getc(fp)) != ';') { - fprintf(stderr, "Fl_FileIcon::load_fti(): Expected a ; at file position %ld (saw '%c')\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Expected a ; at file position %ld (saw '%c')\n", ftell(fp) - 1, ch); break; } @@ -613,7 +613,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // // name FLTK color // ------------- ---------- - // iconcolor 256; mapped to the icon color in Fl_FileIcon::draw() + // iconcolor 256; mapped to the icon color in Fl_File_Icon::draw() // shadowcolor FL_DARK3 // outlinecolor FL_BLACK if (strcmp(params, "iconcolor") == 0) @@ -690,7 +690,7 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from } else { - fprintf(stderr, "Fl_FileIcon::load_fti(): Unknown command \"%s\" at file position %ld.\n", + fprintf(stderr, "Fl_File_Icon::load_fti(): Unknown command \"%s\" at file position %ld.\n", command, ftell(fp) - 1); break; } @@ -708,11 +708,11 @@ Fl_FileIcon::load_fti(const char *fti) // I - File to read from // -// 'Fl_FileIcon::load_xpm()' - Load an XPM icon file... +// 'Fl_File_Icon::load_xpm()' - Load an XPM icon file... // void -Fl_FileIcon::load_xpm(const char *xpm) // I - File to read from +Fl_File_Icon::load_xpm(const char *xpm) // I - File to read from { FILE *fp; // File pointer int i, j; // Looping vars @@ -912,12 +912,12 @@ Fl_FileIcon::load_xpm(const char *xpm) // I - File to read from // -// 'Fl_FileIcon::load_system_icons()' - Load the standard system icons/filetypes. +// 'Fl_File_Icon::load_system_icons()' - Load the standard system icons/filetypes. void -Fl_FileIcon::load_system_icons(void) +Fl_File_Icon::load_system_icons(void) { - Fl_FileIcon *icon; // New icons + Fl_File_Icon *icon; // New icons static int init = 0; // Have the icons been initialized? static short plain[] = // Plain file icon { @@ -991,7 +991,7 @@ Fl_FileIcon::load_system_icons(void) if (!access("/usr/share/mimelnk", F_OK)) { // Load KDE icons... - icon = new Fl_FileIcon("*", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/share/icons/unknown.xpm"); load_kde_icons("/usr/share/mimelnk"); @@ -999,82 +999,82 @@ Fl_FileIcon::load_system_icons(void) else if (!access("/usr/share/icons/folder.xpm", F_OK)) { // Load GNOME icons... - icon = new Fl_FileIcon("*", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/share/icons/page.xpm"); - icon = new Fl_FileIcon("*", Fl_FileIcon::DIRECTORY); + icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); icon->load_xpm("/usr/share/icons/folder.xpm"); } else if (!access("/usr/dt/appconfig/icons", F_OK)) { // Load CDE icons... - icon = new Fl_FileIcon("*", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/dt/appconfig/icons/C/Dtdata.m.pm"); - icon = new Fl_FileIcon("*", Fl_FileIcon::DIRECTORY); + icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); icon->load_xpm("/usr/dt/appconfig/icons/C/DtdirB.m.pm"); - icon = new Fl_FileIcon("core", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("core", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/dt/appconfig/icons/C/Dtcore.m.pm"); - icon = new Fl_FileIcon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/dt/appconfig/icons/C/Dtimage.m.pm"); - icon = new Fl_FileIcon("*.{eps|pdf|ps}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/dt/appconfig/icons/C/Dtps.m.pm"); - icon = new Fl_FileIcon("*.ppd", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN); icon->load_xpm("/usr/dt/appconfig/icons/C/DtPrtpr.m.pm"); } else if (!access("/usr/lib/filetype", F_OK)) { // Load SGI icons... - icon = new Fl_FileIcon("*", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/iconlib/generic.doc.fti"); - icon = new Fl_FileIcon("*", Fl_FileIcon::DIRECTORY); + icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); icon->load_fti("/usr/lib/filetype/iconlib/generic.folder.closed.fti"); - icon = new Fl_FileIcon("core", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("core", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/default/iconlib/CoreFile.fti"); - icon = new Fl_FileIcon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/system/iconlib/ImageFile.fti"); if (!access("/usr/lib/filetype/install/iconlib/acroread.doc.fti", F_OK)) { - icon = new Fl_FileIcon("*.{eps|ps}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{eps|ps}", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); - icon = new Fl_FileIcon("*.pdf", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.pdf", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/install/iconlib/acroread.doc.fti"); } else { - icon = new Fl_FileIcon("*.{eps|pdf|ps}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti"); } if (!access("/usr/lib/filetype/install/iconlib/html.fti", F_OK)) { - icon = new Fl_FileIcon("*.{htm|html|shtml}", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.{htm|html|shtml}", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/iconlib/generic.doc.fti"); icon->load_fti("/usr/lib/filetype/install/iconlib/html.fti"); } if (!access("/usr/lib/filetype/install/iconlib/color.ps.idle.fti", F_OK)) { - icon = new Fl_FileIcon("*.ppd", Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN); icon->load_fti("/usr/lib/filetype/install/iconlib/color.ps.idle.fti"); } } else { // Create the default icons... - new Fl_FileIcon("*", Fl_FileIcon::PLAIN, sizeof(plain) / sizeof(plain[0]), plain); - new Fl_FileIcon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_FileIcon::PLAIN, + new Fl_File_Icon("*", Fl_File_Icon::PLAIN, sizeof(plain) / sizeof(plain[0]), plain); + new Fl_File_Icon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_File_Icon::PLAIN, sizeof(image) / sizeof(image[0]), image); - new Fl_FileIcon("*", Fl_FileIcon::DIRECTORY, sizeof(dir) / sizeof(dir[0]), dir); + new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY, sizeof(dir) / sizeof(dir[0]), dir); } // Mark things as initialized... @@ -1134,7 +1134,7 @@ load_kde_mimelnk(const char *filename) char mimetype[1024]; char *val; char full_iconfilename[1024]; - Fl_FileIcon *icon; + Fl_File_Icon *icon; if ((fp = fopen(filename, "rb")) != NULL) @@ -1154,9 +1154,9 @@ load_kde_mimelnk(const char *filename) sprintf(full_iconfilename, "/usr/share/icons/%s", iconfilename); if (strcmp(mimetype, "inode/directory") == 0) - icon = new Fl_FileIcon("*", Fl_FileIcon::DIRECTORY); + icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY); else - icon = new Fl_FileIcon(kde_to_fltk_pattern(pattern), Fl_FileIcon::PLAIN); + icon = new Fl_File_Icon(kde_to_fltk_pattern(pattern), Fl_File_Icon::PLAIN); icon->load_xpm(full_iconfilename); } @@ -1221,5 +1221,5 @@ get_kde_val(char *str, // -// End of "$Id: Fl_FileIcon.cxx,v 1.10.2.1 2001/08/02 16:17:04 easysw Exp $". +// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". // diff --git a/src/Fl_HelpDialog.cxx b/src/Fl_Help_Dialog.cxx similarity index 64% rename from src/Fl_HelpDialog.cxx rename to src/Fl_Help_Dialog.cxx index 71e04e8a8..feacd52de 100644 --- a/src/Fl_HelpDialog.cxx +++ b/src/Fl_Help_Dialog.cxx @@ -1,8 +1,8 @@ // generated by Fast Light User Interface Designer (fluid) version 1.0100 -#include "../FL/Fl_HelpDialog.H" +#include "../FL/Fl_Help_Dialog.H" -inline void Fl_HelpDialog::cb_view__i(Fl_HelpView*, void*) { +inline void Fl_Help_Dialog::cb_view__i(Fl_Help_View*, void*) { if (view_->changed()) { index_ ++; @@ -34,18 +34,18 @@ else if (view_->filename()) line_[index_] = view_->topline(); }; } -void Fl_HelpDialog::cb_view_(Fl_HelpView* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_view__i(o,v); +void Fl_Help_Dialog::cb_view_(Fl_Help_View* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_view__i(o,v); } -inline void Fl_HelpDialog::cb_Close_i(Fl_Button*, void*) { +inline void Fl_Help_Dialog::cb_Close_i(Fl_Button*, void*) { window_->hide(); } -void Fl_HelpDialog::cb_Close(Fl_Button* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_Close_i(o,v); +void Fl_Help_Dialog::cb_Close(Fl_Button* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_Close_i(o,v); } -inline void Fl_HelpDialog::cb_back__i(Fl_Button*, void*) { +inline void Fl_Help_Dialog::cb_back__i(Fl_Button*, void*) { if (index_ > 0) index_ --; @@ -59,11 +59,11 @@ if (strcmp(view_->filename(), file_[index_]) != 0) view_->topline(line_[index_]); } -void Fl_HelpDialog::cb_back_(Fl_Button* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_back__i(o,v); +void Fl_Help_Dialog::cb_back_(Fl_Button* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_back__i(o,v); } -inline void Fl_HelpDialog::cb_forward__i(Fl_Button*, void*) { +inline void Fl_Help_Dialog::cb_forward__i(Fl_Button*, void*) { if (index_ < max_) index_ ++; @@ -77,11 +77,11 @@ if (strcmp(view_->filename(), file_[index_]) != 0) view_->topline(line_[index_]); } -void Fl_HelpDialog::cb_forward_(Fl_Button* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_forward__i(o,v); +void Fl_Help_Dialog::cb_forward_(Fl_Button* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_forward__i(o,v); } -inline void Fl_HelpDialog::cb_smaller__i(Fl_Button*, void*) { +inline void Fl_Help_Dialog::cb_smaller__i(Fl_Button*, void*) { if (view_->textsize() > 8) view_->textsize(view_->textsize() - 2); @@ -89,11 +89,11 @@ if (view_->textsize() <= 8) smaller_->deactivate(); larger_->activate(); } -void Fl_HelpDialog::cb_smaller_(Fl_Button* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_smaller__i(o,v); +void Fl_Help_Dialog::cb_smaller_(Fl_Button* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_smaller__i(o,v); } -inline void Fl_HelpDialog::cb_larger__i(Fl_Button*, void*) { +inline void Fl_Help_Dialog::cb_larger__i(Fl_Button*, void*) { if (view_->textsize() < 18) view_->textsize(view_->textsize() + 2); @@ -101,16 +101,16 @@ if (view_->textsize() >= 18) larger_->deactivate(); smaller_->activate(); } -void Fl_HelpDialog::cb_larger_(Fl_Button* o, void* v) { - ((Fl_HelpDialog*)(o->parent()->user_data()))->cb_larger__i(o,v); +void Fl_Help_Dialog::cb_larger_(Fl_Button* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_larger__i(o,v); } -Fl_HelpDialog::Fl_HelpDialog() { +Fl_Help_Dialog::Fl_Help_Dialog() { Fl_Double_Window* w; { Fl_Double_Window* o = window_ = new Fl_Double_Window(530, 385, "Help Dialog"); w = o; o->user_data((void*)(this)); - { Fl_HelpView* o = view_ = new Fl_HelpView(10, 10, 510, 330); + { Fl_Help_View* o = view_ = new Fl_Help_View(10, 10, 510, 330); o->box(FL_DOWN_BOX); o->callback((Fl_Callback*)cb_view_); o->end(); @@ -148,37 +148,37 @@ index_ = -1; max_ = 0; } -Fl_HelpDialog::~Fl_HelpDialog() { +Fl_Help_Dialog::~Fl_Help_Dialog() { delete window_; } -int Fl_HelpDialog::h() { +int Fl_Help_Dialog::h() { return (window_->h()); } -void Fl_HelpDialog::hide() { +void Fl_Help_Dialog::hide() { window_->hide(); } -void Fl_HelpDialog::load(const char *f) { +void Fl_Help_Dialog::load(const char *f) { view_->set_changed(); view_->load(f); window_->label(view_->title()); } -void Fl_HelpDialog::position(int xx, int yy) { +void Fl_Help_Dialog::position(int xx, int yy) { window_->position(xx, yy); } -void Fl_HelpDialog::resize(int xx, int yy, int ww, int hh) { +void Fl_Help_Dialog::resize(int xx, int yy, int ww, int hh) { window_->resize(xx, yy, ww, hh); } -void Fl_HelpDialog::show() { +void Fl_Help_Dialog::show() { window_->show(); } -void Fl_HelpDialog::textsize(uchar s) { +void Fl_Help_Dialog::textsize(uchar s) { view_->textsize(s); if (s <= 8) @@ -192,30 +192,30 @@ else larger_->activate(); } -uchar Fl_HelpDialog::textsize() { +uchar Fl_Help_Dialog::textsize() { return (view_->textsize()); } -void Fl_HelpDialog::topline(const char *n) { +void Fl_Help_Dialog::topline(const char *n) { view_->topline(n); } -void Fl_HelpDialog::topline(int n) { +void Fl_Help_Dialog::topline(int n) { view_->topline(n); } -int Fl_HelpDialog::visible() { +int Fl_Help_Dialog::visible() { return (window_->visible()); } -int Fl_HelpDialog::w() { +int Fl_Help_Dialog::w() { return (window_->w()); } -int Fl_HelpDialog::x() { +int Fl_Help_Dialog::x() { return (window_->x()); } -int Fl_HelpDialog::y() { +int Fl_Help_Dialog::y() { return (window_->y()); } diff --git a/src/Fl_HelpDialog.fl b/src/Fl_Help_Dialog.fl similarity index 95% rename from src/Fl_HelpDialog.fl rename to src/Fl_Help_Dialog.fl index 53f7fe698..79b27b012 100644 --- a/src/Fl_HelpDialog.fl +++ b/src/Fl_Help_Dialog.fl @@ -1,17 +1,17 @@ # data file for the Fltk User Interface Designer (fluid) version 1.0100 -header_name {../FL/Fl_HelpDialog.H} +header_name {../FL/Fl_Help_Dialog.H} code_name {.cxx} gridx 5 gridy 5 snap 3 -class Fl_HelpDialog {open +class Fl_Help_Dialog {open } { decl {int index_;} {} decl {int max_;} {} decl {int line_[100];} {} decl {char file_[100][256];} {} - Function {Fl_HelpDialog()} {open + Function {Fl_Help_Dialog()} {open } { Fl_Window window_ { label {Help Dialog} open selected @@ -50,8 +50,8 @@ else if (view_->filename()) line_[index_] = view_->topline(); }} open private xywh {10 10 510 330} box DOWN_BOX resizable - code0 {\#include } - class Fl_HelpView + code0 {\#include } + class Fl_Help_View } {} Fl_Button {} { label Close @@ -117,7 +117,7 @@ forward_->deactivate(); index_ = -1; max_ = 0;} {} } - Function {~Fl_HelpDialog()} {} { + Function {~Fl_Help_Dialog()} {} { code {delete window_;} {} } Function {h()} {return_type int diff --git a/src/Fl_HelpView.cxx b/src/Fl_Help_View.cxx similarity index 90% rename from src/Fl_HelpView.cxx rename to src/Fl_Help_View.cxx index 479e8865d..f5b8063ab 100644 --- a/src/Fl_HelpView.cxx +++ b/src/Fl_Help_View.cxx @@ -1,7 +1,7 @@ // -// "$Id: Fl_HelpView.cxx,v 1.1.2.5 2001/09/10 03:09:43 easysw Exp $" +// "$Id: Fl_Help_View.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $" // -// Fl_HelpView widget routines. +// Fl_Help_View widget routines. // // Copyright 1997-2001 by Easy Software Products. // Image support donated by Matthias Melcher, Copyright 2000. @@ -25,32 +25,32 @@ // // Contents: // -// Fl_HelpView::add_block() - Add a text block to the list. -// Fl_HelpView::add_image() - Add an image to the image cache. -// Fl_HelpView::add_link() - Add a new link to the list. -// Fl_HelpView::add_target() - Add a new target to the list. -// Fl_HelpView::compare_targets() - Compare two targets. -// Fl_HelpView::do_align() - Compute the alignment for a line in +// Fl_Help_View::add_block() - Add a text block to the list. +// Fl_Help_View::add_image() - Add an image to the image cache. +// Fl_Help_View::add_link() - Add a new link to the list. +// Fl_Help_View::add_target() - Add a new target to the list. +// Fl_Help_View::compare_targets() - Compare two targets. +// Fl_Help_View::do_align() - Compute the alignment for a line in // a block. -// Fl_HelpView::draw() - Draw the Fl_HelpView widget. -// Fl_HelpView::find_image() - Find an image by name -// Fl_HelpView::format() - Format the help text. -// Fl_HelpView::format_table() - Format a table... -// Fl_HelpView::get_align() - Get an alignment attribute. -// Fl_HelpView::get_attr() - Get an attribute value from the string. -// Fl_HelpView::get_color() - Get an alignment attribute. -// Fl_HelpView::handle() - Handle events in the widget. -// Fl_HelpView::Fl_HelpView() - Build a Fl_HelpView widget. -// Fl_HelpView::~Fl_HelpView() - Destroy a Fl_HelpView widget. -// Fl_HelpView::load() - Load the specified file. -// Fl_HelpView::load_gif() - Load a GIF image file... -// Fl_HelpView::load_jpeg() - Load a JPEG image file. -// Fl_HelpView::load_png() - Load a PNG image file. -// Fl_HelpView::resize() - Resize the help widget. -// Fl_HelpView::topline() - Set the top line to the named target. -// Fl_HelpView::topline() - Set the top line by number. -// Fl_HelpView::value() - Set the help text directly. -// Fl_HelpView::compare_blocks() - Compare two blocks. +// Fl_Help_View::draw() - Draw the Fl_Help_View widget. +// Fl_Help_View::find_image() - Find an image by name +// Fl_Help_View::format() - Format the help text. +// Fl_Help_View::format_table() - Format a table... +// Fl_Help_View::get_align() - Get an alignment attribute. +// Fl_Help_View::get_attr() - Get an attribute value from the string. +// Fl_Help_View::get_color() - Get an alignment attribute. +// Fl_Help_View::handle() - Handle events in the widget. +// Fl_Help_View::Fl_Help_View() - Build a Fl_Help_View widget. +// Fl_Help_View::~Fl_Help_View() - Destroy a Fl_Help_View widget. +// Fl_Help_View::load() - Load the specified file. +// Fl_Help_View::load_gif() - Load a GIF image file... +// Fl_Help_View::load_jpeg() - Load a JPEG image file. +// Fl_Help_View::load_png() - Load a PNG image file. +// Fl_Help_View::resize() - Resize the help widget. +// Fl_Help_View::topline() - Set the top line to the named target. +// Fl_Help_View::topline() - Set the top line by number. +// Fl_Help_View::value() - Set the help text directly. +// Fl_Help_View::compare_blocks() - Compare two blocks. // gif_read_cmap() - Read the colormap from a GIF file... // gif_get_block() - Read a GIF data block... // gif_get_code() - Get a LZW code from the file... @@ -63,7 +63,7 @@ // Include necessary header files... // -#include +#include #include "config.h" #include #include @@ -433,24 +433,24 @@ static int gif_read_cmap(FILE *fp, int ncolors, gif_cmap_t cmap); static int gif_get_block(FILE *fp, unsigned char *buffer); static int gif_get_code (FILE *fp, int code_size, int first_time); static int gif_read_lzw(FILE *fp, int first_time, int input_code_size); -static int gif_read_image(FILE *fp, Fl_HelpImage *img, gif_cmap_t cmap, +static int gif_read_image(FILE *fp, Fl_Help_Image *img, gif_cmap_t cmap, int interlace); static void scrollbar_callback(Fl_Widget *s, void *); // -// 'Fl_HelpView::add_block()' - Add a text block to the list. +// 'Fl_Help_View::add_block()' - Add a text block to the list. // -Fl_HelpBlock * // O - Pointer to new block -Fl_HelpView::add_block(const char *s, // I - Pointer to start of block text +Fl_Help_Block * // O - Pointer to new block +Fl_Help_View::add_block(const char *s, // I - Pointer to start of block text int xx, // I - X position of block int yy, // I - Y position of block int ww, // I - Right margin of block int hh, // I - Height of block unsigned char border) // I - Draw border? { - Fl_HelpBlock *temp; // New block + Fl_Help_Block *temp; // New block // printf("add_block(s = %p, xx = %d, yy = %d, ww = %d, hh = %d, border = %d)\n", @@ -461,9 +461,9 @@ Fl_HelpView::add_block(const char *s, // I - Pointer to start of block text ablocks_ += 16; if (ablocks_ == 16) - blocks_ = (Fl_HelpBlock *)malloc(sizeof(Fl_HelpBlock) * ablocks_); + blocks_ = (Fl_Help_Block *)malloc(sizeof(Fl_Help_Block) * ablocks_); else - blocks_ = (Fl_HelpBlock *)realloc(blocks_, sizeof(Fl_HelpBlock) * ablocks_); + blocks_ = (Fl_Help_Block *)realloc(blocks_, sizeof(Fl_Help_Block) * ablocks_); } temp = blocks_ + nblocks_; @@ -480,16 +480,16 @@ Fl_HelpView::add_block(const char *s, // I - Pointer to start of block text // -// 'Fl_HelpView::add_image()' - Add an image to the image cache. +// 'Fl_Help_View::add_image()' - Add an image to the image cache. // -Fl_HelpImage * // O - Image or NULL if not found -Fl_HelpView::add_image(const char *name, // I - Path of image +Fl_Help_Image * // O - Image or NULL if not found +Fl_Help_View::add_image(const char *name, // I - Path of image const char *wattr, // I - Width attribute const char *hattr, // I - Height attribute int make) // I - Make the image? { - Fl_HelpImage *img, // New image + Fl_Help_Image *img, // New image *orig; // Original image FILE *fp; // File pointer unsigned char header[16]; // First 16 bytes of file @@ -503,7 +503,7 @@ Fl_HelpView::add_image(const char *name, // I - Path of image // See if the image has already been loaded... - if ((img = find_image(name, wattr, hattr)) != (Fl_HelpImage *)0) + if ((img = find_image(name, wattr, hattr)) != (Fl_Help_Image *)0) { // Make the image if needed... if (!img->image) @@ -521,9 +521,9 @@ Fl_HelpView::add_image(const char *name, // I - Path of image aimage_ += 16; if (aimage_ == 16) - image_ = (Fl_HelpImage *)malloc(sizeof(Fl_HelpImage) * aimage_); + image_ = (Fl_Help_Image *)malloc(sizeof(Fl_Help_Image) * aimage_); else - image_ = (Fl_HelpImage *)realloc(image_, sizeof(Fl_HelpImage) * aimage_); + image_ = (Fl_Help_Image *)realloc(image_, sizeof(Fl_Help_Image) * aimage_); } img = image_ + nimage_; @@ -572,17 +572,17 @@ Fl_HelpView::add_image(const char *name, // I - Path of image localname = name; if (!localname) - return ((Fl_HelpImage *)0); + return ((Fl_Help_Image *)0); if (strncmp(localname, "file:", 5) == 0) localname += 5; // Figure out the file type... if ((fp = fopen(localname, "rb")) == NULL) - return ((Fl_HelpImage *)0); + return ((Fl_Help_Image *)0); if (fread(header, 1, sizeof(header), fp) == 0) - return ((Fl_HelpImage *)0); + return ((Fl_Help_Image *)0); rewind(fp); @@ -607,7 +607,7 @@ Fl_HelpView::add_image(const char *name, // I - Path of image if (!status) { free(img->name); - return ((Fl_HelpImage *)0); + return ((Fl_Help_Image *)0); } img->wattr[0] = '\0'; @@ -619,7 +619,7 @@ Fl_HelpView::add_image(const char *name, // I - Path of image if (aimage_ == nimage_) { aimage_ += 16; - image_ = (Fl_HelpImage *)realloc(image_, sizeof(Fl_HelpImage) * aimage_); + image_ = (Fl_Help_Image *)realloc(image_, sizeof(Fl_Help_Image) * aimage_); } orig = image_ + nimage_ - 1; @@ -756,17 +756,17 @@ Fl_HelpView::add_image(const char *name, // I - Path of image // -// 'Fl_HelpView::add_link()' - Add a new link to the list. +// 'Fl_Help_View::add_link()' - Add a new link to the list. // void -Fl_HelpView::add_link(const char *n, // I - Name of link +Fl_Help_View::add_link(const char *n, // I - Name of link int xx, // I - X position of link int yy, // I - Y position of link int ww, // I - Width of link text int hh) // I - Height of link text { - Fl_HelpLink *temp; // New link + Fl_Help_Link *temp; // New link char *target; // Pointer to target name @@ -775,9 +775,9 @@ Fl_HelpView::add_link(const char *n, // I - Name of link alinks_ += 16; if (alinks_ == 16) - links_ = (Fl_HelpLink *)malloc(sizeof(Fl_HelpLink) * alinks_); + links_ = (Fl_Help_Link *)malloc(sizeof(Fl_Help_Link) * alinks_); else - links_ = (Fl_HelpLink *)realloc(links_, sizeof(Fl_HelpLink) * alinks_); + links_ = (Fl_Help_Link *)realloc(links_, sizeof(Fl_Help_Link) * alinks_); } temp = links_ + nlinks_; @@ -804,14 +804,14 @@ Fl_HelpView::add_link(const char *n, // I - Name of link // -// 'Fl_HelpView::add_target()' - Add a new target to the list. +// 'Fl_Help_View::add_target()' - Add a new target to the list. // void -Fl_HelpView::add_target(const char *n, // I - Name of target +Fl_Help_View::add_target(const char *n, // I - Name of target int yy) // I - Y position of target { - Fl_HelpTarget *temp; // New target + Fl_Help_Target *temp; // New target if (ntargets_ >= atargets_) @@ -819,9 +819,9 @@ Fl_HelpView::add_target(const char *n, // I - Name of target atargets_ += 16; if (atargets_ == 16) - targets_ = (Fl_HelpTarget *)malloc(sizeof(Fl_HelpTarget) * atargets_); + targets_ = (Fl_Help_Target *)malloc(sizeof(Fl_Help_Target) * atargets_); else - targets_ = (Fl_HelpTarget *)realloc(targets_, sizeof(Fl_HelpTarget) * atargets_); + targets_ = (Fl_Help_Target *)realloc(targets_, sizeof(Fl_Help_Target) * atargets_); } temp = targets_ + ntargets_; @@ -835,23 +835,23 @@ Fl_HelpView::add_target(const char *n, // I - Name of target // -// 'Fl_HelpView::compare_targets()' - Compare two targets. +// 'Fl_Help_View::compare_targets()' - Compare two targets. // int // O - Result of comparison -Fl_HelpView::compare_targets(const Fl_HelpTarget *t0, // I - First target - const Fl_HelpTarget *t1) // I - Second target +Fl_Help_View::compare_targets(const Fl_Help_Target *t0, // I - First target + const Fl_Help_Target *t1) // I - Second target { return (strcasecmp(t0->name, t1->name)); } // -// 'Fl_HelpView::do_align()' - Compute the alignment for a line in a block. +// 'Fl_Help_View::do_align()' - Compute the alignment for a line in a block. // int // O - New line -Fl_HelpView::do_align(Fl_HelpBlock *block, // I - Block to add to +Fl_Help_View::do_align(Fl_Help_Block *block, // I - Block to add to int line, // I - Current line int xx, // I - Current X position int a, // I - Current alignment @@ -890,14 +890,14 @@ Fl_HelpView::do_align(Fl_HelpBlock *block, // I - Block to add to // -// 'Fl_HelpView::draw()' - Draw the Fl_HelpView widget. +// 'Fl_Help_View::draw()' - Draw the Fl_Help_View widget. // void -Fl_HelpView::draw() +Fl_Help_View::draw() { int i; // Looping var - const Fl_HelpBlock *block; // Pointer to current block + const Fl_Help_Block *block; // Pointer to current block const char *ptr, // Pointer to text in block *attrs; // Pointer to start of element attributes char *s, // Pointer into buffer @@ -1185,7 +1185,7 @@ Fl_HelpView::draw() } else if (strcasecmp(buf, "IMG") == 0) { - Fl_HelpImage *img = (Fl_HelpImage *)0; + Fl_Help_Image *img = (Fl_Help_Image *)0; int width = 16; int height = 24; char wattr[8], hattr[8]; @@ -1198,7 +1198,7 @@ Fl_HelpView::draw() if ((img = add_image(attr, wattr, hattr)) != NULL) { if (!img->image) - img = (Fl_HelpImage *)0; + img = (Fl_Help_Image *)0; } if (img) @@ -1351,16 +1351,16 @@ Fl_HelpView::draw() // -// 'Fl_HelpView::find_image()' - Find an image by name +// 'Fl_Help_View::find_image()' - Find an image by name // -Fl_HelpImage * // O - Image or NULL if not found -Fl_HelpView::find_image(const char *name, // I - Path and name of image +Fl_Help_Image * // O - Image or NULL if not found +Fl_Help_View::find_image(const char *name, // I - Path and name of image const char *wattr, // I - Width attribute of image const char *hattr) // I - Height attribute of image { int i; // Looping var - Fl_HelpImage *img; // Current image + Fl_Help_Image *img; // Current image for (i = nimage_, img = image_; i > 0; i --, img ++) @@ -1369,19 +1369,19 @@ Fl_HelpView::find_image(const char *name, // I - Path and name of image strcmp(img->hattr, hattr) == 0) return (img); - return ((Fl_HelpImage *)0); + return ((Fl_Help_Image *)0); } // -// 'Fl_HelpView::format()' - Format the help text. +// 'Fl_Help_View::format()' - Format the help text. // void -Fl_HelpView::format() +Fl_Help_View::format() { int i; // Looping var - Fl_HelpBlock *block, // Current block + Fl_Help_Block *block, // Current block *cell; // Current table cell int row; // Current table row (block number) const char *ptr, // Pointer into block @@ -1434,7 +1434,7 @@ Fl_HelpView::format() delete image_[i].image; nimage_ --; if (i < nimage_) - memcpy(image_ + i, image_ + i + 1, (nimage_ - i) * sizeof(Fl_HelpImage)); + memcpy(image_ + i, image_ + i + 1, (nimage_ - i) * sizeof(Fl_Help_Image)); i --; } @@ -1864,7 +1864,7 @@ Fl_HelpView::format() popfont(font, size); else if (strcasecmp(buf, "IMG") == 0) { - Fl_HelpImage *img = (Fl_HelpImage *)0; + Fl_Help_Image *img = (Fl_Help_Image *)0; int width = 16; int height = 24; @@ -1873,9 +1873,9 @@ Fl_HelpView::format() get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); if (get_attr(attrs, "SRC", attr, sizeof(attr))) - if ((img = add_image(attr, wattr, hattr)) != (Fl_HelpImage *)0 && + if ((img = add_image(attr, wattr, hattr)) != (Fl_Help_Image *)0 && img->image == NULL) - img = (Fl_HelpImage *)0; + img = (Fl_Help_Image *)0; if (img) { @@ -2016,11 +2016,11 @@ Fl_HelpView::format() size_ = yy + hh; if (ntargets_ > 1) - qsort(targets_, ntargets_, sizeof(Fl_HelpTarget), + qsort(targets_, ntargets_, sizeof(Fl_Help_Target), (compare_func_t)compare_targets); if (nblocks_ > 1) - qsort(blocks_, nblocks_, sizeof(Fl_HelpBlock), + qsort(blocks_, nblocks_, sizeof(Fl_Help_Block), (compare_func_t)compare_blocks); if (size_ < (h() - 8)) @@ -2033,11 +2033,11 @@ Fl_HelpView::format() // -// 'Fl_HelpView::format_table()' - Format a table... +// 'Fl_Help_View::format_table()' - Format a table... // void -Fl_HelpView::format_table(int *table_width, // O - Total table width +Fl_Help_View::format_table(int *table_width, // O - Total table width int *columns, // O - Column widths const char *table) // I - Pointer to start of table { @@ -2308,16 +2308,16 @@ Fl_HelpView::format_table(int *table_width, // O - Total table width popfont(font, size); else if (strcasecmp(buf, "IMG") == 0 && incell) { - Fl_HelpImage *img = (Fl_HelpImage *)0; + Fl_Help_Image *img = (Fl_Help_Image *)0; get_attr(attrs, "WIDTH", wattr, sizeof(wattr)); get_attr(attrs, "HEIGHT", hattr, sizeof(hattr)); if (get_attr(attrs, "SRC", attr, sizeof(attr))) - if ((img = add_image(attr, wattr, hattr)) != (Fl_HelpImage *)0 && + if ((img = add_image(attr, wattr, hattr)) != (Fl_Help_Image *)0 && img->image == NULL) - img = (Fl_HelpImage *)0; + img = (Fl_Help_Image *)0; if (img) temp_width = img->w; @@ -2462,11 +2462,11 @@ Fl_HelpView::format_table(int *table_width, // O - Total table width // -// 'Fl_HelpView::get_align()' - Get an alignment attribute. +// 'Fl_Help_View::get_align()' - Get an alignment attribute. // int // O - Alignment -Fl_HelpView::get_align(const char *p, // I - Pointer to start of attrs +Fl_Help_View::get_align(const char *p, // I - Pointer to start of attrs int a) // I - Default alignment { char buf[255]; // Alignment value @@ -2485,11 +2485,11 @@ Fl_HelpView::get_align(const char *p, // I - Pointer to start of attrs // -// 'Fl_HelpView::get_attr()' - Get an attribute value from the string. +// 'Fl_Help_View::get_attr()' - Get an attribute value from the string. // const char * // O - Pointer to buf or NULL -Fl_HelpView::get_attr(const char *p, // I - Pointer to start of attributes +Fl_Help_View::get_attr(const char *p, // I - Pointer to start of attributes const char *n, // I - Name of attribute char *buf, // O - Buffer for attribute value int bufsize) // I - Size of buffer @@ -2560,11 +2560,11 @@ Fl_HelpView::get_attr(const char *p, // I - Pointer to start of attributes // -// 'Fl_HelpView::get_color()' - Get an alignment attribute. +// 'Fl_Help_View::get_color()' - Get an alignment attribute. // Fl_Color // O - Color value -Fl_HelpView::get_color(const char *n, // I - Color name +Fl_Help_View::get_color(const char *n, // I - Color name Fl_Color c) // I - Default color value { int rgb, r, g, b; // RGB values @@ -2627,15 +2627,15 @@ Fl_HelpView::get_color(const char *n, // I - Color name // -// 'Fl_HelpView::handle()' - Handle events in the widget. +// 'Fl_Help_View::handle()' - Handle events in the widget. // int // O - 1 if we handled it, 0 otherwise -Fl_HelpView::handle(int event) // I - Event to handle +Fl_Help_View::handle(int event) // I - Event to handle { int i; // Looping var int xx, yy; // Adjusted mouse position - Fl_HelpLink *link; // Current link + Fl_Help_Link *link; // Current link char target[32]; // Current target @@ -2727,10 +2727,10 @@ Fl_HelpView::handle(int event) // I - Event to handle // -// 'Fl_HelpView::Fl_HelpView()' - Build a Fl_HelpView widget. +// 'Fl_Help_View::Fl_Help_View()' - Build a Fl_Help_View widget. // -Fl_HelpView::Fl_HelpView(int xx, // I - Left position +Fl_Help_View::Fl_Help_View(int xx, // I - Left position int yy, // I - Top position int ww, // I - Width in pixels int hh, // I - Height in pixels @@ -2738,29 +2738,29 @@ Fl_HelpView::Fl_HelpView(int xx, // I - Left position : Fl_Group(xx, yy, ww, hh, l), scrollbar_(xx + ww - 17, yy, 17, hh) { - link_ = (Fl_HelpFunc *)0; + link_ = (Fl_Help_Func *)0; filename_[0] = '\0'; value_ = NULL; ablocks_ = 0; nblocks_ = 0; - blocks_ = (Fl_HelpBlock *)0; + blocks_ = (Fl_Help_Block *)0; nimage_ = 0; aimage_ = 0; - image_ = (Fl_HelpImage *)0; + image_ = (Fl_Help_Image *)0; if (!broken_image) broken_image = new Fl_Pixmap((char **)broken_xpm); alinks_ = 0; nlinks_ = 0; - links_ = (Fl_HelpLink *)0; + links_ = (Fl_Help_Link *)0; atargets_ = 0; ntargets_ = 0; - targets_ = (Fl_HelpTarget *)0; + targets_ = (Fl_Help_Target *)0; nfonts_ = 0; textfont_ = FL_TIMES; @@ -2783,13 +2783,13 @@ Fl_HelpView::Fl_HelpView(int xx, // I - Left position // -// 'Fl_HelpView::~Fl_HelpView()' - Destroy a Fl_HelpView widget. +// 'Fl_Help_View::~Fl_Help_View()' - Destroy a Fl_Help_View widget. // -Fl_HelpView::~Fl_HelpView() +Fl_Help_View::~Fl_Help_View() { int i; // Looping var - Fl_HelpImage *img; // Current image + Fl_Help_Image *img; // Current image if (nblocks_) @@ -2814,11 +2814,11 @@ Fl_HelpView::~Fl_HelpView() // -// 'Fl_HelpView::load()' - Load the specified file. +// 'Fl_Help_View::load()' - Load the specified file. // int // O - 0 on success, -1 on error -Fl_HelpView::load(const char *f)// I - Filename to load (may also have target) +Fl_Help_View::load(const char *f)// I - Filename to load (may also have target) { FILE *fp; // File to read from long len; // Length of file @@ -2898,11 +2898,11 @@ Fl_HelpView::load(const char *f)// I - Filename to load (may also have target) // -// 'Fl_HelpView::load_gif()' - Load a GIF image file... +// 'Fl_Help_View::load_gif()' - Load a GIF image file... // int // O - 0 = success, -1 = fail -Fl_HelpView::load_gif(Fl_HelpImage *img,// I - Image pointer +Fl_Help_View::load_gif(Fl_Help_Image *img,// I - Image pointer FILE *fp) // I - File to load from { unsigned char buf[1024]; // Input buffer @@ -2980,11 +2980,11 @@ Fl_HelpView::load_gif(Fl_HelpImage *img,// I - Image pointer #ifdef HAVE_LIBJPEG // -// 'Fl_HelpView::load_jpeg()' - Load a JPEG image file. +// 'Fl_Help_View::load_jpeg()' - Load a JPEG image file. // int // O - 0 = success, -1 = fail -Fl_HelpView::load_jpeg(Fl_HelpImage *img, // I - Image pointer +Fl_Help_View::load_jpeg(Fl_Help_Image *img, // I - Image pointer FILE *fp) // I - File to load from { struct jpeg_decompress_struct cinfo; // Decompressor info @@ -3035,11 +3035,11 @@ Fl_HelpView::load_jpeg(Fl_HelpImage *img, // I - Image pointer #ifdef HAVE_LIBPNG // -// 'Fl_HelpView::load_png()' - Load a PNG image file. +// 'Fl_Help_View::load_png()' - Load a PNG image file. // int // O - 0 = success, -1 = fail -Fl_HelpView::load_png(Fl_HelpImage *img,// I - Image pointer +Fl_Help_View::load_png(Fl_Help_Image *img,// I - Image pointer FILE *fp) // I - File to read from { int i; // Looping var @@ -3122,11 +3122,11 @@ Fl_HelpView::load_png(Fl_HelpImage *img,// I - Image pointer // -// 'Fl_HelpView::resize()' - Resize the help widget. +// 'Fl_Help_View::resize()' - Resize the help widget. // void -Fl_HelpView::resize(int xx, // I - New left position +Fl_Help_View::resize(int xx, // I - New left position int yy, // I - New top position int ww, // I - New width int hh) // I - New height @@ -3139,13 +3139,13 @@ Fl_HelpView::resize(int xx, // I - New left position // -// 'Fl_HelpView::topline()' - Set the top line to the named target. +// 'Fl_Help_View::topline()' - Set the top line to the named target. // void -Fl_HelpView::topline(const char *n) // I - Target name +Fl_Help_View::topline(const char *n) // I - Target name { - Fl_HelpTarget key, // Target name key + Fl_Help_Target key, // Target name key *target; // Pointer to matching target @@ -3155,7 +3155,7 @@ Fl_HelpView::topline(const char *n) // I - Target name strncpy(key.name, n, sizeof(key.name) - 1); key.name[sizeof(key.name) - 1] = '\0'; - target = (Fl_HelpTarget *)bsearch(&key, targets_, ntargets_, sizeof(Fl_HelpTarget), + target = (Fl_Help_Target *)bsearch(&key, targets_, ntargets_, sizeof(Fl_Help_Target), (compare_func_t)compare_targets); if (target != NULL) @@ -3164,11 +3164,11 @@ Fl_HelpView::topline(const char *n) // I - Target name // -// 'Fl_HelpView::topline()' - Set the top line by number. +// 'Fl_Help_View::topline()' - Set the top line by number. // void -Fl_HelpView::topline(int t) // I - Top line number +Fl_Help_View::topline(int t) // I - Top line number { if (!value_) return; @@ -3190,11 +3190,11 @@ Fl_HelpView::topline(int t) // I - Top line number // -// 'Fl_HelpView::value()' - Set the help text directly. +// 'Fl_Help_View::value()' - Set the help text directly. // void -Fl_HelpView::value(const char *v) // I - Text to view +Fl_Help_View::value(const char *v) // I - Text to view { if (!v) return; @@ -3212,14 +3212,14 @@ Fl_HelpView::value(const char *v) // I - Text to view // -// 'Fl_HelpView::compare_blocks()' - Compare two blocks. +// 'Fl_Help_View::compare_blocks()' - Compare two blocks. // int // O - Result of comparison -Fl_HelpView::compare_blocks(const void *a, // I - First block +Fl_Help_View::compare_blocks(const void *a, // I - First block const void *b) // I - Second block { - return (((Fl_HelpBlock *)a)->y - ((Fl_HelpBlock *)b)->y); + return (((Fl_Help_Block *)a)->y - ((Fl_Help_Block *)b)->y); } @@ -3503,7 +3503,7 @@ gif_read_lzw(FILE *fp, // I - File to read from static int // I - 0 = success, -1 = failure gif_read_image(FILE *fp, // I - Input file - Fl_HelpImage *img, // I - Image pointer + Fl_Help_Image *img, // I - Image pointer gif_cmap_t cmap, // I - Colormap int interlace) // I - Non-zero = interlaced image { @@ -3575,10 +3575,10 @@ gif_read_image(FILE *fp, // I - Input file static void scrollbar_callback(Fl_Widget *s, void *) { - ((Fl_HelpView *)(s->parent()))->topline(int(((Fl_Scrollbar*)s)->value())); + ((Fl_Help_View *)(s->parent()))->topline(int(((Fl_Scrollbar*)s)->value())); } // -// End of "$Id: Fl_HelpView.cxx,v 1.1.2.5 2001/09/10 03:09:43 easysw Exp $". +// End of "$Id: Fl_Help_View.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $". // diff --git a/src/Makefile b/src/Makefile index 6f1097bc4..1f3982d48 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.18.2.14.2.9 2001/08/11 14:49:51 easysw Exp $" +# "$Id: Makefile,v 1.18.2.14.2.10 2001/09/29 14:38:59 easysw Exp $" # # Library makefile for the Fast Light Tool Kit (FLTK). # @@ -41,13 +41,13 @@ CPPFILES = \ Fl_Counter.cxx \ Fl_Dial.cxx \ Fl_Double_Window.cxx \ - Fl_FileBrowser.cxx \ - Fl_FileChooser.cxx \ - Fl_FileChooser2.cxx \ - Fl_FileIcon.cxx \ + Fl_File_Browser.cxx \ + Fl_File_Chooser.cxx \ + Fl_File_Chooser2.cxx \ + Fl_File_Icon.cxx \ Fl_Group.cxx \ - Fl_HelpDialog.cxx \ - Fl_HelpView.cxx \ + Fl_Help_Dialog.cxx \ + Fl_Help_View.cxx \ Fl_Image.cxx \ Fl_Input.cxx \ Fl_Input_.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.9 2001/08/11 14:49:51 easysw Exp $". +# End of "$Id: Makefile,v 1.18.2.14.2.10 2001/09/29 14:38:59 easysw Exp $". # diff --git a/src/fl_file_chooser.cxx b/src/fl_file_chooser.cxx index 0b3c99b9f..a7e721824 100644 --- a/src/fl_file_chooser.cxx +++ b/src/fl_file_chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_file_chooser.cxx,v 1.10.2.10.2.4 2001/08/04 12:21:33 easysw Exp $" +// "$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). // @@ -25,13 +25,13 @@ #include #include -#include +#include -static Fl_FileChooser *fc = (Fl_FileChooser *)0; +static Fl_File_Chooser *fc = (Fl_File_Chooser *)0; static void (*current_callback)(const char*) = 0; -static void callback(Fl_FileChooser *, void*) { +static void callback(Fl_File_Chooser *, void*) { if (current_callback) (*current_callback)(fc->value(0)); } @@ -47,9 +47,10 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname) if (!fname || !*fname) fname = "."; if (!fc) { - fc = new Fl_FileChooser(fname, pat, Fl_FileChooser::CREATE, message); + 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); @@ -64,6 +65,30 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname) } +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.4 2001/08/04 12:21:33 easysw Exp $". +// 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/makedepend b/src/makedepend index da088b55a..1b2f1adf2 100644 --- a/src/makedepend +++ b/src/makedepend @@ -57,47 +57,50 @@ Fl_Dial.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/math.h Fl_Double_Window.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H Fl_Double_Window.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H Fl_Double_Window.o: ../FL/Fl_Window.H ../FL/x.H ../FL/fl_draw.H -Fl_FileBrowser.o: ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H -Fl_FileBrowser.o: ../FL/Fl_Browser_.H ../FL/Fl_Group.H ../FL/Fl_Widget.H -Fl_FileBrowser.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Scrollbar.H -Fl_FileBrowser.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H -Fl_FileBrowser.o: ../FL/Fl.H ../FL/fl_draw.H ../FL/filename.H ../config.h -Fl_FileChooser.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Enumerations.H -Fl_FileChooser.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H -Fl_FileChooser.o: ../FL/Fl_Widget.H ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H -Fl_FileChooser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H -Fl_FileChooser.o: ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H ../FL/Fl.H -Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H -Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H -Fl_FileChooser.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H -Fl_FileChooser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Bitmap.H ../FL/Fl_Image.H -Fl_FileChooser2.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Enumerations.H -Fl_FileChooser2.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H -Fl_FileChooser2.o: ../FL/Fl_Widget.H ../FL/Fl_FileBrowser.H -Fl_FileChooser2.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H -Fl_FileChooser2.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -Fl_FileChooser2.o: ../FL/Fl_FileIcon.H ../FL/Fl.H ../FL/Fl_Button.H -Fl_FileChooser2.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/fl_ask.H -Fl_FileChooser2.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H -Fl_FileChooser2.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/filename.H -Fl_FileChooser2.o: ../FL/x.H ../FL/Fl_Window.H -Fl_FileIcon.o: ../config.h ../FL/Fl_FileIcon.H ../FL/Fl.H -Fl_FileIcon.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Widget.H -Fl_FileIcon.o: ../FL/fl_draw.H ../FL/filename.H +Fl_File_Browser.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H +Fl_File_Browser.o: ../FL/Fl_Browser_.H ../FL/Fl_Group.H ../FL/Fl_Widget.H +Fl_File_Browser.o: ../FL/Enumerations.H ../FL/Fl_Export.H +Fl_File_Browser.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H +Fl_File_Browser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/fl_draw.H +Fl_File_Browser.o: ../FL/filename.H ../config.h +Fl_File_Chooser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Enumerations.H +Fl_File_Chooser.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H +Fl_File_Chooser.o: ../FL/Fl_Widget.H ../FL/Fl_File_Browser.H +Fl_File_Chooser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H +Fl_File_Chooser.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H +Fl_File_Chooser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Button.H +Fl_File_Chooser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/fl_ask.H +Fl_File_Chooser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H +Fl_File_Chooser.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Bitmap.H +Fl_File_Chooser.o: ../FL/Fl_Image.H +Fl_File_Chooser2.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Enumerations.H +Fl_File_Chooser2.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H +Fl_File_Chooser2.o: ../FL/Fl_Widget.H ../FL/Fl_File_Browser.H +Fl_File_Chooser2.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H +Fl_File_Chooser2.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H +Fl_File_Chooser2.o: ../FL/Fl_Valuator.H ../FL/Fl_File_Icon.H ../FL/Fl.H +Fl_File_Chooser2.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H +Fl_File_Chooser2.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H +Fl_File_Chooser2.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H +Fl_File_Chooser2.o: ../FL/Fl_Menu_Item.H ../FL/filename.H ../FL/x.H +Fl_File_Chooser2.o: ../FL/Fl_Window.H +Fl_File_Icon.o: ../config.h ../FL/Fl_File_Icon.H ../FL/Fl.H +Fl_File_Icon.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Widget.H +Fl_File_Icon.o: ../FL/fl_draw.H ../FL/filename.H Fl_Group.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_Group.o: ../FL/Fl_Group.H ../FL/Fl_Window.H ../FL/Fl_Group.H Fl_Group.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Fl_Tooltip.H Fl_Group.o: ../FL/Fl_Widget.H -Fl_HelpDialog.o: ../FL/Fl_HelpDialog.H ../FL/Fl.H ../FL/Enumerations.H -Fl_HelpDialog.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H -Fl_HelpDialog.o: ../FL/Fl_Widget.H ../FL/Fl_HelpView.H ../FL/Fl_Group.H -Fl_HelpDialog.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H -Fl_HelpDialog.o: ../FL/fl_draw.H ../FL/Fl_Button.H -Fl_HelpView.o: ../FL/Fl_HelpView.H ../FL/Fl.H ../FL/Enumerations.H -Fl_HelpView.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H -Fl_HelpView.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H -Fl_HelpView.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H ../FL/Fl_Pixmap.H -Fl_HelpView.o: ../FL/Fl_Image.H +Fl_Help_Dialog.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Enumerations.H +Fl_Help_Dialog.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H +Fl_Help_Dialog.o: ../FL/Fl_Window.H ../FL/Fl_Help_View.H ../FL/Fl_Group.H +Fl_Help_Dialog.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H +Fl_Help_Dialog.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Fl_Button.H +Fl_Help_View.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Enumerations.H +Fl_Help_View.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H +Fl_Help_View.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H +Fl_Help_View.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H +Fl_Help_View.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H Fl_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_draw.H Fl_Image.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H Fl_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H @@ -275,11 +278,11 @@ 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_FileChooser.H ../FL/Fl.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_FileBrowser.H ../FL/Fl_Browser.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_FileIcon.H ../FL/Fl.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 diff --git a/test/demo.cxx b/test/demo.cxx index 9ed05ab8b..e980070cd 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -1,5 +1,5 @@ // -// "$Id: demo.cxx,v 1.8.2.5.2.1 2001/08/01 21:24:49 easysw Exp $" +// "$Id: demo.cxx,v 1.8.2.5.2.2 2001/09/29 14:38:59 easysw Exp $" // // Main demo program for the Fast Light Tool Kit (FLTK). // @@ -313,6 +313,7 @@ int load_the_menu(const char* fname) } int main(int argc, char **argv) { + putenv("FLTK_DOCDIR=../documentation"); create_the_forms(); char buf[256]; strcpy(buf, argv[0]); @@ -334,6 +335,6 @@ int main(int argc, char **argv) { } // -// End of "$Id: demo.cxx,v 1.8.2.5.2.1 2001/08/01 21:24:49 easysw Exp $". +// End of "$Id: demo.cxx,v 1.8.2.5.2.2 2001/09/29 14:38:59 easysw Exp $". // diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index cafb2e8d7..2e21ccd3d 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: file_chooser.cxx,v 1.4.2.3.2.1 2001/08/03 18:46:57 easysw Exp $" +// "$Id: file_chooser.cxx,v 1.4.2.3.2.2 2001/09/29 14:38:59 easysw Exp $" // // File chooser test program for the Fast Light Tool Kit (FLTK). // @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ void pickfile(Fl_Widget *) { } int main(int argc, char **argv) { - Fl_FileIcon::load_system_icons(); + Fl_File_Icon::load_system_icons(); Fl_Window window(310,110); pattern = new Fl_Input(100,10,200,25,"Pattern:"); pattern->static_value("*"); @@ -56,5 +56,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: file_chooser.cxx,v 1.4.2.3.2.1 2001/08/03 18:46:57 easysw Exp $". +// End of "$Id: file_chooser.cxx,v 1.4.2.3.2.2 2001/09/29 14:38:59 easysw Exp $". // diff --git a/test/help.cxx b/test/help.cxx index 04a0be6c1..ca8054fd1 100644 --- a/test/help.cxx +++ b/test/help.cxx @@ -1,7 +1,7 @@ // -// "$Id: help.cxx,v 1.1.2.1 2001/08/02 19:43:49 easysw Exp $" +// "$Id: help.cxx,v 1.1.2.2 2001/09/29 14:38:59 easysw Exp $" // -// Fl_HelpDialog test program. +// Fl_Help_Dialog test program. // // Copyright 1999-2001 by Easy Software Products. // @@ -31,7 +31,7 @@ // Include necessary headers... // -#include +#include // @@ -42,10 +42,10 @@ int // O - Exit status main(int argc, // I - Number of command-line arguments char *argv[]) // I - Command-line arguments { - Fl_HelpDialog *help; // Help dialog + Fl_Help_Dialog *help; // Help dialog - help = new Fl_HelpDialog; + help = new Fl_Help_Dialog; if (argc < 2) help->load("../documentation/index.html"); @@ -63,5 +63,5 @@ main(int argc, // I - Number of command-line arguments // -// End of "$Id: help.cxx,v 1.1.2.1 2001/08/02 19:43:49 easysw Exp $". +// End of "$Id: help.cxx,v 1.1.2.2 2001/09/29 14:38:59 easysw Exp $". // diff --git a/test/makedepend b/test/makedepend index d179c90e4..6bda0747a 100644 --- a/test/makedepend +++ b/test/makedepend @@ -107,7 +107,7 @@ editor.o: ../FL/Fl_Text_Buffer.H file_chooser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H file_chooser.o: ../FL/Fl_Button.H ../FL/Fl_Window.H ../FL/Fl_Group.H file_chooser.o: ../FL/Fl_Widget.H ../FL/Fl_Input.H ../FL/Fl_Input_.H -file_chooser.o: ../FL/fl_file_chooser.H ../FL/Fl_FileIcon.H ../FL/Fl.H +file_chooser.o: ../FL/fl_file_chooser.H ../FL/Fl_File_Icon.H ../FL/Fl.H fonts.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H fonts.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Hold_Browser.H fonts.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H @@ -146,11 +146,10 @@ glpuzzle.o: ../FL/Fl_Export.H ../FL/Fl.H ../FL/Fl_Gl_Window.H glpuzzle.o: ../FL/Fl_Window.H trackball.c trackball.h hello.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H hello.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H -help.o: ../FL/Fl_HelpDialog.H ../FL/Fl.H ../FL/Enumerations.H -help.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H -help.o: ../FL/Fl_Widget.H ../FL/Fl_HelpView.H ../FL/Fl_Group.H -help.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/fl_draw.H -help.o: ../FL/Fl_Button.H +help.o: ../FL/Fl_Help_Dialog.H ../FL/Fl.H ../FL/Enumerations.H +help.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H +help.o: ../FL/Fl_Help_View.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H +help.o: ../FL/Fl_Slider.H ../FL/fl_draw.H ../FL/Fl_Button.H iconize.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H iconize.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H iconize.o: ../FL/Fl_Button.H ../FL/Fl_Box.H