summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
commit9a528400f083b3761e0d54565ea1002604f5472a (patch)
tree789a2d8e0283ad5715026bba5dcd4ce805a067f5
parentbc3de1ec15062a9016150c124d6a4d6c14d87720 (diff)
Doco updates.
Add directory-only support to Fl_FileBrowser. Update button and menu drawing code for check and radio buttons. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES17
-rw-r--r--FL/Fl_FileBrowser.H10
-rw-r--r--documentation/Fl_FileBrowser.html55
-rw-r--r--documentation/Fl_FileChooser.html110
-rw-r--r--documentation/Fl_FileIcon.html116
-rw-r--r--src/Fl_FileBrowser.cxx10
-rw-r--r--src/Fl_Light_Button.cxx10
-rw-r--r--src/Fl_Menu.cxx53
-rw-r--r--src/Fl_Return_Button.cxx10
-rw-r--r--test/pack.cxx16
10 files changed, 203 insertions, 204 deletions
diff --git a/CHANGES b/CHANGES
index ff2616da5..5f23080ed 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,9 +8,20 @@ TODO - Documentation updates.
CHANGES IN FLTK 1.1.0b2
- - Fixed image/text label handling; in b1 the label needed
- a non-blank text string to display the image. This bug
- also caused all sorts of crashes and display problems.
+ - Fixed image/text label handling; in b1 the label
+ needed a non-blank text string to display the image.
+ This bug also caused all sorts of crashes and display
+ problems.
+ - Added new filetype() method to Fl_FileBrowser to allow
+ for file or directory browsing.
+ - Fixed the drawing of the focus box around
+ Fl_Return_Button.
+ - Fixed menu item measurement bug (wasn't initializing
+ image pointers to 0...)
+ - Radio and checkbox menu items now draw with the new
+ style (round radio buttons with dots and square check
+ buttons with check marks.)
+ - Improved the appearance of Fl_Check_Button.
CHANGES IN FLTK 1.1.0b1
diff --git a/FL/Fl_FileBrowser.H b/FL/Fl_FileBrowser.H
index 2d788580e..9add8e088 100644
--- a/FL/Fl_FileBrowser.H
+++ b/FL/Fl_FileBrowser.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_FileBrowser.H,v 1.4.2.2 2001/08/11 14:49:51 easysw Exp $"
+// "$Id: Fl_FileBrowser.H,v 1.4.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// FileBrowser definitions.
//
@@ -40,6 +40,9 @@
class Fl_FileBrowser : public Fl_Browser
{
+ enum { FILES, DIRECTORIES };
+
+ int filetype_;
const char *directory_;
uchar iconsize_;
const char *pattern_;
@@ -63,10 +66,13 @@ public:
uchar textsize() const { return (Fl_Browser::textsize()); };
void textsize(uchar s) { Fl_Browser::textsize(s); iconsize_ = 3 * s / 2; };
+
+ int filetype() const { return (filetype_); };
+ void filetype(int t) { filetype_ = t; load(directory_); };
};
#endif // !_Fl_FileBrowser_H_
//
-// End of "$Id: Fl_FileBrowser.H,v 1.4.2.2 2001/08/11 14:49:51 easysw Exp $".
+// End of "$Id: Fl_FileBrowser.H,v 1.4.2.3 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/documentation/Fl_FileBrowser.html b/documentation/Fl_FileBrowser.html
index 4a0203298..2c9e1da00 100644
--- a/documentation/Fl_FileBrowser.html
+++ b/documentation/Fl_FileBrowser.html
@@ -1,76 +1,73 @@
<HTML>
-<HEAD>
- <TITLE>FileBrowser - ESP Widget Set for FLTK</TITLE>
- <LINK REL="STYLESHEET" TYPE="text/css" HREF="fltk.css">
- <MAP NAME="navbar">
- <AREA SHAPE="RECT" COORD="20,19,74,36" HREF="index.html" ALT="Widget Set Home Page">
- <AREA SHAPE="RECT" COORD="96,19,240,36" HREF="documentation.html" ALT="Widget Set Documentation">
- <AREA SHAPE="RECT" COORD="262,19,356,36" HREF="download.html" ALT="Download Widget Set">
- <AREA SHAPE="RECT" COORD="378,19,416,36" HREF="http://www.easysw.com" ALT="ESP Home Page">
- <AREA SHAPE="RECT" COORD="438,19,487,36" HREF="http://www.fltk.org" ALT="FLTK Home Page">
- </MAP>
-</HEAD>
-
-<BODY BGCOLOR="#ccccff">
+<BODY>
<!-- NEW PAGE -->
-<H2>class FileBrowser</H2>
+<H2><A NAME="Fl_FileBrowser">class Fl_FileBrowser</A></H2>
<HR>
<H3>Class Hierarchy</H3>
<UL><PRE>
-Fl_Browser
+<A HREF="Fl_Browser.html#Fl_Browser">Fl_Browser</A>
|
- +----<B>FileBrowser</B>
+ +----<B>Fl_FileBrowser</B>
</PRE></UL>
<H3>Include Files</H3>
<UL><PRE>
-#include "FileBrowser.h"
+#include &lt;FL/Fl_FileBrowser.H>
</PRE></UL>
<H3>Description</H3>
-<P>The <CODE>FileBrowser</CODE> widget displays a list of filenames,
+<P>The <CODE>Fl_FileBrowser</CODE> widget displays a list of filenames,
optionally with file-specific icons.
<H3>Methods</H3>
<UL>
- <LI><A HREF="#FileBrowser.FileBrowser">FileBrowser</A>
- <LI><A HREF="#FileBrowser.~FileBrowser">~FileBrowser</A>
- <LI><A HREF="#FileBrowser.iconsize">iconsize</A>
- <LI><A HREF="#FileBrowser.filter">filter</A>
- <LI><A HREF="#FileBrowser.load">load</A>
+ <LI><A HREF="#Fl_FileBrowser.Fl_FileBrowser">Fl_FileBrowser</A>
+ <LI><A HREF="#Fl_FileBrowser.~Fl_FileBrowser">~Fl_FileBrowser</A>
+ <LI><A HREF="#Fl_FileBrowser.iconsize">iconsize</A>
+ <LI><A HREF="#Fl_FileBrowser.filter">filter</A>
+ <LI><A HREF="#Fl_FileBrowser.filetype">filetype</A>
+ <LI><A HREF="#Fl_FileBrowser.load">load</A>
</UL>
-<H4><A NAME="FileBrowser.FileBrowser">FileBrowser(int xx, int yy, int ww, int hh, const char *l = 0)</A></H4>
+<H4><A NAME="Fl_FileBrowser.Fl_FileBrowser">Fl_FileBrowser(int xx, int yy, int ww, int hh, const char *l = 0)</A></H4>
-<P>The constructor creates the <CODE>FileBrowser</CODE> widget at the specified
+<P>The constructor creates the <CODE>Fl_FileBrowser</CODE> widget at the specified
position and size.
-<H4><A NAME="FileBrowser.~FileBrowser">~FileBrowser()</A></H4>
+<H4><A NAME="Fl_FileBrowser.~Fl_FileBrowser">~Fl_FileBrowser()</A></H4>
<P>The destructor destroys the widget and frees all memory that has been
allocated.
-<H4><A NAME="FileBrowser.iconsize">void iconsize(uchar s)<BR>
+<H4><A NAME="Fl_FileBrowser.iconsize">void iconsize(uchar s)<BR>
uchar iconsize() const</A></H4>
<P>Sets or gets the size of the icons. The default size is 20 pixels.
-<H4><A NAME="FileBrowser.filter">void filter(const char *pattern)<BR>
+<H4><A NAME="Fl_FileBrowser.filter">void filter(const char *pattern)<BR>
const char *filter() const</A></H4>
<P>Sets or gets the filename filter. The pattern matching uses the
<CODE>filename_match()</CODE> function in FLTK.
-<H4><A NAME="FileBrowser.load">int load(const char *directory)</A></H4>
+<H4><A NAME="Fl_FileBrowser.filetype">void filetype(int type)<BR>
+int filetype() const</A></H4>
+
+<P>Sets or gets the file browser type, <CODE>FILES</CODE> or
+<CODE>DIRECTORIES</CODE>. When set to <CODE>FILES</CODE>, both
+files and directories are shown. Otherwise only directories are
+shown.
+
+<H4><A NAME="Fl_FileBrowser.load">int load(const char *directory)</A></H4>
<P>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
index 6a3010702..13846c34d 100644
--- a/documentation/Fl_FileChooser.html
+++ b/documentation/Fl_FileChooser.html
@@ -1,72 +1,60 @@
<HTML>
-<HEAD>
- <TITLE>FileChooser - ESP Widget Set for FLTK</TITLE>
- <LINK REL="STYLESHEET" TYPE="text/css" HREF="fltk.css">
- <MAP NAME="navbar">
- <AREA SHAPE="RECT" COORD="20,19,74,36" HREF="index.html" ALT="Widget Set Home Page">
- <AREA SHAPE="RECT" COORD="96,19,240,36" HREF="documentation.html" ALT="Widget Set Documentation">
- <AREA SHAPE="RECT" COORD="262,19,356,36" HREF="download.html" ALT="Download Widget Set">
- <AREA SHAPE="RECT" COORD="378,19,416,36" HREF="http://www.easysw.com" ALT="ESP Home Page">
- <AREA SHAPE="RECT" COORD="438,19,487,36" HREF="http://www.fltk.org" ALT="FLTK Home Page">
- </MAP>
-</HEAD>
-
-<BODY BGCOLOR="#ccccff">
+<BODY>
<!-- NEW PAGE -->
-<H2>class FileChooser</H2>
+<H2><A NAME="FL_FileChooser">class Fl_FileChooser</A></H2>
<HR>
<H3>Class Hierarchy</H3>
<UL><PRE>
-Fl_Group
+<A HREF="Fl_Group.html#Fl_Group">Fl_Group</A>
|
- +----<B>FileChooser</B>
+ +----<B>Fl_FileChooser</B>
</PRE></UL>
<H3>Include Files</H3>
<UL><PRE>
-#include "FileChooser.h"
+#include &lt;FL/Fl_FileChooser.H>
</PRE></UL>
<H3>Description</H3>
-<P>The <CODE>FileChooser</CODE> widget displays a standard file selection
+<P>The <CODE>Fl_FileChooser</CODE> widget displays a standard file selection
dialog that supports various selection modes.
-<CENTER><IMG SRC="FileChooser.gif" WIDTH="397" HEIGHT="322" ALT="FileChooser widget"></CENTER>
+<CENTER><IMG SRC="Fl_FileChooser.gif" WIDTH="397" HEIGHT="322" ALT="Fl_FileChooser widget"></CENTER>
<H3>Methods</H3>
<UL>
- <LI><A HREF="#FileChooser.FileChooser">FileChooser</A>
- <LI><A HREF="#FileChooser.~FileChooser">~FileChooser</A>
- <LI><A HREF="#FileChooser.color">color</A>
- <LI><A HREF="#FileChooser.count">count</A>
- <LI><A HREF="#FileChooser.directory">directory</A>
- <LI><A HREF="#FileChooser.filter">filter</A>
- <LI><A HREF="#FileChooser.hide">hide</A>
- <LI><A HREF="#FileChooser.iconsize">iconsize</A>
- <LI><A HREF="#FileChooser.label">label</A>
- <LI><A HREF="#FileChooser.rescan">rescan</A>
- <LI><A HREF="#FileChooser.show">show</A>
- <LI><A HREF="#FileChooser.textcolor">textcolor</A>
- <LI><A HREF="#FileChooser.textfont">textfont</A>
- <LI><A HREF="#FileChooser.textsize">textsize</A>
- <LI><A HREF="#FileChooser.type">type</A>
- <LI><A HREF="#FileChooser.value">value</A>
- <LI><A HREF="#FileChooser.visible">visible</A>
+ <LI><A HREF="#Fl_FileChooser.Fl_FileChooser">Fl_FileChooser</A>
+ <LI><A HREF="#Fl_FileChooser.~Fl_FileChooser">~Fl_FileChooser</A>
+ <LI><A HREF="#Fl_FileChooser.color">color</A>
+ <LI><A HREF="#Fl_FileChooser.count">count</A>
+ <LI><A HREF="#Fl_FileChooser.directory">directory</A>
+ <LI><A HREF="#Fl_FileChooser.filter">filter</A>
+ <LI><A HREF="#Fl_FileChooser.hide">hide</A>
+ <LI><A HREF="#Fl_FileChooser.iconsize">iconsize</A>
+ <LI><A HREF="#Fl_FileChooser.label">label</A>
+ <LI><A HREF="#Fl_FileChooser.rescan">rescan</A>
+ <LI><A HREF="#Fl_FileChooser.show">show</A>
+ <LI><A HREF="#Fl_FileChooser.textcolor">textcolor</A>
+ <LI><A HREF="#Fl_FileChooser.textfont">textfont</A>
+ <LI><A HREF="#Fl_FileChooser.textsize">textsize</A>
+ <LI><A HREF="#Fl_FileChooser.type">type</A>
+ <LI><A HREF="#Fl_FileChooser.value">value</A>
+ <LI><A HREF="#Fl_FileChooser.visible">visible</A>
</UL>
-<H4><A NAME="FileChooser.FileChooser">FileChooser(const char *pathname, const char *pattern,
+<H4><A NAME="Fl_FileChooser.Fl_FileChooser">Fl_FileChooser(const char *pathname, const char *pattern,
int type, const char *title)</A></H4>
-<P>The constructor creates the <CODE>FileChooser</CODE> dialog pictured
+<P>The constructor creates the <CODE>Fl_FileChooser</CODE> dialog pictured
above. The <CODE>pathname</CODE> 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.)
@@ -84,86 +72,88 @@ in the list and in the filename input field.)
or more existing files.
<LI><CODE>CREATE</CODE> - allows the user to select a
single, existing file or specify a new filename.
+ <LI><CODE>DIRECTORY</CODE> - allows the user to select a
+ single, existing directory.
</UL>
<P>The <CODE>title</CODE> argument is used to set the title bar text for the
-<CODE>FileChooser</CODE> window.
+<CODE>Fl_FileChooser</CODE> window.
-<H4><A NAME="FileChooser.~FileChooser">~FileChooser()</A></H4>
+<H4><A NAME="Fl_FileChooser.~Fl_FileChooser">~Fl_FileChooser()</A></H4>
<P>Destroys the widget and frees all memory used by it.
-<H4><A NAME="FileChooser.color">void color(Fl_Color c)<BR>
+<H4><A NAME="Fl_FileChooser.color">void color(Fl_Color c)<BR>
Fl_Color color()</A></H4>
<P>Sets or gets the background color of the <CODE>FileBrowser</CODE> list.
-<H4><A NAME="FileChooser.count">int count()</A></H4>
+<H4><A NAME="Fl_FileChooser.count">int count()</A></H4>
<P>Returns the number of selected files.
-<H4><A NAME="FileChooser.directory">void directory(const char *pathname)<BR>
+<H4><A NAME="Fl_FileChooser.directory">void directory(const char *pathname)<BR>
const char *directory()</A></H4>
<P>Sets or gets the current directory.
-<H4><A NAME="FileChooser.filter">void filter(const char *pattern)<BR>
+<H4><A NAME="Fl_FileChooser.filter">void filter(const char *pattern)<BR>
const char *filter()</A></H4>
<P>Sets or gets the current filename filter pattern.
-<H4><A NAME="FileChooser.hide">void hide()</A></H4>
+<H4><A NAME="Fl_FileChooser.hide">void hide()</A></H4>
-<P>Hides the <CODE>FileChooser</CODE> window.
+<P>Hides the <CODE>Fl_FileChooser</CODE> window.
-<H4><A NAME="FileChooser.iconsize">void iconsize(uchar s)<BR>
+<H4><A NAME="Fl_FileChooser.iconsize">void iconsize(uchar s)<BR>
uchar iconsize()</A></H4>
<P>Sets or gets the size of the icons in the <CODE>FileBrowser</CODE>. By
default the icon size is set to 1.5 times the <CODE>textsize()</CODE>.
-<H4><A NAME="FileChooser.label">void label(const char *l)<BR>
+<H4><A NAME="Fl_FileChooser.label">void label(const char *l)<BR>
const char *label()</A></H4>
-<P>Sets or gets the title bar text for the <CODE>FileChooser</CODE>.
+<P>Sets or gets the title bar text for the <CODE>Fl_FileChooser</CODE>.
-<H4><A NAME="FileChooser.rescan">void rescan()</A></H4>
+<H4><A NAME="Fl_FileChooser.rescan">void rescan()</A></H4>
<P>Reloads the current directory in the <CODE>FileBrowser</CODE>.
-<H4><A NAME="FileChooser.show">void show()</A></H4>
+<H4><A NAME="Fl_FileChooser.show">void show()</A></H4>
-<P>Shows the <CODE>FileChooser</CODE> window.
+<P>Shows the <CODE>Fl_FileChooser</CODE> window.
-<H4><A NAME="FileChooser.textcolor">void textcolor(Fl_Color c)<BR>
+<H4><A NAME="Fl_FileChooser.textcolor">void textcolor(Fl_Color c)<BR>
Fl_Color textcolor()</A></H4>
<P>Sets or gets the current <CODE>FileBrowser</CODE> text color.
-<H4><A NAME="FileChooser.textfont">void textfont(uchar f)<BR>
+<H4><A NAME="Fl_FileChooser.textfont">void textfont(uchar f)<BR>
uchar textfont()</A></H4>
<P>Sets or gets the current <CODE>FileBrowser</CODE> text font.
-<H4><A NAME="FileChooser.textsize">void textsize(uchar s)<BR>
+<H4><A NAME="Fl_FileChooser.textsize">void textsize(uchar s)<BR>
uchar textsize()</A></H4>
<P>Sets or gets the current <CODE>FileBrowser</CODE> text size.
-<H4><A NAME="FileChooser.type">void type(int t)<BR>
+<H4><A NAME="Fl_FileChooser.type">void type(int t)<BR>
int type()</A></H4>
-<P>Sets or gets the current type of <CODE>FileChooser</CODE>.
+<P>Sets or gets the current type of <CODE>Fl_FileChooser</CODE>.
-<H4><A NAME="FileChooser.value">const char *value(const char *pathname)<BR>
+<H4><A NAME="Fl_FileChooser.value">const char *value(const char *pathname)<BR>
const char *value(int file)<BR>
const char *value()</A></H4>
<P>Sets or gets the current value of the selected file.
-<H4><A NAME="FileChooser.visible">int visible()</A></H4>
+<H4><A NAME="Fl_FileChooser.visible">int visible()</A></H4>
-<P>Returns 1 if the <CODE>FileChooser</CODE> window is visible.
+<P>Returns 1 if the <CODE>Fl_FileChooser</CODE> window is visible.
<HR>
diff --git a/documentation/Fl_FileIcon.html b/documentation/Fl_FileIcon.html
index bd60fb93a..51c80f68c 100644
--- a/documentation/Fl_FileIcon.html
+++ b/documentation/Fl_FileIcon.html
@@ -1,38 +1,26 @@
<HTML>
-<HEAD>
- <TITLE>FileIcon - ESP Widget Set for FLTK</TITLE>
- <LINK REL="STYLESHEET" TYPE="text/css" HREF="fltk.css">
- <MAP NAME="navbar">
- <AREA SHAPE="RECT" COORD="20,19,74,36" HREF="index.html" ALT="Widget Set Home Page">
- <AREA SHAPE="RECT" COORD="96,19,240,36" HREF="documentation.html" ALT="Widget Set Documentation">
- <AREA SHAPE="RECT" COORD="262,19,356,36" HREF="download.html" ALT="Download Widget Set">
- <AREA SHAPE="RECT" COORD="378,19,416,36" HREF="http://www.easysw.com" ALT="ESP Home Page">
- <AREA SHAPE="RECT" COORD="438,19,487,36" HREF="http://www.fltk.org" ALT="FLTK Home Page">
- </MAP>
-</HEAD>
-
-<BODY BGCOLOR="#ccccff">
+<BODY>
<!-- NEW PAGE -->
-<H2>class FileIcon</H2>
+<H2><A NAME="Fl_FileIcon">class Fl_FileIcon</A></H2>
<HR>
<H3>Class Hierarchy</H3>
<UL><PRE>
-<B>FileIcon</B>
+<B>Fl_FileIcon</B>
</PRE></UL>
<H3>Include Files</H3>
<UL><PRE>
-#include "FileIcon.h"
+#include &lt;FL/Fl_FileIcon.H>
</PRE></UL>
<H3>Description</H3>
-<P>The <CODE>FileIcon</CODE> class manages icon images that can be
+<P>The <CODE>Fl_FileIcon</CODE> class manages icon images that can be
used as labels in other widgets and as icons in the <CODE>FileBrowser</CODE>
widget.
@@ -40,47 +28,47 @@ widget.
<UL>
- <LI><A HREF="#FileIcon.FileIcon">FileIcon</A>
- <LI><A HREF="#FileIcon.~FileIcon">~FileIcon</A>
- <LI><A HREF="#FileIcon.add">add</A>
- <LI><A HREF="#FileIcon.add_color">add_color</A>
- <LI><A HREF="#FileIcon.add_vertex">add_vertex</A>
- <LI><A HREF="#FileIcon.clear">clear</A>
- <LI><A HREF="#FileIcon.draw">draw</A>
- <LI><A HREF="#FileIcon.find">find</A>
- <LI><A HREF="#FileIcon.first">first</A>
- <LI><A HREF="#FileIcon.label">label</A>
- <LI><A HREF="#FileIcon.labeltype">labeltype</A>
- <LI><A HREF="#FileIcon.load_fti">load_fti</A>
- <LI><A HREF="#FileIcon.load">load</A>
- <LI><A HREF="#FileIcon.load_system_icons">load_system_icons</A>
- <LI><A HREF="#FileIcon.load_xpm">load_xpm</A>
- <LI><A HREF="#FileIcon.pattern">pattern</A>
- <LI><A HREF="#FileIcon.size">size</A>
- <LI><A HREF="#FileIcon.type">type</A>
- <LI><A HREF="#FileIcon.value">value</A>
+ <LI><A HREF="#Fl_FileIcon.Fl_FileIcon">Fl_FileIcon</A>
+ <LI><A HREF="#Fl_FileIcon.~Fl_FileIcon">~Fl_FileIcon</A>
+ <LI><A HREF="#Fl_FileIcon.add">add</A>
+ <LI><A HREF="#Fl_FileIcon.add_color">add_color</A>
+ <LI><A HREF="#Fl_FileIcon.add_vertex">add_vertex</A>
+ <LI><A HREF="#Fl_FileIcon.clear">clear</A>
+ <LI><A HREF="#Fl_FileIcon.draw">draw</A>
+ <LI><A HREF="#Fl_FileIcon.find">find</A>
+ <LI><A HREF="#Fl_FileIcon.first">first</A>
+ <LI><A HREF="#Fl_FileIcon.label">label</A>
+ <LI><A HREF="#Fl_FileIcon.labeltype">labeltype</A>
+ <LI><A HREF="#Fl_FileIcon.load_fti">load_fti</A>
+ <LI><A HREF="#Fl_FileIcon.load">load</A>
+ <LI><A HREF="#Fl_FileIcon.load_system_icons">load_system_icons</A>
+ <LI><A HREF="#Fl_FileIcon.load_xpm">load_xpm</A>
+ <LI><A HREF="#Fl_FileIcon.pattern">pattern</A>
+ <LI><A HREF="#Fl_FileIcon.size">size</A>
+ <LI><A HREF="#Fl_FileIcon.type">type</A>
+ <LI><A HREF="#Fl_FileIcon.value">value</A>
</UL>
-<H4><A NAME="FileIcon.FileIcon">FileIcon()</A></H4>
+<H4><A NAME="Fl_FileIcon.Fl_FileIcon">Fl_FileIcon()</A></H4>
-<P>The constructor creates a new <CODE>FileIcon</CODE> with the specified
+<P>The constructor creates a new <CODE>Fl_FileIcon</CODE> with the specified
information.
-<H4><A NAME="FileIcon.~FileIcon">~FileIcon()</A></H4>
+<H4><A NAME="Fl_FileIcon.~Fl_FileIcon">~Fl_FileIcon()</A></H4>
<P>The destructor destroys the icon and frees all memory that has been
allocated for it.
-<H4><A NAME="FileIcon.add">short *add(short d)</A></H4>
+<H4><A NAME="Fl_FileIcon.add">short *add(short d)</A></H4>
<P>Adds a keyword value to the icon array, returning a pointer to it.
-<H4><A NAME="FileIcon.add_color">short *add_color(short c)</A></H4>
+<H4><A NAME="Fl_FileIcon.add_color">short *add_color(short c)</A></H4>
<P>Adds a color value to the icon array, returning a pointer to it.
-<H4><A NAME="FileIcon.add_vertex">short *add_vertex(int x, int y)<BR>
+<H4><A NAME="Fl_FileIcon.add_vertex">short *add_vertex(int x, int y)<BR>
short *add_vertex(float x, float y)</A></H4>
<P>Adds a vertex value to the icon array, returning a pointer to it.
@@ -88,76 +76,76 @@ 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.
-<H4><A NAME="FileIcon.clear">void clear()</A></H4>
+<H4><A NAME="Fl_FileIcon.clear">void clear()</A></H4>
<P>Clears all icon data from the icon.
-<H4><A NAME="FileIcon.draw">void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1)</A></H4>
+<H4><A NAME="Fl_FileIcon.draw">void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1)</A></H4>
<P>Draws the icon in the indicated area.
-<H4><A NAME="FileIcon.find">static FileIcon *find(const char *filename, int filetype = ANY);</A></H4>
+<H4><A NAME="Fl_FileIcon.find">static Fl_FileIcon *find(const char *filename, int filetype = ANY);</A></H4>
<P>Finds an icon that matches the given filename and file type.
-<H4><A NAME="FileIcon.first">static FileIcon *first()</A></H4>
+<H4><A NAME="Fl_FileIcon.first">static Fl_FileIcon *first()</A></H4>
<P>Returns a pointer to the first icon in the list.
-<H4><A NAME="FileIcon.label">void label(Fl_Widget *w)</A></H4>
+<H4><A NAME="Fl_FileIcon.label">void label(Fl_Widget *w)</A></H4>
-<P>Applies the icon to the widget, registering the <CODE>FileIcon</CODE>
+<P>Applies the icon to the widget, registering the <CODE>Fl_FileIcon</CODE>
label type as needed.
-<H4><A NAME="FileIcon.labeltype">static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a)</A></H4>
+<H4><A NAME="Fl_FileIcon.labeltype">static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a)</A></H4>
<P>The labeltype function for icons.
-<H4><A NAME="FileIcon.load">void load(const char *f)</A></H4>
+<H4><A NAME="Fl_FileIcon.load">void load(const char *f)</A></H4>
<P>Loads the specified icon image. The format is deduced from the filename.
-<H4><A NAME="FileIcon.load_fti">void load_fti(const char *fti)</A></H4>
+<H4><A NAME="Fl_FileIcon.load_fti">void load_fti(const char *fti)</A></H4>
<P>Loads an SGI icon file.
-<H4><A NAME="FileIcon.load_system_icons">static void load_system_icons(void)</A></H4>
+<H4><A NAME="Fl_FileIcon.load_system_icons">static void load_system_icons(void)</A></H4>
<P>Loads all system-defined icons. This call is useful when using the
<CODE>FileChooser</CODE> widget and should be used when the application
starts:
<UL><PRE>
-FileIcon::load_system_icons();
+Fl_FileIcon::load_system_icons();
</PRE></UL>
-<H4><A NAME="FileIcon.load_xpm">void load_xpm(const char *xpm)</A></H4>
+<H4><A NAME="Fl_FileIcon.load_xpm">void load_xpm(const char *xpm)</A></H4>
<P>Loads an XPM icon file.
-<H4><A NAME="FileIcon.pattern">const char *pattern()</A></H4>
+<H4><A NAME="Fl_FileIcon.pattern">const char *pattern()</A></H4>
<P>Returns the filename matching pattern for the icon.
-<H4><A NAME="FileIcon.size">int size()</A></H4>
+<H4><A NAME="Fl_FileIcon.size">int size()</A></H4>
<P>Returns the number of words of data used by the icon.
-<H4><A NAME="FileIcon.type">int type()</A></H4>
+<H4><A NAME="Fl_FileIcon.type">int type()</A></H4>
<P>Returns the filetype associated with the icon, which can be one of the
following:
<UL>
- <LI><CODE>FileIcon::ANY</CODE>, any kind of file.
- <LI><CODE>FileIcon::PLAIN</CODE>, plain files.
- <LI><CODE>FileIcon::FIFO</CODE>, named pipes.
- <LI><CODE>FileIcon::DEVICE</CODE>, character and block devices.
- <LI><CODE>FileIcon::LINK</CODE>, symbolic links.
- <LI><CODE>FileIcon::DIRECTORY</CODE>, directories.
+ <LI><CODE>Fl_FileIcon::ANY</CODE>, any kind of file.
+ <LI><CODE>Fl_FileIcon::PLAIN</CODE>, plain files.
+ <LI><CODE>Fl_FileIcon::FIFO</CODE>, named pipes.
+ <LI><CODE>Fl_FileIcon::DEVICE</CODE>, character and block devices.
+ <LI><CODE>Fl_FileIcon::LINK</CODE>, symbolic links.
+ <LI><CODE>Fl_FileIcon::DIRECTORY</CODE>, directories.
</UL>
-<H4><A NAME="FileIcon.value">short *value()</A></H4>
+<H4><A NAME="Fl_FileIcon.value">short *value()</A></H4>
<P>Returns the data array for the icon.
diff --git a/src/Fl_FileBrowser.cxx b/src/Fl_FileBrowser.cxx
index 7ebbcfcb8..63587bcf4 100644
--- a/src/Fl_FileBrowser.cxx
+++ b/src/Fl_FileBrowser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_FileBrowser.cxx,v 1.13.2.4 2001/08/06 15:19:20 easysw Exp $"
+// "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $"
//
// Fl_FileBrowser routines.
//
@@ -382,6 +382,7 @@ Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate
pattern_ = "*";
directory_ = "";
iconsize_ = 3 * textsize() / 2;
+ filetype_ = FILES;
}
@@ -389,7 +390,7 @@ Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate
// 'Fl_FileBrowser::load()' - Load a directory into the browser.
//
-int // O - Number of files loaded
+int // O - Number of files loaded
Fl_FileBrowser::load(const char *directory)// I - Directory to load
{
int i; // Looping var
@@ -531,7 +532,8 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load
num_dirs ++;
insert(num_dirs, name, Fl_FileIcon::find(filename));
}
- else if (filename_match(files[i]->d_name, pattern_))
+ else if (filetype_ == FILES &&
+ filename_match(files[i]->d_name, pattern_))
add(files[i]->d_name, Fl_FileIcon::find(filename));
}
@@ -564,5 +566,5 @@ Fl_FileBrowser::filter(const char *pattern) // I - Pattern string
//
-// End of "$Id: Fl_FileBrowser.cxx,v 1.13.2.4 2001/08/06 15:19:20 easysw Exp $".
+// End of "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx
index 3a554ac62..7993ff909 100644
--- a/src/Fl_Light_Button.cxx
+++ b/src/Fl_Light_Button.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.2 2001/08/04 20:17:10 easysw Exp $"
+// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// Lighted button widget for the Fast Light Tool Kit (FLTK).
//
@@ -50,9 +50,9 @@ void Fl_Light_Button::draw() {
if (value()) {
fl_color(col);
fl_line_style(FL_SOLID, 2);
- fl_line(x() + W - d - 6, y() + d + 4,
- x() + W / 2 - 2, y() + W - d - 6,
- x() + d + 4, y() + W / 2 - 1);
+ fl_line(x() + W - d - 7, y() + d + 5,
+ x() + W / 2 - 1, y() + W - d - 7,
+ x() + d + 5, y() + W / 2);
fl_line_style(FL_SOLID);
}
break;
@@ -105,5 +105,5 @@ Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char* l)
}
//
-// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.2 2001/08/04 20:17:10 easysw Exp $".
+// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.3 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 2e958dab9..000e7d706 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $"
+// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -108,11 +108,13 @@ extern char fl_draw_shortcut;
// width of label, including effect of & characters:
int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const {
Fl_Label l;
- l.value = text;
- l.type = labeltype_;
- l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
- l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
- l.color = FL_BLACK; // this makes no difference?
+ l.value = text;
+ l.image = 0;
+ l.deimage = 0;
+ l.type = labeltype_;
+ l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
+ l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
+ l.color = FL_BLACK; // this makes no difference?
fl_draw_shortcut = 1;
int w = 0; int h = 0; l.measure(w, hp ? *hp : h);
fl_draw_shortcut = 0;
@@ -156,26 +158,33 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
}
if (flags & (FL_MENU_TOGGLE|FL_MENU_RADIO)) {
- int y1 = y+(h-14)/2;
- fl_color(FL_DARK3);
+ int size = 12;
+ int y1 = y + (h - size) / 2;
+ int x1 = x + 2;
+
if (flags & FL_MENU_RADIO) {
- fl_line(x+2, y1+7, x+8, y1+1, x+14, y1+7);
- if (selected) {
- fl_color(color);
- fl_polygon(x+3, y1+7, x+8, y1+2, x+13, y1+7, x+8, y1+12);
- }
- fl_color(FL_LIGHT3); fl_line(x+14, y1+7, x+8, y1+13, x+2, y1+7);
+ fl_color(FL_DARK3);
+ fl_arc(x1, y1, size, size, 45.0, 225.0);
+ fl_color(FL_LIGHT3);
+ fl_arc(x1, y1, size, size, 225.0, 405.0);
+
if (value()) {
- fl_color(FL_BLACK);
- fl_polygon(x+4, y1+7, x+8, y1+3, x+12, y1+7, x+8, y1+11);
+ fl_color(FL_BLACK);
+ fl_pie(x1 + 3, y1 + 3, size - 7, size - 7, 0.0, 360.0);
}
} else {
- fl_yxline(x+3, y1+11, y1+2, x+12);
- if (selected) {fl_color(color); fl_rectf(x+4, y1+3, 9, 9);}
- fl_color(FL_LIGHT3); fl_xyline(x+4, y1+12, x+13, y1+3);
- if (value()) {fl_color(FL_BLACK); fl_rectf(x+5, y1+4, 7, 7);}
+ fl_draw_box(FL_THIN_DOWN_FRAME, x1, y1, size, size, color);
+ if (value()) {
+ fl_color(FL_BLACK);
+ fl_line_style(FL_SOLID, 2);
+ fl_line(x1 + size - 3, y1 + 2,
+ x1 + size / 2 - 1, y1 + size - 4,
+ x1 + 3, y1 + size / 2);
+ fl_line_style(FL_SOLID);
+ }
}
- x += 14; w -= 14;
+ x += size + 3;
+ w -= size + 3;
}
if (!fl_draw_shortcut) fl_draw_shortcut = 1;
@@ -743,5 +752,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Return_Button.cxx b/src/Fl_Return_Button.cxx
index 55723fcb0..7394a23e3 100644
--- a/src/Fl_Return_Button.cxx
+++ b/src/Fl_Return_Button.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.1 2001/08/04 16:43:31 easysw Exp $"
+// "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.2 2001/09/04 13:13:29 easysw Exp $"
//
// Return button widget for the Fast Light Tool Kit (FLTK).
//
@@ -53,11 +53,7 @@ void Fl_Return_Button::draw() {
if (w()/3 < W) W = w()/3;
fl_return_arrow(x()+w()-W-4, y(), W, h());
draw_label(x(), y(), w()-W+4, h());
- if (Fl::focus() == this) {
- fl_line_style(FL_DASH);
- fl_rect(x() + 4, y() + 4, w() - 8, h() - 8);
- fl_line_style(FL_SOLID);
- }
+ if (Fl::focus() == this) draw_focus();
}
int Fl_Return_Button::handle(int event) {
@@ -70,5 +66,5 @@ int Fl_Return_Button::handle(int event) {
}
//
-// End of "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.1 2001/08/04 16:43:31 easysw Exp $".
+// End of "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.2 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/test/pack.cxx b/test/pack.cxx
index af167324d..67f113e0e 100644
--- a/test/pack.cxx
+++ b/test/pack.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: pack.cxx,v 1.4.2.3 2001/01/22 15:13:41 easysw Exp $"
+// "$Id: pack.cxx,v 1.4.2.3.2.1 2001/09/04 13:13:29 easysw Exp $"
//
// Fl_Pack test program for the Fast Light Tool Kit (FLTK).
//
@@ -56,10 +56,10 @@ void spacing_cb(Fl_Value_Slider*o, long) {
int main(int argc, char **argv) {
Fl_Window *w;
- {Fl_Window* o = new Fl_Window(365, 525);
+ {Fl_Window* o = new Fl_Window(360, 370);
w = o;
- scroll = new Fl_Scroll(10,10,345,285);
- {Fl_Pack* o = new Fl_Pack(10, 10, 345, 285);
+ scroll = new Fl_Scroll(10,10,340,285);
+ {Fl_Pack* o = new Fl_Pack(10, 10, 340, 285);
pack = o;
o->box(FL_DOWN_FRAME);
//o->box(FL_ENGRAVED_FRAME);
@@ -91,16 +91,16 @@ int main(int argc, char **argv) {
w->resizable(o);
}
scroll->end();
- {Fl_Light_Button* o = new Fl_Light_Button(10, 325, 175, 25, "HORIZONTAL");
+ {Fl_Light_Button* o = new Fl_Light_Button(10, 305, 165, 25, "HORIZONTAL");
o->type(FL_RADIO_BUTTON);
o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::HORIZONTAL));
}
- {Fl_Light_Button* o = new Fl_Light_Button(10, 350, 175, 25, "VERTICAL");
+ {Fl_Light_Button* o = new Fl_Light_Button(185, 305, 165, 25, "VERTICAL");
o->type(FL_RADIO_BUTTON);
o->value(1);
o->callback((Fl_Callback*)type_cb, (void*)(Fl_Pack::VERTICAL));
}
- {Fl_Value_Slider* o = new Fl_Value_Slider(50,375, 295,25,"spacing:");
+ {Fl_Value_Slider* o = new Fl_Value_Slider(100, 335, 250, 25, "Spacing: ");
o->align(FL_ALIGN_LEFT);
o->type(FL_HORIZONTAL);
o->range(0,30);
@@ -114,5 +114,5 @@ int main(int argc, char **argv) {
}
//
-// End of "$Id: pack.cxx,v 1.4.2.3 2001/01/22 15:13:41 easysw Exp $".
+// End of "$Id: pack.cxx,v 1.4.2.3.2.1 2001/09/04 13:13:29 easysw Exp $".
//