From 09daf20b81cdae78772f07c0af22a571d7cc73eb Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 29 Nov 2001 19:24:00 +0000 Subject: Documentation updates galore (up to chapter 7, still need to do chapter 8 and 9, tweek the appendices, and recapture the screenshots...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/Fl.html | 25 +- documentation/Fl_Adjuster.html | 20 +- documentation/Fl_Box.html | 18 +- documentation/Fl_Browser.html | 136 ++-- documentation/Fl_Browser_.html | 50 +- documentation/Fl_Button.html | 68 +- documentation/Fl_Chart.html | 56 +- documentation/Fl_Check_Button.html | 16 +- documentation/Fl_Choice.html | 58 +- documentation/Fl_Clock.html | 32 +- documentation/Fl_Color_Chooser.html | 72 +- documentation/Fl_Counter.html | 22 +- documentation/Fl_Dial.html | 14 +- documentation/Fl_Double_Window.html | 28 +- documentation/Fl_Float_Input.html | 8 +- documentation/Fl_Free.html | 26 +- documentation/Fl_Gl_Window.html | 142 ++-- documentation/Fl_Group.html | 72 +- documentation/Fl_Hold_Browser.html | 30 +- documentation/Fl_Input.html | 122 ++-- documentation/Fl_Input_.html | 118 ++-- documentation/Fl_Int_Input.html | 8 +- documentation/Fl_Light_Button.html | 18 +- documentation/Fl_Menu_.html | 50 +- documentation/Fl_Menu_Bar.html | 46 +- documentation/Fl_Menu_Button.html | 62 +- documentation/Fl_Menu_Item.html | 192 +++--- documentation/Fl_Menu_Window.html | 22 +- documentation/Fl_Multi_Browser.html | 34 +- documentation/Fl_Multiline_Input.html | 22 +- documentation/Fl_Multiline_Output.html | 14 +- documentation/Fl_Output.html | 52 +- documentation/Fl_Overlay_Window.html | 42 +- documentation/Fl_Pack.html | 32 +- documentation/Fl_Positioner.html | 32 +- documentation/Fl_Repeat_Button.html | 16 +- documentation/Fl_Return_Button.html | 14 +- documentation/Fl_Roller.html | 10 +- documentation/Fl_Round_Button.html | 18 +- documentation/Fl_Scroll.html | 72 +- documentation/Fl_Scrollbar.html | 40 +- documentation/Fl_Secret_Input.html | 12 +- documentation/Fl_Select_Browser.html | 28 +- documentation/Fl_Single_Window.html | 18 +- documentation/Fl_Slider.html | 52 +- documentation/Fl_Tabs.html | 48 +- documentation/Fl_Tile.html | 52 +- documentation/Fl_Timer.html | 32 +- documentation/Fl_Valuator.html | 86 +-- documentation/Fl_Value_Input.html | 48 +- documentation/Fl_Value_Output.html | 36 +- documentation/Fl_Value_Slider.html | 24 +- documentation/Fl_Widget.html | 188 +++--- documentation/Fl_Window.html | 190 +++--- documentation/basics.html | 22 +- documentation/common.html | 30 +- documentation/drawing.html | 1158 ++++++++++++++++++++------------ documentation/editor.html | 673 ++++++++++--------- documentation/enumerations.html | 68 +- documentation/events.html | 468 ++++++++----- documentation/fluid.html | 598 ++++++++--------- documentation/forms.html | 154 ++--- documentation/glut.html | 96 +-- documentation/index.html | 2 +- documentation/intro.html | 24 +- documentation/license.html | 610 ++++++++--------- documentation/migration.html | 2 +- documentation/opengl.html | 144 ++-- documentation/osissues.html | 318 ++++----- documentation/preface.html | 14 +- documentation/subclassing.html | 375 ++++++----- documentation/widgets.html | 2 +- 72 files changed, 3980 insertions(+), 3521 deletions(-) (limited to 'documentation') diff --git a/documentation/Fl.html b/documentation/Fl.html index 8ca85427f..21257a8c4 100644 --- a/documentation/Fl.html +++ b/documentation/Fl.html @@ -361,8 +361,31 @@ FLTK).

int compose(int &del);

+

Use of this function is very simple. Any text editing widget should +call this for each FL_KEYBOARD event. + +

If true is returned, then it has modified the +Fl::event_text() and Fl::event_length() to a set of bytes to +insert (it may be of zero length!). In will also set the "del" +parameter to the number of bytes to the left of the cursor to +delete, this is used to delete the results of the previous call to +Fl::compose(). + +

If false is returned, the keys should be treated as function +keys, and del is set to zero. You could insert the text anyways, if +you don't know what else to do. + +

Though the current implementation returns immediately, future +versions may take quite awhile, as they may pop up a window or do +other user-interface things to allow characters to be selected. +

void compose_reset();

+

If the user moves the cursor, be sure to call Fl::compose_reset(). +The next call to Fl::compose() will start out in an initial state. In +particular it will not set "del" to non-zero. This call is very fast +so it is ok to call it many times and in many places. +

int damage();
void damage(int x);

@@ -597,7 +620,7 @@ between this and FL_WHITE.

void free_color(Fl_Color c, int overlay = 0);

-

Frees the specified color from the colormap, if applicable. +

Frees the specified color from the colormap, if applicable. If overlay is non-zero then the color is freed from the overlay colormap. diff --git a/documentation/Fl_Adjuster.html b/documentation/Fl_Adjuster.html index 70cade0b7..536590a5e 100644 --- a/documentation/Fl_Adjuster.html +++ b/documentation/Fl_Adjuster.html @@ -17,7 +17,7 @@

Description

-The Fl_Adjuster widget was stolen from Prisms, and has proven +The Fl_Adjuster widget was stolen from Prisms, and has proven to be very useful for values that need a large dynamic range.

Fl_Adjuster widget.

When you press a button and drag to the right the value increases. @@ -25,25 +25,25 @@ When you drag to the left it decreases. The largest button adjusts by 100 * step(), the next by 10 * step() and that smallest button by step(). Clicking on the buttons increments by 10 times the amount dragging by a pixel does. Shift + -click decrements by 10 times the amount. +click decrements by 10 times the amount.

Methods

-

Fl_Adjuster::Fl_Adjuster(int x, int +

Fl_Adjuster::Fl_Adjuster(int x, int y, int w, int h, const char *label = 0)

- Creates a new Fl_Adjuster widget using the given position, -size, and label string. It looks best if one of the dimensions is 3 -times the other. + Creates a new Fl_Adjuster widget using the given position, +size, and label string. It looks best if one of the dimensions is 3 +times the other.

virtual Fl_Adjuster::~Fl_Adjuster()

- Destroys the valuator. + Destroys the valuator.

uchar Fl_Adjuster::soft() const
void Fl_Adjuster::soft(uchar)

- If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default is + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is one. diff --git a/documentation/Fl_Box.html b/documentation/Fl_Box.html index 01ed1b4c0..e575fad8a 100644 --- a/documentation/Fl_Box.html +++ b/documentation/Fl_Box.html @@ -17,23 +17,23 @@

Description

- This widget simply draws its box, and possibly it's label. Putting it -before some other widgets and making it big enough to surround them -will let you draw a frame around them. + This widget simply draws its box, and possibly it's label. Putting it +before some other widgets and making it big enough to surround them +will let you draw a frame around them.

Methods

-

Fl_Box::Fl_Box(int x, int y, int w, int h, +

Fl_Box::Fl_Box(int x, int y, int w, int h, const char * = 0) -
Fl_Box::Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const +
Fl_Box::Fl_Box(Fl_Boxtype b, int x, int y, int w, int h, const char *)

- The first constructor sets box() to FL_NO_BOX, which -means it is invisible. However such widgets are useful as placeholders + The first constructor sets box() to FL_NO_BOX, which +means it is invisible. However such widgets are useful as placeholders or Fl_Group::resizable() - values. To change the box to something visible, use box(n). -

The second form of the constructor sets the box to the specified box + values. To change the box to something visible, use box(n). +

The second form of the constructor sets the box to the specified box type.

Fl_Box::~Fl_Box(void)

The destructor removes the box. diff --git a/documentation/Fl_Browser.html b/documentation/Fl_Browser.html index 22541b057..96a6ef5a7 100644 --- a/documentation/Fl_Browser.html +++ b/documentation/Fl_Browser.html @@ -19,32 +19,32 @@

Description

- The Fl_Browser widget displays a scrolling list of text -lines, and manages all the storage for the text. This is not a text -editor or spreadsheet! But it is useful for showing a vertical list of -named objects to the user. -

Each line in the browser is identified by number. The numbers -start at one (this is so that zero can be reserved for "no line" in -the selective browsers). Unless otherwise noted, the methods do not -check to see if the passed line number is in range and legal. It must + The Fl_Browser widget displays a scrolling list of text +lines, and manages all the storage for the text. This is not a text +editor or spreadsheet! But it is useful for showing a vertical list of +named objects to the user. +

Each line in the browser is identified by number. The numbers +start at one (this is so that zero can be reserved for "no line" in +the selective browsers). Unless otherwise noted, the methods do not +check to see if the passed line number is in range and legal. It must always be greater than zero and <= size().

Each line contains a null-terminated string of text and a void * data pointer. The text string is displayed, the void * - pointer can be used by the callbacks to reference the object the text + pointer can be used by the callbacks to reference the object the text describes.

-

The base class does nothing when the user clicks on it. The +

The base class does nothing when the user clicks on it. The subclasses Fl_Select_Browser, Fl_Hold_Browser, and -Fl_Multi_Browser react to user clicks to select lines in +Fl_Multi_Browser react to user clicks to select lines in the browser and do callbacks.

The base class called -Fl_Browser_ provides the scrolling and selection mechanisms of -this and all the subclasses, but the dimensions and appearance of each +Fl_Browser_ provides the scrolling and selection mechanisms of +this and all the subclasses, but the dimensions and appearance of each item are determined by the subclass. You can use Fl_Browser_ - to display information other than text, or text that is dynamically -produced from your own data structures. If you find that loading the -browser is a lot of work or is inefficient, you may want to make a + to display information other than text, or text that is dynamically +produced from your own data structures. If you find that loading the +browser is a lot of work or is inefficient, you may want to make a subclass of Fl_Browser_.

Methods

@@ -88,51 +88,51 @@ subclass of Fl_Browser_.

-

Fl_Browser::Fl_Browser(int, int, int, +

Fl_Browser::Fl_Browser(int, int, int, int, const char * = 0)

- The constructor makes an empty browser. + The constructor makes an empty browser.

Fl_Browser::~Fl_Browser(void)

- The destructor deletes all list items and destroys the browser. -

void Fl_Browser::add(const char *, void * = + The destructor deletes all list items and destroys the browser. +

void Fl_Browser::add(const char *, void * = 0)

- Add a new line to the end of the browser. The text is copied using -the strdup() function. It may also be NULL to make a + Add a new line to the end of the browser. The text is copied using +the strdup() function. It may also be NULL to make a blank line. The void * argument is returned as the data() - of the new item. + of the new item.

void Fl_Browser::bottomline(int n)

Scrolls the browser so the bottom line in the browser is n.

void Fl_Browser::clear()

- Remove all the lines in the browser. + Remove all the lines in the browser.

uchar Fl_Browser::column_char() const
void Fl_Browser::column_char(char c)

- The first form gets the current column separator character. By default -this is '\t' (tab). -

The second form sets the column separator to c. This will + The first form gets the current column separator character. By default +this is '\t' (tab). +

The second form sets the column separator to c. This will only have an effect if you also set column_widths().

-

const int +

const int *Fl_Browser::column_widths() const
void Fl_Browser::column_widths(const int *w)

- The first form gets the current column width array. This array is -zero-terminated and specifies the widths in pixels of each column. The -text is split at each column_char() and each part is formatted -into it's own column. After the last column any remaining text is -formatted into the space between the last column and the right edge of + The first form gets the current column width array. This array is +zero-terminated and specifies the widths in pixels of each column. The +text is split at each column_char() and each part is formatted +into it's own column. After the last column any remaining text is +formatted into the space between the last column and the right edge of the browser, even if the text contains instances of column_char() -. The default value is a one-element array of just a zero, which makes -there are no columns. -

The second form sets the current array to w. Make sure the +. The default value is a one-element array of just a zero, which makes +there are no columns. +

The second form sets the current array to w. Make sure the last entry is zero.

void *Fl_Browser::data(int n) const
void Fl_Browser::data(int n, void *)

- The first form returns the data for line n. If n is -out of range this returns NULL. + The first form returns the data for line n. If n is +out of range this returns NULL.

The second form sets the data for line n.

uchar Fl_Browser::format_char() const
void Fl_Browser::format_char(char c)

- The first form gets the current format code prefix character, which by -default is @. A string of formatting codes at the start of -each column are stripped off and used to modify how the rest of the -line is printed: + The first form gets the current format code prefix character, which by +default is @. A string of formatting codes at the start of +each column are stripped off and used to modify how the rest of the +line is printed: - Notice that the @. command can be used to reliably + Notice that the @. command can be used to reliably terminate the parsing. To print a random string in a random color, use -sprintf("@C%d@.%s", color, string) and it will work even if the -string starts with a digit or has the format character in it. -

The second form sets the current prefix to c. Set the +sprintf("@C%d@.%s", color, string) and it will work even if the +string starts with a digit or has the format character in it. +

The second form sets the current prefix to c. Set the prefix to 0 to disable formatting.

void Fl_Browser::hide(int n)

- Makes line n invisible, preventing selection by the user. - The line can still be selected under program control. -

void Fl_Browser::insert(int n, const char + Makes line n invisible, preventing selection by the user. + The line can still be selected under program control. +

void Fl_Browser::insert(int n, const char *, void * = 0)

Insert a new line before line n. If n > -size() then the line is added to the end. +size() then the line is added to the end.

int Fl_Browser::load(const char *filename)

- Clears the browser and reads the file, adding each line from the file -to the browser. If the filename is NULL or a zero-length -string then this just clears the browser. This returns zero if there + Clears the browser and reads the file, adding each line from the file +to the browser. If the filename is NULL or a zero-length +string then this just clears the browser. This returns zero if there was any error in opening or reading the file, in which case errno - is set to the system error. The data() of each line is set -to NULL. + is set to the system error. The data() of each line is set +to NULL.

void Fl_Browser::middleline(int n)

Scrolls the browser so the middle line in the browser is n.

void Fl_Browser::move(int to, int from)

Line from is removed and reinserted at to; to - is calculated after the line is removed. + is calculated after the line is removed.

int Fl_Browser::position() const
void Fl_Browser::position(int p)

- The first form returns the current vertical scrollbar position, where -0 corresponds to the top. If there is not vertical scrollbar then this -will always return 0. + The first form returns the current vertical scrollbar position, where +0 corresponds to the top. If there is not vertical scrollbar then this +will always return 0.

The second form sets the vertical scrollbar position to p.

void Fl_Browser::remove(int n)

- Remove line n and make the browser one line shorter. + Remove line n and make the browser one line shorter.

void Fl_Browser::show(int n)

- Makes line n visible for selection. + Makes line n visible for selection.

int Fl_Browser::size() const

- Returns how many lines are in the browser. The last line number is -equal to this. + Returns how many lines are in the browser. The last line number is +equal to this.

const char *Fl_Browser::text(int n) const
void Fl_Browser::text(int n, const char *)

- The first form returns the text for line n. If n is -out of range it returns NULL. + The first form returns the text for line n. If n is +out of range it returns NULL.

The second form sets the text for line n.

int Fl_Browser::topline() const
void Fl_Browser::topline(int n)

-The first form returns the current top line in the browser. If there -is no vertical scrollbar then this will always return 1. +The first form returns the current top line in the browser. If there +is no vertical scrollbar then this will always return 1.

The second form scrolls the browser so the top line in the browser is n.

int Fl_Browser::visible(int n) const

Returns a non-zero value if line n is visible. diff --git a/documentation/Fl_Browser_.html b/documentation/Fl_Browser_.html index f7908f0f5..69c415fd2 100644 --- a/documentation/Fl_Browser_.html +++ b/documentation/Fl_Browser_.html @@ -19,18 +19,18 @@

Description

- This is the base class for browsers. To be useful it must be -subclassed and several virtual functions defined. The Forms-compatable -browser and the file chooser's browser are subclassed off of this. -

This has been designed so that the subclass has complete control + This is the base class for browsers. To be useful it must be +subclassed and several virtual functions defined. The Forms-compatable +browser and the file chooser's browser are subclassed off of this. +

This has been designed so that the subclass has complete control over the storage of the data, although because next() and -prev() functions are used to index, it works best as a linked list -or as a large block of characters in which the line breaks must be +prev() functions are used to index, it works best as a linked list +or as a large block of characters in which the line breaks must be searched for.

-

A great deal of work has been done so that the "height" of a data -object does not need to be determined until it is drawn. This is -useful if actually figuring out the size of an object requires -accessing image data or doing stat() on a file or doing some +

A great deal of work has been done so that the "height" of a data +object does not need to be determined until it is drawn. This is +useful if actually figuring out the size of an object requires +accessing image data or doing stat() on a file or doing some other slow operation.

Methods

@@ -95,15 +95,15 @@ other slow operation.

-

Fl_Browser::Fl_Browser(int, int, +

Fl_Browser::Fl_Browser(int, int, int, int, const char * = 0)

-

The constructor makes an empty browser. +

The constructor makes an empty browser.

Fl_Browser::~Fl_Browser(void)

-

The destructor deletes all list items and destroys the browser. +

The destructor deletes all list items and destroys the browser.

Fl_Browser_::bbox(int &x, int &y, int &w, int &h) const

@@ -176,12 +176,12 @@ width from the item widths.

The second form handles an event within the specified bounding box. -

void +

void Fl_Browser_::has_scrollbar(int h)

-

By default you can scroll in both directions, and the scrollbars -disappear if the data will fit in the widget. has_scrollbar() changes -this based on the value of h: +

By default you can scroll in both directions, and the scrollbars +disappear if the data will fit in the widget. has_scrollbar() changes +this based on the value of h:

    @@ -196,10 +196,10 @@ this based on the value of h:
  • Fl_Browser_::BOTH - The default is both scrollbars. -
  • Fl_Browser_::HORIZONTAL_ALWAYS - Horizontal +
  • Fl_Browser_::HORIZONTAL_ALWAYS - Horizontal scrollbar always on, vertical always off. -
  • Fl_Browser_::VERTICAL_ALWAYS - Vertical +
  • Fl_Browser_::VERTICAL_ALWAYS - Vertical scrollbar always on, horizontal always off.
  • Fl_Browser_::BOTH_ALWAYS - Both always on. @@ -368,8 +368,8 @@ selected.

    Fl_Color Fl_Browser_::textcolor() const
    void Fl_Browser_::textcolor(Fl_Color color)

    -

    The first form gets the default text color for the lines in the -browser. +

    The first form gets the default text color for the lines in the +browser.

    The second form sets the default text color to color

    @@ -377,8 +377,8 @@ browser.

    Fl_Font Fl_Browser_::textfont() const
    void Fl_Browser_::textfont(Fl_Font font)

    -

    The first form gets the default text font for the lines in the -browser. +

    The first form gets the default text font for the lines in the +browser.

    The second form sets the default text font to font

    @@ -386,8 +386,8 @@ browser.

    uchar Fl_Browser_::textsize() const
    void Fl_Browser_::textsize(uchar size)

    -

    The first form gets the default text size for the lines in the -browser. +

    The first form gets the default text size for the lines in the +browser.

    The second form sets the default text size to size

    diff --git a/documentation/Fl_Button.html b/documentation/Fl_Button.html index 26202efcb..921c86391 100644 --- a/documentation/Fl_Button.html +++ b/documentation/Fl_Button.html @@ -20,14 +20,14 @@

Description

-

Buttons generate callbacks when they are clicked by the user. You +

Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() and when().

Buttons can also generate callbacks in response to FL_SHORTCUT events. The button can either have an explicit -shortcut() value or a letter shortcut can be indicated in -the label() with an '&' character before it. For the label -shortcut it does not matter if Alt is held down, but if you have +shortcut() value or a letter shortcut can be indicated in +the label() with an '&' character before it. For the label +shortcut it does not matter if Alt is held down, but if you have an input field in the same window, the user will have to hold down the Alt key so that the input field does not eat the event first as an FL_KEYBOARD event.

@@ -62,69 +62,69 @@ FL_KEYBOARD event.

-

Fl_Button::Fl_Button(int x, int y, int +

Fl_Button::Fl_Button(int x, int y, int w, int h, const char *label = 0)

- The constructor creates the button using the position, size, and -label. + The constructor creates the button using the position, size, and +label.

Fl_Button::~Fl_Button(void)

- The destructor removed the button. + The destructor removed the button.

int Fl_Button::clear()

- Same as value(0). + Same as value(0).

Fl_Boxtype Fl_Button::down_box() const
void Fl_Button::down_box(Fl_Boxtype bt)

The first form returns the current down box type, which is drawn when -value() is non-zero. -

The second form sets the down box type. The default value of 0 +value() is non-zero. +

The second form sets the down box type. The default value of 0 causes FLTK to figure out the correct matching down version of box() .

int Fl_Button::set()

- Same as value(1). + Same as value(1).

void Fl_Button::setonly()

- Turns on this button and turns off all other radio buttons in the -group (calling value(1) or set() does not do this). + Turns on this button and turns off all other radio buttons in the +group (calling value(1) or set() does not do this).

ulong Fl_Button::shortcut() const
void Fl_Button::shortcut(ulong key)

- The first form returns the current shortcut key for the button. -

The second form sets the shortcut key to key. Setting this -overrides the use of '&' in the label(). The value is a bitwise + The first form returns the current shortcut key for the button. +

The second form sets the shortcut key to key. Setting this +overrides the use of '&' in the label(). The value is a bitwise OR of a key and a set of shift flags, for example FL_ALT | 'a' -, FL_ALT | (FL_F + 10), or just 'a'. A value +, FL_ALT | (FL_F + 10), or just 'a'. A value of 0 disables the shortcut.

The key can be any value returned by -Fl::event_key(), but will usually be an ASCII letter. Use +Fl::event_key(), but will usually be an ASCII letter. Use a lower-case letter unless you require the shift key to be held down.

The shift flags can be any set of values accepted by -Fl::event_state(). If the bit is on that shift key must -be pushed. Meta, Alt, Ctrl, and Shift must be off if they are not in -the shift flags (zero for the other bits indicates a "don't care" +Fl::event_state(). If the bit is on that shift key must +be pushed. Meta, Alt, Ctrl, and Shift must be off if they are not in +the shift flags (zero for the other bits indicates a "don't care" setting).

uchar Fl_Button::type() const
void Fl_Button::type(uchar t)

- The first form of type() returns the current button type, -which can be one of: + The first form of type() returns the current button type, +which can be one of: - The second form sets the button type to t. + The second form sets the button type to t.

char Fl_Button::value() const
int Fl_Button::value(int)

- The first form returns the current value (0 or 1). The second form -sets the current value. + The first form returns the current value (0 or 1). The second form +sets the current value.

Fl_When Fl_Widget::when() const
void Fl_Widget::when(Fl_When w)

- Controls when callbacks are done. The following values are useful, -the default value is FL_WHEN_RELEASE: + Controls when callbacks are done. The following values are useful, +the default value is FL_WHEN_RELEASE: diff --git a/documentation/Fl_Chart.html b/documentation/Fl_Chart.html index 7a65a772d..cc00cce70 100644 --- a/documentation/Fl_Chart.html +++ b/documentation/Fl_Chart.html @@ -51,69 +51,69 @@ This widget displays simple charts and is provided for Forms compatibility. -

Fl_Chart::Fl_Chart(int x, int y, int w, +

Fl_Chart::Fl_Chart(int x, int y, int w, int h, const char *label = 0)

- Creates a new Fl_Chart widget using the given position, size, -and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Chart widget using the given position, size, +and label string. The default boxtype is FL_NO_BOX.

virtual Fl_Chart::~Fl_Chart()

- Destroys the Fl_Chart widget and all of its data. -

void add(double value, const char *label = + Destroys the Fl_Chart widget and all of its data. +

void add(double value, const char *label = NULL, uchar color = 0)

The add method adds the value and optionally -label and color to the chart. +label and color to the chart.

uchar autosize(void) const
void autosize(uchar onoff)

- The autosize method controls whether or not the chart will -automatically adjust the bounds of the chart. The first form returns a -boolean value that is non-zero if auto-sizing is enabled and zero is -auto-sizing is disabled. -

The second form of autosize sets the auto-sizing property + The autosize method controls whether or not the chart will +automatically adjust the bounds of the chart. The first form returns a +boolean value that is non-zero if auto-sizing is enabled and zero is +auto-sizing is disabled. +

The second form of autosize sets the auto-sizing property to onoff.

void bounds(double *a, double *b)
void bounds(double a, double b)

- The bounds method gets or sets the lower and upper bounds of -the chart values to a and b respectively. + The bounds method gets or sets the lower and upper bounds of +the chart values to a and b respectively.

void clear(void)

- The clear method removes all values from the chart. -

void insert(int pos, double value, const + The clear method removes all values from the chart. +

void insert(int pos, double value, const char *label = NULL, uchar color = 0)

The insert method inserts a data value at the given position -pos. Position 0 is the first data value. +pos. Position 0 is the first data value.

int maxsize(void) const
void maxsize(int n)

-The maxsize method gets or sets the maximum number of data +The maxsize method gets or sets the maximum number of data values for a chart. If you do not call this method then the chart will be allowed to grow to any size depending on available memory. -

void replace(int pos, double value, const +

void replace(int pos, double value, const char *label = NULL, uchar color = 0)

The replace method replaces data value pos with -value, label, and color. Position 0 is the -first data value. +value, label, and color. Position 0 is the +first data value.

int size(void) const

- The size method returns the number of data values in the -chart. + The size method returns the number of data values in the +chart.

uchar type() const
void type(uchar t)

- The first form of type() returns the current chart type. The -chart type can be one of the following: + The first form of type() returns the current chart type. The +chart type can be one of the following:
FL_BAR_CHART
Each sample value is drawn as a vertical bar.
FL_FILLED_CHART
-
The chart is filled from the bottom of the graph to the sample +
The chart is filled from the bottom of the graph to the sample values.
FL_HORBAR_CHART
Each sample value is drawn as a horizontal bar.
FL_LINE_CHART
-
The chart is drawn as a polyline with vertices at each sample +
The chart is drawn as a polyline with vertices at each sample value.
FL_PIE_CHART
-
A pie chart is drawn with each sample value being drawn as a +
A pie chart is drawn with each sample value being drawn as a proportionate slice in the circle.
FL_SPECIALPIE_CHART
Like FL_PIE_CHART, but the first slice is separated from the pie.
FL_SPIKE_CHART
Each sample value is drawn as a vertical line.
- The second form of type() sets the chart type to t. + The second form of type() sets the chart type to t. diff --git a/documentation/Fl_Check_Button.html b/documentation/Fl_Check_Button.html index d1074e2ac..0b6a88e99 100644 --- a/documentation/Fl_Check_Button.html +++ b/documentation/Fl_Check_Button.html @@ -17,14 +17,14 @@

Description

-Buttons generate callbacks when they are clicked by the user. You +Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() and when().

Fl_Check_Button widget

-

The Fl_Check_Button subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_DIAMOND_DOWN_BOX. The color of the -light when on is controlled with selection_color(), which +

The Fl_Check_Button subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_DIAMOND_DOWN_BOX. The color of the +light when on is controlled with selection_color(), which defaults to FL_RED.

Methods

-Fl_Check_Button::Fl_Check_Button(int x, int y, int w, int h, const char +Fl_Check_Button::Fl_Check_Button(int x, int y, int w, int h, const char *label = 0)

- Creates a new Fl_Check_Button widget using the given -position, size, and label string. + Creates a new Fl_Check_Button widget using the given +position, size, and label string.

Fl_Check_Button::~Fl_Check_Button()

The destructor deletes the check button. diff --git a/documentation/Fl_Choice.html b/documentation/Fl_Choice.html index ad22c3448..266c217d5 100644 --- a/documentation/Fl_Choice.html +++ b/documentation/Fl_Choice.html @@ -17,26 +17,26 @@

Description

- This is a button that when pushed pops up a menu (or hierarchy of + This is a button that when pushed pops up a menu (or hierarchy of menus) defined by an array of -Fl_Menu_Item objects. Motif calls this an OptionButton. +Fl_Menu_Item objects. Motif calls this an OptionButton.

The only difference between this and a -Fl_Menu_Button is that the name of the most recent chosen -menu item is displayed inside the box, while the label is displayed -outside the box. However, since the use of this is most often to -control a single variable rather than do individual callbacks, some of -the Fl_Menu_Button methods are redescribed here in those +Fl_Menu_Button is that the name of the most recent chosen +menu item is displayed inside the box, while the label is displayed +outside the box. However, since the use of this is most often to +control a single variable rather than do individual callbacks, some of +the Fl_Menu_Button methods are redescribed here in those terms.

-

When the user picks an item off the menu the value() is set +

When the user picks an item off the menu the value() is set to that item and then the callback is done.

-

All three mouse buttons pop up the menu. The Forms behavior of the -first two buttons to increment/decrement the choice is not implemented. +

All three mouse buttons pop up the menu. The Forms behavior of the +first two buttons to increment/decrement the choice is not implemented. This could be added with a subclass, however.

-

The menu will also pop up in response to shortcuts indicated by +

The menu will also pop up in response to shortcuts indicated by putting a '&' character in the label(). See Fl_Button for a description of this.

-

Typing the shortcut() of any of the items will do exactly -the same as when you pick the item with the mouse. The '&' character in +

Typing the shortcut() of any of the items will do exactly +the same as when you pick the item with the mouse. The '&' character in item names are only looked at when the menu is popped up, however.

Fl_Choice widget.

Methods

@@ -49,33 +49,33 @@ item names are only looked at when the menu is popped up, however.

  • set_changed
  • value
  • -

    Fl_Choice::Fl_Choice(int x, int y, int +

    Fl_Choice::Fl_Choice(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Choice widget using the given position, -size, and label string. The default boxtype is FL_UP_BOX. + Creates a new Fl_Choice widget using the given position, +size, and label string. The default boxtype is FL_UP_BOX.

    The constructor sets menu() to NULL. See Fl_Menu_ for the methods to set or change the menu.

    virtual Fl_Choice::~Fl_Choice()

    - The destructor removes the Fl_Choice widget and all of its -menu items. + The destructor removes the Fl_Choice widget and all of its +menu items.

    int Fl_Choice::value() const
    int Fl_Choice::value(int)
    int Fl_Choice::value(const Fl_Menu *)

    - The value is the index into the Fl_Menu array of the last -item chosen by the user. It is zero initially. You can set it as an -integer, or set it with a pointer to a menu item. The set routines -return non-zero if the new value is different than the old one. - Changing it causes a redraw(). + The value is the index into the Fl_Menu array of the last +item chosen by the user. It is zero initially. You can set it as an +integer, or set it with a pointer to a menu item. The set routines +return non-zero if the new value is different than the old one. + Changing it causes a redraw().

    int Fl_Widget::changed() const

    - This value is true if the user picks a different value. It is -turned off by value() and just before doing a callback (the + This value is true if the user picks a different value. It is +turned off by value() and just before doing a callback (the callback can turn it back on if desired).

    void Fl_Widget::set_changed()

    - This method sets the changed() flag. + This method sets the changed() flag.

    void Fl_Widget::clear_changed()

    - This method clears the changed() flag. + This method clears the changed() flag.

    Fl_Boxtype Fl_Choice::down_box() const
    void Fl_Choice::down_box(Fl_Boxtype b)

    - The first form gets the current down box, which is used when the menu -is popped up. The default down box type is FL_DOWN_BOX The + The first form gets the current down box, which is used when the menu +is popped up. The default down box type is FL_DOWN_BOX The second form sets the current down box type to b. diff --git a/documentation/Fl_Clock.html b/documentation/Fl_Clock.html index 5f217bb31..682b06414 100644 --- a/documentation/Fl_Clock.html +++ b/documentation/Fl_Clock.html @@ -17,9 +17,9 @@

    Description

    - This widget provides a round analog clock display and is provided for + This widget provides a round analog clock display and is provided for Forms compatibility. It installs a 1-second timeout callback using -Fl::add_timeout(). +Fl::add_timeout().

    Fl_Clock widget. Fl_Clock widget.

    Methods

      @@ -30,28 +30,28 @@ Forms compatibility. It installs a 1-second timeout callback using second
    • value
    -

    Fl_Clock::Fl_Clock(int x, int y, int w, +

    Fl_Clock::Fl_Clock(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Clock widget using the given position, size, -and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Clock widget using the given position, size, +and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Clock::~Fl_Clock()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Clock and all of it's children can be automatic (local) -variables, but you must declare the Fl_Clockfirst, so -that it is destroyed last. +Fl_Clock and all of it's children can be automatic (local) +variables, but you must declare the Fl_Clockfirst, so +that it is destroyed last.

    int Fl_Clock::hour() const

    - Returns the current hour (0 to 23). + Returns the current hour (0 to 23).

    int Fl_Clock::minute() const

    - Returns the current minute (0 to 59). + Returns the current minute (0 to 59).

    int Fl_Clock::second() const

    - Returns the current second (0 to 60, 60 = leap second). + Returns the current second (0 to 60, 60 = leap second).

    void Fl_Clock::value(ulong v)
    void Fl_Clock::value(int h, int m, int s)
    ulong Fl_Clock::value(void)

    - The first two forms of value set the displayed time to the -given UNIX time value or specific hours, minutes, and seconds. -

    The third form of value returns the displayed time in + The first two forms of value set the displayed time to the +given UNIX time value or specific hours, minutes, and seconds. +

    The third form of value returns the displayed time in seconds since the UNIX epoch (January 1, 1970).

    diff --git a/documentation/Fl_Color_Chooser.html b/documentation/Fl_Color_Chooser.html index 89fc52592..e5761915b 100644 --- a/documentation/Fl_Color_Chooser.html +++ b/documentation/Fl_Color_Chooser.html @@ -17,14 +17,14 @@

    Description

    - The Fl_Color_Chooser widget provides a standard RGB color -chooser. You can place any number of these into a panel of your own -design. This widget contains the hue box, value slider, and rgb input -fields from the above diagram (it does not have the color chips or the -Cancel or OK buttons). The callback is done every time the user -changes the rgb value. It is not done if they move the hue control in -a way that produces the same rgb value, such as when saturation -or value is zero. + The Fl_Color_Chooser widget provides a standard RGB color +chooser. You can place any number of these into a panel of your own +design. This widget contains the hue box, value slider, and rgb input +fields from the above diagram (it does not have the color chips or the +Cancel or OK buttons). The callback is done every time the user +changes the rgb value. It is not done if they move the hue control in +a way that produces the same rgb value, such as when saturation +or value is zero.

    Methods

    -Fl_Color_Chooser::Fl_Color_Chooser(int x, int y, int w, int h, const +Fl_Color_Chooser::Fl_Color_Chooser(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Color_Chooser widget using the given -position, size, and label string. The recommended dimensions are -200x95. The color is initialized to black. -

    virtual + Creates a new Fl_Color_Chooser widget using the given +position, size, and label string. The recommended dimensions are +200x95. The color is initialized to black. +

    virtual Fl_Color_Chooser::~Fl_Color_Chooser()

    - The destructor removes the color chooser and all of its controls. + The destructor removes the color chooser and all of its controls.

    double Fl_Color_Chooser::hue() const

    - Return the current hue. 0 <= hue < 6. Zero is red, one is yellow, -two is green, etc. This value is convienent for the internal -calculations - some other systems consider hue to run from zero to one, + Return the current hue. 0 <= hue < 6. Zero is red, one is yellow, +two is green, etc. This value is convienent for the internal +calculations - some other systems consider hue to run from zero to one, or from 0 to 360. -

    double +

    double Fl_Color_Chooser::saturation() const

    - Returns the saturation. 0 <= saturation <= 1. -

    double Fl_Color_Chooser::value() + Returns the saturation. 0 <= saturation <= 1. +

    double Fl_Color_Chooser::value() const

    - Returns the value/brightness. 0 <= value <= 1. + Returns the value/brightness. 0 <= value <= 1.

    double Fl_Color_Chooser::r() const

    - Returns the current red value. 0 <= r <= 1. + Returns the current red value. 0 <= r <= 1.

    double Fl_Color_Chooser::g() const

    - Returns the current green value. 0 <= g <= 1. + Returns the current green value. 0 <= g <= 1.

    double Fl_Color_Chooser::b() const

    - Returns the current blue value. 0 <= b <= 1. -

    int Fl_Color_Chooser::rgb(double, + Returns the current blue value. 0 <= b <= 1. +

    int Fl_Color_Chooser::rgb(double, double, double)

    - Sets the current rgb color values. Does not do the callback. Does -not clamp (but out of range values will produce psychedelic effects in -the hue selector). -

    int + Sets the current rgb color values. Does not do the callback. Does +not clamp (but out of range values will produce psychedelic effects in +the hue selector). +

    int Fl_Color_Chooser::hsv(double,double,double)

    - Set the hsv values. The passed values are clamped (or for hue, -modulus 6 is used) to get legal values. Does not do the callback. -

    static void -Fl_Color_Chooser::hsv2rgb(double, double, double, double&, double&, + Set the hsv values. The passed values are clamped (or for hue, +modulus 6 is used) to get legal values. Does not do the callback. +

    static void +Fl_Color_Chooser::hsv2rgb(double, double, double, double&, double&, double&)

    - This static method converts HSV colors to RGB colorspace. -

    static void -Fl_Color_Chooser::rgb2hsv(double, double, double, double&, double&, + This static method converts HSV colors to RGB colorspace. +

    static void +Fl_Color_Chooser::rgb2hsv(double, double, double, double&, double&, double&)

    This static method converts RGB colors to HSV colorspace. diff --git a/documentation/Fl_Counter.html b/documentation/Fl_Counter.html index 34fffb768..6b2428050 100644 --- a/documentation/Fl_Counter.html +++ b/documentation/Fl_Counter.html @@ -17,8 +17,8 @@

    Description

    - The Fl_Counter widget is provided for forms compatibility. - It controls a single floating point value. + The Fl_Counter widget is provided for forms compatibility. + It controls a single floating point value.

    Fl_Counter widget.

    Methods

    -

    Fl_Counter::Fl_Counter(int x, int y, +

    Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Counter widget using the given position, -size, and label string. The default type is FL_NORMAL_COUNTER. + Creates a new Fl_Counter widget using the given position, +size, and label string. The default type is FL_NORMAL_COUNTER.

    virtual Fl_Counter::~Fl_Counter()

    -Destroys the valuator. +Destroys the valuator.

    double Fl_Counter::lstep() const

    -Set the increment for the double-arrow buttons. The default -value is 1.0. +Set the increment for the double-arrow buttons. The default +value is 1.0.

    type(uchar)

    - Sets the type of counter: + Sets the type of counter:
      -
    • FL_NORMAL_COUNTER - Displays a counter with 4 arrow +
    • FL_NORMAL_COUNTER - Displays a counter with 4 arrow buttons.
    • -
    • FL_SIMPLE_COUNTER - Displays a counter with only 2 arrow +
    • FL_SIMPLE_COUNTER - Displays a counter with only 2 arrow buttons.
    diff --git a/documentation/Fl_Dial.html b/documentation/Fl_Dial.html index 4184ddd99..c42df0c9e 100644 --- a/documentation/Fl_Dial.html +++ b/documentation/Fl_Dial.html @@ -17,8 +17,8 @@

    Description

    - The Fl_Dial widget provides a circular dial to control a -single floating point value. + The Fl_Dial widget provides a circular dial to control a +single floating point value.

    Fl_Dial widget.

    Methods

      @@ -29,12 +29,12 @@ single floating point value.
    • angles
    • type
    -

    Fl_Dial::Fl_Dial(int x, int y, int w, int +

    Fl_Dial::Fl_Dial(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Dial widget using the given position, size, -and label string. The default type is FL_NORMAL_DIAL. + Creates a new Fl_Dial widget using the given position, size, +and label string. The default type is FL_NORMAL_DIAL.

    virtual Fl_Dial::~Fl_Dial()

    - Destroys the valuator. + Destroys the valuator.

    @@ -52,7 +52,7 @@ progress clockwise). Normally angle1 is less than angle2, but if you reverse them the dial moves counter-clockwise.

    type(uchar)

    - Sets the type of the dial to: + Sets the type of the dial to:
    • FL_NORMAL_DIAL - Draws a normal dial with a knob.
    • FL_LINE_DIAL - Draws a dial with a line.
    • diff --git a/documentation/Fl_Double_Window.html b/documentation/Fl_Double_Window.html index 7be7b758d..25161e516 100644 --- a/documentation/Fl_Double_Window.html +++ b/documentation/Fl_Double_Window.html @@ -17,19 +17,19 @@

    Description

    - The Fl_Double_Window class provides a double-buffered window. - If possible this will use the X double buffering extension (Xdbe). If -not, it will draw the window data into an off-screen pixmap, and then -copy it to the on-screen window. -

    It is highly recommended that you put the following code before the + The Fl_Double_Window class provides a double-buffered window. + If possible this will use the X double buffering extension (Xdbe). If +not, it will draw the window data into an off-screen pixmap, and then +copy it to the on-screen window. +

    It is highly recommended that you put the following code before the first show() of any window in your program:

       Fl::visual(FL_DOUBLE|FL_INDEX)
       
    - This makes sure you can use Xdbe on servers where double buffering -does not exist for every visual. + This makes sure you can use Xdbe on servers where double buffering +does not exist for every visual.

    Methods

    -Fl_Double_Window::Fl_Double_Window(int x, int y, int w, int h, const +Fl_Double_Window::Fl_Double_Window(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Double_Window widget using the given -position, size, and label (title) string. -

    virtual + Creates a new Fl_Double_Window widget using the given +position, size, and label (title) string. +

    virtual Fl_Double_Window::~Fl_Double_Window()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to -all the children in the user code. + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to +all the children in the user code.

    ulong Fl_Double_Window::pixmap() const

    Returns the off-screen pixmap or back buffer. This value is zero until diff --git a/documentation/Fl_Float_Input.html b/documentation/Fl_Float_Input.html index a19dda0dd..42a03f15f 100644 --- a/documentation/Fl_Float_Input.html +++ b/documentation/Fl_Float_Input.html @@ -26,10 +26,10 @@
  • ~Fl_Float_Input
  • -Fl_Float_Input::Fl_Float_Input(int x, int y, int w, int h, const char +Fl_Float_Input::Fl_Float_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Float_Input widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. -

    virtual + Creates a new Fl_Float_Input widget using the given position, +size, and label string. The default boxtype is FL_DOWN_BOX. +

    virtual Fl_Float_Input::~Fl_Float_Input()

    Destroys the widget and any value associated with it. diff --git a/documentation/Fl_Free.html b/documentation/Fl_Free.html index 89a8de00f..aa7046e80 100644 --- a/documentation/Fl_Free.html +++ b/documentation/Fl_Free.html @@ -17,11 +17,11 @@

    Description

    - Emulation of the Forms "free" widget. This emulation allows the free -demo to run, and appears to be useful for porting programs written in -Forms which use the free widget or make subclasses of the Forms -widgets. -

    There are five types of free, which determine when the handle + Emulation of the Forms "free" widget. This emulation allows the free +demo to run, and appears to be useful for porting programs written in +Forms which use the free widget or make subclasses of the Forms +widgets. +

    There are five types of free, which determine when the handle function is called:

      @@ -32,19 +32,19 @@ function is called: 

      #define FL_ALL_FREE 5
    -

    An FL_INPUT_FREE accepts FL_FOCUS events. A FL_CONTINUOUS_FREE sets -a timeout callback 100 times a second and provides a FL_STEP event, -this has obvious detrimental effects on machine performance. +

    An FL_INPUT_FREE accepts FL_FOCUS events. A FL_CONTINUOUS_FREE sets +a timeout callback 100 times a second and provides a FL_STEP event, +this has obvious detrimental effects on machine performance. FL_ALL_FREE does both. FL_SLEEPING_FREE are deactivated.

    Methods

    -

    Fl_Free(uchar type, int, int, int, int, +

    Fl_Free(uchar type, int, int, int, int, const char*l, FL_HANDLEPTR hdl)

    The constructor takes both the type and the handle - function. The handle function should be declared as follows: + function. The handle function should be declared as follows:
       int
      @@ -55,9 +55,9 @@ handle_function(Fl_Widget *w,
       		char      key)
       
    - This function is called from the the handle() method in -response to most events, and is called by the draw() method. -The event argument contains the event type: + This function is called from the the handle() method in +response to most events, and is called by the draw() method. +The event argument contains the event type:
       // old event names for compatability:
      diff --git a/documentation/Fl_Gl_Window.html b/documentation/Fl_Gl_Window.html
      index 21276d2e0..fd5957e57 100644
      --- a/documentation/Fl_Gl_Window.html
      +++ b/documentation/Fl_Gl_Window.html
      @@ -17,15 +17,15 @@
       

    Description

    - The Fl_Gl_Window widget sets things up so OpenGL works, and -also keeps an OpenGL "context" for that window, so that changes to the + The Fl_Gl_Window widget sets things up so OpenGL works, and +also keeps an OpenGL "context" for that window, so that changes to the lighting and projection may be reused between redraws. Fl_Gl_Window also flushes the OpenGL streams and swaps buffers after draw() - returns. -

    OpenGL hardware typically provides some overlay bit planes, which -are very useful for drawing UI controls atop your 3D graphics. If the -overlay hardware is not provided, FLTK tries to simulate the overlay, -This works pretty well if your graphics are double buffered, but not + returns. +

    OpenGL hardware typically provides some overlay bit planes, which +are very useful for drawing UI controls atop your 3D graphics. If the +overlay hardware is not provided, FLTK tries to simulate the overlay, +This works pretty well if your graphics are double buffered, but not very well for single-buffered.

    Methods

    @@ -64,32 +64,32 @@ very well for single-buffered.

    -

    Fl_Gl_Window::Fl_Gl_Window(int x, +

    Fl_Gl_Window::Fl_Gl_Window(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Gl_Window widget using the given position, -size, and label string. The default boxtype is FL_NO_BOX. The -default mode is FL_RGB|FL_DOUBLE|FL_DEPTH. -

    virtual + Creates a new Fl_Gl_Window widget using the given position, +size, and label string. The default boxtype is FL_NO_BOX. The +default mode is FL_RGB|FL_DOUBLE|FL_DEPTH. +

    virtual Fl_Gl_Window::~Fl_Gl_Window()

    - The destructor removes the widget and destroys the OpenGL context -associated with it. + The destructor removes the widget and destroys the OpenGL context +associated with it.

    virtual void Fl_Gl_Window::draw(void)

    -Fl_Gl_Window::draw() is a pure virtual method. You must +Fl_Gl_Window::draw() is a pure virtual method. You must subclass Fl_Gl_Window and provide an implementation for -draw(). You may also provide an implementation of draw_overlay() -if you want to draw into the overlay planes. You can avoid +draw(). You may also provide an implementation of draw_overlay() +if you want to draw into the overlay planes. You can avoid reinitializing the viewport and lights and other things by checking -valid() at the start of draw() and only doing the -initialization if it is false. -

    The draw() method can only use OpenGL calls. Do not +valid() at the start of draw() and only doing the +initialization if it is false. +

    The draw() method can only use OpenGL calls. Do not attempt to call X, any of the functions in <FL/fl_draw.H>, or glX directly. Do not call gl_start() or gl_finish().

    -

    If double-buffering is enabled in the window, the back and front +

    If double-buffering is enabled in the window, the back and front buffers are swapped after this function is completed.

    const int Fl_Gl_Window::mode() const
    int Fl_Gl_Window::mode(int m)

    - Set or change the OpenGL capabilites of the window. The value can be -any of the following OR'd together: + Set or change the OpenGL capabilites of the window. The value can be +any of the following OR'd together:
    • FL_RGB - RGB color (not indexed)
    • FL_RGB8 - RGB color with at least 8 bits of each color
    • @@ -102,22 +102,22 @@ any of the following OR'd together:
    • FL_STENCIL - stencil buffer
    • FL_MULTISAMPLE - multisample antialiasing
    -FL_RGB and FL_SINGLE have a value of zero, so they -are "on" unless you give FL_INDEX or FL_DOUBLE. +FL_RGB and FL_SINGLE have a value of zero, so they +are "on" unless you give FL_INDEX or FL_DOUBLE.

    If the desired combination cannot be done, FLTK will try turning off FL_MULTISAMPLE. If this also fails the show() will call Fl::error() and not show the window.

    -

    You can change the mode while the window is displayed. This is most -useful for turning double-buffering on and off. Under X this will -cause the old X window to be destroyed and a new one to be created. If -this is a top-level window this will unfortunately also cause the +

    You can change the mode while the window is displayed. This is most +useful for turning double-buffering on and off. Under X this will +cause the old X window to be destroyed and a new one to be created. If +this is a top-level window this will unfortunately also cause the window to blink, raise to the top, and be de-iconized, and the xid() - will change, possibly breaking other code. It is best to make the GL + will change, possibly breaking other code. It is best to make the GL window a child of another window if you wish to do this!

    static int Fl_Gl_Window::can_do(int)
    int Fl_Gl_Window::can_do() const

    - Returns non-zero if the hardware supports the given or current OpenGL -mode. + Returns non-zero if the hardware supports the given or current OpenGL +mode.

    void* Fl_Gl_Window::context() const;
    void Fl_Gl_Window::context(void*, int destroy_flag = false);

    @@ -136,11 +136,11 @@ href=#Fl_Gl_Window.mode>mode() is changed, or the next time

    char Fl_Gl_Window::valid() const
    void Fl_Gl_Window::valid(char i)

    -Fl_Gl_Window::valid() is turned off when FLTK creates a new +Fl_Gl_Window::valid() is turned off when FLTK creates a new context for this window or when the window resizes, and is turned on after draw() is called. You can use this inside your -draw() method to avoid unneccessarily initializing the OpenGL -context. Just do this: +draw() method to avoid unneccessarily initializing the OpenGL +context. Just do this:
       void mywindow::draw() {
         if (!valid()) {
      @@ -153,59 +153,59 @@ void mywindow::draw() {
       }
       
    -You can turn valid() on by calling valid(1). You +You can turn valid() on by calling valid(1). You should only do this after fixing the transformation inside a draw() or after make_current(). This is done automatically after -draw() returns. +draw() returns.

    void Fl_Gl_Window::invalidate()

    - The invalidate() method turns off valid() and is -equivalent to calling value(0). + The invalidate() method turns off valid() and is +equivalent to calling value(0).

    void Fl_Gl_Window::ortho()

    - Set the projection so 0,0 is in the lower left of the window and each + Set the projection so 0,0 is in the lower left of the window and each pixel is 1 unit wide/tall. If you are drawing 2D images, your -draw() method may want to call this if valid() is false. +draw() method may want to call this if valid() is false.

    void Fl_Gl_Window::make_current()

    - The make_current() method selects the OpenGL context for the -widget. It is called automatically prior to the draw() method -being called and can also be used to implement feedback and/or -selection within the handle() method. -

    void + The make_current() method selects the OpenGL context for the +widget. It is called automatically prior to the draw() method +being called and can also be used to implement feedback and/or +selection within the handle() method. +

    void Fl_Gl_Window::make_overlay_current()

    - The make_overlay_current() method selects the OpenGL context + The make_overlay_current() method selects the OpenGL context for the widget's overlay. It is called automatically prior to the -draw_overlay() method being called and can also be used to +draw_overlay() method being called and can also be used to implement feedback and/or selection within the handle() - method. + method.

    void Fl_Gl_Window::swap_buffers()

    - The swap_buffers() method swaps the back and front buffers. -It is called automatically after the draw() method is called. + The swap_buffers() method swaps the back and front buffers. +It is called automatically after the draw() method is called.

    void Fl_Gl_Window::hide()

    - Hides the window and destroys the OpenGL context. -

    int + Hides the window and destroys the OpenGL context. +

    int Fl_Gl_Window::can_do_overlay()

    - Returns true if the hardware overlay is possible. If this is false, -FLTK will try to simulate the overlay, with significant loss of update -speed. Calling this will cause FLTK to open the display. -

    void + Returns true if the hardware overlay is possible. If this is false, +FLTK will try to simulate the overlay, with significant loss of update +speed. Calling this will cause FLTK to open the display. +

    void Fl_Gl_Window::redraw_overlay()

    - This method causes draw_overlay to be called at a later time. - Initially the overlay is clear, if you want the window to display -something in the overlay when it first appears, you must call this -immediately after you show() your window. -

    virtual void + This method causes draw_overlay to be called at a later time. + Initially the overlay is clear, if you want the window to display +something in the overlay when it first appears, you must call this +immediately after you show() your window. +

    virtual void Fl_Gl_Window::draw_overlay()

    - You must implement this virtual function if you want to draw into the -overlay. The overlay is cleared before this is called. You should + You must implement this virtual function if you want to draw into the +overlay. The overlay is cleared before this is called. You should draw anything that is not clear using OpenGL. You must use -gl_color(i) to choose colors (it allocates them from the colormap -using system-specific calls), and remember that you are in an indexed -OpenGL mode and drawing anything other than flat-shaded will probably -not work. +gl_color(i) to choose colors (it allocates them from the colormap +using system-specific calls), and remember that you are in an indexed +OpenGL mode and drawing anything other than flat-shaded will probably +not work.

    Both this function and Fl_Gl_Window::draw() should check -Fl_Gl_Window::valid() and set the same transformation. If you -don't your code may not work on other systems. Depending on the OS, -and on whether overlays are real or simulated, the OpenGL context may +Fl_Gl_Window::valid() and set the same transformation. If you +don't your code may not work on other systems. Depending on the OS, +and on whether overlays are real or simulated, the OpenGL context may be the same or different between the overlay and main window.

    diff --git a/documentation/Fl_Group.html b/documentation/Fl_Group.html index 1e8e4dac6..957b4bf3f 100644 --- a/documentation/Fl_Group.html +++ b/documentation/Fl_Group.html @@ -19,12 +19,12 @@

    Description

    - The Fl_Group class is the FLTK container widget. It maintains -an array of child widgets. These children can themselves be any widget + The Fl_Group class is the FLTK container widget. It maintains +an array of child widgets. These children can themselves be any widget including Fl_Group. The most important subclass of Fl_Group - is Fl_Window, however -groups can also be used to control radio buttons or to enforce resize -behavior. + is Fl_Window, however +groups can also be used to control radio buttons or to enforce resize +behavior.

    Methods

    @@ -61,17 +61,17 @@ behavior.
    -

    Fl_Group::Fl_Group(int x, int y, int w, +

    Fl_Group::Fl_Group(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Group widget using the given position, size, -and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Group widget using the given position, size, +and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Group::~Fl_Group()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Group and all of it's children can be automatic (local) -variables, but you must declare the Fl_Group first, so -that it is destroyed last. +Fl_Group and all of it's children can be automatic (local) +variables, but you must declare the Fl_Group first, so +that it is destroyed last.

    void Fl_Group::add(Fl_Widget &w)
    void Fl_Group::add(Fl_Widget *w)

    @@ -99,8 +99,8 @@ This does insert(w, find(beforethis)). This will append the widget if beforethis is not in the group.

    void Fl_Group::remove(Fl_Widget &w)

    -Removes a widget from the group. This does nothing if the widget is -not currently a child of this group. +Removes a widget from the group. This does nothing if the widget is +not currently a child of this group.

    static Fl_Group *Fl_Group::current()
    static void Fl_Group::current(Fl_Group *w)

    @@ -108,48 +108,48 @@ not currently a child of this group. constructor automatically does current()->add(widget) if this is not null. To prevent new widgets from being added to a group, call Fl_Group::current(0).

    void Fl_Group::begin()

    -begin() sets the current group so you can build the widget -tree by just constructing the widgets. begin() is -automatically called by the constructor for Fl_Group (and thus for -Fl_Window as well). begin() is exactly the same as current(this). +begin() sets the current group so you can build the widget +tree by just constructing the widgets. begin() is +automatically called by the constructor for Fl_Group (and thus for +Fl_Window as well). begin() is exactly the same as current(this).

    Don't forget to end() the group or window!

    void Fl_Group::end()

    -end() is exactly the same as current(this->parent()). Any new widgets -added to the widget tree will be added to the parent of the group. +end() is exactly the same as current(this->parent()). Any new widgets +added to the widget tree will be added to the parent of the group.

    const Fl_Widget **Fl_Group::array() const

    Returns a pointer to the array of children. This pointer is only valid until the next time a child is added or removed.

    Fl_Widget *Fl_Group::child(int n) const

    Returns array()[n]. No range checking is done!

    int Fl_Group::children() const

    - Returns how many child widgets the group has. + Returns how many child widgets the group has.

    int Fl_Group::find(const Fl_Widget *w) const
    int Fl_Group::find(const Fl_Widget &w) const

    Searches the child array for the widget and returns the index. Returns children() if the widget is -NULL or not found. +NULL or not found.

    void Fl_Group::resizable(Fl_Widget *box)
    void Fl_Group::resizable(Fl_Widget &box)
    Fl_Widget *Fl_Group::resizable() const

    - The resizable widget defines the resizing box for the group. When the -group is resized it calculates a new size and position for all of its -children. Widgets that are horizontally or vertically inside the -dimensions of the box are scaled to the new size. Widgets outside the -box are moved. + The resizable widget defines the resizing box for the group. When the +group is resized it calculates a new size and position for all of its +children. Widgets that are horizontally or vertically inside the +dimensions of the box are scaled to the new size. Widgets outside the +box are moved.

    In these examples the gray area is the resizable:

    Resizeable groups   Resizeable groups

    -

    The resizable may be set to the group itself (this is the default -value for an Fl_Group, although NULL is the default -for an Fl_Window), in which case all the contents are resized. -If the resizable is NULL then all widgets remain a fixed size +

    The resizable may be set to the group itself (this is the default +value for an Fl_Group, although NULL is the default +for an Fl_Window), in which case all the contents are resized. +If the resizable is NULL then all widgets remain a fixed size and distance from the top-left corner.

    -

    It is possible to achieve any type of resize behavior by using an -invisible Fl_Box as the resizable and/or by using a hierarchy +

    It is possible to achieve any type of resize behavior by using an +invisible Fl_Box as the resizable and/or by using a hierarchy of child Fl_Group's.

    -

    Fl_Group +

    Fl_Group &Fl_Group::add_resizable(Fl_Widget &box)

    - Adds a widget to the group and makes it the resizable widget. + Adds a widget to the group and makes it the resizable widget. diff --git a/documentation/Fl_Hold_Browser.html b/documentation/Fl_Hold_Browser.html index 3cd7ba673..da9adf5ac 100644 --- a/documentation/Fl_Hold_Browser.html +++ b/documentation/Fl_Hold_Browser.html @@ -18,12 +18,12 @@

    Description

    The Fl_Hold_Browser class is a subclass of Fl_Browser - which lets the user select a single item, or no items by clicking on -the empty space. As long as the mouse button is held down the item -pointed to by it is highlighted, and this highlighting remains on when -the mouse button is released. Normally the callback is done when the -user releases the mouse, but you can change this with when(). -

    See Fl_Browser for + which lets the user select a single item, or no items by clicking on +the empty space. As long as the mouse button is held down the item +pointed to by it is highlighted, and this highlighting remains on when +the mouse button is released. Normally the callback is done when the +user releases the mouse, but you can change this with when(). +

    See Fl_Browser for methods to add and remove lines from the browser.

    Methods

      @@ -34,22 +34,22 @@ methods to add and remove lines from the browser.

    • value

    -Fl_Hold_Browser::Fl_Hold_Browser(int x, int y, int w, int h, const char +Fl_Hold_Browser::Fl_Hold_Browser(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Hold_Browser widget using the given + Creates a new Fl_Hold_Browser widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Hold_Browser::~Fl_Hold_Browser()

    - The destructor also deletes all the items in the list. + The destructor also deletes all the items in the list.

    int Fl_Browser::deselect()

    - Same as value(0). + Same as value(0).

    int Fl_Browser::select(int,int=1)
    int Fl_Browser::selected(int) const

    You can use these for compatibility with -Fl_Multi_Browser. If you turn on the selection of more -than one line the results are unpredictable. +Fl_Multi_Browser. If you turn on the selection of more +than one line the results are unpredictable.

    int Fl_Browser::value() const
    void Fl_Browser::value(int)

    - Set or get which line is selected. This returns zero if no line is + Set or get which line is selected. This returns zero if no line is selected, so be aware that this can happen in a callback. diff --git a/documentation/Fl_Input.html b/documentation/Fl_Input.html index a99da8d93..5474d5e37 100644 --- a/documentation/Fl_Input.html +++ b/documentation/Fl_Input.html @@ -20,13 +20,13 @@

    Description

    -

    This is the FLTK text input widget. It displays a single line of text -and lets the user edit it. Normally it is drawn with an inset box and -a white background. The text may contain any characters (even 0), and -will correctly display anything, using ^X notation for unprintable -control characters and \nnn notation for unprintable characters with -the high bit set. It assumes the font can draw any characters in the -ISO-8859-1 character set. +

    This is the FLTK text input widget. It displays a single line of text +and lets the user edit it. Normally it is drawn with an inset box and +a white background. The text may contain any characters (even 0), and +will correctly display anything, using ^X notation for unprintable +control characters and \nnn notation for unprintable characters with +the high bit set. It assumes the font can draw any characters in the +ISO-8859-1 character set.

    @@ -43,32 +43,32 @@ clipboard by selecting the region with mouse button 2. - - - - - - - -
    Mouse button 3Currently acts like button 1.
    BackspaceDeletes one character to the left, or +
    BackspaceDeletes one character to the left, or deletes the selected region.
    EnterMay cause the callback, see when().
    ^A or HomeGo to start of line.
    ^B or LeftMove left
    ^CCopy the selection to the clipboard
    ^D or DeleteDeletes one character to the right +
    ^D or DeleteDeletes one character to the right or deletes the selected region.
    ^E or EndGo to the end of line.
    ^F or RightMove right
    ^KDelete to the end of line (next \n character) -or deletes a single \n character. These deletions are all concatenated +
    ^KDelete to the end of line (next \n character) +or deletes a single \n character. These deletions are all concatenated into the clipboard.
    ^N or DownMove down (for Fl_Multiline_Input +
    ^N or DownMove down (for Fl_Multiline_Input only, otherwise it moves to the next input field).
    ^P or UpMove up (for Fl_Multiline_Input only, +
    ^P or UpMove up (for Fl_Multiline_Input only, otherwise it moves to the previous input field).
    ^UDelete everything.
    ^V or ^YPaste the clipboard
    ^X or ^WCopy the region to the clipboard and +
    ^X or ^WCopy the region to the clipboard and delete it.
    ^Z or ^_Undo. This is a single-level undo -mechanism, but all adjacent deletions and insertions are concatenated -into a single "undo". Often this will undo a lot more than you +
    ^Z or ^_Undo. This is a single-level undo +mechanism, but all adjacent deletions and insertions are concatenated +into a single "undo". Often this will undo a lot more than you expected.
    Shift+moveMove the cursor but also extend the +
    Shift+moveMove the cursor but also extend the selection.
    RightCtrl or @@ -259,76 +259,76 @@ inserted.
    -

    Fl_Input::Fl_Input(int x, int y, int w, +

    Fl_Input::Fl_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Input widget using the given position, size, -and label string. The default boxtype is FL_DOWN_BOX. + Creates a new Fl_Input widget using the given position, size, +and label string. The default boxtype is FL_DOWN_BOX.

    virtual Fl_Input::~Fl_Input()

    - Destroys the widget and any value associated with it. + Destroys the widget and any value associated with it.

    const char *Fl_Input::value() const
    int Fl_Input::value(const char*)
    int Fl_Input::value(const char*, int)

    - The first form returns the current value, which is a pointer to the -internal buffer and is valid only until the next event is handled. -

    The second two forms change the text and set the mark and the point + The first form returns the current value, which is a pointer to the +internal buffer and is valid only until the next event is handled. +

    The second two forms change the text and set the mark and the point to the end of it. The string is copied to the internal buffer. Passing -NULL is the same as "". This returns non-zero if the new value is -different than the current one. You can use the second version to -directly set the length if you know it already or want to put nul's in +NULL is the same as "". This returns non-zero if the new value is +different than the current one. You can use the second version to +directly set the length if you know it already or want to put nul's in the text.

    -

    int Fl_Input::static_value(const +

    int Fl_Input::static_value(const char*)
    int Fl_Input::static_value(const char*, int)

    - Change the text and set the mark and the point to the end of it. The -string is not copied. If the user edits the string it is copied -to the internal buffer then. This can save a great deal of time and -memory if your program is rapidly changing the values of text fields, -but this will only work if the passed string remains unchanged until -either the Fl_Input is destroyed or value() is called -again. + Change the text and set the mark and the point to the end of it. The +string is not copied. If the user edits the string it is copied +to the internal buffer then. This can save a great deal of time and +memory if your program is rapidly changing the values of text fields, +but this will only work if the passed string remains unchanged until +either the Fl_Input is destroyed or value() is called +again.

    int Fl_Input::size() const

    - Returns the number of characters in value(). This may be -greater than strlen(value()) if there are nul characters in -it. + Returns the number of characters in value(). This may be +greater than strlen(value()) if there are nul characters in +it.

    char Fl_Input::index(int) const

    - Same as value()[n], but may be faster in plausible -implementations. No bounds checking is done. + Same as value()[n], but may be faster in plausible +implementations. No bounds checking is done.

    Fl_When Fl_Widget::when() const
    void Fl_Widget::when(Fl_When)

    - Controls when callbacks are done. The following values are useful, -the default value is FL_WHEN_RELEASE: + Controls when callbacks are done. The following values are useful, +the default value is FL_WHEN_RELEASE:
      -
    • 0: The callback is not done, but changed() is +
    • 0: The callback is not done, but changed() is turned on.
    • -
    • FL_WHEN_CHANGED: The callback is done each time the text +
    • FL_WHEN_CHANGED: The callback is done each time the text is changed by the user.
    • -
    • FL_WHEN_RELEASE: The callback will be done when this -widget loses the focus, including when the window is unmapped. This -is a useful value for text fields in a panel where doing the callback -on every change is wasteful. However the callback will also happen if -the mouse is moved out of the window, which means it should not do -anything visible (like pop up an error message). You might do better +
    • FL_WHEN_RELEASE: The callback will be done when this +widget loses the focus, including when the window is unmapped. This +is a useful value for text fields in a panel where doing the callback +on every change is wasteful. However the callback will also happen if +the mouse is moved out of the window, which means it should not do +anything visible (like pop up an error message). You might do better setting this to zero, and scanning all the items for changed() when the OK button on a panel is pressed.
    • -
    • FL_WHEN_ENTER_KEY: If the user types the Enter key, the -entire text is selected, and the callback is done if the text has -changed. Normally the Enter key will navigate to the next field (or -insert a newline for a Fl_Mulitline_Input), this changes the +
    • FL_WHEN_ENTER_KEY: If the user types the Enter key, the +entire text is selected, and the callback is done if the text has +changed. Normally the Enter key will navigate to the next field (or +insert a newline for a Fl_Mulitline_Input), this changes the behavior.
    • -
    • FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will -do the callback even if the text has not changed. Useful for command +
    • FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will +do the callback even if the text has not changed. Useful for command fields.

    Fl_Color Fl_Input::textcolor() const
    void Fl_Input::textcolor(Fl_Color)

    - Gets or sets the color of the text in the input field. + Gets or sets the color of the text in the input field.

    Fl_Font Fl_Input::textfont() const
    void Fl_Input::textfont(Fl_Font)

    - Gets or sets the font of the text in the input field. + Gets or sets the font of the text in the input field.

    uchar Fl_Input::textsize() const
    void Fl_Input::textsize(uchar)

    - Gets or sets the size of the text in the input field. -

    Fl_Color Fl_Input::cursor_color() + Gets or sets the size of the text in the input field. +

    Fl_Color Fl_Input::cursor_color() const
    void Fl_Input::cursor_color(Fl_Color)

    Get or set the color of the cursor. This is black by default. diff --git a/documentation/Fl_Input_.html b/documentation/Fl_Input_.html index c2e4a617b..18790d0ea 100644 --- a/documentation/Fl_Input_.html +++ b/documentation/Fl_Input_.html @@ -21,9 +21,9 @@

    Description

    This is a virtual base class below Fl_Input. It has all the same interfaces, but lacks the -handle() and draw() method. You may want to subclass it -if you are one of those people who likes to change how the editing keys -work. +handle() and draw() method. You may want to subclass it +if you are one of those people who likes to change how the editing keys +work.

    This can act like any of the subclasses of Fl_Input, by setting type() to one of the following values:

    -

    Fl_Int_Input::Fl_Int_Input(int x, +

    Fl_Int_Input::Fl_Int_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Int_Input widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. -

    virtual + Creates a new Fl_Int_Input widget using the given position, +size, and label string. The default boxtype is FL_DOWN_BOX. +

    virtual Fl_Int_Input::~Fl_Int_Input()

    Destroys the widget and any value associated with it. diff --git a/documentation/Fl_Light_Button.html b/documentation/Fl_Light_Button.html index c7598a7a2..a5e597ef3 100644 --- a/documentation/Fl_Light_Button.html +++ b/documentation/Fl_Light_Button.html @@ -17,14 +17,14 @@

    Description

    -Buttons generate callbacks when they are clicked by the user. You +Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() -and when(). +and when().

    Fl_Light_Button widget.

    -

    The Fl_Light_Button subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_DOWN_BOX. The color of the light when -on is controlled with selection_color(), which defaults to +

    The Fl_Light_Button subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_DOWN_BOX. The color of the light when +on is controlled with selection_color(), which defaults to FL_YELLOW.

    Methods

    -Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char +Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Light_Button widget using the given -position, size, and label string. + Creates a new Fl_Light_Button widget using the given +position, size, and label string.

    Fl_Light_Button::~Fl_Light_Button()

    The destructor deletes the check button. diff --git a/documentation/Fl_Menu_.html b/documentation/Fl_Menu_.html index ba6ad06dd..bc34198f6 100644 --- a/documentation/Fl_Menu_.html +++ b/documentation/Fl_Menu_.html @@ -19,11 +19,11 @@

    Description

    -All widgets that have a menu in FLTK are subclassed off of this class. +All widgets that have a menu in FLTK are subclassed off of this class. Currently FLTK provides you with Fl_Menu_Button, Fl_Menu_Bar, and Fl_Choice -. +.

    The class contains a pointer to an array of structures of type Fl_Menu_Item. The @@ -71,7 +71,7 @@ be "private": a dynamically allocated array managed by the Fl_Menu_. -

    Fl_Menu_::Fl_Menu_(int x, int y, int w, +

    Fl_Menu_::Fl_Menu_(int x, int y, int w, int h, const char *label = 0)

    Creates a new Fl_Menu_ widget using the given position, size, @@ -124,9 +124,9 @@ will result in a submenu called "foo" and one in that called copied to new memory and can be freed. The other arguments (including the shortcut) are copied into the menu item unchanged.

    -

    If an item exists already with that name then it is replaced with -this new one. Otherwise this new one is added to the end of the -correct menu or submenu. The return value is the offset into the array +

    If an item exists already with that name then it is replaced with +this new one. Otherwise this new one is added to the end of the +correct menu or submenu. The return value is the offset into the array that the new entry was placed at.

    The return value is the index into the array that the entry was put.

    @@ -163,42 +163,42 @@ href=Fl_Menu_Item.html>Fl_Menu_Item.
    int Fl_Menu_::value(int)
    const Fl_Menu_Item* mvalue() const
    int Fl_Menu_::value(const Fl_Menu_Item*)

    - The value is the index into menu() of the last item chosen by -the user. It is zero initially. You can set it as an integer, or set -it with a pointer to a menu item. The set routines return non-zero if -the new value is different than the old one. + The value is the index into menu() of the last item chosen by +the user. It is zero initially. You can set it as an integer, or set +it with a pointer to a menu item. The set routines return non-zero if +the new value is different than the old one. -

    const Fl_Menu_Item* +

    const Fl_Menu_Item* Fl_Menu_::test_shortcut()

    - Only call this in response to FL_SHORTCUT events. If the -event matches an entry in the menu that entry is selected and the -callback will be done (or changed() will be set). This allows -shortcuts directed at one window to call menus in another. + Only call this in response to FL_SHORTCUT events. If the +event matches an entry in the menu that entry is selected and the +callback will be done (or changed() will be set). This allows +shortcuts directed at one window to call menus in another.

    void Fl_Menu_::global()

    - Make the shortcuts for this menu work no matter what window has the + Make the shortcuts for this menu work no matter what window has the focus when you type it. This is done by using -Fl::add_handler(). This Fl_Menu_ widget does not -have to be visible (ie the window it is in can be hidden, or it does -not have to be put in a window at all). -

    Currently there can be only one global()menu. Setting a new +Fl::add_handler(). This Fl_Menu_ widget does not +have to be visible (ie the window it is in can be hidden, or it does +not have to be put in a window at all). +

    Currently there can be only one global()menu. Setting a new one will replace the old one. There is no way to remove the global() setting (so don't destroy the widget!)

    const char* Fl_Menu_::text() const
    const char* Fl_Menu_::text(int i) const

    - Returns the title of the last item chosen, or of item i. + Returns the title of the last item chosen, or of item i.

    Fl_Color Fl_Menu_::textcolor() const
    void Fl_Menu_::textcolor(Fl_Color)

    - Get or set the current color of menu item labels. + Get or set the current color of menu item labels.

    Fl_Font Fl_Menu_::textfont() const
    void Fl_Menu_::textfont(Fl_Font)

    - Get or set the current font of menu item labels. + Get or set the current font of menu item labels.

    uchar Fl_Menu_::textsize() const
    void Fl_Menu_::textsize(uchar)

    - Get or set the font size of menu item labels. + Get or set the font size of menu item labels.

    Fl_Boxtype Fl_Menu_::down_box() const
    void Fl_Menu_::down_box(Fl_Boxtype)

    - This box type is used to surround the currently-selected items in the + This box type is used to surround the currently-selected items in the menus. If this is FL_NO_BOX then it acts like FL_THIN_UP_BOX and selection_color() acts like FL_WHITE, for back compatability. diff --git a/documentation/Fl_Menu_Bar.html b/documentation/Fl_Menu_Bar.html index 3fc543899..840bbbd86 100644 --- a/documentation/Fl_Menu_Bar.html +++ b/documentation/Fl_Menu_Bar.html @@ -17,47 +17,47 @@

    Description

    - This widget provides a standard menubar interface. Usually you will -put this widget along the top edge of your window. The height of the -widget should be 30 for the menu titles to draw correctly with the -default font. -

    The items on the bar and the menus they bring up are defined by a + This widget provides a standard menubar interface. Usually you will +put this widget along the top edge of your window. The height of the +widget should be 30 for the menu titles to draw correctly with the +default font. +

    The items on the bar and the menus they bring up are defined by a single Fl_Menu_Item - array. Because a Fl_Menu_Item array defines a hierarchy, the -top level menu defines the items in the menubar, while the submenus -define the pull-down menus. Sub-sub menus and lower pop up to the right + array. Because a Fl_Menu_Item array defines a hierarchy, the +top level menu defines the items in the menubar, while the submenus +define the pull-down menus. Sub-sub menus and lower pop up to the right of the submenus.

    Fl_Menu_Bar widget.

    -

    If there is an item in the top menu that is not a title of a -submenu, then it acts like a "button" in the menubar. Clicking on it +

    If there is an item in the top menu that is not a title of a +submenu, then it acts like a "button" in the menubar. Clicking on it will pick it.

    -

    When the user picks an item off the menu, the item's callback is -done with the menubar as the Fl_Widget* argument. If the item +

    When the user picks an item off the menu, the item's callback is +done with the menubar as the Fl_Widget* argument. If the item does not have a callback the menubar's callback is done instead.

    -

    Submenus will also pop up in response to shortcuts indicated by -putting a '&' character in the name field of the menu item. If you put a -'&' character in a top-level "button" then the shortcut picks it. The +

    Submenus will also pop up in response to shortcuts indicated by +putting a '&' character in the name field of the menu item. If you put a +'&' character in a top-level "button" then the shortcut picks it. The '&' character in submenus is ignored until the menu is popped up.

    -

    Typing the shortcut() of any of the menu items will cause +

    Typing the shortcut() of any of the menu items will cause callbacks exactly the same as when you pick the item with the mouse.

    Methods

    -

    Fl_Menu_Bar::Fl_Menu_Bar(int x, int +

    Fl_Menu_Bar::Fl_Menu_Bar(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Menu_Bar widget using the given position, -size, and label string. The default boxtype is FL_UP_BOX. + Creates a new Fl_Menu_Bar widget using the given position, +size, and label string. The default boxtype is FL_UP_BOX.

    The constructor sets menu() to NULL. See Fl_Menu_ for the methods to set or change the menu.

    labelsize(), labelfont(), and labelcolor() - are used to control how the menubar items are drawn. They are -initialized from the Fl_Menu static variables, but you can + are used to control how the menubar items are drawn. They are +initialized from the Fl_Menu static variables, but you can change them if desired.

    -

    label() is ignored unless you change align() to +

    label() is ignored unless you change align() to put it outside the menubar.

    virtual Fl_Menu_Bar::~Fl_Menu_Bar()

    - The destructor removes the Fl_Menu_Bar widget and all of its + The destructor removes the Fl_Menu_Bar widget and all of its menu items. diff --git a/documentation/Fl_Menu_Button.html b/documentation/Fl_Menu_Button.html index b8e4a382d..602a50472 100644 --- a/documentation/Fl_Menu_Button.html +++ b/documentation/Fl_Menu_Button.html @@ -17,23 +17,23 @@

    Description

    - This is a button that when pushed pops up a menu (or hierarchy of + This is a button that when pushed pops up a menu (or hierarchy of menus) defined by an array of -Fl_Menu_Item objects. +Fl_Menu_Item objects.

    Fl_Menu_Button widget.

    -

    Normally any mouse button will pop up a menu and it is lined up +

    Normally any mouse button will pop up a menu and it is lined up below the button as shown in the picture. However an Fl_Menu_Button may also control a pop-up menu. This is done by setting the type() , see below.

    -

    The menu will also pop up in response to shortcuts indicated by +

    The menu will also pop up in response to shortcuts indicated by putting a '&' character in the label().

    -

    Typing the shortcut() of any of the menu items will cause -callbacks exactly the same as when you pick the item with the mouse. - The '&' character in menu item names are only looked at when the menu is +

    Typing the shortcut() of any of the menu items will cause +callbacks exactly the same as when you pick the item with the mouse. + The '&' character in menu item names are only looked at when the menu is popped up, however.

    -

    When the user picks an item off the menu, the item's callback is -done with the menu_button as the Fl_Widget* argument. If the -item does not have a callback the menu_button's callback is done +

    When the user picks an item off the menu, the item's callback is +done with the menu_button as the Fl_Widget* argument. If the +item does not have a callback the menu_button's callback is done instead.

    Methods

      @@ -43,37 +43,37 @@ instead.

    • type

    -Fl_Menu_Button::Fl_Menu_Button(int x, int y, int w, int h, const char +Fl_Menu_Button::Fl_Menu_Button(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Menu_Button widget using the given position, -size, and label string. The default boxtype is FL_UP_BOX. + Creates a new Fl_Menu_Button widget using the given position, +size, and label string. The default boxtype is FL_UP_BOX.

    The constructor sets menu() to NULL. See Fl_Menu_ for the methods to set or change the menu.

    -

    virtual +

    virtual Fl_Menu_Button::~Fl_Menu_Button()

    - The destructor removes the Fl_Menu_Button widget and all of -its menu items. + The destructor removes the Fl_Menu_Button widget and all of +its menu items.

    const Fl_Menu* Fl_Menu_Button::popup()

    - Act exactly as though the user clicked the button or typed the -shortcut key. The menu appears, it waits for the user to pick an item, -and if they pick one it sets value() and does the callback or -sets changed() as described above. The menu item is returned -or NULL if the user dismisses the menu. + Act exactly as though the user clicked the button or typed the +shortcut key. The menu appears, it waits for the user to pick an item, +and if they pick one it sets value() and does the callback or +sets changed() as described above. The menu item is returned +or NULL if the user dismisses the menu.

    void Fl_Menu_Button::type(uchar)

    - If type() is zero a normal menu button is produced. If it is + If type() is zero a normal menu button is produced. If it is nonzero then this is a pop-up menu. The bits in type() - indicate what mouse buttons pop up the menu. For convienece the -constants Fl_Menu_Button::POPUP1, POPUP2, POPUP3, POPUP12, POPUP13, + indicate what mouse buttons pop up the menu. For convienece the +constants Fl_Menu_Button::POPUP1, POPUP2, POPUP3, POPUP12, POPUP13, POPUP23, and POPUP123 are defined. -Fl_Menu_Button::POPUP3 is usually what you want. -

    A popup menu button is invisible and does not interfere with any -events other than the mouse button specified (and any shortcuts). The -widget can be stretched to cover all your other widgets by putting it -last in the hierarchy so it is "on top". You can also make several +Fl_Menu_Button::POPUP3 is usually what you want. +

    A popup menu button is invisible and does not interfere with any +events other than the mouse button specified (and any shortcuts). The +widget can be stretched to cover all your other widgets by putting it +last in the hierarchy so it is "on top". You can also make several widgets covering different areas for context-sensitive popup menus.

    -

    The popup menus appear with the cursor pointing at the previously +

    The popup menus appear with the cursor pointing at the previously selected item. This is a feature. If you don't like it, do -value(0) after the menu items are picked to forget the current +value(0) after the menu items are picked to forget the current item.

    diff --git a/documentation/Fl_Menu_Item.html b/documentation/Fl_Menu_Item.html index bb8e495c1..582088f2e 100644 --- a/documentation/Fl_Menu_Item.html +++ b/documentation/Fl_Menu_Item.html @@ -47,7 +47,7 @@ enum { // values for flags: }; -Typically menu items are statically defined; for example: +Typically menu items are statically defined; for example:

    Description

    - The Fl_Menu_Window widget is a window type used for menus. By -default the window is drawn in the hardware overlay planes if they are -available so that the menu don't force the rest of the window to -redraw. + The Fl_Menu_Window widget is a window type used for menus. By +default the window is drawn in the hardware overlay planes if they are +available so that the menu don't force the rest of the window to +redraw.

    Methods

    -Fl_Menu_Window::Fl_Menu_Window(int x, int y, int w, int h, const char +Fl_Menu_Window::Fl_Menu_Window(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Menu_Window widget using the given position, -size, and label string. -

    virtual + Creates a new Fl_Menu_Window widget using the given position, +size, and label string. +

    virtual Fl_Menu_Window::~Fl_Menu_Window()

    - Destroys the window and all of its children. + Destroys the window and all of its children.

    Fl_Menu_Window::clear_overlay();

    - Tells FLTK to use normal drawing planes instead of overlay planes. -This is usually necessary if your menu contains multi-color pixmaps. + Tells FLTK to use normal drawing planes instead of overlay planes. +This is usually necessary if your menu contains multi-color pixmaps.

    Fl_Menu_Window::set_overlay()

    Tells FLTK to use hardware overlay planes if they are available. diff --git a/documentation/Fl_Multi_Browser.html b/documentation/Fl_Multi_Browser.html index 350fb9ca4..49e691ba7 100644 --- a/documentation/Fl_Multi_Browser.html +++ b/documentation/Fl_Multi_Browser.html @@ -18,13 +18,13 @@

    Description

    The Fl_Multi_Browser class is a subclass of Fl_Browser - which lets the user select any set of the lines. The user interface -is Macintosh style: clicking an item turns off all the others and -selects that one, dragging selects all the items the mouse moves over, -and shift + click toggles the items. This is different then how forms -did it. Normally the callback is done when the user releases the -mouse, but you can change this with when(). -

    See Fl_Browser for + which lets the user select any set of the lines. The user interface +is Macintosh style: clicking an item turns off all the others and +selects that one, dragging selects all the items the mouse moves over, +and shift + click toggles the items. This is different then how forms +did it. Normally the callback is done when the user releases the +mouse, but you can change this with when(). +

    See Fl_Browser for methods to add and remove lines from the browser.

    Methods

      @@ -35,22 +35,22 @@ methods to add and remove lines from the browser.

    • value

    -Fl_Multi_Browser::Fl_Multi_Browser(int x, int y, int w, int h, const +Fl_Multi_Browser::Fl_Multi_Browser(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Multi_Browser widget using the given + Creates a new Fl_Multi_Browser widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Multi_Browser::~Fl_Multi_Browser()

    - The destructor also deletes all the items in the list. + The destructor also deletes all the items in the list.

    int Fl_Browser::deselect()

    - Deselects all lines. + Deselects all lines.

    int Fl_Browser::select(int,int=1)
    int Fl_Browser::selected(int) const

    - Selects one or more lines or gets the current selection state of a -line. + Selects one or more lines or gets the current selection state of a +line.

    int Fl_Browser::value() const
    void Fl_Browser::value(int)

    - Selects a single line or gets the last toggled line. This returns zero -if no line has been toggled, so be aware that this can happen in a + Selects a single line or gets the last toggled line. This returns zero +if no line has been toggled, so be aware that this can happen in a callback. diff --git a/documentation/Fl_Multiline_Input.html b/documentation/Fl_Multiline_Input.html index dfec9c12d..dd8c4ab16 100644 --- a/documentation/Fl_Multiline_Input.html +++ b/documentation/Fl_Multiline_Input.html @@ -17,13 +17,13 @@

    Description

    - This input field displays '\n' characters as new lines rather than ^J, -and accepts the Return, Tab, and up and down arrow keys. This is for -editing multiline text. -

    This is far from the nirvana of text editors, and is probably only -good for small bits of text, 10 lines at most. I think FLTK can be -used to write a powerful text editor, but it is not going to be a -built-in feature. Powerful text editors in a toolkit are a big source + This input field displays '\n' characters as new lines rather than ^J, +and accepts the Return, Tab, and up and down arrow keys. This is for +editing multiline text. +

    This is far from the nirvana of text editors, and is probably only +good for small bits of text, 10 lines at most. I think FLTK can be +used to write a powerful text editor, but it is not going to be a +built-in feature. Powerful text editors in a toolkit are a big source of bloat.

    Methods

      @@ -33,11 +33,11 @@ of bloat.

    -Fl_Multiline_Input::Fl_Multiline_Input(int x, int y, int w, int h, +Fl_Multiline_Input::Fl_Multiline_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Multiline_Input widget using the given + Creates a new Fl_Multiline_Input widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Multiline_Input::~Fl_Multiline_Input()

    Destroys the widget and any value associated with it. diff --git a/documentation/Fl_Multiline_Output.html b/documentation/Fl_Multiline_Output.html index aad161675..6c7a08616 100644 --- a/documentation/Fl_Multiline_Output.html +++ b/documentation/Fl_Multiline_Output.html @@ -17,9 +17,9 @@

    Description

    - This widget is a subclass of Fl_Output that displays multiple -lines of text. It also displays tab characters as whitespace to the -next column. + This widget is a subclass of Fl_Output that displays multiple +lines of text. It also displays tab characters as whitespace to the +next column.

    Methods

    -Fl_Multiline_Output::Fl_Multiline_Output(int x, int y, int w, int h, +Fl_Multiline_Output::Fl_Multiline_Output(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Multiline_Output widget using the given + Creates a new Fl_Multiline_Output widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Multiline_Output::~Fl_Multiline_Output()

    Destroys the widget and any value associated with it. diff --git a/documentation/Fl_Output.html b/documentation/Fl_Output.html index fee6d91b9..d8fec183b 100644 --- a/documentation/Fl_Output.html +++ b/documentation/Fl_Output.html @@ -20,18 +20,18 @@

    Description

    This widget displays a piece of text. When you set the value() -, Fl_Output does a strcpy() to it's own storage, -which is useful for program-generated values. The user may select -portions of the text using the mouse and paste the contents into other -fields or programs. +, Fl_Output does a strcpy() to it's own storage, +which is useful for program-generated values. The user may select +portions of the text using the mouse and paste the contents into other +fields or programs.
    Fl_Output widget.

    There is a single subclass, -Fl_Multiline_Output, which allows you to display multiple lines of +Fl_Multiline_Output, which allows you to display multiple lines of text.

    -

    The text may contain any characters except \0, and will correctly -display anything, using ^X notation for unprintable control characters -and \nnn notation for unprintable characters with the high bit set. It -assummes the font can draw any characters in the ISO-Latin1 character +

    The text may contain any characters except \0, and will correctly +display anything, using ^X notation for unprintable control characters +and \nnn notation for unprintable characters with the high bit set. It +assummes the font can draw any characters in the ISO-Latin1 character set.

    Methods

    -

    Fl_Output::Fl_Output(int x, int y, int +

    Fl_Output::Fl_Output(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Output widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. + Creates a new Fl_Output widget using the given position, +size, and label string. The default boxtype is FL_DOWN_BOX.

    virtual Fl_Output::~Fl_Output()

    - Destroys the widget and any value associated with it. + Destroys the widget and any value associated with it.

    const char *Fl_Output::value() const
    int Fl_Output::value(const char*)
    int Fl_Output::value(const char*, int)

    - The first form returns the current value, which is a pointer to the -internal buffer and is valid only until the value is changed. -

    The second two forms change the text and set the mark and the point + The first form returns the current value, which is a pointer to the +internal buffer and is valid only until the value is changed. +

    The second two forms change the text and set the mark and the point to the end of it. The string is copied to the internal buffer. Passing -NULL is the same as "". This returns non-zero if the new value is -different than the current one. You can use the second version to -directly set the length if you know it already or want to put nul's in +NULL is the same as "". This returns non-zero if the new value is +different than the current one. You can use the second version to +directly set the length if you know it already or want to put nul's in the text.

    int Fl_Output::size() const

    - Returns the number of characters in value(). This may be -greater than strlen(value()) if there are nul characters in -it. + Returns the number of characters in value(). This may be +greater than strlen(value()) if there are nul characters in +it.

    char Fl_Output::index(int) const

    - Same as value()[n], but may be faster in plausible -implementations. No bounds checking is done. + Same as value()[n], but may be faster in plausible +implementations. No bounds checking is done.

    Fl_Color Fl_Output::textcolor() const
    void Fl_Output::textcolor(Fl_Color)

    - Gets or sets the color of the text in the input field. + Gets or sets the color of the text in the input field.

    Fl_Font Fl_Output::textfont() const
    void Fl_Output::textfont(Fl_Font)

    - Gets or sets the font of the text in the input field. + Gets or sets the font of the text in the input field.

    uchar Fl_Output::textsize() const
    void Fl_Output::textsize(uchar)

    Gets or sets the size of the text in the input field. diff --git a/documentation/Fl_Overlay_Window.html b/documentation/Fl_Overlay_Window.html index 43401ec12..1a838196d 100644 --- a/documentation/Fl_Overlay_Window.html +++ b/documentation/Fl_Overlay_Window.html @@ -17,14 +17,14 @@

    Description

    - This window provides double buffering and also the ability to draw the -"overlay" which is another picture placed on top of the main image. The -overlay is designed to be a rapidly-changing but simple graphic such as -a mouse selection box. Fl_Overlay_Window uses the overlay -planes provided by your graphics hardware if they are available. -

    If no hardware support is found the overlay is simulated by drawing -directly into the on-screen copy of the double-buffered window, and -"erased" by copying the backbuffer over it again. This means the + This window provides double buffering and also the ability to draw the +"overlay" which is another picture placed on top of the main image. The +overlay is designed to be a rapidly-changing but simple graphic such as +a mouse selection box. Fl_Overlay_Window uses the overlay +planes provided by your graphics hardware if they are available. +

    If no hardware support is found the overlay is simulated by drawing +directly into the on-screen copy of the double-buffered window, and +"erased" by copying the backbuffer over it again. This means the overlay will blink if you change the image in the window.

    Methods

      @@ -34,23 +34,23 @@ overlay will blink if you change the image in the window.

    • redraw_overlay

    -Fl_Overlay_Window::Fl_Overlay_Window(int x, int y, int w, int h, const +Fl_Overlay_Window::Fl_Overlay_Window(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Overlay_Window widget using the given -position, size, and label (title) string. -

    virtual + Creates a new Fl_Overlay_Window widget using the given +position, size, and label (title) string. +

    virtual Fl_Overlay_Window::~Fl_Overlay_Window()

    - Destroys the window and all child widgets. -

    virtual void + Destroys the window and all child widgets. +

    virtual void Fl_Overlay_Window::draw_overlay() = 0

    - You must subclass Fl_Overlay_Window and provide this method. - It is just like a draw() method, except it draws the overlay. - The overlay will have already been "cleared" when this is called. You + You must subclass Fl_Overlay_Window and provide this method. + It is just like a draw() method, except it draws the overlay. + The overlay will have already been "cleared" when this is called. You can use any of the routines described in -<FL/fl_draw.H>. +<FL/fl_draw.H>.

    void Fl_Overlay_Window::redraw_overlay()

    - Call this to indicate that the overlay data has changed and needs to -be redrawn. The overlay will be clear until the first time this is -called, so if you want an initial display you must call this after + Call this to indicate that the overlay data has changed and needs to +be redrawn. The overlay will be clear until the first time this is +called, so if you want an initial display you must call this after calling show(). diff --git a/documentation/Fl_Pack.html b/documentation/Fl_Pack.html index a26e81e5c..ae1fd2477 100644 --- a/documentation/Fl_Pack.html +++ b/documentation/Fl_Pack.html @@ -17,15 +17,15 @@

    Description

    - This widget was designed to add the functionality of compressing and -aligning widgets. -

    If type() is FL_HORIZONTAL all the children are -resized to the height of the Fl_Pack, and are moved next to + This widget was designed to add the functionality of compressing and +aligning widgets. +

    If type() is FL_HORIZONTAL all the children are +resized to the height of the Fl_Pack, and are moved next to each other horizontally. If type() is not FL_HORIZONTAL - then the children are resized to the width and are stacked below each -other. Then the Fl_Pack resizes itself to surround the child + then the children are resized to the width and are stacked below each +other. Then the Fl_Pack resizes itself to surround the child widgets.

    -

    This widget is needed for the Fl_Tabs. +

    This widget is needed for the Fl_Tabs. In addition you may want to put the Fl_Pack inside an Fl_Scroll.

    Methods

    @@ -34,18 +34,18 @@ widgets.

  • ~Fl_Pack
  • spacing
  • -

    Fl_Pack::Fl_Pack(int x, int y, int w, int +

    Fl_Pack::Fl_Pack(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Pack widget using the given position, size, -and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Pack widget using the given position, size, +and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Pack::~Fl_Pack()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Pack and all of it's children can be automatic (local) -variables, but you must declare the Fl_Packfirst, so -that it is destroyed last. +Fl_Pack and all of it's children can be automatic (local) +variables, but you must declare the Fl_Packfirst, so +that it is destroyed last.

    int Fl_Pack::spacing() const
    void Fl_Pack::spacing(int)

    - Gets or sets the number of extra pixels of blank space that are added + Gets or sets the number of extra pixels of blank space that are added between the children. diff --git a/documentation/Fl_Positioner.html b/documentation/Fl_Positioner.html index 2cf1f2727..f70d8cef1 100644 --- a/documentation/Fl_Positioner.html +++ b/documentation/Fl_Positioner.html @@ -17,10 +17,10 @@

    Description

    - This class is provided for Forms compatibility. It provides 2D input. -It would be useful if this could be put atop another widget so that the -crosshairs are on top, but this is not implemented. The color of the -crosshairs is selection_color(). + This class is provided for Forms compatibility. It provides 2D input. +It would be useful if this could be put atop another widget so that the +crosshairs are on top, but this is not implemented. The color of the +crosshairs is selection_color().

    Fl_Positioner widget.

    Methods

    @@ -41,29 +41,29 @@ crosshairs is selection_color().

    -Fl_Positioner::Fl_Positioner(int x, int y, int w, int h, const char +Fl_Positioner::Fl_Positioner(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Positioner widget using the given position, -size, and label string. The default boxtype is FL_NO_BOX. -

    virtual + Creates a new Fl_Positioner widget using the given position, +size, and label string. The default boxtype is FL_NO_BOX. +

    virtual Fl_Positioner::~Fl_Positioner()

    - Deletes the widget. -

    void Fl_Positioner::value(float *x, + Deletes the widget. +

    void Fl_Positioner::value(float *x, float *y) const

    - Returns the current position in x and y. + Returns the current position in x and y.

    void xbounds(float *xmin, float *xmax)
    void xbounds(float xmin, float xmax)

    - Gets or sets the X axis bounds. + Gets or sets the X axis bounds.

    void xstep(float x)

    - Sets the stepping value for the X axis. + Sets the stepping value for the X axis.

    float Fl_Positioner::xvalue(void) const
    void Fl_Positioner::xvalue(float x)

    - Gets or sets the X axis coordinate. + Gets or sets the X axis coordinate.

    void ybounds(float *ymin, float *ymay)
    void ybounds(float ymin, float ymay)

    - Gets or sets the Y axis bounds. + Gets or sets the Y axis bounds.

    void ystep(float y)

    - Sets the stepping value for the Y axis. + Sets the stepping value for the Y axis.

    float Fl_Positioner::yvalue(void) const
    void Fl_Positioner::yvalue(float y)

    Gets or sets the Y axis coordinate. diff --git a/documentation/Fl_Repeat_Button.html b/documentation/Fl_Repeat_Button.html index bea62f78c..fe94d54b0 100644 --- a/documentation/Fl_Repeat_Button.html +++ b/documentation/Fl_Repeat_Button.html @@ -14,21 +14,21 @@
    #include <FL/Fl_Repeat_Button.H>

    Description

    - The Fl_Repeat_Button is a subclass of Fl_Button that -generates a callback when it is pressed and then repeatedly generates -callbacks as long as it is held down. The speed of the repeat is fixed -and depends on the implementation. + The Fl_Repeat_Button is a subclass of Fl_Button that +generates a callback when it is pressed and then repeatedly generates +callbacks as long as it is held down. The speed of the repeat is fixed +and depends on the implementation.

    Methods

    -Fl_Repeat_Button::Fl_Repeat_Button(int x, int y, int w, int h, const +Fl_Repeat_Button::Fl_Repeat_Button(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Repeat_Button widget using the given + Creates a new Fl_Repeat_Button widget using the given position, size, and label string. The default boxtype is FL_UP_BOX -. -

    virtual +. +

    virtual Fl_Repeat_Button::~Fl_Repeat_Button()

    Deletes the button. diff --git a/documentation/Fl_Return_Button.html b/documentation/Fl_Return_Button.html index 1acc552de..6c11ae9c3 100644 --- a/documentation/Fl_Return_Button.html +++ b/documentation/Fl_Return_Button.html @@ -14,9 +14,9 @@
    #include <FL/Fl_Return_Button.H>

    Description

    -The Fl_Return_Button is a subclass of Fl_Button that -generates a callback when it is pressed or when the user presses the -Enter key. A carriage-return symbol is drawn next to the button label. +The Fl_Return_Button is a subclass of Fl_Button that +generates a callback when it is pressed or when the user presses the +Enter key. A carriage-return symbol is drawn next to the button label.

    Fl_Return_Button widget.

    Methods

      @@ -24,11 +24,11 @@ Enter key. A carriage-return symbol is drawn next to the button label.
    • ~Fl_Return_Button

    -Fl_Return_Button::Fl_Return_Button(int x, int y, int w, int h, const +Fl_Return_Button::Fl_Return_Button(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Return_Button widget using the given + Creates a new Fl_Return_Button widget using the given position, size, and label string. The default boxtype is FL_UP_BOX -. -

    virtual +. +

    virtual Fl_Return_Button::~Fl_Return_Button()

    Deletes the button. diff --git a/documentation/Fl_Roller.html b/documentation/Fl_Roller.html index d423d23d0..8c0077269 100644 --- a/documentation/Fl_Roller.html +++ b/documentation/Fl_Roller.html @@ -17,17 +17,17 @@

    Description

    - The Fl_Roller widget is a "dolly" control commonly used to -move 3D objects. + The Fl_Roller widget is a "dolly" control commonly used to +move 3D objects.

    Fl_Roller widget.

    Methods

    -

    Fl_Roller::Fl_Roller(int x, int y, int +

    Fl_Roller::Fl_Roller(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Roller widget using the given position, -size, and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Roller widget using the given position, +size, and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Roller::~Fl_Roller()

    Destroys the valuator. diff --git a/documentation/Fl_Round_Button.html b/documentation/Fl_Round_Button.html index de82d14d9..f462901c5 100644 --- a/documentation/Fl_Round_Button.html +++ b/documentation/Fl_Round_Button.html @@ -17,14 +17,14 @@

    Description

    -Buttons generate callbacks when they are clicked by the user. You +Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() -and when(). +and when().

    Fl_Round_Button widget.

    -

    The Fl_Round_Button subclass display the "on" state by -turning on a light, rather than drawing pushed in. The shape of the -"light" is initially set to FL_ROUND_DOWN_BOX. The color of the light -when on is controlled with selection_color(), which defaults to +

    The Fl_Round_Button subclass display the "on" state by +turning on a light, rather than drawing pushed in. The shape of the +"light" is initially set to FL_ROUND_DOWN_BOX. The color of the light +when on is controlled with selection_color(), which defaults to FL_RED.

    Methods

    -Fl_Round_Button::Fl_Round_Button(int x, int y, int w, int h, const char +Fl_Round_Button::Fl_Round_Button(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Round_Button widget using the given -position, size, and label string. + Creates a new Fl_Round_Button widget using the given +position, size, and label string.

    Fl_Round_Button::~Fl_Round_Button()

    The destructor deletes the check button. diff --git a/documentation/Fl_Scroll.html b/documentation/Fl_Scroll.html index c76b4a94c..5b68214ab 100644 --- a/documentation/Fl_Scroll.html +++ b/documentation/Fl_Scroll.html @@ -17,36 +17,36 @@

    Description

    - This container widget lets you maneuver around a set of widgets much -larger than your window. If the child widgets are larger than the size -of this object then scrollbars will appear so that you can scroll over -to them: + This container widget lets you maneuver around a set of widgets much +larger than your window. If the child widgets are larger than the size +of this object then scrollbars will appear so that you can scroll over +to them:

    Fl_Scroll widget.

    -

    If all of the child widgets are packed together into a solid -rectangle then you want to set box() to FL_NO_BOX or -one of the _FRAME types. This will result in the best output. +

    If all of the child widgets are packed together into a solid +rectangle then you want to set box() to FL_NO_BOX or +one of the _FRAME types. This will result in the best output. However, if the child widgets are a sparse arrangment you must set -box() to a real _BOX type. This can result in some +box() to a real _BOX type. This can result in some blinking during redrawing, but that can be solved by using a Fl_Double_Window.

    -

    This widget can also be used to pan around a single child widget +

    This widget can also be used to pan around a single child widget "canvas". This child widget should be of your own class, with a -draw() method that draws the contents. The scrolling is done by -changing the x() and y() of the widget, so this child -must use the x() and y() to position it's drawing. +draw() method that draws the contents. The scrolling is done by +changing the x() and y() of the widget, so this child +must use the x() and y() to position it's drawing. To speed up drawing it should test fl_clip() .

    Another very useful child is a single -Fl_Pack, which is itself a group that packs it's children +Fl_Pack, which is itself a group that packs it's children together and changes size to surround them. Filling the Fl_Pack - with Fl_Tabs groups (and then putting -normal widgets inside those) gives you a very powerful scrolling list + with Fl_Tabs groups (and then putting +normal widgets inside those) gives you a very powerful scrolling list of individually-openable panels.

    -

    Fluid lets you create these, but you can only lay out objects that -fit inside the Fl_Scroll without scrolling. Be sure to leave +

    Fluid lets you create these, but you can only lay out objects that +fit inside the Fl_Scroll without scrolling. Be sure to leave space for the scrollbars, as Fluid won't show these either.

    -

    You cannot use Fl_Window as a child of this since the -clipping is not conveyed to it when drawn, and it will draw over the +

    You cannot use Fl_Window as a child of this since the +clipping is not conveyed to it when drawn, and it will draw over the scrollbars and neighboring objects.

    Methods

    -

    Fl_Scroll::Fl_Scroll(int x, int y, int +

    Fl_Scroll::Fl_Scroll(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Scroll widget using the given position, -size, and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Scroll widget using the given position, +size, and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Scroll::~Fl_Scroll()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Scroll and all of it's children can be automatic (local) -variables, but you must declare the Fl_Scrollfirst, so -that it is destroyed last. +Fl_Scroll and all of it's children can be automatic (local) +variables, but you must declare the Fl_Scrollfirst, so +that it is destroyed last.

    void Fl_Widget::type(int)

    - By default you can scroll in both directions, and the scrollbars + By default you can scroll in both directions, and the scrollbars disappear if the data will fit in the area of the scroll. type() - can change this: + can change this:
    • 0 - No scrollbars
    • Fl_Scroll::HORIZONTAL - Only a horizontal scrollbar.
    • Fl_Scroll::VERTICAL - Only a vertical scrollbar.
    • Fl_Scroll::BOTH - The default is both scrollbars.
    • -
    • Fl_Scroll::HORIZONTAL_ALWAYS - Horizontal scrollbar +
    • Fl_Scroll::HORIZONTAL_ALWAYS - Horizontal scrollbar always on, vertical always off.
    • -
    • Fl_Scroll::VERTICAL_ALWAYS - Vertical scrollbar always on, +
    • Fl_Scroll::VERTICAL_ALWAYS - Vertical scrollbar always on, horizontal always off.
    • Fl_Scroll::BOTH_ALWAYS - Both always on.

    void Fl_Scroll::scrollbar.align(int)
    void Fl_Scroll::hscrollbar.align(int)

    This is used to change what side the scrollbars are drawn on. If the -FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. - If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on -the top. +FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. + If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on +the top.

    int Fl_Scroll::xposition() const

    - Gets the current horizontal scrolling position. + Gets the current horizontal scrolling position.

    int Fl_Scroll::yposition() const

    - Gets the current vertical scrolling position. + Gets the current vertical scrolling position.

    void Fl_Scroll::position(int w, int h)

    Sets the upper-lefthand corner of the scrolling region. diff --git a/documentation/Fl_Scrollbar.html b/documentation/Fl_Scrollbar.html index e05de38a5..b1d9123da 100644 --- a/documentation/Fl_Scrollbar.html +++ b/documentation/Fl_Scrollbar.html @@ -17,15 +17,15 @@

    Description

    - The Fl_Scrollbar widget displays a slider with arrow buttons -at the ends of the scrollbar. Clicking on the arrows move up/left and + The Fl_Scrollbar widget displays a slider with arrow buttons +at the ends of the scrollbar. Clicking on the arrows move up/left and down/right by linesize(). Scrollbars also accept -FL_SHORTCUT events: the arrows move by linesize(), and +FL_SHORTCUT events: the arrows move by linesize(), and vertical scrollbars take Page Up/Down (they move by the page size minus -linesize()) and Home/End (they jump to the top or bottom). -

    Scrollbars have step(1) preset (they always return -integers). If desired you can set the step() to non-integer -values. You will then have to use casts to get at the floating-point +linesize()) and Home/End (they jump to the top or bottom). +

    Scrollbars have step(1) preset (they always return +integers). If desired you can set the step() to non-integer +values. You will then have to use casts to get at the floating-point versions of value() from Fl_Slider.

    Fl_Scrollbar widget.

    Methods

    @@ -35,26 +35,26 @@ versions of value() from Fl_Slider.

  • linesize
  • value
  • -

    Fl_Scrollbar::Fl_Scrollbar(int x, +

    Fl_Scrollbar::Fl_Scrollbar(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Scrollbar widget using the given position, -size, and label string. You need to do type(FL_HORIZONTAL) if -you want a horizontal scrollbar. -

    virtual + Creates a new Fl_Scrollbar widget using the given position, +size, and label string. You need to do type(FL_HORIZONTAL) if +you want a horizontal scrollbar. +

    virtual Fl_Scrollbar::~Fl_Scrollbar()

    - Destroys the valuator. + Destroys the valuator.

    int Fl_Scrollbar::linesize() const
    void Fl_Scrollbar::linesize(int i)

    - This number controls how big the steps are that the arrow keys do. In + This number controls how big the steps are that the arrow keys do. In addition page up/down move by the size last sent to value() - minus one linesize(). The default is 16. + minus one linesize(). The default is 16.

    int Fl_Scrollbar::value()
    int Fl_Scrollbar::value(int position, int size, int top, int total)

    - The first form returns the integer value of the scrollbar. You can get -the floating point value with Fl_Slider::value(). The second + The first form returns the integer value of the scrollbar. You can get +the floating point value with Fl_Slider::value(). The second form sets value(), range(), and slider_size() - to make a variable-sized scrollbar. You should call this every time -your window changes size, your data changes size, or your scroll -position changes (even if in response to a callback from this + to make a variable-sized scrollbar. You should call this every time +your window changes size, your data changes size, or your scroll +position changes (even if in response to a callback from this scrollbar). All necessary calls to redraw() are done. diff --git a/documentation/Fl_Secret_Input.html b/documentation/Fl_Secret_Input.html index 62f8ba96e..a861b6069 100644 --- a/documentation/Fl_Secret_Input.html +++ b/documentation/Fl_Secret_Input.html @@ -18,19 +18,19 @@

    Description

    The Fl_Secret_Input class is a subclass of Fl_Input - that displays its input as a string of asterisks. This subclass is -usually used to receive passwords and other "secret" information. + that displays its input as a string of asterisks. This subclass is +usually used to receive passwords and other "secret" information.

    Methods

    -Fl_Secret_Input::Fl_Secret_Input(int x, int y, int w, int h, const char +Fl_Secret_Input::Fl_Secret_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Secret_Input widget using the given + Creates a new Fl_Secret_Input widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Secret_Input::~Fl_Secret_Input()

    Destroys the widget and any value associated with it. diff --git a/documentation/Fl_Select_Browser.html b/documentation/Fl_Select_Browser.html index 002299527..42211e9a9 100644 --- a/documentation/Fl_Select_Browser.html +++ b/documentation/Fl_Select_Browser.html @@ -18,11 +18,11 @@

    Description

    The Fl_Select_Browser class is a subclass of Fl_Browser - which lets the user select a single item, or no items by clicking on -the empty space. As long as the mouse button is held down the item -pointed to by it is highlighted. Normally the callback is done when the -user presses the mouse, but you can change this with when(). -

    See Fl_Browser for + which lets the user select a single item, or no items by clicking on +the empty space. As long as the mouse button is held down the item +pointed to by it is highlighted. Normally the callback is done when the +user presses the mouse, but you can change this with when(). +

    See Fl_Browser for methods to add and remove lines from the browser.

    Methods

      @@ -33,21 +33,21 @@ methods to add and remove lines from the browser.

    • value

    -Fl_Select_Browser::Fl_Select_Browser(int x, int y, int w, int h, const +Fl_Select_Browser::Fl_Select_Browser(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Select_Browser widget using the given + Creates a new Fl_Select_Browser widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Select_Browser::~Fl_Select_Browser()

    - The destructor also deletes all the items in the list. + The destructor also deletes all the items in the list.

    int Fl_Browser::deselect()

    - Same as value(0). + Same as value(0).

    int Fl_Browser::select(int,int=1)
    int Fl_Browser::selected(int) const

    You can use these for compatibility with -Fl_Multi_Browser. If you turn on the selection of more -than one line the results are unpredictable. +Fl_Multi_Browser. If you turn on the selection of more +than one line the results are unpredictable.

    int Fl_Browser::value() const

    - Returns the number of the highlighted item, or zero if none. Notice + Returns the number of the highlighted item, or zero if none. Notice that this is going to be zero except during a callback! diff --git a/documentation/Fl_Single_Window.html b/documentation/Fl_Single_Window.html index e10493734..c6bc84bfa 100644 --- a/documentation/Fl_Single_Window.html +++ b/documentation/Fl_Single_Window.html @@ -17,22 +17,22 @@

    Description

    - This is the same as Fl_Window. However, it is possible that -some implementations will provide double-buffered windows by default. -This subclass can be used to force single-buffering. This may be -useful for modifying existing programs that use incremental update, or -for some types of image data, such as a movie flipbook. + This is the same as Fl_Window. However, it is possible that +some implementations will provide double-buffered windows by default. +This subclass can be used to force single-buffering. This may be +useful for modifying existing programs that use incremental update, or +for some types of image data, such as a movie flipbook.

    Methods

    -Fl_Single_Window::Fl_Single_Window(int x, int y, int w, int h, const +Fl_Single_Window::Fl_Single_Window(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Single_Window widget using the given -position, size, and label (title) string. -

    virtual + Creates a new Fl_Single_Window widget using the given +position, size, and label (title) string. +

    virtual Fl_Single_Window::~Fl_Single_Window()

    Destroys the window and all child widgets. diff --git a/documentation/Fl_Slider.html b/documentation/Fl_Slider.html index 80803e97e..c6f51d600 100644 --- a/documentation/Fl_Slider.html +++ b/documentation/Fl_Slider.html @@ -19,11 +19,11 @@

    Description

    - The Fl_Slider widget contains a sliding knob inside a box. It -if often used as a scrollbar. Moving the box all the way to the -top/left sets it to the minimum(), and to the bottom/right to + The Fl_Slider widget contains a sliding knob inside a box. It +if often used as a scrollbar. Moving the box all the way to the +top/left sets it to the minimum(), and to the bottom/right to the maximum(). The minimum() may be greater than the -maximum() to reverse the slider direction. +maximum() to reverse the slider direction.

    Fl_Slider widget.

    Methods

      @@ -34,45 +34,45 @@ maximum() to reverse the slider direction.
    • slider_size
    • type
    -

    Fl_Slider::Fl_Slider(int x, int y, int +

    Fl_Slider::Fl_Slider(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Slider widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. + Creates a new Fl_Slider widget using the given position, +size, and label string. The default boxtype is FL_DOWN_BOX.

    virtual Fl_Slider::~Fl_Slider()

    - Destroys the valuator. -

    int Fl_Slider::scrollvalue(int + Destroys the valuator. +

    int Fl_Slider::scrollvalue(int windowtop, int windowsize, int first, int totalsize)

    Returns -Fl_Scrollbar::value(). +Fl_Scrollbar::value().

    Fl_Boxtype Fl_Slider::slider() const
    void Fl_Slider::slider(Fl_Boxtype)

    - Set the type of box to draw for the moving part of the slider. The -color of the moving part (or of the notch in it for the nice sliders) -is controlled by selection_color(). The default value of zero -causes the slider to figure out what to draw from box(). + Set the type of box to draw for the moving part of the slider. The +color of the moving part (or of the notch in it for the nice sliders) +is controlled by selection_color(). The default value of zero +causes the slider to figure out what to draw from box().

    float Fl_Slider::slider_size() const
    void Fl_Slider::slider_size(float)

    - Get or set the dimensions of the moving piece of slider. This is the -fraction of the size of the entire widget. If you set this to 1 then -the slider cannot move. The default value is .08. -

    For the "fill" sliders this is the size of the area around the end -that causes a drag effect rather than causing the slider to jump to the + Get or set the dimensions of the moving piece of slider. This is the +fraction of the size of the entire widget. If you set this to 1 then +the slider cannot move. The default value is .08. +

    For the "fill" sliders this is the size of the area around the end +that causes a drag effect rather than causing the slider to jump to the mouse.

    uchar Fl_Widget::type() const
    void Fl_Widget::type(uchar t)

    - Setting this changes how the slider is drawn, which can be one of the -following: + Setting this changes how the slider is drawn, which can be one of the +following:
      -
    • FL_VERTICAL - Draws a vertical slider (this is the +
    • FL_VERTICAL - Draws a vertical slider (this is the default).
    • FL_HORIZONTAL - Draws a horizontal slider.
    • -
    • FL_VERT_FILL_SLIDER - Draws a filled vertical slider, +
    • FL_VERT_FILL_SLIDER - Draws a filled vertical slider, useful as a progress or value meter.
    • -
    • FL_HOR_FILL_SLIDER - Draws a filled horizontal slider, +
    • FL_HOR_FILL_SLIDER - Draws a filled horizontal slider, useful as a progress or value meter.
    • -
    • FL_VERT_NICE_SLIDER - Draws a vertical slider with a nice +
    • FL_VERT_NICE_SLIDER - Draws a vertical slider with a nice looking control knob.
    • -
    • FL_HOR_NICE_SLIDER - Draws a horizontal slider with a +
    • FL_HOR_NICE_SLIDER - Draws a horizontal slider with a nice looking control knob.
    diff --git a/documentation/Fl_Tabs.html b/documentation/Fl_Tabs.html index 69f49f0b8..4e1cfde4f 100644 --- a/documentation/Fl_Tabs.html +++ b/documentation/Fl_Tabs.html @@ -17,26 +17,26 @@

    Description

    - The Fl_Tabs widget is the "file card tabs" interface that -allows you to put lots and lots of buttons and switches in a panel, as -popularized by many toolkits. + The Fl_Tabs widget is the "file card tabs" interface that +allows you to put lots and lots of buttons and switches in a panel, as +popularized by many toolkits.

    Fl_Tabs widget.

    Clicking the tab makes a child visible() (by calling show() on it) and all other children are invisible (by calling hide() on them). Usually the children are -Fl_Group widgets containing several widgets +Fl_Group widgets containing several widgets themselves.

    -

    Each child makes a card, and it's label() is printed on the -card tab (including the label font and style). The color of that child -is used to color the card as well. Currently this only draws nicely if -you set box() to the -default FL_THIN_UP_BOX or to FL_FLAT_BOX, which gets +

    Each child makes a card, and it's label() is printed on the +card tab (including the label font and style). The color of that child +is used to color the card as well. Currently this only draws nicely if +you set box() to the +default FL_THIN_UP_BOX or to FL_FLAT_BOX, which gets rid of the edges drawn on the sides and bottom.

    -

    The size of the tabs is controlled by the bounding box of the -children (there should be some space between the children and the edge -of the Fl_Tabs), and the tabs may be placed "inverted" on the -bottom, this is determined by which gap is larger. It is easiest to -lay this out in fluid, using the fluid browser to select each child +

    The size of the tabs is controlled by the bounding box of the +children (there should be some space between the children and the edge +of the Fl_Tabs), and the tabs may be placed "inverted" on the +bottom, this is determined by which gap is larger. It is easiest to +lay this out in fluid, using the fluid browser to select each child group and resize them until the tabs look the way you want them to.

    Methods

      @@ -44,21 +44,21 @@ group and resize them until the tabs look the way you want them to.

    • ~Fl_Tabs
    • value
    -

    Fl_Tabs::Fl_Tabs(int x, int y, int w, int h, +

    Fl_Tabs::Fl_Tabs(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Tabs widget using the given position, size, -and label string. The default boxtype is FL_THIN_UP_BOX. + Creates a new Fl_Tabs widget using the given position, size, +and label string. The default boxtype is FL_THIN_UP_BOX.

    Use add(Fl_Widget *) - to add each child (which is probably itself a Fl_Group). The -children should be sized to stay away from the top or bottom edge of + to add each child (which is probably itself a Fl_Group). The +children should be sized to stay away from the top or bottom edge of the Fl_Tabs, which is where the tabs are drawn.

    virtual Fl_Tabs::~Fl_Tabs()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Tabs and all of it's children can be automatic (local) -variables, but you must declare the Fl_Tabsfirst, so -that it is destroyed last. +Fl_Tabs and all of it's children can be automatic (local) +variables, but you must declare the Fl_Tabsfirst, so +that it is destroyed last.

    Fl_Widget* Fl_Tabs::value() const
    int Fl_Tabs::value(Fl_Widget*)

    Gets or sets the currently visible widget/tab. diff --git a/documentation/Fl_Tile.html b/documentation/Fl_Tile.html index cd2afc2b5..977326308 100644 --- a/documentation/Fl_Tile.html +++ b/documentation/Fl_Tile.html @@ -17,21 +17,21 @@

    Description

    - The Fl_Tile class lets you resize the children by dragging -the border between them: + The Fl_Tile class lets you resize the children by dragging +the border between them:

    Fl_Tile widget.

    -

    Fl_Tile allows objects to be resized to zero dimensions. - To prevent this you can use the resizable() to limit where +

    Fl_Tile allows objects to be resized to zero dimensions. + To prevent this you can use the resizable() to limit where corners can be dragged to.

    -

    Even though objects can be resized to zero sizes, they must -initially have non-zero sizes so the Fl_Tile can figure out -their layout. If desired, call position() after creating the -children but before displaying the window to set the borders where you +

    Even though objects can be resized to zero sizes, they must +initially have non-zero sizes so the Fl_Tile can figure out +their layout. If desired, call position() after creating the +children but before displaying the window to set the borders where you want.

    The "borders" are part of the children, an - Fl_Tile does not -draw any graphics of it's own. In the above example all the final -children have FL_DOWN_BOX types, and the "ridges" you see are + Fl_Tile does not +draw any graphics of it's own. In the above example all the final +children have FL_DOWN_BOX types, and the "ridges" you see are two adjacent FL_DOWN_BOX's drawn next to each other.

    Methods

      @@ -40,26 +40,26 @@ two adjacent FL_DOWN_BOX's drawn next to each other.

    • position
    • resizeable
    -

    Fl_Tile::Fl_Tile(int x, int y, int w, int +

    Fl_Tile::Fl_Tile(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Tile widget using the given position, size, -and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Tile widget using the given position, size, +and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Tile::~Fl_Tile()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Tile and all of it's children can be automatic (local) -variables, but you must declare the Fl_Tile first, so -that it is destroyed last. -

    void Fl_Tile::position(from_x, from_y, +Fl_Tile and all of it's children can be automatic (local) +variables, but you must declare the Fl_Tile first, so +that it is destroyed last. +

    void Fl_Tile::position(from_x, from_y, to_x, to_y)

    - Drag the intersection at from_x,from_y to to_x,to_y. - This redraws all the necessary children. + Drag the intersection at from_x,from_y to to_x,to_y. + This redraws all the necessary children.

    void Fl_Tile::resizable(Fl_Widget &w)
    void Fl_Tile::resizable(Fl_Widget *w)

    -The "resizable" child widget (which should be invisible) limits where the -border can be dragged to. If you don't set it, it will be possible to -drag the borders right to the edge, and thus resize objects on the edge -to zero width or height. The resizable() widget is not +The "resizable" child widget (which should be invisible) limits where the +border can be dragged to. If you don't set it, it will be possible to +drag the borders right to the edge, and thus resize objects on the edge +to zero width or height. The resizable() widget is not resized by dragging any borders. diff --git a/documentation/Fl_Timer.html b/documentation/Fl_Timer.html index 1ae611413..489f73d38 100644 --- a/documentation/Fl_Timer.html +++ b/documentation/Fl_Timer.html @@ -17,11 +17,11 @@

    Description

    - This is provided only to emulate the Forms Timer widget. It works by -making a timeout callback every 1/5 second. This is wasteful and -inaccurate if you just want something to happen a fixed time in the + This is provided only to emulate the Forms Timer widget. It works by +making a timeout callback every 1/5 second. This is wasteful and +inaccurate if you just want something to happen a fixed time in the future. You should directly call -Fl::add_timeout() instead. +Fl::add_timeout() instead.

    Methods

    -

    Fl_Timer::Fl_Timer(uchar type, int x, int +

    Fl_Timer::Fl_Timer(uchar type, int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Timer widget using the given type, position, -size, and label string. The type parameter can be any of the -following symbolic constants: + Creates a new Fl_Timer widget using the given type, position, +size, and label string. The type parameter can be any of the +following symbolic constants:
      -
    • FL_NORMAL_TIMER - The timer just does the callback and +
    • FL_NORMAL_TIMER - The timer just does the callback and displays the string "Timer" in the widget.
    • -
    • FL_VALUE_TIMER - The timer does the callback and displays +
    • FL_VALUE_TIMER - The timer does the callback and displays the current timer value in the widget.
    • -
    • FL_HIDDEN_TIMER - The timer just does the callback and +
    • FL_HIDDEN_TIMER - The timer just does the callback and does not display anything.

    virtual Fl_Timer::~Fl_Timer()

    - Destroys the timer and removes the timeout. + Destroys the timer and removes the timeout.

    char direction() const
    void direction(char d)

    - Gets or sets the direction of the timer. If the direction is zero -then the timer will count up, otherwise it will count down from the -initial value(). + Gets or sets the direction of the timer. If the direction is zero +then the timer will count up, otherwise it will count down from the +initial value().

    char suspended() const
    void suspended(char d)

    - Gets or sets whether the timer is suspended. + Gets or sets whether the timer is suspended.

    float value() const
    void value(float)

    Gets or sets the current timer value. diff --git a/documentation/Fl_Valuator.html b/documentation/Fl_Valuator.html index 2875e30fe..e72d7cce3 100644 --- a/documentation/Fl_Valuator.html +++ b/documentation/Fl_Valuator.html @@ -20,16 +20,16 @@

    Description

    - The Fl_Valuator class controls a single floating-point value -and provides a consistent interface to set the value, range, and step, -and insures that callbacks are done the same for every object. + The Fl_Valuator class controls a single floating-point value +and provides a consistent interface to set the value, range, and step, +and insures that callbacks are done the same for every object.

    There are probably more of these classes in FLTK than any others:

    Fl_Valuator widgets.

    -

    In the above diagram each box surrounds an actual subclass. These +

    In the above diagram each box surrounds an actual subclass. These are further differentiated by setting the -type() of the widget to the symbolic value labeling the +type() of the widget to the symbolic value labeling the widget. The ones labelled "0" are the default versions with a -type(0). For consistency the symbol FL_VERTICAL is +type(0). For consistency the symbol FL_VERTICAL is defined as zero.

    Methods

    @@ -66,69 +66,69 @@ defined as zero.

    -

    Fl_Valuator::Fl_Valuator(int x, int +

    Fl_Valuator::Fl_Valuator(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Valuator widget using the given position, -size, and label string. The default boxtype is FL_NO_BOX. + Creates a new Fl_Valuator widget using the given position, +size, and label string. The default boxtype is FL_NO_BOX.

    virtual Fl_Valuator::~Fl_Valuator()

    - Destroys the valuator. + Destroys the valuator.

    double Fl_Valuator::value() const
    int Fl_Valuator::value(double)

    - Get or set the current value. The new value is not clamped or + Get or set the current value. The new value is not clamped or otherwise changed before storing it. Use clamp() or round() - to modify the value before calling this if you want. If the new value -is different than the current one the object is redrawn. The initial -value is zero. + to modify the value before calling this if you want. If the new value +is different than the current one the object is redrawn. The initial +value is zero.

    double Fl_Valuator::minimum() const
    void Fl_Valuator::minimum(double)

    - Gets or sets the minimum value for the valuator. + Gets or sets the minimum value for the valuator.

    double Fl_Valuator::maximum() const
    void Fl_Valuator::maximum(double)

    - Gets or sets the maximum value for the valuator. -

    void Fl_Valuator::range(double min, + Gets or sets the maximum value for the valuator. +

    void Fl_Valuator::range(double min, double max);

    - Sets the minimum and maximum values for the valuator. When the user -manipulates the widget, the value is limited to this range. This -clamping is done after rounding to the step value (this makes a -difference if the range is not a multiple of the step). -

    The minimum may be greater than the maximum. This has the effect of -"reversing" the object so the larger values are in the opposite -direction. This also switches which end of the filled sliders is + Sets the minimum and maximum values for the valuator. When the user +manipulates the widget, the value is limited to this range. This +clamping is done after rounding to the step value (this makes a +difference if the range is not a multiple of the step). +

    The minimum may be greater than the maximum. This has the effect of +"reversing" the object so the larger values are in the opposite +direction. This also switches which end of the filled sliders is filled.

    -

    Some widgets consider this a "soft" range. This means they will -stop at the range, but if the user releases and grabs the control again +

    Some widgets consider this a "soft" range. This means they will +stop at the range, but if the user releases and grabs the control again and tries to move it further, it is allowed.

    -

    The range may affect the display. You must redraw() the +

    The range may affect the display. You must redraw() the widget after changing the range.

    double Fl_Valuator::step() const
    void Fl_Valuator::step(double)
    void Fl_Valuator::step(int A, int B)

    - Get or set the step value. As the user moves the mouse the value is + Get or set the step value. As the user moves the mouse the value is rounded to the nearest multiple of the step value. This is done -before clamping it to the range. For most objects the default step -is zero. -

    For precision the step is stored as the ratio of two integers, A/B. - You can set these integers directly. Currently setting a floating +before clamping it to the range. For most objects the default step +is zero. +

    For precision the step is stored as the ratio of two integers, A/B. + You can set these integers directly. Currently setting a floating point value sets the nearest A/1 or 1/B value possible.

    int Fl_Valuator::format(char *)

    -Format the passed value to show enough digits so that for the current +Format the passed value to show enough digits so that for the current step value. If the step has been set to zero then it does a %g -format. The characters are written into the passed buffer. +format. The characters are written into the passed buffer.

    double Fl_Valuator::round(double)

    -Round the passed value to the nearest step increment. Does nothing if -step is zero. +Round the passed value to the nearest step increment. Does nothing if +step is zero.

    double Fl_Valuator::clamp(double)

    -Clamp the passed value to the valuator range. -

    double +Clamp the passed value to the valuator range. +

    double Fl_Valuator::increment(double,int n)

    - Adds n times the step value to the passed value. If step was -set to zero it uses fabs(maximum() - minimum()) / 100. + Adds n times the step value to the passed value. If step was +set to zero it uses fabs(maximum() - minimum()) / 100.

    int Fl_Widget::changed() const

    - This value is true if the user has moved the slider. It is turned off -by value(x) and just before doing a callback (the callback can -turn it back on if desired). + This value is true if the user has moved the slider. It is turned off +by value(x) and just before doing a callback (the callback can +turn it back on if desired).

    void Fl_Widget::set_changed()

    Sets the changed() flag.

    void Fl_Widget::clear_changed() diff --git a/documentation/Fl_Value_Input.html b/documentation/Fl_Value_Input.html index e4fad9208..70766872f 100644 --- a/documentation/Fl_Value_Input.html +++ b/documentation/Fl_Value_Input.html @@ -17,16 +17,16 @@

    Description

    - The Fl_Value_Input widget displays a floating point value. -The user can click in the text field and edit it (there is in fact a + The Fl_Value_Input widget displays a floating point value. +The user can click in the text field and edit it (there is in fact a hidden Fl_Input widget with -type(FL_FLOAT_INPUT) in there), and when they hit return or tab -the value updates to what they typed and the callback is done. -

    If step() is not zero, the user can also drag the mouse +type(FL_FLOAT_INPUT) in there), and when they hit return or tab +the value updates to what they typed and the callback is done. +

    If step() is not zero, the user can also drag the mouse across the object and thus slide the value. The left button moves one -step() per pixel, the middle by 10 * step(), and the left -button by 100 * step(). It is then impossible to select text -by dragging across it, although clicking can still move the insertion +step() per pixel, the middle by 10 * step(), and the left +button by 100 * step(). It is then impossible to select text +by dragging across it, although clicking can still move the insertion cursor.

    Fl_Value_Input widget.

    Methods

    @@ -40,33 +40,33 @@ cursor.

  • textsize
  • -Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char +Fl_Value_Input::Fl_Value_Input(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Value_Input widget using the given position, -size, and label string. The default boxtype is FL_DOWN_BOX. -

    virtual + Creates a new Fl_Value_Input widget using the given position, +size, and label string. The default boxtype is FL_DOWN_BOX. +

    virtual Fl_Value_Input::~Fl_Value_Input()

    - Destroys the valuator. -

    Fl_Color + Destroys the valuator. +

    Fl_Color Fl_Value_Input::cursor_color() const
    void Fl_Value_Input::cursor_color(Fl_Color)

    - Get or set the color of the cursor. This is black by default. + Get or set the color of the cursor. This is black by default.

    uchar Fl_Value_Input::soft() const
    void Fl_Value_Input::soft(uchar)

    - If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default is -true. -

    Fl_Color + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is +true. +

    Fl_Color Fl_Value_Input::textcolor() const
    void Fl_Value_Input::textcolor(Fl_Color)

    - Gets or sets the color of the text in the value box. -

    Fl_Font Fl_Value_Input::textfont() + Gets or sets the color of the text in the value box. +

    Fl_Font Fl_Value_Input::textfont() const

    void Fl_Value_Input::textfont(Fl_Font)

    - Gets or sets the typeface of the text in the value box. -

    uchar Fl_Value_Input::textsize() + Gets or sets the typeface of the text in the value box. +

    uchar Fl_Value_Input::textsize() const
    void Fl_Value_Input::textsize(uchar)

    Gets or sets the size of the text in the value box. diff --git a/documentation/Fl_Value_Output.html b/documentation/Fl_Value_Output.html index ca284f3b3..0f03ce632 100644 --- a/documentation/Fl_Value_Output.html +++ b/documentation/Fl_Value_Output.html @@ -17,13 +17,13 @@

    Description

    - The Fl_Value_Output widget displays a floating point value. -If step() is not zero, the user can adjust the value by + The Fl_Value_Output widget displays a floating point value. +If step() is not zero, the user can adjust the value by dragging the mouse left and right. The left button moves one step() per pixel, the middle by 10 * step(), and the right button by -100 * step(). +100 * step().

    This is much lighter-weight than -Fl_Value_Input because it contains no text editing code or +Fl_Value_Input because it contains no text editing code or character buffer.

    Fl_Value_Output widget.

    Methods

    @@ -36,30 +36,30 @@ character buffer.

  • textsize
  • -Fl_Value_Output::Fl_Value_Output(int x, int y, int w, int h, const char +Fl_Value_Output::Fl_Value_Output(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Value_Output widget using the given + Creates a new Fl_Value_Output widget using the given position, size, and label string. The default boxtype is FL_NO_BOX -. -

    virtual +. +

    virtual Fl_Value_Output::~Fl_Value_Output()

    - Destroys the valuator. + Destroys the valuator.

    uchar Fl_Value_Output::soft() const
    void Fl_Value_Output::soft(uchar)

    - If "soft" is turned on, the user is allowed to drag the value outside -the range. If they drag the value to one of the ends, let go, then -grab again and continue to drag, they can get to any value. Default is -one. -

    Fl_Color + If "soft" is turned on, the user is allowed to drag the value outside +the range. If they drag the value to one of the ends, let go, then +grab again and continue to drag, they can get to any value. Default is +one. +

    Fl_Color Fl_Value_Output::textcolor() const
    void Fl_Value_Output::textcolor(Fl_Color)

    - Gets or sets the color of the text in the value box. -

    Fl_Font + Gets or sets the color of the text in the value box. +

    Fl_Font Fl_Value_Output::textfont() const

    void Fl_Value_Output::textfont(Fl_Font)

    - Gets or sets the typeface of the text in the value box. -

    uchar Fl_Value_Output::textsize() + Gets or sets the typeface of the text in the value box. +

    uchar Fl_Value_Output::textsize() const
    void Fl_Value_Output::textsize(uchar)

    Gets or sets the size of the text in the value box. diff --git a/documentation/Fl_Value_Slider.html b/documentation/Fl_Value_Slider.html index 03dd61c5a..43039c7c6 100644 --- a/documentation/Fl_Value_Slider.html +++ b/documentation/Fl_Value_Slider.html @@ -17,8 +17,8 @@

    Description

    - The Fl_Value_Slider widget is a Fl_Slider widget -with a box displaying the current value. + The Fl_Value_Slider widget is a Fl_Slider widget +with a box displaying the current value.

    Fl_Value_Slider widget.

    Methods

      @@ -29,24 +29,24 @@ with a box displaying the current value.
    • textsize

    -Fl_Value_Slider::Fl_Value_Slider(int x, int y, int w, int h, const char +Fl_Value_Slider::Fl_Value_Slider(int x, int y, int w, int h, const char *label = 0)

    - Creates a new Fl_Value_Slider widget using the given + Creates a new Fl_Value_Slider widget using the given position, size, and label string. The default boxtype is FL_DOWN_BOX -. -

    virtual +. +

    virtual Fl_Value_Slider::~Fl_Value_Slider()

    - Destroys the valuator. -

    Fl_Color + Destroys the valuator. +

    Fl_Color Fl_Value_Slider::textcolor() const
    void Fl_Value_Slider::textcolor(Fl_Color)

    - Gets or sets the color of the text in the value box. -

    Fl_Font + Gets or sets the color of the text in the value box. +

    Fl_Font Fl_Value_Slider::textfont() const

    void Fl_Value_Slider::textfont(Fl_Font)

    - Gets or sets the typeface of the text in the value box. -

    uchar Fl_Value_Slider::textsize() + Gets or sets the typeface of the text in the value box. +

    uchar Fl_Value_Slider::textsize() const
    void Fl_Value_Slider::textsize(uchar)

    Gets or sets the size of the text in the value box. diff --git a/documentation/Fl_Widget.html b/documentation/Fl_Widget.html index 394b49c21..99c20db3c 100644 --- a/documentation/Fl_Widget.html +++ b/documentation/Fl_Widget.html @@ -19,15 +19,15 @@

    Description

    -Fl_Widget is the base class for all widgets in FLTK. You can't -create one of these because the constructor is not public. However you -can subclass it. +Fl_Widget is the base class for all widgets in FLTK. You can't +create one of these because the constructor is not public. However you +can subclass it.

    All "property" accessing methods, such as color(), -parent(), or argument() are implemented as trivial inline -functions and thus are as fast and small as accessing fields in a +parent(), or argument() are implemented as trivial inline +functions and thus are as fast and small as accessing fields in a structure. Unless otherwise noted, the property setting methods such as -color(n) or label(s) are also trivial inline functions, -even if they change the widget's appearance. It is up to the user code +color(n) or label(s) are also trivial inline functions, +even if they change the widget's appearance. It is up to the user code to call redraw() after these.

    Methods

    @@ -95,81 +95,81 @@ to call redraw() after these.

    -

    Fl_Widget::Fl_Widget(int x, int y, int w, int h, const char* +

    Fl_Widget::Fl_Widget(int x, int y, int w, int h, const char* label=0);

    - This is the protected constructor for an Fl_Widget, but all derived -widgets have a matching public constructor. It takes a value for x(), -y(), w(), h(), and an optional value for label(). + This is the protected constructor for an Fl_Widget, but all derived +widgets have a matching public constructor. It takes a value for x(), +y(), w(), h(), and an optional value for label().

    virtual Fl_Widget::~Fl_Widget();

    - Destroying single widgets is not very common. It is your -responsibility to either remove() them from any enclosing group, or to -destroy that group immediately after destroying the children. + Destroying single widgets is not very common. It is your +responsibility to either remove() them from any enclosing group, or to +destroy that group immediately after destroying the children.

    uchar Fl_Widget::type() const;

    - This value is used for Forms compatability and to simulate RTTI. + This value is used for Forms compatability and to simulate RTTI.

    short Fl_Widget::x() const
    short Fl_Widget::y() const
    short Fl_Widget::w() const
    short Fl_Widget::h() const

    - The position of the upper-left corner of the widget in its enclosing -Fl_Window (not its parent if that is not an Fl_Window), and its -width and height. -

    virtual void + The position of the upper-left corner of the widget in its enclosing +Fl_Window (not its parent if that is not an Fl_Window), and its +width and height. +

    virtual void Fl_Widget::resize(int x, int y, int w, int h)
    void Fl_Widget::position(short x, short y)
    void Fl_Widget::size(short w, short h)

    - Change the size or position of the widget. This is a virtual function -so the widget may implement its own handling of resizing. The default -version does not do redraw(), that is the parent widget's -responsibility (this is because the parent may know a faster way to -update the display, such as scrolling from the old position). + Change the size or position of the widget. This is a virtual function +so the widget may implement its own handling of resizing. The default +version does not do redraw(), that is the parent widget's +responsibility (this is because the parent may know a faster way to +update the display, such as scrolling from the old position).

    position(x,y) is a shortcut for resize(x,y,w(),h()) , and size(w,h) is a shortcut for resize(x(),y(),w,h) .

    Fl_Window* Fl_Widget::window() const;

    Return a pointer to the Fl_Window - that this widget is in (it will skip any and all parent widgets -between this and the window). Returns NULL if none. Note: -for an Fl_Window, this returns its parent window (if -any), not this window. + that this widget is in (it will skip any and all parent widgets +between this and the window). Returns NULL if none. Note: +for an Fl_Window, this returns its parent window (if +any), not this window.

    Fl_Boxtype Fl_Widget::box() const
    void Fl_Widget::box(Fl_Boxtype)

    - The box() identifies a routine that draws the background of -the widget. See Box Types for the + The box() identifies a routine that draws the background of +the widget. See Box Types for the available types. The default depends on the widget, but is usually -FL_NO_BOX or FL_UP_BOX. +FL_NO_BOX or FL_UP_BOX.

    Fl_Color Fl_Widget::color() const
    void Fl_Widget::color(Fl_Color)

    - This color is passed to the box routine. Color is an index into an + This color is passed to the box routine. Color is an index into an internal table of rgb colors. For most widgets this defaults to FL_GRAY. See the enumeration list for predefined colors. Use -Fl::set_color() to redefine colors. -

    Fl_Color +Fl::set_color() to redefine colors. +

    Fl_Color Fl_Widget::selection_color() const
    void Fl_Widget::selection_color(Fl_Color)

    void Fl_Widget::color(Fl_Color, Fl_Color)

    - For Forms compatibility a second color is defined. This is usually -used to color the widget when it is selected, although some widgets use + For Forms compatibility a second color is defined. This is usually +used to color the widget when it is selected, although some widgets use this color for other purposes. You can set both colors at once with -color(a,b). +color(a,b).

    const char* Fl_Widget::label() const
    void Fl_Widget::label(const char*)

    - The label is printed somewhere on the widget or next to it. The -string is not copied, the passed pointer is stored unchanged in -the widget. -

    void Fl_Widget::label(Fl_Labeltype, + The label is printed somewhere on the widget or next to it. The +string is not copied, the passed pointer is stored unchanged in +the widget. +

    void Fl_Widget::label(Fl_Labeltype, const char*)
    uchar Fl_Widget::labeltype() const
    void Fl_Widget::labeltype(Fl_Labeltype)

    - A labeltype identifies a routine that -draws the label of the widget. This can be used for special effects -such as emboss, or to use the label() pointer as another form -of data such as a bitmap. The value FL_NORMAL_LABEL prints -the label as text. + A labeltype identifies a routine that +draws the label of the widget. This can be used for special effects +such as emboss, or to use the label() pointer as another form +of data such as a bitmap. The value FL_NORMAL_LABEL prints +the label as text.

    Fl_Align Fl_Widget::align() const
    void Fl_Widget::align(Fl_Align)

    - How the label is printed next to or inside the widget. The default -value is FL_ALIGN_CENTER, which centers the label. The value + How the label is printed next to or inside the widget. The default +value is FL_ALIGN_CENTER, which centers the label. The value can be any of these constants or'd together:
    • FL_ALIGN_CENTER
    • @@ -183,67 +183,67 @@ can be any of these constants or'd together:

    Fl_Color Fl_Widget::labelcolor() const
    void Fl_Widget::labelcolor(Fl_Color)

    - This color is passed to the labeltype routine, and is typically the -color of the label text. This defaults to FL_BLACK. + This color is passed to the labeltype routine, and is typically the +color of the label text. This defaults to FL_BLACK.

    Fl_Font Fl_Widget::labelfont() const
    void Fl_Widget::labelfont(Fl_Font)

    Fonts are identified by small 8-bit indexes into a table. See the -enumeration list for predefined typefaces. The default value uses a +enumeration list for predefined typefaces. The default value uses a Helvetica typeface (Arial for Microsoft® Windows®). The function -Fl::set_font() can define new typefaces. +Fl::set_font() can define new typefaces.

    uchar Fl_Widget::labelsize() const
    void Fl_Widget::labelsize(uchar)

    - Fonts are further identified by a point size. The default is 14. -

    typedef void (Fl_Callback)(Fl_Widget*, + Fonts are further identified by a point size. The default is 14. +

    typedef void (Fl_Callback)(Fl_Widget*, void*)
    Fl_Callback* Fl_Widget::callback() const
    void Fl_Widget::callback(Fl_Callback*, void* = 0)

    - Each widget has a single callback. You can set it or examine it with -these methods. + Each widget has a single callback. You can set it or examine it with +these methods.

    void* Fl_Widget::user_data() const
    void Fl_Widget::user_data(void*)

    - You can also just change the void * second argument to the -callback with the user_data methods. -

    void Fl_Widget::callback(void + You can also just change the void * second argument to the +callback with the user_data methods. +

    void Fl_Widget::callback(void (*)(Fl_Widget*, long), long = 0)
    long Fl_Widget::argument() const
    void Fl_Widget::argument(long)

    - For convenience you can also define the callback as taking a long + For convenience you can also define the callback as taking a long argument. This is implemented by casting this to a Fl_Callback - and casting the long to a void * and may not be -portable to some machines. + and casting the long to a void * and may not be +portable to some machines.

    void Fl_Widget::callback(void (*)(Fl_Widget*))

    - For convenience you can also define the callback as taking only one + For convenience you can also define the callback as taking only one argument. This is implemented by casting this to a Fl_Callback - and may not be portable to some machines. + and may not be portable to some machines.

    void Fl_Widget::do_callback()
    void Fl_Widget::do_callback(Fl_Widget*, void* = 0)
    void Fl_Widget::do_callback(Fl_Widget*, long)

    - You can cause a widget to do its callback at any time, and even pass -arbitrary arguments. + You can cause a widget to do its callback at any time, and even pass +arbitrary arguments.

    int Fl_Widget::changed() const
    void Fl_Widget::set_changed()
    void Fl_Widget::clear_changed()

    -Fl_Widget::changed() is a flag that is turned on when the user -changes the value stored in the widget. This is only used by -subclasses of Fl_Widget that store values, but is in the base +Fl_Widget::changed() is a flag that is turned on when the user +changes the value stored in the widget. This is only used by +subclasses of Fl_Widget that store values, but is in the base class so it is easier to scan all the widgets in a panel and -do_callback() on the changed ones in response to an "OK" button. -

    Most widgets turn this flag off when they do the callback, and when +do_callback() on the changed ones in response to an "OK" button. +

    Most widgets turn this flag off when they do the callback, and when the program sets the stored value.

    Fl_When Fl_Widget::when() const
    void Fl_Widget::when(Fl_When)

    Fl_Widget::when() is a set of bitflags used by subclasses of -Fl_Widget to decide when to do the callback. If the value is zero -then the callback is never done. Other values are described in the -individual widgets. This field is in the base class so that you can -scan a panel and do_callback() on all the ones that don't do -their own callbacks in response to an "OK" button. -

    static void +Fl_Widget to decide when to do the callback. If the value is zero +then the callback is never done. Other values are described in the +individual widgets. This field is in the base class so that you can +scan a panel and do_callback() on all the ones that don't do +their own callbacks in response to an "OK" button. +

    static void Fl_Widget::default_callback(Fl_Widget*, void*)

    - The default callback, which puts a pointer to the widget on the queue + The default callback, which puts a pointer to the widget on the queue returned by Fl::readqueue() -. You may want to call this from your own callback. +. You may want to call this from your own callback.

    int Fl_Widget::visible() const
    int Fl_Widget::visible_r() const
    void Fl_Widget::show()
    @@ -252,12 +252,12 @@ An invisible widget never gets redrawn and does not get events. The visible() method returns true if the widget is set to be visible.The visible_r() method returns true if the widget and all of its parents are visible. A widget is only visible if -visible() is true on it and all of its parents. +visible() is true on it and all of its parents.

    Changing it will send FL_SHOW or FL_HIDE -events to the widget. Do not change it if the parent is not +events to the widget. Do not change it if the parent is not visible, as this will send false FL_SHOW or FL_HIDE - events to the widget. redraw() is called if necessary on -this or the parent. + events to the widget. redraw() is called if necessary on +this or the parent.

    int Fl_Widget::active() const
    int Fl_Widget::active_r() const
    void Fl_Widget::activate()
    @@ -284,11 +284,11 @@ displays rather than input devices. This is the same as (active() && visible() && !output()) but is faster.

    void Fl_Widget::redraw()

    - Mark the widget as needing its draw() routine called. + Mark the widget as needing its draw() routine called.

    uchar Fl_Widget::damage() const

    - Non-zero if draw() needs to be called. Actually this is a -bit field that the widget subclass can use to figure out what parts to -draw. + Non-zero if draw() needs to be called. Actually this is a +bit field that the widget subclass can use to figure out what parts to +draw.

    Fl_Group *Fl_Widget::parent() const

    Returns a pointer to the parent widget. Usually this is a Fl_Group or Fl_Window. Returns

    int Fl_Widget::contains(Fl_Widget* b) const

    Returns true if b is a child of this widget, or is equal to -this widget. Returns false if b is NULL. -

    int Fl_Widget::inside(const Fl_Widget* a) +this widget. Returns false if b is NULL. +

    int Fl_Widget::inside(const Fl_Widget* a) const

    Returns true if this is a child of a, or is equal to a -. Returns false if a is NULL. +. Returns false if a is NULL.

    int Fl_Widget::take_focus()

    - Tries to make this widget be the Fl::focus() widget, by first -sending it an FL_FOCUS event, and if it returns non-zero, -setting Fl::focus() to this widget. You should use this -method to assign the focus to an widget. Returns true if the widget + Tries to make this widget be the Fl::focus() widget, by first +sending it an FL_FOCUS event, and if it returns non-zero, +setting Fl::focus() to this widget. You should use this +method to assign the focus to an widget. Returns true if the widget accepted the focus. diff --git a/documentation/Fl_Window.html b/documentation/Fl_Window.html index 2323a38e3..a245e2d52 100644 --- a/documentation/Fl_Window.html +++ b/documentation/Fl_Window.html @@ -20,17 +20,17 @@

    Description

    - This widget produces an actual window. This can either be a main -window, with a border and title and all the window management controls, -or a "subwindow" inside a window. This is controlled by whether or not -the window has a parent(). + This widget produces an actual window. This can either be a main +window, with a border and title and all the window management controls, +or a "subwindow" inside a window. This is controlled by whether or not +the window has a parent().

    Once you create a window, you usually add children Fl_Widget 's to it by using window->add(child) for each new widget. See Fl_Group for more information +href=Fl_Group.html#Fl_Group>Fl_Group for more information on how to add and remove children.

    -

    There are several subclasses of Fl_Window that provide +

    There are several subclasses of Fl_Window that provide double-buffering, overlay, menu, and OpenGL support.

    -

    The window's callback is done if the user tries to close a window +

    The window's callback is done if the user tries to close a window using the window manager and Fl::modal() is zero or equal to the window. Fl_Window has a default callback that calls Fl_Window::hide().

    @@ -89,9 +89,9 @@ place to show the window or allow the user to pick a location. If you want to force a position you should call position(x,y) or hotspot() before calling show(). -

    Fl_Widget::box() is set to FL_FLAT_BOX. If you -plan to completely fill the window with children widgets you should -change this to FL_NO_BOX. If you turn the window border off +

    Fl_Widget::box() is set to FL_FLAT_BOX. If you +plan to completely fill the window with children widgets you should +change this to FL_NO_BOX. If you turn the window border off you may want to change this to FL_UP_BOX.

    Fl_Window::Fl_Window(int x, int y, int w, int h, const char *title = 0)

    @@ -100,157 +100,157 @@ you may want to change this to FL_UP_BOX.

    leaves visible() set to true.

    virtual Fl_Window::~Fl_Window()

    - The destructor also deletes all the children. This allows a -whole tree to be deleted at once, without having to keep a pointer to + The destructor also deletes all the children. This allows a +whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the -Fl_Window and all of it's children can be automatic (local) -variables, but you must declare the Fl_Window first so -that it is destroyed last. -

    void Fl_Window::size_range(int minw, +Fl_Window and all of it's children can be automatic (local) +variables, but you must declare the Fl_Window first so +that it is destroyed last. +

    void Fl_Window::size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)

    - Set the allowable range the user can resize this window to. This only -works for top-level windows. + Set the allowable range the user can resize this window to. This only +works for top-level windows.
      -
    • minw and minh are the smallest the window can +
    • minw and minh are the smallest the window can be.
    • -
    • maxw and maxh are the largest the window can be. - If either is equal to the minimum then you cannot resize in -that direction. If either is zero then FLTK picks a maximum size in +
    • maxw and maxh are the largest the window can be. + If either is equal to the minimum then you cannot resize in +that direction. If either is zero then FLTK picks a maximum size in that direction such that the window will fill the screen.
    • -
    • dw and dh are size increments. The window will +
    • dw and dh are size increments. The window will be constrained to widths of minw + N * dw, where N - is any non-negative integer. If these are less or equal to 1 they + is any non-negative integer. If these are less or equal to 1 they are ignored. (this is ignored on WIN32)
    • -
    • aspect is a flag that indicates that the window should - preserve it's aspect ratio. This only works if both the maximum and +
    • aspect is a flag that indicates that the window should + preserve it's aspect ratio. This only works if both the maximum and minimum have the same aspect ratio. (ignored on WIN32 and by many X window managers)
    - If this function is not called, FLTK tries to figure out the range + If this function is not called, FLTK tries to figure out the range from the setting of resizable():
      -
    • If resizable() is NULL (this is the default) -then the window cannot be resized and the resize border and max-size +
    • If resizable() is NULL (this is the default) +then the window cannot be resized and the resize border and max-size control will not be displayed for the window.
    • -
    • If either dimension of resizable() is less than 100, +
    • If either dimension of resizable() is less than 100, then that is considered the minimum size. Otherwise the resizable() has a minimum size of 100.
    • -
    • If either dimension of resizable() is zero, then that is +
    • If either dimension of resizable() is zero, then that is also the maximum size (so the window cannot resize in that direction).
    - It is undefined what happens if the current size does not fit in the -constraints passed to size_range(). + It is undefined what happens if the current size does not fit in the +constraints passed to size_range().

    virtual void Fl_Window::show()
    void Fl_Window::show(int argc, char **argv)

    -Put the window on the screen. Usually this has the side effect of -opening the display. The second form is used for top-level -windows and allow standard arguments to be parsed from the +Put the window on the screen. Usually this has the side effect of +opening the display. The second form is used for top-level +windows and allow standard arguments to be parsed from the command-line. -

    If the window is already shown then it is restored and raised to the +

    If the window is already shown then it is restored and raised to the top. This is really convenient because your program can call show() at any time, even if the window is already up. It also means that show() serves the purpose of raise() in other toolkits.

    virtual void Fl_Window::hide()

    - Remove the window from the screen. If the window is already hidden or + Remove the window from the screen. If the window is already hidden or has not been shown then this does nothing and is harmless.

    int Fl_Window::shown() const

    Returns non-zero if show() has been called (but not hide() -). You can tell if a window is iconified with (w->shown() -&!w->visible()). +). You can tell if a window is iconified with (w->shown() +&!w->visible()).

    void Fl_Window::iconize()

    - Iconifies the window. If you call this when shown() is false -it will show() it as an icon. If the window is already -iconified this does nothing. + Iconifies the window. If you call this when shown() is false +it will show() it as an icon. If the window is already +iconified this does nothing.

    Call show() to restore the window.

    -

    When a window is iconified/restored (either by these calls or by the +

    When a window is iconified/restored (either by these calls or by the user) the handle() method is called with FL_HIDE and FL_SHOW events and visible() is turned on and off.

    -

    There is no way to control what is drawn in the icon except with the -string passed to Fl_Window::xclass(). You should not rely on +

    There is no way to control what is drawn in the icon except with the +string passed to Fl_Window::xclass(). You should not rely on window managers displaying the icons.

    void Fl_Window::resize(int,int,int,int)

    - Change the size and position of the window. If shown() is -true, these changes are communicated to the window server (which may -refuse that size and cause a further resize). If shown() is -false, the size and position are used when show() is called. -See Fl_Group for the effect -of resizing on the child widgets. + Change the size and position of the window. If shown() is +true, these changes are communicated to the window server (which may +refuse that size and cause a further resize). If shown() is +false, the size and position are used when show() is called. +See Fl_Group for the effect +of resizing on the child widgets.

    You can also call the Fl_Widget methods size(x,y) - and position(w,h), which are inline wrappers for this virtual + and position(w,h), which are inline wrappers for this virtual function.

    void Fl_Window::free_position()

    Undoes the effect of a previous resize() or show() - so that the next time show() is called the window manager is -free to position the window. -

    void Fl_Window::hotspot(int x, int y, int + so that the next time show() is called the window manager is +free to position the window. +

    void Fl_Window::hotspot(int x, int y, int offscreen = 0)
    void Fl_Window::hotspot(const Fl_Widget*, int offscreen = 0)
    void Fl_Window::hotspot(const Fl_Widgetp, int offscreen = 0)

    -position() the window so that the mouse is pointing at the -given position, or at the center of the given widget, which may be the -window itself. If the optional offscreen parameter is -non-zero, then the window is allowed to extend off the screen (this -does not work with some X window managers). +position() the window so that the mouse is pointing at the +given position, or at the center of the given widget, which may be the +window itself. If the optional offscreen parameter is +non-zero, then the window is allowed to extend off the screen (this +does not work with some X window managers).

    void Fl_Window::fullscreen()

    - Makes the window completely fill the screen, without any window -manager border visible. You must use fullscreen_off() to undo -this. This may not work with all window managers. -

    int Fl_Window::fullscreen_off(int + Makes the window completely fill the screen, without any window +manager border visible. You must use fullscreen_off() to undo +this. This may not work with all window managers. +

    int Fl_Window::fullscreen_off(int x, int y, int w, int h)

    Turns off any side effects of fullscreen() and does -resize(x,y,w,h). +resize(x,y,w,h).

    int Fl_Window::border(int)
    uchar Fl_Window::border() const

    - Gets or sets whether or not the window manager border is around the -window. The default value is true. border(n) can be used to -turn the border on and off, and returns non-zero if the value has been + Gets or sets whether or not the window manager border is around the +window. The default value is true. border(n) can be used to +turn the border on and off, and returns non-zero if the value has been changed. Under most X window managers this does not work after show() has been called, although SGI's 4DWM does work.

    void Fl_Window::clear_border()

    -clear_border() is a fast inline function to turn the border -off. It only works before show() is called. +clear_border() is a fast inline function to turn the border +off. It only works before show() is called.

    void Fl_Window::set_modal()

    - A "modal" window, when shown(), will prevent any events from -being delivered to other windows in the same program, and will also -remain on top of the other windows (if the X window manager supports -the "transient for" property). Several modal windows may be shown at -once, in which case only the last one shown gets events. You can see + A "modal" window, when shown(), will prevent any events from +being delivered to other windows in the same program, and will also +remain on top of the other windows (if the X window manager supports +the "transient for" property). Several modal windows may be shown at +once, in which case only the last one shown gets events. You can see which window (if any) is modal by calling -Fl::modal(). +Fl::modal().

    uchar Fl_Window::modal() const

    - Returns true if this window is modal. + Returns true if this window is modal.

    void Fl_Window::set_non_modal()

    - A "non-modal" window (terminology borrowed from Microsoft Windows) -acts like a modal() one in that it remains on top, but it has -no effect on event delivery. There are three states for a -window: modal, non-modal, and normal. + A "non-modal" window (terminology borrowed from Microsoft Windows) +acts like a modal() one in that it remains on top, but it has +no effect on event delivery. There are three states for a +window: modal, non-modal, and normal.

    uchar Fl_Window::non_modal() const

    - Returns true if this window is modal or non-modal. + Returns true if this window is modal or non-modal.

    void Fl_Window::label(const char*)
    const char* Fl_Window::label() const

    - Gets or sets the window title bar label. + Gets or sets the window title bar label.

    void Fl_Window::iconlabel(const char*)
    const char* Fl_Window::iconlabel() const

    - Gets or sets the icon label. + Gets or sets the icon label.

    void Fl_Window::xclass(const char*)
    const char* Fl_Window::xclass() const

    - A string used to tell the system what type of window this is. Mostly -this identifies the picture to draw in the icon. Under X, this is -turned into a XA_WM_CLASS pair by truncating at the first -non-alphanumeric character and capitalizing the first character, and -the second one if the first is 'x'. Thus "foo" turns into "foo, Foo", + A string used to tell the system what type of window this is. Mostly +this identifies the picture to draw in the icon. Under X, this is +turned into a XA_WM_CLASS pair by truncating at the first +non-alphanumeric character and capitalizing the first character, and +the second one if the first is 'x'. Thus "foo" turns into "foo, Foo", and "xprog.1" turns into "xprog, XProg". This only works if called -before calling show(). +before calling show().

    Under Microsoft Windows this string is used as the name of the WNDCLASS structure, though it is not clear if this can have any visible effect.

    void Fl_Window::make_current()

    make_current() sets things up so that the drawing functions in <FL/fl_draw.H> will go into this -window. This is useful for incremental update of windows, such as in an -idle callback, which will make your program behave much better if it -draws a slow graphic. Danger: incremental update is very hard to +href=drawing.html#Drawing><FL/fl_draw.H> will go into this +window. This is useful for incremental update of windows, such as in an +idle callback, which will make your program behave much better if it +draws a slow graphic. Danger: incremental update is very hard to debug and maintain!

    This method only works for the Fl_Window and Fl_Gl_Window classes.

    diff --git a/documentation/basics.html b/documentation/basics.html index cf2f1eaf9..983f1a6cb 100644 --- a/documentation/basics.html +++ b/documentation/basics.html @@ -33,7 +33,7 @@ int main(int argc, char **argv) { } -

    After including the required header files, the program then creates a +

    After including the required header files, the program then creates a window:

      @@ -116,7 +116,7 @@ of the form "type name() const".

      Almost all of the set/get pairs are very fast, short inline functions and thus very efficient. However, the "set" methods do not call redraw() - you have to call it -yourself. This greatly reduces code size and execution time. +yourself. This greatly reduces code size and execution time. The only common exception is value() which calls redraw() if necessary.

      @@ -144,8 +144,8 @@ desired.

      Showing the Window

      -

      The show() method shows the widget or window. For windows -you can also provide the command-line arguments to allow users to +

      The show() method shows the widget or window. For windows +you can also provide the command-line arguments to allow users to customize the appearance, size, and position of your windows.

      The Main Event Loop

      @@ -192,8 +192,8 @@ under FLTK control are closed by the user or your program.

      Compiling Programs with Standard Compilers

      -

      Under UNIX (and under Microsoft Windows when using the GNU development -tools) you will probably need to tell the compiler where to find the +

      Under UNIX (and under Microsoft Windows when using the GNU development +tools) you will probably need to tell the compiler where to find the header files. This is usually done using the -I option:

        @@ -208,7 +208,7 @@ used to get the options that are required by your compiler:

        CC `fltk-config --cxxflags` ...
      -

      Similarly, when linking your application you will need to tell the +

      Similarly, when linking your application you will need to tell the compiler to use the FLTK library:

        @@ -228,18 +228,18 @@ CC ... `fltk-config --ldflags`
         

        In Visual C++ you will need to tell the compiler where to find the FLTK header files. This can be done by selecting "Settings" from the "Project" menu and then -changing the "Preprocessor" settings under the +changing the "Preprocessor" settings under the "C/C++" tab. You will also need to add the FLTK and WinSock (WSOCK32.LIB) libraries to the "Link" settings.

        -

        You can build your Microsoft Windows applications as Console or +

        You can build your Microsoft Windows applications as Console or WIN32 applications. If you want to use the standard C main() function as the entry point, FLTK includes a WinMain() function that will call your main() function for you.

        -

        Note: The Visual C++ 5.0 optimizer is known to cause problems with -many programs. We only recommend using the "Favor Small Code" +

        Note: The Visual C++ 5.0 optimizer is known to cause problems with +many programs. We only recommend using the "Favor Small Code" optimization setting. The Visual C++ 6.0 optimizer seems to be much better and can be used with the "optimized for speed" setting.

        diff --git a/documentation/common.html b/documentation/common.html index e05bdfbc8..61628b403 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -120,12 +120,12 @@ value, instead of a simple string.

        Valuators

        -

        Unlike text widgets, valuators keep track of numbers instead of +

        Unlike text widgets, valuators keep track of numbers instead of strings. FLTK provides the following valuators:

          -
        • Fl_Counter - A widget with arrow buttons that shows the +
        • Fl_Counter - A widget with arrow buttons that shows the current value.
        • Fl_Dial - A round knob.
        • @@ -164,7 +164,7 @@ with FLTK:

        • Fl_Gl_Window - An OpenGL window on the screen.
        • -
        • Fl_Group - The base container class; can be used to group +
        • Fl_Group - The base container class; can be used to group any widgets together.
        • Fl_Pack - A collection of widgets that are packed into the group area.
        • @@ -259,14 +259,14 @@ Figure 3-3 shows the standard box types included with FLTK.

          FLTK Box Types
          Figure 3-3: FLTK box types

          -

          FL_NO_BOX means nothing is drawn at all, so whatever is -already on the screen remains. The FL_..._FRAME types only +

          FL_NO_BOX means nothing is drawn at all, so whatever is +already on the screen remains. The FL_..._FRAME types only draw their edges, leaving the interior unchanged. The blue color in Figure 3-3 is the area that is not drawn by the frame types.

          Making Your Own Boxtypes

          -

          You can define your own boxtypes by making a small function that draws +

          You can define your own boxtypes by making a small function that draws the box and adding it to the table of boxtypes.

          @@ -279,7 +279,7 @@ the box and adding it to the table of boxtypes.

          The Drawing Function

          -

          The drawing function is passed the bounding box and background color +

          The drawing function is passed the bounding box and background color for the widget:

            @@ -350,7 +350,7 @@ sign. Figure 3-4 shows the available symbols.

            align()

            -

            The align() method positions the label. The following +

            The align() method positions the label. The following constants are defined and may be OR'd together as needed:

              @@ -359,17 +359,17 @@ constants are defined and may be OR'd together as needed:

            • FL_ALIGN_TOP - align the label at the top of the widget.
            • -
            • FL_ALIGN_BOTTOM - align the label at the bottom of the +
            • FL_ALIGN_BOTTOM - align the label at the bottom of the widget.
            • FL_ALIGN_LEFT - align the label to the left of the widget.
            • -
            • FL_ALIGN_RIGHT - align the label to the right of the +
            • FL_ALIGN_RIGHT - align the label to the right of the widget.
            • FL_ALIGN_INSIDE - align the label inside the widget.
            • -
            • FL_ALIGN_CLIP - clip the label to the widget's bounding +
            • FL_ALIGN_CLIP - clip the label to the widget's bounding box.
            • FL_ALIGN_WRAP - wrap the label text as needed.
            • @@ -382,7 +382,7 @@ constants are defined and may be OR'd together as needed:

              labeltype()

              -

              The labeltype() method sets the type of the label. The +

              The labeltype() method sets the type of the label. The following standard label types are included:

                @@ -478,7 +478,7 @@ starting at the constant FL_FREE_LABELTYPE. Once you have added the label type you can use the labeltype() method to select your label type.

                -

                The Fl::set_labeltype method can also be used to overload +

                The Fl::set_labeltype method can also be used to overload an existing label type such as FL_NORMAL_LABEL.

                Callbacks

                @@ -494,8 +494,8 @@ void xyz_callback(Fl_Widget *w, void *data) { }
          -

          The callback() method sets the callback function for a -widget. You can optionally pass a pointer to some data needed for the +

          The callback() method sets the callback function for a +widget. You can optionally pass a pointer to some data needed for the callback:

            diff --git a/documentation/drawing.html b/documentation/drawing.html
            index 737d8264e..30a359247 100644
            --- a/documentation/drawing.html
            +++ b/documentation/drawing.html
            @@ -1,90 +1,176 @@
            -
            -

            5 - Drawing Things in FLTK

            - This chapter covers the drawing functions that are provided with FLTK. + + + +

            5 - Drawing Things in FLTK

            + +

            This chapter covers the drawing functions that are provided with FLTK. +

            When Can You Draw Things in FLTK?

            - There are only certain places you can execute drawing code in FLTK. -Calling these functions at other places will result in undefined -behavior! + +

            There are only certain places you can execute drawing code in FLTK. +Calling these functions at other places will result in undefined +behavior! +

              -
            • The most common is inside the virtual method -Fl_Widget::draw(). To write code here, you must subclass one -of the existing Fl_Widget classes and implement your own -version of draw().
            • -
            • You can also write boxtypes and -labeltypes. These are small procedures that can be called by -existing Fl_Widget::draw() methods. These "types" are -identified by an 8-bit index that is stored in the widget's box(), -labeltype(), and possibly other properties.
            • -
            • You can call -Fl_Window::make_current() to do incremental update of a -widget. Use -Fl_Widget::window() to find the window.
            • + +
            • The most common place is inside the virtual method + Fl_Widget::draw(). + To write code here, you must subclass one of the + existing Fl_Widget classes and implement your + own version of draw().
            • + +
            • You can also write boxtypes and labeltypes. These are + small procedures that can be called by existing Fl_Widget::draw() + methods. These "types" are identified by an + 8-bit index that is stored in the widget's + box(), labeltype(), and possibly other + properties.
            • + +
            • You can call Fl_Window::make_current() + to do incremental update of a widget. Use Fl_Widget::window() + to find the window.
            • +
            +

            FLTK Drawing Functions

            - To use the drawing functions you must first include the -<FL/fl_draw.H> header file. FLTK provides the following types of -drawing functions: + +

            To use the drawing functions you must first include the +<FL/fl_draw.H> header file. FLTK provides the +following types of drawing functions: +

            -

            Clipping

            - You can limit all your drawing to a rectangular region by calling -fl_clip, and put the drawings back by using fl_pop_clip. - This rectangle is measured in pixels (it is unaffected by the current -transformation matrix). -

            In addition, the system may provide clipping when updating windows, -this clip region may be more complex than a simple rectangle.

            + +

            Clipping

            + +

            You can limit all your drawing to a rectangular region by calling +fl_clip, and put the drawings back by using fl_pop_clip. +This rectangle is measured in pixels and is unaffected by the current +transformation matrix. + +

            In addition, the system may provide clipping when updating windows +which may be more complex than a simple rectangle.

            +

            void fl_push_clip(int x, int y, int w, int h)

            -Intersect the current clip region with a rectangle and push this new -region onto the stack. + +

            Intersect the current clip region with a rectangle and push this new +region onto the stack. +

            void fl_push_no_clip()

            -Pushes an empty clip region on the stack so nothing will be clipped. + +

            Pushes an empty clip region on the stack so nothing will be clipped. +

            void fl_pop_clip()

            -Restore the previous clip region. You must call fl_pop_clip() -once for every time you call fl_clip(). If you return to -FLTK with the clip stack not empty unpredictable results occur. + +

            Restore the previous clip region. + +

          + + + +
          Note: + +

          You must call fl_pop_clip() once for every + time you call fl_clip(). If you return to FLTK + with the clip stack not empty unpredictable results + occur. + +

          +

          int fl_not_clipped(int x, int y, int w, int h)

          -Returns true if any of the rectangle intersects the current clip -region. If this returns false you don't have to draw the object. -Under X this returns 2 if the rectangle is partially clipped, and 1 if -it is entirely inside the clip region. -

          int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, + +

          Returns non-zero if any of the rectangle intersects the current clip +region. If this returns 0 you don't have to draw the object. + +

          + + + +
          Note: + +

          Under X this returns 2 if the rectangle is partially + clipped, and 1 if it is entirely inside the clip region. + +

          + +

          int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)

          -Intersect the rectangle x,y,w,h with the current clip region -and returns the bounding box of the result in X,Y,W,H. -Returns non-zero if the resulting rectangle is different than the -original. This can be used to limit the necessary drawing to a -rectangle. W and H are set to zero if the rectangle -is completely outside the region. -

          Colors

          + +

          Intersect the rectangle x,y,w,h with the current +clip region and returns the bounding box of the result in +X,Y,W,H. Returns non-zero if the resulting rectangle is +different than the original. This can be used to limit the +necessary drawing to a rectangle. W and H are +set to zero if the rectangle is completely outside the region. + +

          Colors

          + +

          FLTK manages colors as 32-bit unsigned integers. Values from +0 to 255 represent colors from the FLTK 1.0.x standard colormap +and are allocated as needed on screens without TrueColor +support. The Fl_Color enumeration type defines the +standard colors and color cube for the first 256 colors. All of +these are named with symbols in <FL/Enumerations.H>. + +

          Color values greater than 255 are treated as 24-bit RGB +values. These are mapped to the closest color supported by the +screen, either from one of the 256 colors in the FLTK 1.0.x +colormap or a direct RGB value on TrueColor screens. You can +generate 24-bit RGB color values using the fl_rgb_color() +function. +

          void fl_color(Fl_Color)

          - Set the color for all subsequent drawing operations. Fl_Color - is an enumeration type, and all values are in the range 0-255. This -is not the X or WIN32 pixel, it is an index into an internal -table! The table provides several general colors, a 24-entry gray -ramp, and a 5x8x5 color cube. All of these are named with -symbols in -<FL/Enumerations.H>. -

          For colormapped displays, a color cell will be allocated out of -fl_colormap the first time you use a color. If the colormap fills -up then a least-squares algorithm is used to find the closest color.

          + +

          Sets the color for all subsequent drawing operations. + +

          For colormapped displays, a color cell will be allocated out +of fl_colormap the first time you use a color. If the +colormap fills up then a least-squares algorithm is used to find +the closest color.

          +

          Fl_Color fl_color()

          - Returns the last fl_color() that was set. This can be used -for state save/restore. + +

          Returns the last fl_color() that was set. This can +be used for state save/restore. +

          void fl_color(uchar r, uchar g, uchar b)

          - Set the color for all subsequent drawing operations. The closest -possible match to the RGB color is used. The RGB color is used -directly on TrueColor displays. For colormap visuals the nearest index -in the gray ramp or color cube is used. -

          Line dashes and thickness

          +

          Set the color for all subsequent drawing operations. The +closest possible match to the RGB color is used. The RGB color +is used directly on TrueColor displays. For colormap visuals the +nearest index in the gray ramp or color cube is used. + +

          Line Dashes and Thickness

          + +

          FLTK supports drawing of lines with different styles and +widths. Full functionality is not available under Windows 95, 98, +and Me due to the reduced drawing functionality these operating +systems provide.

          void fl_line_style(int style, int width=0, char* dashes=0)

          @@ -92,431 +178,617 @@ in the gray ramp or color cube is used. responsibility to set it back to the default with fl_line_style(0). -
          -Note: Because of how line styles are implemented on WIN32 systems, -you must set the line style after setting the drawing color. -If you set the color after the line style you will lose the line style -settings! -
          +
          + + + +
          Note: -

          style is a bitmask in which you 'or' the following values. If -you don't specify a dash type you will get a solid line. If you don't -specify a cap or join type you will get a system-defined default of -whatever value is fastest. +

          Because of how line styles are implemented on WIN32 + systems, you must set the line style after + setting the drawing color. If you set the color after + the line style you will lose the line style settings! + +

          + +

          style is a bitmask which is a bitwise-OR of the following +values. If you don't specify a dash type you will get a solid +line. If you don't specify a cap or join type you will get a +system-defined default of whatever value is fastest.

            -
          • FL_SOLID      ------- -
          • FL_DASH       - - - - -
          • FL_DOT        ....... -
          • FL_DASHDOT    - . - . -
          • FL_DASHDOTDOT - .. - -
          • FL_CAP_FLAT -
          • FL_CAP_ROUND -
          • FL_CAP_SQUARE (extends past end point 1/2 line width) -
          • FL_JOIN_MITER (pointed) -
          • FL_JOIN_ROUND -
          • FL_JOIN_BEVEL (flat) + +
          • FL_SOLID      ------- + +
          • FL_DASH       - - - - + +
          • FL_DOT        ....... + +
          • FL_DASHDOT    - . - . + +
          • FL_DASHDOTDOT - .. - + +
          • FL_CAP_FLAT + +
          • FL_CAP_ROUND + +
          • FL_CAP_SQUARE (extends past end point 1/2 line width) + +
          • FL_JOIN_MITER (pointed) + +
          • FL_JOIN_ROUND + +
          • FL_JOIN_BEVEL (flat) +
          -

          width is the number of pixels thick to draw the lines. Zero -results in the system-defined default, which on both X and Windows is -somewhat different and nicer than 1. +

          width is the number of pixels thick to draw the lines. +Zero results in the system-defined default, which on both X and +Windows is somewhat different and nicer than 1. -

          dashes is a pointer to an array of dash lengths, measured in +

          dashes is a pointer to an array of dash lengths, measured in pixels. The first location is how long to draw a solid portion, the next is how long to draw the gap, then the solid, etc. It is -terminated with a zero-length entry. A null pointer or a zero-length -array results in a solid line. Odd array sizes are not supported and -result in undefined behavior. The dashes array does not work on -Windows 95/98, use the dash styles instead. - -

          Fast Shapes

          - These are used to draw almost all the FLTK widgets. They draw on -exact pixel boundaries and are as fast as possible, and their behavior -will be duplicated exactly on any platform FLTK is ported to. It is -undefined whether these are affected by the -transformation matrix, so you should only call these while it is -the identity. +terminated with a zero-length entry. A NULL pointer or a zero-length +array results in a solid line. Odd array sizes are not supported and +result in undefined behavior. + +
          + + + +
          Note: + +

          The dashes array does not work under Windows 95, 98, + or Me, since those operating systems do not support + complex line styles. + +

          + +

          Drawing Fast Shapes

          + +

          These functions are used to draw almost all the FLTK widgets. +They draw on exact pixel boundaries and are as fast as possible. +Their behavior is duplicated exactly on all platforms FLTK is +ported. It is undefined whether these are affected by the transformation matrix, so you should only +call these while the matrix is set to the identity matrix (the +default). +

          void fl_point(int x, int y)

          -Draw a single pixel at the given coordinates. + +

          Draw a single pixel at the given coordinates. +

          void fl_rectf(int x, int y, int w, int h)

          - Color a rectangle that exactly fills the given bounding box. + +

          Color a rectangle that exactly fills the given bounding box. +

          void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b)

          - Color a rectangle with "exactly" the passed r,g,b color. On -screens with less than 24 bits of color this is done by drawing a -solid-colored block using fl_draw_image() - so that dithering is produced. + +

          Color a rectangle with "exactly" the passed +r,g,b color. On screens with less than 24 bits of +color this is done by drawing a solid-colored block using fl_draw_image() so that +the correct color shade is produced. +

          void fl_rect(int x, int y, int w, int h)

          - Draw a 1-pixel border inside this bounding box. + +

          Draw a 1-pixel border inside this bounding box. +

          void fl_line(int x, int y, int x1, int y1) -
          void fl_line(int x, int y, int x1, int y1, int x2, int y2)

          - Draw one or two 1-pixel thick lines between the given points. +
          void fl_line(int x, int y, int x1, int y1, int x2, int y2) + +

          Draw one or two lines between the given points. +

          void fl_loop(int x, int y, int x1, int y1, int x2, int y2) -
          void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, +
          void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)

          - Outline a 3 or 4-sided polygon with 1-pixel thick lines. + +

          Outline a 3 or 4-sided polygon with lines. +

          void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) -
          void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int +
          void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)

          - Fill a 3 or 4-sided polygon. The polygon must be convex. + +

          Fill a 3 or 4-sided polygon. The polygon must be convex. +

          void fl_xyline(int x, int y, int x1, int y1) -
          void fl_xyline(int x, int y, int x1, int y1, int x2) -
          void fl_xyline(int x, int y, int x1, int y1, int x2, int y3)

          - Draw 1-pixel wide horizontal and vertical lines. A horizontal line is -drawn first, then a vertical, then a horizontal. +
          void fl_xyline(int x, int y, int x1, int y1, int x2) +
          void fl_xyline(int x, int y, int x1, int y1, int x2, int y3) + +

          Draw horizontal and vertical lines. A horizontal line is +drawn first, then a vertical, then a horizontal. +

          void fl_yxline(int x, int y, int y1) -
          void fl_yxline(int x, int y, int y1, int x2) -
          void fl_yxline(int x, int y, int y1, int x2, int y3)

          - Draw 1-pixel wide vertical and horizontal lines. A vertical line is -drawn first, then a horizontal, then a vertical. +
          void fl_yxline(int x, int y, int y1, int x2) +
          void fl_yxline(int x, int y, int y1, int x2, int y3) + +

          Draw vertical and horizontal lines. A vertical line is drawn +first, then a horizontal, then a vertical. +

          void fl_arc(int x, int y, int w, int h, double a1, double a2) -
          void fl_pie(int x, int y, int w, int h, double a1, double a2)

          - High-speed ellipse sections. These functions match the rather limited -circle drawing code provided by X and WIN32. The advantage over -using fl_arc is that they are faster -because they often use the hardware, and they draw much nicer small -circles, since the small sizes are often hard-coded bitmaps. -

          If a complete circle is drawn it will fit inside the passed bounding -box. The two angles are measured in degrees counterclockwise from +
          void fl_pie(int x, int y, int w, int h, double a1, double a2) + +

          Draw ellipse sections using integer coordinates. These +functions match the rather limited circle drawing code provided +by X and WIN32. The advantage over using fl_arc with floating point +coordinates is that they are faster because they often use the +hardware, and they draw much nicer small circles, since the +small sizes are often hard-coded bitmaps. + +

          If a complete circle is drawn it will fit inside the passed bounding +box. The two angles are measured in degrees counterclockwise from 3'oclock and are the starting and ending angle of the arc, a2 - must be greater or equal to a1.

          -

          fl_arc() draws a 1-pixel thick line (notice this has a -different number of arguments than the fl_arc() - described below.

          -

          fl_pie() draws a filled-in pie slice. This slice may -extend outside the line drawn by fl_arc, to avoid this use -w - 1 and h - 1.

          -

          Complex Shapes

          - These functions let you draw arbitrary shapes with 2-D linear -transformations. The functionality matches that found in Adobe® -PostScriptTM. The exact pixels that are filled is less defined -than for the previous calls so that FLTK can take advantage of drawing -hardware. On both X and WIN32 the transformed vertices are rounded to integers before -drawing the line segments: this severely limits the accuracy of these -functions for complex graphics, so use OpenGL when greater accuracy -and/or performance is required. +must be greater or equal to a1.

          + +

          fl_arc() draws a series of lines to approximate the arc. +Notice that the integer version of fl_arc() has a different +number of arguments than the fl_arc() +function described later in this chapter.

          + +

          fl_pie() draws a filled-in pie slice. This slice may +extend outside the line drawn by fl_arc; to avoid this +use w - 1 and h - 1.

          + +

          Drawing Complex Shapes

          + +

          The complex drawing functions let you draw arbitrary shapes +with 2-D linear transformations. The functionality matches that +found in the Adobe® PostScriptTM language. The +exact pixels that are filled are less defined than for the fast +drawing functions so that FLTK can take advantage of drawing +hardware. On both X and WIN32 the transformed vertices are +rounded to integers before drawing the line segments: this +severely limits the accuracy of these functions for complex +graphics, so use OpenGL when greater accuracy and/or performance +is required. +

          void fl_push_matrix() -
          void fl_pop_matrix()

          - Save and restore the current transformation. The maximum depth of the -stack is 4. +
          void fl_pop_matrix() + +

          Save and restore the current transformation. The maximum +depth of the stack is 4. +

          void fl_scale(float x, float y) -
          void fl_scale(float x) -
          void fl_translate(float x, float y) -
          void fl_rotate(float d) -
          void fl_mult_matrix(float a, float b, float c, float d, float -x, float y)

          - Concatenate another transformation onto the current one. The rotation -angle is in degrees (not radians) and is counter-clockwise. +
          void fl_scale(float x) +
          void fl_translate(float x, float y) +
          void fl_rotate(float d) +
          void fl_mult_matrix(float a, float b, float c, float d, float +x, float y) + +

          Concatenate another transformation onto the current one. The rotation +angle is in degrees (not radians) and is counter-clockwise. +

          void fl_begin_line() -
          void fl_end_line()

          - Start and end drawing 1-pixel thick lines. +
          void fl_end_line() + +

          Start and end drawing lines. +

          void fl_begin_loop()
          void fl_end_loop()

          - Start and end drawing a closed sequence of 1-pixel thick lines. + +

          Start and end drawing a closed sequence of lines. +

          void fl_begin_polygon() -
          void fl_end_polygon()

          - Start and end drawing a convex filled polygon. +
          void fl_end_polygon() + +

          Start and end drawing a convex filled polygon. +

          void fl_begin_complex_polygon() -
          void fl_gap() -
          void fl_end_complex_polygon()

          - Start and end drawing a complex filled polygon. This polygon may be -concave, may have holes in it, or may be several disconnected pieces. -Call fl_gap() to seperate loops of the path (it is unnecessary -but harmless to call fl_gap() before the first vertex, after -the last one, or several times in a row). For portability, you should -only draw polygons that appear the same whether "even/odd" or -"non-zero" winding rules are used to fill them. This mostly means that -holes should be drawn in the opposite direction of the outside. +
          void fl_gap() +
          void fl_end_complex_polygon() + +

          Start and end drawing a complex filled polygon. This polygon +may be concave, may have holes in it, or may be several +disconnected pieces. Call fl_gap() to seperate loops of +the path. It is unnecessary but harmless to call +fl_gap() before the first vertex, after the last one, +or several times in a row. + +

          + + + +
          Note: + +

          For portability, you should only draw polygons that + appear the same whether "even/odd" or + "non-zero" winding rules are used to fill + them. Holes should be drawn in the opposite direction of + the outside loop. + +

          +

          fl_gap() should only be called between -fl_begin_complex_polygon() and fl_end_complex_polygon(). - To outline the polygon, use fl_begin_loop() and replace each -fl_gap() with fl_end_loop();fl_begin_loop().

          +fl_begin_complex_polygon() and +fl_end_complex_polygon(). To outline the polygon, use +fl_begin_loop() and replace each fl_gap() with +fl_end_loop();fl_begin_loop().

          +

          void fl_vertex(float x, float y)

          - Add a single vertex to the current path. -

          void fl_curve(float x, float y, float x1, float y1, float x2, float +Add a single vertex to the current path. + +

          void fl_curve(float x, float y, float x1, float y1, float x2, float y2, float x3, float y3)

          - Add a series of points on a Bezier curve to the path. The curve ends -(and two of the points) are at x,y and x3,y3. + +

          Add a series of points on a Bezier curve to the path. The curve ends +(and two of the points) are at x,y and x3,y3. +

          void fl_arc(float x, float y, float r, float start, float end)

          - Add a series of points to the current path on the arc of a circle (you -can get elliptical paths by using scale and rotate before calling -this). x,y are the center of the circle, and r is its -radius. fl_arc() takes start and end angles -that are measured in degrees counter-clockwise from 3 o'clock. If -end is less than start then it draws the arc in a -clockwise direction. + +

          Add a series of points to the current path on the arc of a +circle; you can get elliptical paths by using scale and rotate +before calling fl_arc(). x,y are the center of +the circle, and r is its radius. fl_arc() +takes start and end angles that are measured +in degrees counter-clockwise from 3 o'clock. If end is +less than start then it draws the arc in a clockwise +direction. +

          void fl_circle(float x, float y, float r)

          -fl_circle() is equivalent to fl_arc(...,0,360) but -may be faster. It must be the only thing in the path: if you -want a circle as part of a complex polygon you must use fl_arc() -. This draws incorrectly if the transformation is both rotated and -non-square scaled. -

          Text

          - All text is drawn in the current font. It is -undefined whether this location or the characters are modified by the -current transformation. + +

          fl_circle() is equivalent to fl_arc(...,0,360) but +may be faster. It must be the only thing in the path: if you +want a circle as part of a complex polygon you must use fl_arc(). + +

          + + + +
          Note: + +

          fl_circle() draws incorrectly if the + transformation is both rotated and non-square scaled. + +

          + +

          Drawing Text

          + +

          All text is drawn in the current font. +It is undefined whether this location or the characters are +modified by the current transformation. +

          void fl_draw(const char *, float x, float y) -
          void fl_draw(const char *, int n, float x, float y)

          - Draw a nul-terminated string or an array of n characters -starting at the given location. -

          void fl_draw(const char *, int x, int y, int w, int h, Fl_Align)

          - Fancy string drawing function which is used to draw all the labels. -The string is formatted and aligned inside the passed box. Handles -'\t' and '\n', expands all other control characters to ^X, and aligns -inside or against the edges of the box. See -Fl_Widget::align() for values for align. The -value FL_ALIGN_INSIDE is ignored, as this function always -prints inside the box. -

          void fl_measure(const char *, int &w, int &h)

          - Measure how wide and tall the string will be when printed by the -fl_draw(...align) function. If the incoming w is -non-zero it will wrap to that width. +
          void fl_draw(const char *, int n, float x, float y) + +

          Draw a nul-terminated string or an array of n characters +starting at the given location. + +

          void fl_draw(const char *, int x, int y, int w, int h, +Fl_Align align, Fl_Image *img = 0, int draw_symbols = 1)

          + +

          Fancy string drawing function which is used to draw all the +labels. The string is formatted and aligned inside the passed +box. Handles '\t' and '\n', expands all other control +characters to ^X, and aligns inside or against the edges of the +box. See Fl_Widget::align() +for values for align. The value +FL_ALIGN_INSIDE is ignored, as this function always +prints inside the box. + +

          If img is provided and is not NULL, the +image is drawn above or below the text as specified by the +align value. + +

          The draw_symbols argument specifies whether or not +to look for symbol names starting with the "@" character. + +

          void fl_measure(const char *, int &w, int &h, int draw_symbols = 1)

          + +

          Measure how wide and tall the string will be when printed by +the fl_draw(...align) function. If the incoming +w is non-zero it will wrap to that width. +

          int fl_height()

          - Recommended minimum line spacing for the current font. You can also -just use the value of size passed to -fl_font(). + +

          Recommended minimum line spacing for the current font. You +can also just use the value of size passed to fl_font(). +

          int fl_descent()

          - Recommended distance above the bottom of a fl_height() tall -box to draw the text at so it looks centered vertically in that box. + +

          Recommended distance above the bottom of a +fl_height() tall box to draw the text at so it looks +centered vertically in that box. +

          float fl_width(const char*) -
          float fl_width(const char*, int n) -
          float fl_width(uchar)

          - Return the pixel width of a nul-terminated string, a sequence of n - characters, or a single character in the current font. +
          float fl_width(const char*, int n) +
          float fl_width(uchar) + +

          Return the pixel width of a nul-terminated string, a sequence of n +characters, or a single character in the current font. +

          const char *fl_shortcut_label(ulong)

          - Unparse a shortcut value as used by -Fl_Button or -Fl_Menu_Item into a human-readable string like "Alt+N". This -only works if the shortcut is a character key or a numbered function -key. If the shortcut is zero an empty string is returned. The return -value points at a static buffer that is overwritten with each call. -

          Fonts

          -

          void fl_font(int face, int size)

          - Set the current font, which is then used by the routines described -above. You may call this outside a draw context if necessary to call -fl_width(), but on X this will open the display. -

          The font is identified by a face and a size. The -size of the font is measured in pixels (not "points"). Lines - should be spaced size pixels apart (or more).

          -

          The face is an index into an internal table. Initially -only the first 16 faces are filled in. There are symbolic names for -them: FL_HELVETICA, FL_TIMES, FL_COURIER, -and modifier values FL_BOLD and FL_ITALIC which can -be added to these, and FL_SYMBOL and FL_ZAPF_DINGBATS -. Faces greater than 255 cannot be used in Fl_Widget labels, -since it stores the index as a byte.

          + +

          Unparse a shortcut value as used by Fl_Button +or Fl_Menu_Item +into a human-readable string like "Alt+N". This only +works if the shortcut is a character key or a numbered function +key. If the shortcut is zero an empty string is returned. The +return value points at a static buffer that is overwritten with +each call. + +

          Fonts

          + +

          FLTK supports a set of standard fonts based on the Times, +Helvetica/Arial, Courier, and Symbol typefaces, as well as +custom fonts that your application may load. Each font is +accessed by an index into a font table. + +

          Initially only the first 16 faces are filled in. There are +symbolic names for them: FL_HELVETICA, +FL_TIMES, FL_COURIER, and modifier values +FL_BOLD and FL_ITALIC which can be added to +these, and FL_SYMBOL and FL_ZAPF_DINGBATS. +Faces greater than 255 cannot be used in Fl_Widget +labels, since Fl_Widget stores the index as a byte.

          + +

          void fl_font(int face, int size)

          + +

          Set the current font, which is then used by the routines +described above. You may call this outside a draw context if +necessary to call fl_width(), but on X this will open +the display. + +

          The font is identified by a face and a +size. The size of the font is measured in +pixels and not "points". Lines should be spaced +size pixels apart or more.

          +

          int fl_font() -
          int fl_size()

          - Returns the face and size set by the most recent call to -fl_font(a,b). This can be used to save/restore the font. -

          Overlays

          -

          void fl_overlay_rect(int x, int y, int w, int h) -
          void fl_overlay_clear()

          - These functions allow you to draw interactive selection rectangles -without using the overlay hardware. FLTK will XOR a single rectangle -outline over a window. Calling this will erase any previous rectangle -(by XOR'ing it), and then draw the new one. Calling -fl_overlay_clear() will erase the rectangle without drawing a new -one. -

          Using this is tricky. You should make a widget with both a -handle() and draw() method. draw() should call -fl_overlay_clear() before doing anything else. Your handle() - method should call window()->make_current() and then -fl_overlay_rect() after FL_DRAG events, and should call -fl_overlay_clear() after a FL_RELEASE event.

          -

          Images

          - To draw images, you can either do it directly from data in your -memory, or you can create Fl_Bitmap, -Fl_Image, or Fl_Pixmap - objects. The advantage of drawing directly is that it is more -intuitive, and it is faster if the image data changes more often than -it is redrawn. The advantage of using the object is that FLTK will -cache translated forms of the image (on X it uses a server pixmap) and -thus redrawing is much faster. +
          int fl_size() + +

          Returns the face and size set by the most recent call to +fl_font(a,b). This can be used to save/restore the +font. + +

          Drawing Overlays

          + +

          These functions allow you to draw interactive selection rectangles +without using the overlay hardware. FLTK will XOR a single rectangle +outline over a window. + +

          void fl_overlay_rect(int x, int y, int w, int h); +
          void fl_overlay_clear();

          + +

          fl_overlay_rect() draws a selection rectangle, erasing any +previous rectangle by XOR'ing it first. fl_overlay_clear() +will erase the rectangle without drawing a new one. + +

          Using these functions is tricky. You should make a widget +with both a handle() and draw() method. +draw() should call fl_overlay_clear() before +doing anything else. Your handle() method should call +window()->make_current() and then +fl_overlay_rect() after FL_DRAG events, and +should call fl_overlay_clear() after a +FL_RELEASE event.

          + +

          Drawing Images

          + +

          To draw images, you can either do it directly from data in +your memory, or you can create a Fl_Image object. The advantage of +drawing directly is that it is more intuitive, and it is faster +if the image data changes more often than it is redrawn. The +advantage of using the object is that FLTK will cache translated +forms of the image (on X it uses a server pixmap) and thus +redrawing is much faster. +

          Direct Image Drawing

          - It is undefined whether the location or drawing of the image is -affected by the current transformation, so you should only call these -when it is the identity. -

          void fl_draw_image(const uchar *, int X, int Y, int W, int H, int D + +

          The behavior when drawing images when the current +transformation matrix is not the identity is not defined, so you +should only draw images when the matrix is set to the identity. + +

          void fl_draw_image(const uchar *, int X, int Y, int W, int H, int D = 3, int LD = 0) -
          void fl_draw_image_mono(const uchar *, int X, int Y, int W, int H, +
          void fl_draw_image_mono(const uchar *, int X, int Y, int W, int H, int D = 1, int LD = 0)

          - Draw an 8-bit per color RGB or luminance image. The pointer points at -the "r" data of the top-left pixel. Data must be in r,g,b - order. X,Y are where to put the top-left corner. W - and H define the size of the image. D is the delta -to add to the pointer between pixels, it may be any value greater or -equal to 3, or it can be negative to flip the image -horizontally. LD is the delta to add to the pointer between -lines (if 0 is passed it uses W * D), and may be larger than -W * D to crop data, or negative to flip the image vertically. -

          It is highly recommended that you put the following code before the -first show() of any window in your program to get rid + +

          Draw an 8-bit per color RGB or luminance image. The pointer +points at the "r" data of the top-left pixel. Color +data must be in r,g,b order. X,Y are where to +put the top-left corner. W and H define the +size of the image. D is the delta to add to the pointer +between pixels, it may be any value greater or equal to +3, or it can be negative to flip the image +horizontally. LD is the delta to add to the pointer +between lines (if 0 is passed it uses W * D), and may +be larger than W * D to crop data, or negative to flip +the image vertically. + +

          It is highly recommended that you put the following code before the +first show() of any window in your program to get rid of the dithering if possible:

          -
            -
            +
            +
               Fl::visual(FL_RGB);
              -
              -
            - Gray scale (1-channel) images may be drawn. This is done if abs(D) - is less than 3, or by calling fl_draw_image_mono(). Only one -8-bit sample is used for each pixel, and on screens with different -numbers of bits for red, green, and blue only gray colors are used. - Setting D greater than 1 will let you display one channel of -a color image. -

            The X version does not support all possible visuals. If FLTK -cannot draw the image in the current visual it will abort. FLTK -supports any visual of 8 bits or less, and all common TrueColor visuals -up to 32 bits.

            -

            typedef void (*fl_draw_image_cb)(void *, int x, int y, int w, uchar +

          + +

          Gray scale (1-channel) images may be drawn. This is done if +abs(D) is less than 3, or by calling +fl_draw_image_mono(). Only one 8-bit sample is used for +each pixel, and on screens with different numbers of bits for +red, green, and blue only gray colors are used. Setting +D greater than 1 will let you display one channel of a +color image. + +

          + + + +
          Note: + +

          The X version does not support all possible visuals. + If FLTK cannot draw the image in the current visual it + will abort. FLTK supports any visual of 8 bits or less, + and all common TrueColor visuals up to 32 bits.

          + +
          + +

          typedef void (*fl_draw_image_cb)(void *, int x, int y, int w, uchar *) -
          void fl_draw_image(fl_draw_image_cb, void *, int X, int Y, int W, +
          void fl_draw_image(fl_draw_image_cb, void *, int X, int Y, int W, int H, int D = 3) -
          void fl_draw_image_mono(fl_draw_image_cb, void *, int X, int Y, +
          void fl_draw_image_mono(fl_draw_image_cb, void *, int X, int Y, int W, int H, int D = 1)

          - Call the passed function to provide each scan line of the image. This -lets you generate the image as it is being drawn, or do arbitrary -decompression of stored data (provided it can be decompressed to -individual scan lines easily). -

          The callback is called with the void * user data pointer -(this can be used to point at a structure of information about the -image), and the x, y, and w of the scan line -desired from the image. 0,0 is the upper-left corner (not X,Y -). A pointer to a buffer to put the data into is passed. You must -copy w pixels from scanline y, starting at pixel x -, to this buffer.

          -

          Due to cropping, less than the whole image may be requested. So -x may be greater than zero, the first y may be greater -than zero, and w may be less than W. The buffer is -long enough to store the entire W * D pixels, this is for -convienence with some decompression schemes where you must decompress -the entire line at once: decompress it into the buffer, and then if -x is not zero, copy the data over so the x'th pixel is at -the start of the buffer.

          -

          You can assume the y's will be consecutive, except the -first one may be greater than zero.

          -

          If D is 4 or more, you must fill in the unused bytes with -zero.

          + +

          Call the passed function to provide each scan line of the +image. This lets you generate the image as it is being drawn, +or do arbitrary decompression of stored data, provided it can be +decompressed to individual scan lines easily. + +

          The callback is called with the void * user data +pointer which can be used to point at a structure of information +about the image, and the x, y, and w +of the scan line desired from the image. 0,0 is the upper-left +corner of the image, not X,Y. A pointer to a +buffer to put the data into is passed. You must copy w +pixels from scanline y, starting at pixel x, +to this buffer.

          + +

          Due to cropping, less than the whole image may be requested. +So x may be greater than zero, the first y may +be greater than zero, and w may be less than +W. The buffer is long enough to store the entire W +* D pixels, this is for convenience with some decompression +schemes where you must decompress the entire line at once: +decompress it into the buffer, and then if x is not +zero, copy the data over so the x'th pixel is at the +start of the buffer.

          + +

          You can assume the y's will be consecutive, except +the first one may be greater than zero.

          + +

          If D is 4 or more, you must fill in the unused bytes +with zero.

          +

          int fl_draw_pixmap(char **data, int X, int Y, Fl_Color = FL_GRAY)

          -Draws XPM image data, with the top-left corner at the given position. -The image is dithered on 8-bit displays so you won't lose color space -for programs displaying both images and pixmaps. This function returns -zero if there was any error decoding the XPM data. -

          To use an XPM, do:

          -
            -
            +
            +

            Draws XPM image data, with the top-left corner at the given position. +The image is dithered on 8-bit displays so you won't lose color space +for programs displaying both images and pixmaps. This function returns +zero if there was any error decoding the XPM data. + +

            To use an XPM, do:

            + +
               #include "foo.xpm"
               ...
               fl_draw_pixmap(foo, X, Y);
              -
              -
            - In the current version the XPM data is converted to 24-bit RGB color -and passed through fl_draw_image(). This is obviously not the -most efficient way to do it, and has the same visual limitations as -listed above for fl_draw_image(). Transparent colors are -replaced by the optional Fl_Color argument (this may change in -the future). +
          + +

          Transparent colors are replaced by the optional +Fl_Color argument. To draw with true transparency you must +use the Fl_Pixmap class. +

          int fl_measure_pixmap(char **data, int &w, int &h)

          - An XPM image contains the dimensions in its data. This function finds -and returns the width and height. The return value is non-zero if it -parsed the dimensions ok, and zero if there is any problem. -

          class Fl_Bitmap

          - This object encapsulates the width, height, and bits of an X bitmap -(XBM), and allows you to make an Fl_Widget use a bitmap as a -label, or to just draw the bitmap directly. Under X it will create an -offscreen pixmap the first time it is drawn, and copy this each -subsequent time it is drawn. -

          Fl_Bitmap(const char *bits, int W, int H) -
          Fl_Bitmap(const uchar *bits, int W, int H)

          - Construct using an X bitmap. The bits pointer is simply copied to the -object, so it must point at persistent storage. The two constructors -are provided because various X implementations disagree about the type -of bitmap data. To use an XBM file use: + +

          An XPM image contains the dimensions in its data. This +function finds and returns the width and height. The return +value is non-zero if the dimensions were parsed ok and zero if +there was any problem. + +

          Image Classes

          + +

          FLTK provides a base image class called Fl_Image which supports +creating, copying, and drawing images of various kinds, along +with some basic color operations. Images can be used as labels +for widgets using the image() and +deimage() +methods or drawn directly. + +

          The Fl_Image class +does almost nothing by itself, but is instead supported by three +basic image types: +

          -

          ~Fl_Bitmap()

          - The destructor will destroy any X pixmap created. It does not do -anything to the bits data. -

          void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)

          -x,y,w,h indicates a destination rectangle. ox,oy,w,h - is a source rectangle. This source rectangle from the bitmap is drawn -in the destination. 1 bits are drawn with the current color, 0 bits -are unchanged. The source rectangle may extend outside the bitmap -(i.e. ox and oy may be negative and w and -h may be bigger than the bitmap) and this area is left unchanged. -

          void draw(int x, int y)

          - Draws the bitmap with the upper-left corner at x,y. This is -the same as doing draw(x,y,this->w,this->h,0,0). -

          void label(Fl_Widget *)

          - Change the label() and the labeltype() of the widget -to draw the bitmap. 1 bits will be drawn with the labelcolor() -, zero bits will be unchanged. You can use the same bitmap for many -widgets. -

          class Fl_Pixmap

          - This object encapsulates the data from an XPM image, and allows you to -make an Fl_Widget use a pixmap as a label, or to just draw the -pixmap directly. Under X it will create an offscreen pixmap the -first time it is drawn, and copy this each subsequent time it is drawn -. -

          The current implementation converts the pixmap to 24-bit RGB data -and uses fl_draw_image() to draw -it. Thus you will get dithered colors on an 8 bit screen.

          -

          Fl_Pixmap(char *const* data)

          - Construct using XPM data. The data pointer is simply copied to the -object, so it must point at persistent storage. To use an XPM file do: + +

          The Fl_Bitmap class encapsulates a mono-color bitmap image. +The draw() method draws the image using the current drawing +color. + +

          The Fl_Pixmap class encapsulates a colormapped image. +The draw() method draws the image using the colors in the +file, and masks off any transparent colors automatically. + +

          The Fl_RGB_Image class encapsulates a full-color (or +grayscale) image with 1 to 4 color components. Images with an +even number of components are assumed to contain an alpha +channel that is used for transparency. The transparency provided +by the draw() method is either a 24-bit blend against +the existing window contents or a "screen door" transparency +mask, depending on the platform and screen color depth. + +

          FLTK also provides several image classes based on the three +standard image types for common file formats: +

          -

          ~Fl_Pixmap()

          - The destructor will destroy any X pixmap created. It does not do -anything to the data. -

          void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)

          -x,y,w,h indicates a destination rectangle. ox,oy,w,h - is a source rectangle. This source rectangle is copied to the -destination. The source rectangle may extend outside the pixmap (i.e. -ox and oy may be negative and w and h - may be bigger than the pixmap) and this area is left unchanged. -

          void draw(int x, int y)

          - Draws the image with the upper-left corner at x,y. This is -the same as doing draw(x,y,this->w,this->h,0,0). -

          void label(Fl_Widget *)

          - Change the label() and the labeltype() of the widget -to draw the pixmap. You can use the same pixmap for many widgets. -

          class Fl_Image

          - This object encapsulates a full-color RGB image, and allows you to -make an Fl_Widget use an image as a label, or to just draw the -image directly. Under X it will create an offscreen pixmap the first -time it is drawn, and copy this each subsequent time it is drawn. -

          Fl_Image(const uchar *data, int W, int H, int D = 3, int LD = 0)

          - Construct using a pointer to RGB data. W and H are -the size of the image in pixels. D is the delta between pixels -(it may be more than 3 to skip alpha or other data, or negative to flip -the image left/right). LD is the delta between lines (it may -be more than D * W to crop images, or negative to flip the -image vertically). The data pointer is simply copied to the object, so -it must point at persistent storage. -

          ~Fl_Image()

          - The destructor will destroy any X pixmap created. It does not do -anything to the data. -

          void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)

          -x,y,w,h indicates a destination rectangle. ox,oy,w,h - is a source rectangle. This source rectangle is copied to the -destination. The source rectangle may extend outside the image (i.e. -ox and oy may be negative and w and h - may be bigger than the image) and this area is left unchanged. + +

          Each of these image classes load a named file of the +corresponding format. The Fl_Shared_Image class +can be used to load any type of image file - the class examines +the file and constructs an image of the appropriate type. + +

          Finally, FLTK provides a special image class called Fl_Tiled_Image to tile +another image object in the specified area. This class can be +used to tile a background image in a Fl_Group widget, +for example. + +

          virtual void copy();
          +virtual void copy(int w, int h);

          + +

          The copy() method creates a copy of the image. The second form +specifies the new size of the image - the image is resized using the +nearest-neighbor algorithm. + +

          void draw(int x, int y, int w, int h, int ox = 0, int oy = 0);

          + +

          The draw() method draws the image object. +x,y,w,h indicates a destination rectangle. +ox,oy,w,h is a source rectangle. This source rectangle +is copied to the destination. The source rectangle may extend +outside the image, i.e. ox and oy may be +negative and w and h may be bigger than the +image, and this area is left unchanged. +

          void draw(int x, int y)

          - Draws the image with the upper-left corner at x,y. This is -the same as doing draw(x,y,this->w,this->h,0,0). -

          void label(Fl_Widget *)

          - Change the label() and the labeltype() of the widget -to draw the image. You can use the same image for many widgets. + +

          Draws the image with the upper-left corner at x,y. +This is the same as doing +draw(x,y,img->w(),img->h(),0,0). + + + diff --git a/documentation/editor.html b/documentation/editor.html index 236bc8162..565ba5ee0 100644 --- a/documentation/editor.html +++ b/documentation/editor.html @@ -1,25 +1,35 @@ - -

          4 - Designing a Simple Text Editor

          -This chapter takes you through the design of a simple FLTK-based text -editor. + + + +

          4 - Designing a Simple Text Editor

          + +

          This chapter takes you through the design of a simple +FLTK-based text editor. +

          Determining the Goals of the Text Editor

          - Since this will be the first big project you'll be doing with FLTK, -lets define what we want our text editor to do: + +

          Since this will be the first big project you'll be doing with FLTK, +lets define what we want our text editor to do: +

            -
          1. Menubar/menus for all functions.
          2. -
          3. Edit a single text file.
          4. -
          5. Load from a file.
          6. -
          7. Save to a file.
          8. -
          9. Cut/copy/delete/paste functions.
          10. -
          11. Search and replace functions.
          12. -
          13. Keep track of when the file has been changed.
          14. + +
          15. Provide a menubar/menus for all functions.
          16. +
          17. Edit a single text file, possibly with multiple views.
          18. +
          19. Load from a file.
          20. +
          21. Save to a file.
          22. +
          23. Cut/copy/delete/paste functions.
          24. +
          25. Search and replace functions.
          26. +
          27. Keep track of when the file has been changed.
          28. +
          +

          Designing the Main Window

          -Now that we've outlined the goals for our editor, we can begin with -the design of our GUI. Obviously the first thing that we need is a -window: -
            -
            +
            +

            Now that we've outlined the goals for our editor, we can begin with +the design of our GUI. Obviously the first thing that we need is a +window, which we'll place inside a class called EditorWindow: + +

               class EditorWindow : public Fl_Double_Window {
                 public:
                   EditorWindow(int w, int h, const char* t);
              @@ -35,29 +45,31 @@ class EditorWindow : public Fl_Double_Window {
                   Fl_Text_Editor     *editor;
                   char               search[256];
               };
              -
              -
            +
          +

          Variables

          -Our text editor will need some global variables to keep track of -things: -
            -
            -int                changed = 0;
            -char               filename[1024] = "";
            -char               search[256] = "";
            -Fl_Text_Buffer     *textbuf;
            -
            -
          -The textbuf variable is the text editor buffer for our -window described previously. We'll cover the other variables as -we build the application. + +

          Our text editor will need some global variables to keep track of +things: + +

            +int            changed = 0;
            +char           filename[256] = "";
            +Fl_Text_Buffer *textbuf;
            +
          + +

          The textbuf variable is the text editor buffer for +our window class described previously. We'll cover the other +variables as we build the application.

          +

          Menubars and Menus

          -The first goal requires us to use a menubar and menus that define each -function the editor needs to perform. The -Fl_Menu_Item structure is used to define the menus and -items in a menubar: -
            -
            +
            +

            The first goal requires us to use a menubar and menus that +define each function the editor needs to perform. The Fl_Menu_Item structure is +used to define the menus and items in a menubar:

            + +
               Fl_Menu_Item menuitems[] = {
                 { "&File",              0, 0, 0, FL_SUBMENU },
                   { "&New File",        0, (Fl_Callback *)new_cb },
              @@ -87,237 +99,262 @@ Fl_Menu_Item menuitems[] = {
               
                 { 0 }
               };
              -
              -
            -Once we have the menus defined we can create the Fl_Menu_Bar -widget and assign the menus to it with: -
              -
              +
            + +

            Once we have the menus defined we can create the +Fl_Menu_Bar widget and assign the menus to it with:

            + +
               Fl_Menu_Bar *m = new Fl_Menu_Bar(0, 0, 512, 30);
               m->copy(menuitems);
              -
              -
            -We'll define the callback functions later. +
          + +

          We'll define the callback functions later. +

          Editing the Text

          -To keep things simple our text editor will use the -Fl_Text_Editor -widget to edit the text: -
            -
            +
            +

            To keep things simple our text editor will use the +Fl_Text_Editor +widget to edit the text: + +

               w->editor = new Fl_Text_Editor(0, 30, 512, 354);
               w->editor->buffer(textbuf);
              -
              -
            -So that we can keep track of changes to the file, we also want to add -a "modify" callback: -
              -
              +
            + +

            So that we can keep track of changes to the file, we also want to add +a "modify" callback:

            + +
               textbuf->add_modify_callback(changed_cb, w);
               textbuf->call_modify_callbacks();
              -
              -
            -Finally, we want to use a mono-spaced font like FL_COURIER: -
              -
              +
            + +

            Finally, we want to use a mono-spaced font like FL_COURIER: + +

               w->editor->textfont(FL_COURIER);
              -
              -
            +
          +

          The Replace Dialog

          -We can use the FLTK convenience functions for many of the editor's -dialogs, however the replace dialog needs its own custom window. To -keep things simple we will have a "find" string, a "replace" string, -and "replace all", "replace next", and "cancel" buttons. The strings -are just Fl_Input widgets, the "replace all" and "cancel" -buttons are Fl_Button widgets, and the "replace next " button -is a Fl_Return_Button widget: -

          The search and replace dialog.

          -
            -
            +
            +

            We can use the FLTK convenience functions for many of the +editor's dialogs, however the replace dialog needs its own +custom window. To keep things simple we will have a +"find" string, a "replace" string, and +"replace all", "replace next", and +"cancel" buttons. The strings are just +Fl_Input widgets, the "replace all" and +"cancel" buttons are Fl_Button widgets, and +the "replace next " button is a +Fl_Return_Button widget:

            + +

            The search and replace dialog.
            +Figure 4-1: The search and replace dialog.

            + +
               Fl_Window *replace_dlg = new Fl_Window(300, 105, "Replace");
               Fl_Input *replace_find = new Fl_Input(70, 10, 200, 25, "Find:");
               Fl_Input *replace_with = new Fl_Input(70, 40, 200, 25, "Replace:");
               Fl_Button *replace_all = new Fl_Button(10, 70, 90, 25, "Replace All");
               Fl_Button *replace_next = new Fl_Button(105, 70, 120, 25, "Replace Next");
               Fl_Button *replace_cancel = new Fl_Button(230, 70, 60, 25, "Cancel");
              -
              -
            +
          +

          Callbacks

          -Now that we've defined the GUI components of our editor, we need to -define our callback functions. + +

          Now that we've defined the GUI components of our editor, we +need to define our callback functions.

          +

          changed_cb()

          - This function will be called whenever the user changes any text in the -input widget: -
            -
            -void changed_cb(void) {
            -  set_changed(1);
            +
            +

            This function will be called whenever the user changes any text in the +editor widget: + +

              +void changed_cb(int, int nInserted, int nDeleted,int, const char*, void* v) {
              +  if ((nInserted || nDeleted) && !loading) changed = 1;
              +  EditorWindow *w = (EditorWindow *)v;
              +  set_title(w);
              +  if (loading) w->editor->show_insert_position();
               }
              -
              -
            - The set_changed() function is one that we will write to set -the changed status on the current file. We're doing it this way -because some of the other callbacks will set the changed status to 0, -and also because we want to show the changed status in the window's -title bar. +
          + +

          The set_title() function is one that we will write to set +the changed status on the current file. We're doing it this way +because we want to show the changed status in the window's +title bar. +

          copy_cb()

          - This callback function will call -input->copy() to copy the currently selected text to the -clipboard: -
            -
            -void copy_cb(void) {
            -  input->copy();
            +
            +

            This callback function will call kf_copy() +to copy the currently selected text to the clipboard:

            + +
              +void copy_cb(Fl_Widget*, void* v) {
              +  EditorWindow* e = (EditorWindow*)v;
              +  Fl_Text_Editor::kf_copy(0, e->editor);
               }
              -
              -
            +
          +

          cut_cb()

          - This callback function will call -input->copy() to copy the currently selected text to the -clipboard and then input->cut() - to delete it: -
            -
            -void cut_cb(void) {
            -  input->copy();
            -  input->cut();
            +
            +

            This callback function will call kf_cut() +to cut the currently selected text to the clipboard:

            + +
              +void cut_cb(Fl_Widget*, void* v) {
              +  EditorWindow* e = (EditorWindow*)v;
              +  Fl_Text_Editor::kf_cut(0, e->editor);
               }
              -
              -
            +
          +

          delete_cb()

          - This callback function will call -input->cut() to delete the selected text: -
            -
            -void delete_cb(void) {
            -  input->cut();
            +
            +

            This callback function will call remove_selection() +to delete the currently selected text to the clipboard:

            + +
              +void delete_cb(Fl_Widget*, void* v) {
              +  textbuf->remove_selection();
               }
              -
              -
            +
          +

          find_cb()

          - This callback function asks for a search string using the -fl_input() convenience function and then calls the -find2_cb() function to find the string: -
            -
            -void find_cb(void) {
            +
            +

            This callback function asks for a search string using the fl_input() +convenience function and then calls the find2_cb() +function to find the string: + +

              +void find_cb(Fl_Widget* w, void* v) {
              +  EditorWindow* e = (EditorWindow*)v;
                 const char *val;
               
              -  val = fl_input("Search String:", search);
              +  val = fl_input("Search String:", e->search);
                 if (val != NULL) {
                   // User entered a string - go find it!
              -    strcpy(search, val);
              -    find2_cb();
              +    strcpy(e->search, val);
              +    find2_cb(w, v);
                 }
              -}
              -
              -
            +
          +

          find2_cb()

          - This function will find the next occurrence of the search string. If -the search string is blank then we want to pop up the search dialog: -
            -
            -void find2_cb(void) {
            -  const char *val, *found;
            -  int pos;
            -
            -  if (search[0] == '\0') {
            +
            +

            This function will find the next occurrence of the search +string. If the search string is blank then we want to pop up the +search dialog: + +

              +void find2_cb(Fl_Widget* w, void* v) {
              +  EditorWindow* e = (EditorWindow*)v;
              +  if (e->search[0] == '\0') {
                   // Search string is blank; get a new one...
              -    find_cb();
              +    find_cb(w, v);
                   return;
                 }
               
              -  val   = input->value() + input->mark();
              -  found = strstr(val, search);
              -
              -  if (found != NULL) {
              -    // Found a match; update the position and mark...
              -    pos = input->mark() + found - val;
              -    input->position(pos, pos + strlen(search));
              +  int pos = e->editor->insert_position();
              +  int found = textbuf->search_forward(pos, e->search, &pos);
              +  if (found) {
              +    // Found a match; select and update the position...
              +    textbuf->select(pos, pos+strlen(e->search));
              +    e->editor->insert_position(pos+strlen(e->search));
              +    e->editor->show_insert_position();
                 }
              -  else fl_alert("No occurrences of \'%s\' found!", search);
              +  else fl_alert("No occurrences of \'%s\' found!", e->search);
               }
              -
              -
            - If the search string cannot be found we use the -fl_alert() convenience function to display a message to that -effect. +
          + +

          If the search string cannot be found we use the fl_alert() +convenience function to display a message to that effect. +

          new_cb()

          - This callback function will clear the input widget and current -filename. It also calls the check_save() function to give the -user the opportunity to save the current file first as needed: -
            -
            -void new_cb(void) {
            -  if (changed)
            -    if (!check_save()) return;
            +

            This callback function will clear the editor widget and current +filename. It also calls the check_save() function to give the +user the opportunity to save the current file first as needed: + +

              +void new_cb(Fl_Widget*, void*) {
              +  if (!check_save()) return;
               
                 filename[0] = '\0';
              -  input->value("");
              -  set_changed(0);
              +  textbuf->select(0, textbuf->length());
              +  textbuf->remove_selection();
              +  changed = 0;
              +  textbuf->call_modify_callbacks();
               }
              -
              -
            +
          +

          open_cb()

          - This callback function will ask the user for a filename and then load -the specified file into the input widget and current filename. It also -calls the check_save() function to give the user the -opportunity to save the current file first as needed: -
            -
            -void open_cb(void) {
            -  char *newfile;
             
            -  if (changed)
            -    if (!check_save()) return;
            +

            This callback function will ask the user for a filename and then load +the specified file into the input widget and current filename. It also +calls the check_save() function to give the user the +opportunity to save the current file first as needed: + +

              +void open_cb(Fl_Widget*, void*) {
              +  if (!check_save()) return;
               
              -  newfile = fl_file_chooser("Open File?", "*", filename);
              -  if (newfile != NULL) load_file(newfile);
              +  char *newfile = fl_file_chooser("Open File?", "*", filename);
              +  if (newfile != NULL) load_file(newfile, -1);
               }
              -
              -
            - We call the load_file() function to actually load the file. +
          + +

          We call the load_file() function to actually load the file. +

          paste_cb()

          - This callback function will send a FL_PASTE message to the input - widget using the Fl::paste() - method: -
            -
            -void paste_cb(void) {
            -  Fl::paste(*input);
            +
            +

            This callback function will call kf_paste() +to paste the clipboard at the current position:

            + +
              +void paste_cb(Fl_Widget*, void* v) {
              +  EditorWindow* e = (EditorWindow*)v;
              +  Fl_Text_Editor::kf_paste(0, e->editor);
               }
              -
              -
            +
          +

          quit_cb()

          - The quit callback will first see if the current file has been -modified, and if so give the user a chance to save it. It then hides -the main window: -
            -
            -void quit_cb(void) {
            -  if (changed)
            -    if (!check_save())
            -      return;
            -
            -  window->hide();
            +
            +

            The quit callback will first see if the current file has been +modified, and if so give the user a chance to save it. It then exits +from the program: + +

              +void quit_cb(Fl_Widget*, void*) {
              +  if (changed && !check_save())
              +    return;
              +
              +  exit(0);
               }
              -
              -
            +
          +

          replace_cb()

          - The replace callback just shows the replace dialog: -
            -
            +
            +

            The replace callback just shows the replace dialog: + +

               void replace_cb(Fl_Widget*, void* v) {
                 EditorWindow* e = (EditorWindow*)v;
                 e->replace_dlg->show();
               }
              -
              -
            +
          +

          replace2_cb()

          -This callback will replace the next occurence of the replacement -string. If nothing has been entered for the replacement string, then -the replace dialog is displayed instead: -
            -
            +
            +

            This callback will replace the next occurence of the replacement +string. If nothing has been entered for the replacement string, then +the replace dialog is displayed instead: + +

               void replace2_cb(Fl_Widget*, void* v) {
                 EditorWindow* e = (EditorWindow*)v;
                 const char *find = e->replace_find->value();
              @@ -345,13 +382,14 @@ void replace2_cb(Fl_Widget*, void* v) {
                 }
                 else fl_alert("No occurrences of \'%s\' found!", find);
               }
              -
              -
            +
          +

          replall_cb()

          -This callback will replace all occurences of the search string in the -file: -
            -
            +
            +

            This callback will replace all occurences of the search +string in the file: + +

               void replall_cb(Fl_Widget*, void* v) {
                 EditorWindow* e = (EditorWindow*)v;
                 const char *find = e->replace_find->value();
              @@ -388,23 +426,25 @@ void replall_cb(Fl_Widget*, void* v) {
                 if (times) fl_message("Replaced %d occurrences.", times);
                 else fl_alert("No occurrences of \'%s\' found!", find);
               }
              -
              -
            +
          +

          replcan_cb()

          -This callback just hides the replace dialog: -
            -
            +
            +

            This callback just hides the replace dialog: + +

               void replcan_cb(Fl_Widget*, void* v) {
                 EditorWindow* e = (EditorWindow*)v;
                 e->replace_dlg->hide();
               }
              -
              -
            +
          +

          save_cb()

          -This callback saves the current file. If the current filename is -blank it calls the "save as" callback: -
            -
            +
            +

            This callback saves the current file. If the current filename is +blank it calls the "save as" callback: + +

               void save_cb(void) {
                 if (filename[0] == '\0') {
                   // No filename - get one!
              @@ -413,42 +453,38 @@ void save_cb(void) {
                 }
                 else save_file(filename);
               }
              -
              -
            - The save_file() function saves the current file to the -specified filename. +
          + +

          The save_file() function saves the current file to the +specified filename. +

          saveas_cb()

          - This callback asks the user for a filename and saves the current file: -
            -
            +
            +

            This callback asks the user for a filename and saves the current file: + +

               void saveas_cb(void) {
                 char *newfile;
               
                 newfile = fl_file_chooser("Save File As?", "*", filename);
                 if (newfile != NULL) save_file(newfile);
               }
              -
              -
            - The save_file() function saves the current file to the -specified filename. -

            undo_cb()

            - The undo callback just calls the -undo() method: -
              -
              -void undo_cb(void) {
              -  input->undo();
              -}
              -
              -
            +
          + +

          The save_file() function saves the current file to the +specified filename. +

          Other Functions

          - Now that we've defined the callback functions, we need our support -functions to make it all work: + +

          Now that we've defined the callback functions, we need our support +functions to make it all work: +

          check_save()

          - This function checks to see if the current file needs to be saved. If -so, it asks the user if they want to save it: -
            -
            +
            +

            This function checks to see if the current file needs to be saved. If +so, it asks the user if they want to save it: + +

               int check_save(void) {
                 if (!changed) return 1;
               
              @@ -463,12 +499,13 @@ int check_save(void) {
               
                 return (r == 2) ? 1 : 0;
               }
              -
              -
            +
          +

          load_file()

          - This function loads the specified file into the input widget: -
            -
            +
            +

            This function loads the specified file into the textbuf class: + +

               int loading = 0;
               void load_file(char *newfile, int ipos) {
                 loading = 1;
              @@ -485,15 +522,19 @@ void load_file(char *newfile, int ipos) {
                 loading = 0;
                 textbuf->call_modify_callbacks();
               }
              -
              -
            -When loading the file we use the -loadfile() -method to "replace" the text in the buffer. +
          + +

          When loading the file we use the loadfile() +method to "replace" the text in the buffer, or the insertfile() +method to insert text in the buffer from the named file. +

          save_file()

          -This function saves the current buffer to the specified file: -
            -
            +
            +

            This function saves the current buffer to the specified file: + +

               void save_file(char *newfile) {
                 if (textbuf->savefile(newfile))
                   fl_alert("Error writing to file \'%s\':\n%s.", newfile, strerror(errno));
              @@ -502,52 +543,60 @@ void save_file(char *newfile) {
                 changed = 0;
                 textbuf->call_modify_callbacks();
               }
              -
              -
            -

            set_changed()

            - This function sets the changed variable and updates the -window label accordingly: -
              -
              -void set_changed(int c) {
              -  if (c != changed) {
              -    char title[1024];
              -    char *slash;
              -
              -    changed = c;
              +
            - if (filename[0] == '\0') strcpy(title, "Untitled"); - else { - slash = strrchr(filename, '/'); - if (slash == NULL) slash = strrchr(filename, '\\'); +

            set_title()

            - if (slash != NULL) strcpy(title, slash + 1); - else strcpy(title, filename); - } +

            This function checks the changed variable and updates the +window label accordingly: +

              +void set_title(Fl_Window* w) {
              +  if (filename[0] == '\0') strcpy(title, "Untitled");
              +  else {
              +    char *slash;
              +    slash = strrchr(filename, '/');
              +#ifdef WIN32
              +    if (slash == NULL) slash = strrchr(filename, '\\');
              +#endif
              +    if (slash != NULL) strcpy(title, slash + 1);
              +    else strcpy(title, filename);
              +  }
               
              -    if (changed) strcat(title, " (modified)");
              +  if (changed) strcat(title, " (modified)");
               
              -    window->label(title);
              -  }
              +  w->label(title);
               }
              -
              -
            +
          +

          Compiling the Editor

          - The complete source for our text editor can be found in the -test/editor.cxx source file. Both the Makefile and Visual C++ -workspace include the necessary rules to build the editor. You can -also compile it using a standard compiler with: -
            -
            +
            +

            The complete source for our text editor can be found in the test/editor.cxx source file. Both the Makefile and Visual C++ +workspace include the necessary rules to build the editor. You can +also compile it using a standard compiler with: + +

               CC -o editor editor.cxx -lfltk -lXext -lX11 -lm
              -
              -
            - As noted in Chapter 1, you may need to -include compiler and linker options to tell them where to find the FLTK +
          + +

          or by using the fltk-config script with: + +

            +fltk-config --compile editor.cxx
            +
          + +

          As noted in Chapter 1, you may need to +include compiler and linker options to tell them where to find the FLTK library. Also, the CC command may also be called gcc - or c++ on your system. -

          Congratulations, you've just built your own text editor!

          +or c++ on your system. + +

          Congratulations, you've just built your own text editor!

          +

          The Final Product

          - The final editor window should look like the image on the next page. -

          The completed editor window.

          - + +The final editor window should look like the image in Figure 4-2. + +

          The completed editor window.
          +Figure 4-2: The completed editor window

          + + + diff --git a/documentation/enumerations.html b/documentation/enumerations.html index 736090295..e9e67e002 100644 --- a/documentation/enumerations.html +++ b/documentation/enumerations.html @@ -1,22 +1,22 @@

          C - FLTK Enumerations

          This appendix lists the enumerations provided in the -<FL/Enumerations.H> header file, organized by section. +<FL/Enumerations.H>
          header file, organized by section. Constants whose value is zero are marked with "(0)", this is often useful to know when programming.

          Version Numbers

          - The FLTK version number is stored in a number of compile-time -constants: + The FLTK version number is stored in a number of compile-time +constants:
          • FL_MAJOR_VERSION - The major release number, currently 1.
          • FL_MINOR_VERSION - The minor release number, currently 1.
          • FL_PATCH_VERSION - The patch release number, currently 0.
          • -
          • FL_VERSION - A combined floating-point version number for +
          • FL_VERSION - A combined floating-point version number for the major, minor, and patch release numbers, currently 1.0100.

          Events

          - Events are identified by an Fl_Event enumeration value. The -following events are currently defined: + Events are identified by an Fl_Event enumeration value. The +following events are currently defined:
          • FL_NO_EVENT - No event (or an event fltk does not understand) occurred (0).
          • @@ -24,39 +24,39 @@ understand) occurred (0).
          • FL_RELEASE - A mouse button was released.
          • FL_ENTER - The mouse pointer entered a widget.
          • FL_LEAVE - The mouse pointer left a widget.
          • -
          • FL_DRAG - The mouse pointer was moved with a button +
          • FL_DRAG - The mouse pointer was moved with a button pressed.
          • FL_FOCUS - A widget should receive keyboard focus.
          • FL_UNFOCUS - A widget loses keyboard focus.
          • FL_KEYBOARD - A key was pressed.
          • FL_CLOSE - A window was closed.
          • -
          • FL_MOVE - The mouse pointer was moved with no buttons +
          • FL_MOVE - The mouse pointer was moved with no buttons pressed.
          • FL_SHORTCUT - The user pressed a shortcut key.
          • FL_DEACTIVATE - The widget has been deactivated.
          • FL_ACTIVATE - The widget has been activated.
          • FL_HIDE - The widget has been hidden.
          • FL_SHOW - The widget has been shown.
          • -
          • FL_PASTE - The widget should paste the contents of the +
          • FL_PASTE - The widget should paste the contents of the clipboard.
          • -
          • FL_SELECTIONCLEAR - The widget should clear any selections +
          • FL_SELECTIONCLEAR - The widget should clear any selections made for the clipboard.

          Callback "When" Conditions

          - The following constants determine when a callback is performed: + The following constants determine when a callback is performed:
          • FL_WHEN_NEVER - Never call the callback (0).
          • -
          • FL_WHEN_CHANGED - Do the callback only when the widget +
          • FL_WHEN_CHANGED - Do the callback only when the widget value changes.
          • -
          • FL_WHEN_NOT_CHANGED - Do the callback whenever the user +
          • FL_WHEN_NOT_CHANGED - Do the callback whenever the user interacts with the widget.
          • -
          • FL_WHEN_RELEASE - Do the callback when the button or key +
          • FL_WHEN_RELEASE - Do the callback when the button or key is released and the value changes.
          • -
          • FL_WHEN_ENTER_KEY - Do the callback when the user presses +
          • FL_WHEN_ENTER_KEY - Do the callback when the user presses the ENTER key and the value changes.
          • -
          • FL_WHEN_RELEASE_ALWAYS - Do the callback when the button +
          • FL_WHEN_RELEASE_ALWAYS - Do the callback when the button or key is released, even if the value doesn't change.
          • -
          • FL_WHEN_ENTER_KEY_ALWAYS - Do the callback when the user +
          • FL_WHEN_ENTER_KEY_ALWAYS - Do the callback when the user presses the ENTER key, even if the value doesn't change.

          Fl::event_button() Values

          @@ -72,7 +72,7 @@ is released and the value changes.

          Fl::event_key() Values

          The following constants define the non-ASCII keys on the keyboard for -FL_KEYBOARD and FL_SHORTCUT events: +FL_KEYBOARD and FL_SHORTCUT events:
          • FL_Button - A mouse button; use Fl_Button + n for mouse button n.
          • @@ -112,7 +112,7 @@ FL_KEYBOARD and FL_SHORTCUT events:

          Fl::event_state() Values

          The following constants define bits in the Fl::event_state() - value: + value:
          • FL_SHIFT - One of the shift keys is down.
          • FL_CAPS_LOCK - The caps lock is on.
          • @@ -127,8 +127,8 @@ FL_KEYBOARD and FL_SHORTCUT events:

          Alignment Values

          The following constants define bits that can be used with -Fl_Widget::align() to control the positioning of the -label: +Fl_Widget::align() to control the positioning of the +label:
          • FL_ALIGN_CENTER - The label is centered (0).
          • FL_ALIGN_TOP - The label is top-aligned.
          • @@ -150,12 +150,12 @@ label inside the widget.

          Fonts

          - The following constants define the standard FLTK fonts: + The following constants define the standard FLTK fonts:
          • FL_HELVETICA - Helvetica (or Arial) normal (0).
          • FL_HELVETICA_BOLD - Helvetica (or Arial) bold.
          • FL_HELVETICA_ITALIC - Helvetica (or Arial) oblique.
          • -
          • FL_HELVETICA_BOLD_ITALIC - Helvetica (or Arial) +
          • FL_HELVETICA_BOLD_ITALIC - Helvetica (or Arial) bold-oblique.
          • FL_COURIER - Courier normal.
          • FL_COURIER_BOLD - Courier bold.
          • @@ -168,12 +168,12 @@ bold-oblique.
          • FL_SYMBOL - Standard symbol font.
          • FL_SCREEN - Default monospaced screen font.
          • FL_SCREEN_BOLD - Default monospaced bold screen font.
          • -
          • FL_ZAPF_DINGBATS - Zapf-dingbats font. +
          • FL_ZAPF_DINGBATS - Zapf-dingbats font.

          Colors

          - The following color constants can be used to access the colors in the -FLTK standard color palette: + The following color constants can be used to access the colors in the +FLTK standard color palette:
          • FL_BLACK - the default label color (0)
          • FL_RED
          • @@ -209,9 +209,9 @@ B*FL_NUM_BLUE/256);

            Cursors

            -

            The following constants define the mouse cursors that are available in -FLTK. The double-headed arrows are bitmaps -provided by FLTK on X, the others are provided by system-defined +

            The following constants define the mouse cursors that are available in +FLTK. The double-headed arrows are bitmaps +provided by FLTK on X, the others are provided by system-defined cursors.

            • FL_CURSOR_DEFAULT - the default cursor, usually an arrow (0)
            • @@ -230,19 +230,19 @@ cursors.

            FD "When" Conditions

              -
            • FL_READ - Call the callback when there is data to be +
            • FL_READ - Call the callback when there is data to be read.
            • -
            • FL_WRITE - Call the callback when data can be written +
            • FL_WRITE - Call the callback when data can be written without blocking.
            • -
            • FL_EXCEPT - Call the callback if an exception occurs on +
            • FL_EXCEPT - Call the callback if an exception occurs on the file.

            Damage Masks

            - The following damage mask bits are used by the standard FLTK widgets: + The following damage mask bits are used by the standard FLTK widgets:
            • FL_DAMAGE_CHILD - A child needs to be redrawn.
            • FL_DAMAGE_EXPOSE - The window was exposed.
            • -
            • FL_DAMAGE_SCROLL - The Fl_Scroll widget was +
            • FL_DAMAGE_SCROLL - The Fl_Scroll widget was scrolled.
            • FL_DAMAGE_OVERLAY - The overlay planes need to be redrawn.
            • FL_DAMAGE_ALL - Everything needs to be redrawn.
            • diff --git a/documentation/events.html b/documentation/events.html index 2eb847545..a742d69f4 100644 --- a/documentation/events.html +++ b/documentation/events.html @@ -1,238 +1,336 @@ - -

              6 - Handling Events

              - This chapter discusses the FLTK event model and how to handle events -in your program or widget. + + + +

              6 - Handling Events

              + +

              This chapter discusses the FLTK event model and how to handle +events in your program or widget. +

              The FLTK Event Model

              -

              Every time a user moves the mouse pointer, clicks a button, or presses -a key, an event is generated and sent to your application. Events can also -come from other programs like the window manager. +

              Every time a user moves the mouse pointer, clicks a button, +or presses a key, an event is generated and sent to your +application. Events can also come from other programs like the +window manager.

              Events are identified by the integer argument passed to the - Fl_Widget::handle() virtual -method. Other information about the most recent event is stored in +Fl_Widget::handle() virtual +method. Other information about the most recent event is stored in static locations and acquired by calling the Fl::event_*() methods. This static -information remains valid until the next event is read from window -system (i.e. it is ok to look at it outside of the handle() -method). +href="#event_xxx">Fl::event_*() methods. This static +information remains valid until the next event is read from the window +system, so it is ok to look at it outside of the handle() +method.

              Mouse Events

              +

              FL_PUSH

              -A mouse button has gone down with the mouse pointing at this widget. -You can find out what button by calling -Fl::event_button(). You find out the mouse position by -calling Fl::event_x() and -Fl::event_y(). -

              A widget indicates that it "wants" the mouse click by returning -non-zero from its handle() - method. It will then become the -Fl::pushed() widget and will get FL_DRAG and the -matching FL_RELEASE events. If handle() returns zero -then FLTK will try sending the FL_PUSH to another widget.

              + +

              A mouse button has gone down with the mouse pointing at this +widget. You can find out what button by calling +Fl::event_button(). You find out the mouse position by +calling Fl::event_x() and Fl::event_y(). + +

              A widget indicates that it "wants" the mouse click +by returning non-zero from its handle() method. It +will then become the +Fl::pushed() widget and will get FL_DRAG and +the matching FL_RELEASE events. If handle() +returns zero then FLTK will try sending the FL_PUSH to +another widget.

              +

              FL_DRAG

              -The mouse has moved with a button held down. The current button state is -in Fl::event_state(). The mouse position -is in Fl::event_x() and -Fl::event_y(). + +

              The mouse has moved with a button held down. The current +button state is in Fl::event_state(). +The mouse position is in Fl::event_x() and Fl::event_y().

              To receive FL_DRAG events you must also respond to the FL_PUSH and FL_RELEASE events.

              FL_RELEASE

              - A mouse button has been released. You can find out what button by -calling Fl::event_button(). + +

              A mouse button has been released. You can find out what +button by calling Fl::event_button(). +

              FL_MOVE

              - The mouse has moved without any mouse buttons held down. This event -is sent to the Fl::belowmouse() + +

              The mouse has moved without any mouse buttons held down. +This event is sent to the Fl::belowmouse() widget. + +

              FL_MOUSEWHEEL

              + +

              The user has moved the mouse wheel. The Fl::event_dx() and Fl::event_dy() methods +can be used to find the amount to scroll horizontally and +vertically. +

              Focus Events

              +

              FL_ENTER

              - The mouse has been moved to point at this widget. This can be used -for highlighting feedback. If a widget wants to highlight or otherwise -track the mouse, it indicates this by returning non-zero from its -handle() method. It then becomes the -Fl::belowmouse() widget and will receive FL_MOVE - and FL_LEAVE events. + +

              The mouse has been moved to point at this widget. This can +be used for highlighting feedback. If a widget wants to +highlight or otherwise track the mouse, it indicates this by +returning non-zero from its handle() method. It then +becomes the Fl::belowmouse() +widget and will receive FL_MOVE and FL_LEAVE +events. +

              FL_LEAVE

              - The mouse has moved out of the widget. + +

              The mouse has moved out of the widget. +

              FL_FOCUS

              - This indicates an attempt to give a widget the keyboard focus. -

              If a widget wants the focus, it should change itself to display the -fact that it has the focus, and return non-zero from its -handle() method. It then becomes the -Fl::focus() widget and gets FL_KEYBOARD and -FL_UNFOCUS events.

              -

              The focus will change either because the window manager changed -which window gets the focus, or because the user tried to navigate -using tab, arrows, or other keys. You can check -Fl::event_key() to figure out why it moved. For -navigation it will be the key pressed and for instructions from the -window manager it will be zero.

              + +

              This indicates an attempt to give a widget the +keyboard focus. + +

              If a widget wants the focus, it should change itself to +display the fact that it has the focus, and return non-zero from +its handle() +method. It then becomes the Fl::focus() widget and gets +FL_KEYDOWN, FL_KEYUP, and FL_UNFOCUS +events. + +

              The focus will change either because the window manager +changed which window gets the focus, or because the user tried +to navigate using tab, arrows, or other keys. You can check Fl::event_key() to +figure out why it moved. For navigation it will be the key +pressed and interaction with the window manager it will be +zero. +

              FL_UNFOCUS

              -Sent to the previous Fl::focus() -widget when another widget gets the focus. + +

              This event is sent to the previous Fl::focus() widget when +another widget gets the focus or the window loses focus. +

              Keyboard Events

              -

              FL_KEYBOARD

              - A key press. The key pressed can be found in -Fl::event_key(). The text that the key should insert can -be found with Fl::event_text() - and its length is in -Fl::event_length(). If you use the key handle() -should return 1. If you return zero then FLTK assummes you ignored -the key. It will then attempt to send it to a parent widget. If none -of them want it, it will change the event into a FL_SHORTCUT -event. - -

              To receive FL_KEYBOARD events you must also respond to the -FL_FOCUS and FL_UNFOCUS events. - -

              If you are writing a text-editing widget you may also want to call -the Fl::compose() function to translate -individual keystrokes into foreign characters. + +

              FL_KEYDOWN, FL_KEYUP

              + +

              A key was pressed or released. The key can be found in Fl::event_key(). The +text that the key should insert can be found with Fl::event_text() and +its length is in Fl::event_length(). +If you use the key handle() should return 1. If you +return zero then FLTK assumes you ignored the key and will +then attempt to send it to a parent widget. If none of them want +it, it will change the event into a FL_SHORTCUT event. + +

              To receive FL_KEYBOARD events you must also +respond to the FL_FOCUS and FL_UNFOCUS +events. + +

              If you are writing a text-editing widget you may also want to +call the Fl::compose() +function to translate individual keystrokes into foreign +characters.

              FL_SHORTCUT

              -If the Fl::focus() widget is zero -or ignores an FL_KEYBOARD event then FLTK tries sending this -event to every widget it can, until one of them returns non-zero. -FL_SHORTCUT is first sent to the belowmouse() widget, -then its parents and siblings, and eventually to every widget in the -window, trying to find an object that returns non-zero. FLTK tries -really hard to not to ignore any keystrokes! -

              You can also make "global" shortcuts by using -Fl::add_handler(). A global shortcut will work no matter -what windows are displayed or which one has the focus.

              + +

              If the Fl::focus() +widget is zero or ignores an FL_KEYBOARD event then +FLTK tries sending this event to every widget it can, until one +of them returns non-zero. FL_SHORTCUT is first sent to +the Fl::belowmouse() widget, then its parents and +siblings, and eventually to every widget in the window, trying +to find an object that returns non-zero. FLTK tries really hard +to not to ignore any keystrokes! + +

              You can also make "global" shortcuts by using Fl::add_handler(). A +global shortcut will work no matter what windows are displayed +or which one has the focus.

              +

              Widget Events

              +

              FL_DEACTIVATE

              - This widget is no longer active, due to -deactivate() being called on it or one of its parents. -active() may still be true after this, the widget is only active -if active() is true on it and all its parents (use -active_r() to check this). + +

              This widget is no longer active, due to deactivate() +being called on it or one of its parents. active() may +still be true after this, the widget is only active if +active() is true on it and all its parents (use active_r() to check this). +

              FL_ACTIVATE

              - This widget is now active, due to -activate() being called on it or one of its parents. + +

              This widget is now active, due to activate() +being called on it or one of its parents. +

              FL_HIDE

              - This widget is no longer visible, due to hide() being called on it or one of its -parents, or due to a parent window being minimized. visible() -may still be true after this, but the widget is visible only if -visible() is true for it and all its parents (use -visible_r() to check this). +

              This widget is no longer visible, due to hide() being +called on it or one of its parents, or due to a parent window +being minimized. visible() may still be true after +this, but the widget is visible only if visible() is +true for it and all its parents (use visible_r() to +check this).

              FL_SHOW

              -This widget is visible again, due to -show() being called on it or one of its parents, or due to -a parent window being restored. Child Fl_Windows respond to -this by actually creating the window if not done already, so if you -subclass a window, be sure to pass FL_SHOW to the base class -handle() method! +

              This widget is visible again, due to show() being +called on it or one of its parents, or due to a parent window +being restored. Child Fl_Windows respond to this by +actually creating the window if not done already, so if you +subclass a window, be sure to pass FL_SHOW to the base +class handle() method! +

              Clipboard Events

              +

              FL_PASTE

              - You should get this event some time after you call -Fl::paste(). The contents of -Fl::event_text() is the text to insert and the number of -characters is in -Fl::event_length(). + +

              You should get this event some time after you call Fl::paste(). The contents +of Fl::event_text() +is the text to insert and the number of characters is in Fl::event_length(). +

              FL_SELECTIONCLEAR

              - The Fl::selection_owner() - will get this event before the selection is moved to another widget. - This indicates that some other widget or program has claimed the -selection. Motif programs used this to clear the selection -indication. Most modern programs ignore this. -

              Fl::event_*() methods

              - FLTK keeps the information about the most recent event in static -storage. This information is good until the next event is processed. -Thus it is valid inside handle() and callback() - methods. + +

              The Fl::selection_owner() +will get this event before the selection is moved to another +widget. This indicates that some other widget or program has +claimed the selection. Motif programs used this to clear the +selection indication. Most modern programs ignore this. + +

              Fl::event_*() methods

              + +

              FLTK keeps the information about the most recent event in +static storage. This information is good until the next event is +processed. Thus it is valid inside handle() and +callback() methods. +

              These are all trivial inline functions and thus very fast and small:

              + +

              Event Propagation

              - FLTK follows very simple and unchangeable rules for sending events. -The major innovation is that widgets can indicate (by returning 0 from -the handle() method) that they are not interested in an event, -and FLTK can then send that event elsewhere. This eliminates the need -for "interests" (event masks or tables), and this is probably the main -reason FLTK is much smaller than other toolkits. -

              Most events are sent directly to the handle() method of the -Fl_Window that the window system says they belong to. The window -(actually the Fl_Group that Fl_Window is a subclass -of) is responsible for sending the events on to any child widgets. To -make the Fl_Group code somewhat easier, FLTK sends some events -(FL_DRAG, FL_RELEASE, FL_KEYBOARD, -FL_SHORTCUT, FL_UNFOCUS, and FL_LEAVE) directly -to leaf widgets. These procedures control those leaf widgets:

              + +

              FLTK follows very simple and unchangeable rules for sending +events. The major innovation is that widgets can indicate (by +returning 0 from the handle() method) that they are not +interested in an event, and FLTK can then send that event +elsewhere. This eliminates the need for "interests" +(event masks or tables), and this is probably the main reason +FLTK is much smaller than other toolkits. + +

              Most events are sent directly to the handle() method +of the Fl_Window that the window system says they +belong to. The window (actually the Fl_Group that +Fl_Window is a subclass of) is responsible for sending +the events on to any child widgets. To make the +Fl_Group code somewhat easier, FLTK sends some events +(FL_DRAG, FL_RELEASE, FL_KEYBOARD, +FL_SHORTCUT, FL_UNFOCUS, and +FL_LEAVE) directly to leaf widgets. These procedures +control those leaf widgets: +

              -

              FLTK Compose-Character Sequences

              +

              FLTK Compose-Character Sequences

              -The foreign-letter compose processing done by the Fl_Input widget is provided in +

              The foreign-letter compose processing done by the Fl_Input widget is provided in a function that you can call if you are writing your own text editor widget. -

              Fltk uses it's own compose processing to allow "preview" of the -partially composed sequence, which is impossible with the usual -"dead key" processing. - -

              Although currently only characters in the ISO-8859-1 character set are -handled, you should call this in case any enhancements to the -processing are done in the future. The interface has been designed to -handle arbitrary UTF-8 encoded text. - -

              int Fl::compose(int& del)

              +

              FLTK uses its own compose processing to allow "preview" of +the partially composed sequence, which is impossible with the +usual "dead key" processing. -

              Use of this function is very simple. Any text editing widget should -call this for each FL_KEYBOARD event. +

              Although currently only characters in the ISO-8859-1 +character set are handled, you should call this in case any +enhancements to the processing are done in the future. The +interface has been designed to handle arbitrary UTF-8 encoded +text. -

              If true is returned, then it has modified the -Fl::event_text() and Fl::event_length() to a set of bytes to -insert (it may be of zero length!). In will also set the "del" -parameter to the number of bytes to the left of the cursor to -delete, this is used to delete the results of the previous call to -Fl::compose(). +

              The following methods are provided for character composition: -

              If false is returned, the keys should be treated as function -keys, and del is set to zero. You could insert the text anyways, if -you don't know what else to do. +

                -

                Though the current implementation returns immediately, future -versions may take quite awhile, as they may pop up a window or do -other user-interface things to allow characters to be selected. +

              • Fl::compose()
              • -

                int Fl::compose_reset()

                +
              • Fl::compose_reset()
              • -

                If the user moves the cursor, be sure to call Fl::compose_reset(). -The next call to Fl::compose() will start out in an initial state. In -particular it will not set "del" to non-zero. This call is very fast -so it is ok to call it many times and in many places. +

              - + + diff --git a/documentation/fluid.html b/documentation/fluid.html index af360a96e..eade5232e 100644 --- a/documentation/fluid.html +++ b/documentation/fluid.html @@ -1,20 +1,20 @@

              8 - Programming with FLUID

              -This chapter shows how to use the Fast Light User-Interface Designer -("FLUID") to create your GUIs. +This chapter shows how to use the Fast Light User-Interface Designer +("FLUID") to create your GUIs.

              What is FLUID?

              -

              The Fast Light User Interface Designer, or FLUID, is a graphical -editor that is used to produce FLTK source code. +

              The Fast Light User Interface Designer, or FLUID, is a graphical +editor that is used to produce FLTK source code. -

              FLUID edits and saves its state in .fl files. These files are -text, and you can (with care) edit them in a text editor, perhaps to +

              FLUID edits and saves its state in .fl files. These files are +text, and you can (with care) edit them in a text editor, perhaps to get some special effects.

              -

              FLUID can "compile" the .fl file into a .cxx and a .h file. The -.cxx file defines all the objects from the .fl file and the .h file +

              FLUID can "compile" the .fl file into a .cxx and a .h file. The +.cxx file defines all the objects from the .fl file and the .h file declares all the global ones.

              FLUID also supports localization (Internationalization) @@ -22,41 +22,41 @@ of label strings using message files and the GNU gettext or POSIX catgets interfaces.

              A simple program can be made by putting all your code (including a -main() function) into the .fl file and thus making the .cxx file a -single source file to compile. Most programs are more complex than -this, so you write other .cxx files that call the FLUID functions. +main() function) into the .fl file and thus making the .cxx file a +single source file to compile. Most programs are more complex than +this, so you write other .cxx files that call the FLUID functions. These .cxx files must #include the .h file or they can -#include the .cxx file so it still appears to be a single source +#include the .cxx file so it still appears to be a single source file.

              FLUID organization.

              Normally the FLUID file defines one or more functions or classes which -output C++ code. Each function defines a one or more FLTK +output C++ code. Each function defines a one or more FLTK windows, and all the widgets that go inside those windows.

              -

              Widgets created by FLUID are either "named", "complex named" or -"unnamed". A named widget has a legal C++ variable identifier as its -name (i.e. only alphanumeric and underscore). In this case FLUID -defines a global variable or class member that will point at the widget -after the function defining it is called. A complex named object has -punctuation such as '.' or '->' or any other symbols in its name. In -this case FLUID assigns a pointer to the widget to the name, but does -not attempt to declare it. This can be used to get the widgets into +

              Widgets created by FLUID are either "named", "complex named" or +"unnamed". A named widget has a legal C++ variable identifier as its +name (i.e. only alphanumeric and underscore). In this case FLUID +defines a global variable or class member that will point at the widget +after the function defining it is called. A complex named object has +punctuation such as '.' or '->' or any other symbols in its name. In +this case FLUID assigns a pointer to the widget to the name, but does +not attempt to declare it. This can be used to get the widgets into structures. An unnamed widget has a blank name and no pointer is stored.

              -

              Widgets may either call a named callback function that you write in -another source file, or you can supply a small piece of C++ source and +

              Widgets may either call a named callback function that you write in +another source file, or you can supply a small piece of C++ source and FLUID will write a private callback function into the .cxx file.

              Running FLUID Under UNIX

              - To run FLUID under UNIX, type: + To run FLUID under UNIX, type:
                 fluid filename.fl &
              -to edit the .fl file filename.fl. If the file does not exist -you will get an error pop-up, but if you dismiss it you will be editing -a blank file of that name. You can run FLUID without any name, in -which case you will be editing an unnamed blank setup (but you can use -save-as to write it to a file). +to edit the .fl file filename.fl. If the file does not exist +you will get an error pop-up, but if you dismiss it you will be editing +a blank file of that name. You can run FLUID without any name, in +which case you will be editing an unnamed blank setup (but you can use +save-as to write it to a file).

              You can provide any of the standard FLTK switches before the filename:

                @@ -70,25 +70,25 @@ save-as to write it to a file).
                 -bg2 color
                 
              - Changing the colors may be useful to see what your interface will look -at if the user calls it with the same switches. -

              In the current version, if you don't go into the background (with -'&') then you will be able to abort FLUID by typing ^C on the terminal. It + Changing the colors may be useful to see what your interface will look +at if the user calls it with the same switches. +

              In the current version, if you don't go into the background (with +'&') then you will be able to abort FLUID by typing ^C on the terminal. It will exit immediately, losing any changes.

              Running FLUID Under Microsoft Windows

              -To run FLUID under WIN32, double-click on the FLUID.exe file. -You can also run FLUID from the Command Prompt window (FLUID always -runs in the background under WIN32). +To run FLUID under WIN32, double-click on the FLUID.exe file. +You can also run FLUID from the Command Prompt window (FLUID always +runs in the background under WIN32).

              Compiling .fl files

              - FLUID can also be called as a command-line "compiler" to create the -.cxx and .h file from a .fl file. To do this type: + FLUID can also be called as a command-line "compiler" to create the +.cxx and .h file from a .fl file. To do this type:
                 fluid -c filename.fl
                 
              This will read the filename.fl file and write filename.cxx and -filename.h. The directory will be stripped, so they are written to -the current directory always. If there are any errors reading or -writing the files it will print the error and exit with a non-zero +filename.h
              . The directory will be stripped, so they are written to +the current directory always. If there are any errors reading or +writing the files it will print the error and exit with a non-zero code. In a makefile you can use a line like this:
                @@ -96,8 +96,8 @@ my_panels.h my_panels.cxx: my_panels.fl
                 	fluid -c my_panels.fl
                 
              - Some versions of make will accept rules like this to allow all .fl -files found to be compiled: + Some versions of make will accept rules like this to allow all .fl +files found to be compiled:
                 .SUFFIXES: .fl .cxx .h
                @@ -191,7 +191,7 @@ class CubeView : public Fl_Gl_Window {
                      * CUBECOLOR.
                      */
                     void drawCube();
                -    
                +   
                     float vAng,hAng; float xshift,yshift;
                 
                     float boxv0[3];float boxv1[3]; float boxv2[3];float boxv3[3];
                @@ -423,11 +423,11 @@ extensions and you are in business. You can include the CubeViewUI.h
                 

                FLUID Reference

                The Widget Browser

                -The main window shows a menu bar and a scrolling browser of all -the defined widgets. The name of the .fl file being edited is shown in -the window title. -

                The widgets are stored in a hierarchy. You can open and close a -level by clicking the "triangle" at the left of a widget. +The main window shows a menu bar and a scrolling browser of all +the defined widgets. The name of the .fl file being edited is shown in +the window title. +

                The widgets are stored in a hierarchy. You can open and close a +level by clicking the "triangle" at the left of a widget. The leftmost widgets are the parents, and all the widgets listed below them are their children. Parents don't have to have any children.

                @@ -435,30 +435,30 @@ any children.

                classes. Each of these will produce a single C++ public function or class in the output .cxx file. Calling the function or instantiating the class will create all of the child widgets.

                -

                The second level of the hierarchy contains the windows. Each of these +

                The second level of the hierarchy contains the windows. Each of these produces an instance of class Fl_Window.

                Below that are either widgets (subclasses of Fl_Widget) or -groups of widgets (including other groups). Plain groups are for -layout, navigation, and resize purposes. Tab groups provide the +groups of widgets (including other groups). Plain groups are for +layout, navigation, and resize purposes. Tab groups provide the well-known file-card tab interface.

                -

                Widgets are shown in the browser by either their name (such +

                Widgets are shown in the browser by either their name (such as "main_panel" in the example), or by their type and label (such as "Button "the green"").

                -

                You select widgets by clicking on their names, which highlights -them (you can also select widgets from any displayed window). You can -select many widgets by dragging the mouse across them, or by using -Shift+Click to toggle them on and off. To select no widgets, click in -the blank area under the last widget. Note that hidden children may -be selected even when there is no visual indication of this. -

                You open widgets by double-clicking on them, or (to open several +

                You select widgets by clicking on their names, which highlights +them (you can also select widgets from any displayed window). You can +select many widgets by dragging the mouse across them, or by using +Shift+Click to toggle them on and off. To select no widgets, click in +the blank area under the last widget. Note that hidden children may +be selected even when there is no visual indication of this. +

                You open widgets by double-clicking on them, or (to open several widgets you have picked) by typing the F1 key. A control panel will appear so you can change the widget(s).

                Menu Items

                -

                The menu bar at the top is duplicated as a pop-up menu on any -displayed window. The shortcuts for all the menu items work in any +

                The menu bar at the top is duplicated as a pop-up menu on any +displayed window. The shortcuts for all the menu items work in any window. The menu items are:

                File/Open... (Alt+o)

                -Discards the current editing session and reads in a different .fl file. +Discards the current editing session and reads in a different .fl file. You are asked for confirmation if you have changed the current file.

                FLUID can also read .fd files produced by the Forms and XForms "fdesign" programs. It is best to File/Merge them @@ -469,19 +469,19 @@ to edit the resulting setup to fix these errors. Be careful not to save the file without changing the name, as FLUID will write over the .fd file with its own format, which fdesign cannot read!

                File/Save (Alt+s)

                -Writes the current data to the .fl file. If the file is unnamed -then FLUID will ask for a filename. +Writes the current data to the .fl file. If the file is unnamed +then FLUID will ask for a filename.

                File/Save As...(Alt+Shift+S)

                Asks for a new filename and saves the file.

                File/Merge... (Alt+i)

                -Inserts the contents of another .fl file, without changing the name of -the current .fl file. All the functions (even if they have the same -names as the current ones) are added, and you will have to use cut/paste to -put the widgets where you want. +Inserts the contents of another .fl file, without changing the name of +the current .fl file. All the functions (even if they have the same +names as the current ones) are added, and you will have to use cut/paste to +put the widgets where you want.

                File/Write Code (Alt+Shift+C)

                "Compiles" the data into a .cxx and .h file. These are exactly the same as the files you get when you run -FLUID with the -c switch. +FLUID with the -c switch.

                The output file names are the same as the .fl file, with the leading directory and trailing ".fl" stripped, and ".h" or ".cxx" appended.

                @@ -492,65 +492,65 @@ the leading directory and trailing ".fl" stripped, and ".txt", ".po", or ".msg" appended depending on the Internationalization Mode.

                File/Quit (Alt+q)

                -Exits FLUID. You are asked for confirmation if you have changed the -current data. +Exits FLUID. You are asked for confirmation if you have changed the +current data.

                Edit/Undo (Alt+z)

                This isn't implemented yet. You should do save often so you can -recover from any mistakes you make. +recover from any mistakes you make.

                Edit/Cut (Alt+x)

                -Deletes the selected widgets and all of their children. These are saved +Deletes the selected widgets and all of their children. These are saved to a "clipboard" file and can be pasted back into any FLUID window.

                Edit/Copy (Alt+c)

                -Copies the selected widgets and all of their children to the "clipboard" -file. +Copies the selected widgets and all of their children to the "clipboard" +file.

                Edit/Paste (Alt+c)

                -Pastes the widgets from the clipboard file. -

                If the widget is a window, it is added to whatever function is +Pastes the widgets from the clipboard file. +

                If the widget is a window, it is added to whatever function is selected, or contained in the current selection.

                -

                If the widget is a normal widget, it is added to whatever window or -group is selected. If none is, it is added to the window or group that +

                If the widget is a normal widget, it is added to whatever window or +group is selected. If none is, it is added to the window or group that is the parent of the current selection.

                -

                To avoid confusion, it is best to select exactly one widget before +

                To avoid confusion, it is best to select exactly one widget before doing a paste.

                Cut/paste is the only way to change the parent of a widget.

                Edit/Select All (Alt+a)

                -Selects all widgets in the same group as the current selection. -

                If they are all selected already then this selects all widgets in -that group's parent. Repeatedly typing Alt+a will select larger and +Selects all widgets in the same group as the current selection. +

                If they are all selected already then this selects all widgets in +that group's parent. Repeatedly typing Alt+a will select larger and larger groups of widgets until everything is selected.

                Edit/Open... (F1 or double click)

                Displays the current widget in the attributes panel. If the widget is a window and it is not visible then the window is shown instead.

                Edit/Sort

                -Sorts the selected widgets into left to right, top to bottom -order. You need to do this to make navigation keys in FLTK work -correctly. You may then fine-tune the sorting with "Earlier" and -"Later". This does not affect the positions of windows or functions. +Sorts the selected widgets into left to right, top to bottom +order. You need to do this to make navigation keys in FLTK work +correctly. You may then fine-tune the sorting with "Earlier" and +"Later". This does not affect the positions of windows or functions.

                Edit/Earlier (F2)

                -Moves all of the selected widgets one earlier in order among the -children of their parent (if possible). This will affect navigation -order, and if the widgets overlap it will affect how they draw, as the -later widget is drawn on top of the earlier one. You can also use this -to reorder functions, classes, and windows within functions. +Moves all of the selected widgets one earlier in order among the +children of their parent (if possible). This will affect navigation +order, and if the widgets overlap it will affect how they draw, as the +later widget is drawn on top of the earlier one. You can also use this +to reorder functions, classes, and windows within functions.

                Edit/Later (F3)

                -Moves all of the selected widgets one later in order among the -children of their parent (if possible). +Moves all of the selected widgets one later in order among the +children of their parent (if possible).

                Edit/Group (F7)

                Creates a new Fl_Group and make all the currently selected widgets children of it.

                Edit/Ungroup (F8)

                Deletes the parent group if all the children of a group are selected.

                Edit/Overlays on/off (Alt+Shift+O)

                -Toggles the display of the red overlays off, without changing the -selection. This makes it easier to see box borders and how the layout -looks. The overlays will be forced back on if you change the -selection. +Toggles the display of the red overlays off, without changing the +selection. This makes it easier to see box borders and how the layout +looks. The overlays will be forced back on if you change the +selection.

                Edit/Preferences (Alt+p)

                Displays the preferences panel. The alignment preferences control the grid that all widgets snap to when you move and resize them, and for the -"snap" which is how far a widget has to be dragged from its original position +"snap" which is how far a widget has to be dragged from its original position to actually change.

                FLUID Preferences Window

                @@ -563,10 +563,10 @@ file will include the header file automatically. this chapter.

                New/Code/Function

                -Creates a new C function. You will be asked for a name for the -function. This name should be a legal C++ function template, without -the return type. You can pass arguments which can be referred to by -code you type into the individual widgets. +Creates a new C function. You will be asked for a name for the +function. This name should be a legal C++ function template, without +the return type. You can pass arguments which can be referred to by +code you type into the individual widgets.

                If the function contains any unnamed windows, it will be declared as returning a Fl_Window pointer. The unnamed window will be returned from it (more than one unnamed window is useless). If the function @@ -574,7 +574,7 @@ contains only named windows, it will be declared as returning nothing (void).

                It is possible to make the .cxx output be a self-contained program that can be compiled and executed. This is done by deleting -the function name so main(argc,argv) is used. The function +the function name so main(argc,argv) is used. The function will call show() on all the windows it creates and then call Fl::run(). This can also be used to test resize behavior or other parts of the user interface.

                @@ -582,39 +582,39 @@ other parts of the user interface.

                New/Window

                Creates a new Fl_Window widget. The window is added to the currently selected function, or to the function containing the -currently selected item. The window will appear, sized to 100x100. -You can resize it to whatever size you require. +currently selected item. The window will appear, sized to 100x100. +You can resize it to whatever size you require.

                The widget panel will also appear and is described later in this chapter.

                New/...

                -All other items on the New menu are subclasses of Fl_Widget. Creating -them will add them to the currently selected group or window, or the -group or window containing the currently selected widget. The initial -dimensions and position are chosen by copying the current widget, if -possible. -

                When you create the widget you will get the widget's control panel, +All other items on the New menu are subclasses of Fl_Widget. Creating +them will add them to the currently selected group or window, or the +group or window containing the currently selected widget. The initial +dimensions and position are chosen by copying the current widget, if +possible. +

                When you create the widget you will get the widget's control panel, which is described later in this chapter.

                Help/About FLUID

                -Pops up a panel showing the version of FLUID. +Pops up a panel showing the version of FLUID.

                The Widget Panel

                -When you double-click on a widget or a set of widgets you will get -the "widget attribute panel". -

                When you change attributes using this panel, the changes are -reflected immediately in the window. It is useful to hit the "no -overlay" button (or type Alt+Shift+O) to hide the red overlay so you can see +When you double-click on a widget or a set of widgets you will get +the "widget attribute panel". +

                When you change attributes using this panel, the changes are +reflected immediately in the window. It is useful to hit the "no +overlay" button (or type Alt+Shift+O) to hide the red overlay so you can see the widgets more accurately, especially when setting the box type. -

                If you have several widgets selected, they may have different values -for the fields. In this case the value for one of the widgets -is shown. But if you change this value, all of the selected +

                If you have several widgets selected, they may have different values +for the fields. In this case the value for one of the widgets +is shown. But if you change this value, all of the selected widgets are changed to the new value. -

                Hitting "OK" makes the changes permanent. Selecting a different -widget also makes the changes permanent. FLUID checks for simple -syntax errors such as mismatched parenthesis in any code before +

                Hitting "OK" makes the changes permanent. Selecting a different +widget also makes the changes permanent. FLUID checks for simple +syntax errors such as mismatched parenthesis in any code before saving any text. -

                "Revert" or "Cancel" put everything back to when you last brought up -the panel or hit OK. However in the current version of FLUID, changes -to "visible" attributes (such as the color, label, box) are not undone -by revert or cancel. Changes to code like the callbacks are undone, +

                "Revert" or "Cancel" put everything back to when you last brought up +the panel or hit OK. However in the current version of FLUID, changes +to "visible" attributes (such as the color, label, box) are not undone +by revert or cancel. Changes to code like the callbacks are undone, however. @@ -622,125 +622,125 @@ however.

                Widget Attributes

                Name (text field)

                -Name of a variable to declare, and to store a pointer to this -widget into. This variable will be of type "<class>*". If the name is -blank then no variable is created. -

                You can name several widgets with "name[0]", "name[1]", "name[2]", -etc. This will cause FLUID to declare an array of pointers. The array -is big enough that the highest number found can be stored. All widgets +Name of a variable to declare, and to store a pointer to this +widget into. This variable will be of type "<class>*". If the name is +blank then no variable is created. +

                You can name several widgets with "name[0]", "name[1]", "name[2]", +etc. This will cause FLUID to declare an array of pointers. The array +is big enough that the highest number found can be stored. All widgets that in the array must be the same type.

                Type (upper-right pulldown menu)

                - Some classes have subtypes that modify their appearance or behavior. -You pick the subtype off of this menu. + Some classes have subtypes that modify their appearance or behavior. +You pick the subtype off of this menu.

                Box (pulldown menu)

                -The boxtype to draw as a background for the widget. +The boxtype to draw as a background for the widget.
                    The FLUID widget dialog.
                -

                Many widgets will work, and draw faster, with a "frame" instead of a -"box". A frame does not draw the colored interior, leaving whatever -was already there visible. Be careful, as FLUID may draw this ok but +

                Many widgets will work, and draw faster, with a "frame" instead of a +"box". A frame does not draw the colored interior, leaving whatever +was already there visible. Be careful, as FLUID may draw this ok but the real program may leave unwanted stuff inside the widget.

                -

                If a window is filled with child widgets, you can speed up redrawing -by changing the window's box type to "NO_BOX". FLUID will display a -checkerboard for any areas that are not colored in by boxes. Note -that this checkerboard is not drawn by the resulting program. Instead +

                If a window is filled with child widgets, you can speed up redrawing +by changing the window's box type to "NO_BOX". FLUID will display a +checkerboard for any areas that are not colored in by boxes. Note +that this checkerboard is not drawn by the resulting program. Instead random garbage will be displayed.

                Color

                The color to draw the box with.

                Color2

                -

                Some widgets will use this color for certain parts. FLUID does not -always show the result of this: this is the color buttons draw in when +

                Some widgets will use this color for certain parts. FLUID does not +always show the result of this: this is the color buttons draw in when pushed down, and the color of input fields when they have the focus.

                Label

                - String to print next to or inside the button. -

                You can put newlines into the string to make multiple lines. The + String to print next to or inside the button. +

                You can put newlines into the string to make multiple lines. The easiest way is by typing Ctrl+j.

                Label style (pull down menu)

                - How to draw the label. Normal, shadowed, engraved, and embossed -change the appearance of the text. "symbol" requires the label to + How to draw the label. Normal, shadowed, engraved, and embossed +change the appearance of the text. "symbol" requires the label to start with an '@' sign to draw a named -symbol. +symbol.

                From this menu you can also pick "Image...". This lets you use the contents of a GIF, XPM, or XBM image file to label the widget.

                Label Alignment (Buttons)

                - Where to draw the label. The arrows put it on that side of the -widget, you can combine the to put it in the corner. The "box" button -puts the label inside the widget, rather than outside. + Where to draw the label. The arrows put it on that side of the +widget, you can combine the to put it in the corner. The "box" button +puts the label inside the widget, rather than outside.

                Label Font

                - Font to draw the label in. Ignored by symbols, bitmaps, and pixmaps. -Your program can change the actual font used by these "slots" in case -you want some font other than the 16 provided. + Font to draw the label in. Ignored by symbols, bitmaps, and pixmaps. +Your program can change the actual font used by these "slots" in case +you want some font other than the 16 provided.

                Label Size

                -Pixel size (height) for the font to draw the label in. Ignored by symbols, -bitmaps, and pixmaps. To see the result without dismissing the panel, -type the new number and then Tab. +Pixel size (height) for the font to draw the label in. Ignored by symbols, +bitmaps, and pixmaps. To see the result without dismissing the panel, +type the new number and then Tab.

                Label Color

                -Color to draw the label. Ignored by pixmaps (bitmaps, however, do use -this color as the foreground color). +Color to draw the label. Ignored by pixmaps (bitmaps, however, do use +this color as the foreground color).

                Text Font, Size, and Color

                Some widgets display text, such as input fields, pull-down menus, and browsers.

                Visible

                -If you turn this off then the widget is hidden initially. Don't change -this for windows or for the immediate children of a Tabs group. +If you turn this off then the widget is hidden initially. Don't change +this for windows or for the immediate children of a Tabs group.

                Active

                If you turn this off then the widget is deactivated initially.

                Resizable

                -If a window is resizable or has an immediate child that is resizable, -then the user will be able to resize it. In addition all the size -changes of a window or group will go "into" the resizable child. If -you have a large data display surrounded by buttons, you probably want -that data area to be resizable. -

                Only one child can be resizable. Turning this on turns it off for +If a window is resizable or has an immediate child that is resizable, +then the user will be able to resize it. In addition all the size +changes of a window or group will go "into" the resizable child. If +you have a large data display surrounded by buttons, you probably want +that data area to be resizable. +

                Only one child can be resizable. Turning this on turns it off for the other children.

                -

                You can get more complex behavior by making invisible boxes the -resizable widget, or by using hierarchies of groups. Unfortunately the -only way to test it is to compile the program. Resizing the FLUID +

                You can get more complex behavior by making invisible boxes the +resizable widget, or by using hierarchies of groups. Unfortunately the +only way to test it is to compile the program. Resizing the FLUID window is not the same as what will happen in the user program.

                Hotspot

                - Each window may have exactly one hotspot (turning this on will turn -off any others). This will cause it to be positioned with that widget -centered on the mouse. This position is determined when the FLUID -function is called, so you should call it immediately before showing -the window. If you want the window to hide and then reappear at a -new position, you should have your program set the hotspot itself just -before show(). + Each window may have exactly one hotspot (turning this on will turn +off any others). This will cause it to be positioned with that widget +centered on the mouse. This position is determined when the FLUID +function is called, so you should call it immediately before showing +the window. If you want the window to hide and then reappear at a +new position, you should have your program set the hotspot itself just +before show().

                Subclass

                -This is how you use your own subclasses of Fl_Widget. Whatever -identifier you type in here will be the class that is instantiated. -

                In addition, no #include header file is put in the .h file. You +This is how you use your own subclasses of Fl_Widget. Whatever +identifier you type in here will be the class that is instantiated. +

                In addition, no #include header file is put in the .h file. You must provide a #include line as the first line of the "Extra Code" which declares your subclass.

                -

                The class must be similar to the class you are spoofing. It -does not have to be a subclass. It is sometimes useful to change this -to another FLTK class. Currently the only way to get a double-buffered -window is to change this field for the window to "Fl_Double_Window" and +

                The class must be similar to the class you are spoofing. It +does not have to be a subclass. It is sometimes useful to change this +to another FLTK class. Currently the only way to get a double-buffered +window is to change this field for the window to "Fl_Double_Window" and to add "#include <FL/Fl_Double_Window.h>" to the extra code.

                Extra Code

                -These four fields let you type in literal lines of code to dump into -the .h or .cxx files. -

                If the text starts with a # or the word extern then FLUID thinks -this is an "include" line, and it is written to the .h file. If the +These four fields let you type in literal lines of code to dump into +the .h or .cxx files. +

                If the text starts with a # or the word extern then FLUID thinks +this is an "include" line, and it is written to the .h file. If the same include line occurs several times then only one copy is written.

                -

                All other lines are "code" lines. The current widget is -pointed to by the local variable o. The window being constructed is -pointed to by the local variable w. You can also access any -arguments passed to the function here, and any named widgets that are +

                All other lines are "code" lines. The current widget is +pointed to by the local variable o. The window being constructed is +pointed to by the local variable w. You can also access any +arguments passed to the function here, and any named widgets that are before this one.

                -

                FLUID will check for matching parenthesis, braces, and quotes, but -does not do much other error checking. Be careful here, as it may be -hard to figure out what widget is producing an error in the compiler. -If you need more than four lines you probably should call a function in +

                FLUID will check for matching parenthesis, braces, and quotes, but +does not do much other error checking. Be careful here, as it may be +hard to figure out what widget is producing an error in the compiler. +If you need more than four lines you probably should call a function in your own .cxx code.

                Callback

                -This can either be the name of a function, or a small snippet of code. +This can either be the name of a function, or a small snippet of code. If you enter anything but letters, numbers, and the underscore then FLUID -treats it as code. -

                A name names a function in your own code. It must be declared as +treats it as code. +

                A name names a function in your own code. It must be declared as void name(<class>*,void*).

                A code snippet is inserted into a static function in the .cxx output file. The function prototype is void @@ -751,131 +751,131 @@ much other error checking. Be careful here, as it may be hard to figure out what widget is producing an error in the compiler.

                If the callback is blank then no callback is set.

                user_data

                -This is a value for the user_data() of the widget. If blank the -default value of zero is used. This can be any piece of C code that +This is a value for the user_data() of the widget. If blank the +default value of zero is used. This can be any piece of C code that can be cast to a void pointer.

                User Data Type

                -The void * in the callback function prototypes is replaced with this. -You may want to use long for old XForms code. Be warned that -anything other than void * is not guaranteed to work! -However on most architectures other pointer types are ok, and long is -usually ok, too. +The void * in the callback function prototypes is replaced with this. +You may want to use long for old XForms code. Be warned that +anything other than void * is not guaranteed to work! +However on most architectures other pointer types are ok, and long is +usually ok, too.

                When

                When to do the callback. This can be "never", "changed", -"release", "enter key", or "no change". The -value of "enter key" is only useful for text input fields. The "no -change" button means the callback is done on the matching event even if -the data is not changed. -

                There are other rare but useful values for the when() field that are -not in the menu. You should use the extra code fields to put these +"release", "enter key", or "no change". The +value of "enter key" is only useful for text input fields. The "no +change" button means the callback is done on the matching event even if +the data is not changed. +

                There are other rare but useful values for the when() field that are +not in the menu. You should use the extra code fields to put these values in.

                Selecting and Moving Widgets

                -Double-clicking a window name in the browser will display it, if not -displayed yet. From this display you can select widgets, sets of -widgets, and move or resize them. To close a window either +Double-clicking a window name in the browser will display it, if not +displayed yet. From this display you can select widgets, sets of +widgets, and move or resize them. To close a window either double-click it or type Esc. -

                To select a widget, click it. To select several widgets drag a -rectangle around them. Holding down shift will toggle the selection of +

                To select a widget, click it. To select several widgets drag a +rectangle around them. Holding down shift will toggle the selection of the widgets instead.

                -

                You cannot pick hidden widgets. You also cannot choose some widgets -if they are completely overlapped by later widgets. Use the browser to +

                You cannot pick hidden widgets. You also cannot choose some widgets +if they are completely overlapped by later widgets. Use the browser to select these widgets.

                -

                The selected widgets are shown with a red "overlay" line around -them. You can move the widgets by dragging this box. Or you can -resize them by dragging the outer edges and corners. Hold down the Alt -key while dragging the mouse to defeat the snap-to-grid effect for fine +

                The selected widgets are shown with a red "overlay" line around +them. You can move the widgets by dragging this box. Or you can +resize them by dragging the outer edges and corners. Hold down the Alt +key while dragging the mouse to defeat the snap-to-grid effect for fine positioning.

                -

                If there is a tab box displayed you can change which child is +

                If there is a tab box displayed you can change which child is visible by clicking on the file tabs. The child you pick is selected.

                -

                The arrow, tab, and shift+tab keys "navigate" the selection. Left, -right, tab, or shift+tab move to the next or previous widgets in the -hierarchy. Hit the right arrow enough and you will select every widget -in the window. Up/down widgets move to the previous/next widgets that -overlap horizontally. If the navigation does not seem to work you -probably need to "Sort" the widgets. This is important if you have -input fields, as FLTK uses the same rules when using arrow keys to move +

                The arrow, tab, and shift+tab keys "navigate" the selection. Left, +right, tab, or shift+tab move to the next or previous widgets in the +hierarchy. Hit the right arrow enough and you will select every widget +in the window. Up/down widgets move to the previous/next widgets that +overlap horizontally. If the navigation does not seem to work you +probably need to "Sort" the widgets. This is important if you have +input fields, as FLTK uses the same rules when using arrow keys to move between input fields.

                -

                To "open" a widget, double click it. To open several widgets select +

                To "open" a widget, double click it. To open several widgets select them and then type F1 or pick "Edit/Open" off the pop-up menu.

                -

                Type Alt+o to temporarily toggle the overlay off without changing +

                Type Alt+o to temporarily toggle the overlay off without changing the selection, so you can see the widget borders.

                -

                You can resize the window by using the window manager border -controls. FLTK will attempt to round the window size to the nearest -multiple of the grid size and makes it big enough to contain all the -widgets (it does this using illegal X methods, so it is possible it -will barf with some window managers!). Notice that the actual window -in your program may not be resizable, and if it is, the effect on child +

                You can resize the window by using the window manager border +controls. FLTK will attempt to round the window size to the nearest +multiple of the grid size and makes it big enough to contain all the +widgets (it does this using illegal X methods, so it is possible it +will barf with some window managers!). Notice that the actual window +in your program may not be resizable, and if it is, the effect on child widgets may be different.

                -

                The panel for the window (which you get by double-clicking it) is -almost identical to the panel for any other Fl_Widget. There are three +

                The panel for the window (which you get by double-clicking it) is +almost identical to the panel for any other Fl_Widget. There are three extra items:

                Border

                - This button turns the window manager border on or off. On most window -managers you will have to close the window and reopen it to see the -effect. + This button turns the window manager border on or off. On most window +managers you will have to close the window and reopen it to see the +effect.

                xclass

                - The string typed into here is passed to the X window manager as the -class. This can change the icon or window decorations. On most (all?) -window managers you will have to close the window and reopen it to see + The string typed into here is passed to the X window manager as the +class. This can change the icon or window decorations. On most (all?) +window managers you will have to close the window and reopen it to see the effect.

                Image Labels

                -

                Selecting "Image..." off the label style pull-down menu will bring -up a file chooser from which you pick the image file. If an image has -already been chosen, you can change the image used by picking -"Image..." again. The name of the image will appear in the "label" +

                Selecting "Image..." off the label style pull-down menu will bring +up a file chooser from which you pick the image file. If an image has +already been chosen, you can change the image used by picking +"Image..." again. The name of the image will appear in the "label" field, but you can't edit it.

                -

                The contents of the image file are written to the .cxx file, -so if you wish to distribute the C code, you only need to copy the .cxx -file, not the images. If many widgets share the same image then only +

                The contents of the image file are written to the .cxx file, +so if you wish to distribute the C code, you only need to copy the .cxx +file, not the images. If many widgets share the same image then only one copy is written.

                -

                However the file name is stored in the .fl file, so to read -the .fl file you need the image files as well. Filenames are relative -to the location the .fl file is (not necessarily the current -directory). I recommend you either put the images in the same +

                However the file name is stored in the .fl file, so to read +the .fl file you need the image files as well. Filenames are relative +to the location the .fl file is (not necessarily the current +directory). I recommend you either put the images in the same directory as the .fl file, or use absolute path names.

                Notes for all image types

                -FLUID runs using the default visual of your X server. This may be 8 -bits, which will give you dithered images. You may get better results -in your actual program by adding the code "Fl::visual(FL_RGB)" to your +FLUID runs using the default visual of your X server. This may be 8 +bits, which will give you dithered images. You may get better results +in your actual program by adding the code "Fl::visual(FL_RGB)" to your code right before the first window is displayed. -

                All widgets with the same image on them share the same code and -source X pixmap. Thus once you have put an image on a widget, it is +

                All widgets with the same image on them share the same code and +source X pixmap. Thus once you have put an image on a widget, it is nearly free to put the same image on many other widgets.

                -

                If you are using a painting program to edit an image: the only way -to convince FLUID to read the image file again is to remove the image -from all widgets that are using it (including ones in closed windows), -which will cause it to free its internal copy, and then set the image +

                If you are using a painting program to edit an image: the only way +to convince FLUID to read the image file again is to remove the image +from all widgets that are using it (including ones in closed windows), +which will cause it to free its internal copy, and then set the image again. You may find it easier to exit FLUID and run it again.

                -

                Don't rely on how FLTK crops images that are outside the widget, as -this may change in future versions! The cropping of inside labels will +

                Don't rely on how FLTK crops images that are outside the widget, as +this may change in future versions! The cropping of inside labels will probably be unchanged.

                -

                To more accurately place images, make a new "box" widget and put the -image in that as the label. This is also how you can put both an image -and text label on the same widget. If your widget is a button, and you -want the image inside it, you must change the button's boxtype to -FL_UP_FRAME (or another frame), otherwise when it is pushed it will +

                To more accurately place images, make a new "box" widget and put the +image in that as the label. This is also how you can put both an image +and text label on the same widget. If your widget is a button, and you +want the image inside it, you must change the button's boxtype to +FL_UP_FRAME (or another frame), otherwise when it is pushed it will erase the image.

                XBM (X bitmap files)

                -FLUID will read X bitmap files. These files have C source code to -define a bitmap. Sometimes they are stored with the ".h" or ".bm" +FLUID will read X bitmap files. These files have C source code to +define a bitmap. Sometimes they are stored with the ".h" or ".bm" extension rather than the standard ".xbm". -

                FLUID will output code to construct an Fl_Bitmap widget and use it -to label the widget. The '1' bits in the bitmap are drawn using the -label color of the widget. You can change the color in FLUID. The '0' +

                FLUID will output code to construct an Fl_Bitmap widget and use it +to label the widget. The '1' bits in the bitmap are drawn using the +label color of the widget. You can change the color in FLUID. The '0' bits are transparent.

                -

                The program "bitmap" on the X distribution does an ok job of editing +

                The program "bitmap" on the X distribution does an ok job of editing bitmaps.

                XPM (X pixmap files)

                -FLUID will read X pixmap files as used by the libxpm library. These -files have C source code to define a pixmap. The filenames usually +FLUID will read X pixmap files as used by the libxpm library. These +files have C source code to define a pixmap. The filenames usually have a ".xpm" extension. -

                FLUID will output code to construct an Fl_Pixmap widget and use it -to label the widget. The label color of the widget is ignored, even +

                FLUID will output code to construct an Fl_Pixmap widget and use it +to label the widget. The label color of the widget is ignored, even for 2-color images that could be a bitmap.

                -

                XPM files can mark a single color as being transparent. Currently -FLTK and FLUID simulate this transparency rather badly. It will use -the color() of the widget as the background, and all widgets using the -same pixmap are assummed to have the same color. This may be fixed in +

                XPM files can mark a single color as being transparent. Currently +FLTK and FLUID simulate this transparency rather badly. It will use +the color() of the widget as the background, and all widgets using the +same pixmap are assummed to have the same color. This may be fixed in the future or on non-X systems.

                I have not found any good editors for small iconic pictures. For @@ -886,13 +886,13 @@ color images and are difficult to use to edit an image of small size and few colors.

                GIF files

                -FLUID will also read GIF image files. These files are often used on -html documents to make icons. This lets you use nice icons that you +FLUID will also read GIF image files. These files are often used on +html documents to make icons. This lets you use nice icons that you steal off the net in your user interface. -

                FLUID converts these into (modified) XPM format and uses an -Fl_Pixmap widget to label the widget. Transparency is handled the same -as for xpm files. Notice that the conversion removes the compression, -so the code may be much bigger than the .gif file. Only the first +

                FLUID converts these into (modified) XPM format and uses an +Fl_Pixmap widget to label the widget. Transparency is handled the same +as for xpm files. Notice that the conversion removes the compression, +so the code may be much bigger than the .gif file. Only the first image of an animated gif file is used.

                Behavior and performance with large .gif files is not guaranteed!

                Internationalization with FLUID

                @@ -905,7 +905,7 @@ use POSIX catgets. The "use none" method is the default and just passes the label strings as-is to the widget constructors.

                The "GNU gettext" method uses GNU gettext (or a similar text-based I18N library) to retrieve a localized string before calling the widget -constructor. +constructor.

                The "POSIX catgets" method uses the POSIX catgets function to retrieve a numbered message from a message catalog before calling the widget constructor. diff --git a/documentation/forms.html b/documentation/forms.html index 9b405416b..9d0d7cb88 100644 --- a/documentation/forms.html +++ b/documentation/forms.html @@ -1,69 +1,69 @@

                E - Forms Compatibility

                - This appendix describes the Forms compatibility included with FLTK. + This appendix describes the Forms compatibility included with FLTK.

                Importing Forms Layout Files

                -FLUID can read the .fd files put out by -all versions of Forms and XForms fdesign. However, it will mangle them -a bit, but it prints a warning message about anything it does not -understand. FLUID cannot write fdesign files, so you should save to a -new name so you don't write over the old one. -

                You will need to edit your main code considerably to get it to link -with the output from FLUID. If you are not interested in this you may +FLUID can read the .fd files put out by +all versions of Forms and XForms fdesign. However, it will mangle them +a bit, but it prints a warning message about anything it does not +understand. FLUID cannot write fdesign files, so you should save to a +new name so you don't write over the old one. +

                You will need to edit your main code considerably to get it to link +with the output from FLUID. If you are not interested in this you may have more immediate luck with the forms compatibility header, <FL/forms.H>.

                Using the Compatibility Header File

                - You should be able to compile existing Forms or XForms source code by + You should be able to compile existing Forms or XForms source code by changing the include directory switch to your compiler so that the forms.h file supplied with FLTK is included. Take a look at -forms.h to see how it works, but the basic trick is lots of inline -functions. Most of the XForms demo programs work without changes. -

                You will also have to compile your Forms or XForms program using a -C++ compiler. The FLTK library does not provide C bindings or header +forms.h to see how it works, but the basic trick is lots of inline +functions. Most of the XForms demo programs work without changes. +

                You will also have to compile your Forms or XForms program using a +C++ compiler. The FLTK library does not provide C bindings or header files.

                -

                Although FLTK was designed to be compatable with the GL Forms -library (version 0.3 or so), XForms has bloated severely and it's -interface is X-specific. Therefore, XForms compatibility is no longer -a goal of FLTK. Compatibility was limited to things that were free, or -that would add code that would not be linked in if the feature is +

                Although FLTK was designed to be compatable with the GL Forms +library (version 0.3 or so), XForms has bloated severely and it's +interface is X-specific. Therefore, XForms compatibility is no longer +a goal of FLTK. Compatibility was limited to things that were free, or +that would add code that would not be linked in if the feature is unused, or that was not X-specific.

                -

                To use any new features of FLTK, you should rewrite your code to not -use the inline functions and instead use "pure" FLTK. This will make -it a lot cleaner and make it easier to figure out how to call the FLTK -functions. Unfortunately this conversion is harder than expected and +

                To use any new features of FLTK, you should rewrite your code to not +use the inline functions and instead use "pure" FLTK. This will make +it a lot cleaner and make it easier to figure out how to call the FLTK +functions. Unfortunately this conversion is harder than expected and even Digital Domain's inhouse code still uses forms.H a lot.

                Problems You Will Encounter

                Many parts of XForms use X-specific structures like XEvent - in their interface. I did not emulate these! Unfortunately these -features (such as the "canvas" widget) are needed by most large + in their interface. I did not emulate these! Unfortunately these +features (such as the "canvas" widget) are needed by most large programs. You will need to rewrite these to use FLTK subclasses.

                -

                Fl_Free widgets emulate -the old Forms "free" widget. It may be useful for porting -programs that change the handle() function on widgets, but you +

                Fl_Free widgets emulate +the old Forms "free" widget. It may be useful for porting +programs that change the handle() function on widgets, but you will still need to rewrite things.

                -

                Fl_Timer widgets are -provided to emulate the XForms timer. These work, but are quite +

                Fl_Timer widgets are +provided to emulate the XForms timer. These work, but are quite inefficient and inaccurate compared to using Fl::add_timeout().

                -

                All instance variables are hidden. If you directly refer to -the x, y, w, h, label, or other fields of your Forms widgets you will -have to add empty parenthesis after each reference. The easiest way to -do this is to globally replace "->x" with "->x()", etc. Replace +

                All instance variables are hidden. If you directly refer to +the x, y, w, h, label, or other fields of your Forms widgets you will +have to add empty parenthesis after each reference. The easiest way to +do this is to globally replace "->x" with "->x()", etc. Replace "boxtype" with "box()".

                -

                const char * arguments to most FLTK methods are simply -stored, while Forms would strdup() the passed string. This is -most noticable with the label of widgets. Your program must always +

                const char * arguments to most FLTK methods are simply +stored, while Forms would strdup() the passed string. This is +most noticable with the label of widgets. Your program must always pass static data such as a string constant or malloc'd buffer to -label(). If you are using labels to display program output you +label(). If you are using labels to display program output you may want to try the Fl_Output widget.

                -

                The default fonts and sizes are matched to the older GL version of -Forms, so all labels will draw somewhat larger than an XForms program +

                The default fonts and sizes are matched to the older GL version of +Forms, so all labels will draw somewhat larger than an XForms program does.

                -

                fdesign outputs a setting of a "fdui" instance variable to the main -window. I did not emulate this because I wanted all instance variables +

                fdesign outputs a setting of a "fdui" instance variable to the main +window. I did not emulate this because I wanted all instance variables to be hidden. You can store the same information in the user_data() - field of a window. To do this, search through the fdesign output for -all occurances of "->fdui" and edit to use "->user_data()" instead. + field of a window. To do this, search through the fdesign output for +all occurances of "->fdui" and edit to use "->user_data()" instead. This will require casts and is not trivial.

                The prototype for the functions passed to fl_add_timeout() and fl_set_idle_callback() callback are different.

                @@ -116,55 +116,55 @@ all occurances of "->fdui" and edit to use "->user_data()&q
              • xyplot object

              Additional Notes

              - These notes were written for porting programs written with the older -IRISGL version of Forms. Most of these problems are the same ones -encountered when going from old Forms to XForms: + These notes were written for porting programs written with the older +IRISGL version of Forms. Most of these problems are the same ones +encountered when going from old Forms to XForms:

              Does Not Run In Background

              - The IRISGL library always forked when you created the first window, -unless "foreground()" was called. FLTK acts like "foreground()" is -called all the time. If you really want the fork behavior do "if -(fork()) exit(0)" right at the start of your program. + The IRISGL library always forked when you created the first window, +unless "foreground()" was called. FLTK acts like "foreground()" is +called all the time. If you really want the fork behavior do "if +(fork()) exit(0)" right at the start of your program.

              You Cannot Use IRISGL Windows or fl_queue

              - If a Forms (not XForms) program if you wanted your own window for -displaying things you would create a IRISGL window and draw in it, -periodically calling Forms to check if the user hit buttons on the -panels. If the user did things to the IRISGL window, you would find -this out by having the value FL_EVENT returned from the call to Forms. -

              None of this works with FLTK. Nor will it compile, the necessary + If a Forms (not XForms) program if you wanted your own window for +displaying things you would create a IRISGL window and draw in it, +periodically calling Forms to check if the user hit buttons on the +panels. If the user did things to the IRISGL window, you would find +this out by having the value FL_EVENT returned from the call to Forms. +

              None of this works with FLTK. Nor will it compile, the necessary calls are not in the interface.

              You have to make a subclass of Fl_Gl_Window and write a draw() method and -handle() method. This may require anywhere from a trivial to a +handle() method. This may require anywhere from a trivial to a major rewrite.

              If you draw into the overlay planes you will have to also write a -draw_overlay() method and call redraw_overlay() on the +draw_overlay() method and call redraw_overlay() on the OpenGL window.

              One easy way to hack your program so it works is to make the -draw() and handle() methods on your window set some -static variables, storing what event happened. Then in the main loop -of your program, call Fl::wait() and then check these +draw() and handle() methods on your window set some +static variables, storing what event happened. Then in the main loop +of your program, call Fl::wait() and then check these variables, acting on them as though they are events read from fl_queue.

              You Must Use OpenGL to Draw Everything

              -

              The file <FL/gl.h> defines replacements for a lot of IRISGL -calls, translating them to OpenGL. There are much better translators +

              The file <FL/gl.h> defines replacements for a lot of IRISGL +calls, translating them to OpenGL. There are much better translators available that you might want to investigate.

              You Cannot Make Forms Subclasses

              - Programs that call fl_make_object or directly setting the -handle routine will not compile. You have to rewrite them to use a + Programs that call fl_make_object or directly setting the +handle routine will not compile. You have to rewrite them to use a subclass of Fl_Widget. It is important to note that the handle() method is not exactly the same as the handle() - function of Forms. Where a Forms handle() returned non-zero, + function of Forms. Where a Forms handle() returned non-zero, your handle() must call do_callback(). And your -handle() must return non-zero if it "understood" the event. -

              An attempt has been made to emulate the "free" widget. This appears -to work quite well. It may be quicker to modify your subclass into a +handle() must return non-zero if it "understood" the event. +

              An attempt has been made to emulate the "free" widget. This appears +to work quite well. It may be quicker to modify your subclass into a "free" widget, since the "handle" functions match.

              -

              If your subclass draws into the overlay you are in trouble and will +

              If your subclass draws into the overlay you are in trouble and will have to rewrite things a lot.

              You Cannot Use <device.h>

              - If you have written your own "free" widgets you will probably get a -lot of errors about "getvaluator". You should substitute: + If you have written your own "free" widgets you will probably get a +lot of errors about "getvaluator". You should substitute:
              @@ -177,12 +177,12 @@ lot of errors about "getvaluator". You should substitute:
              FormsFLTK
              MOUSE_XFl::event_x_root()
              MOUSE2,MIDDLEMOUSEFl::event_state()
              MOUSE3,LEFTMOUSEFl::event_state()
              - Anything else in getvaluator and you are on your own... + Anything else in getvaluator and you are on your own...

              Font Numbers Are Different

              - The "style" numbers have been changed because I wanted to insert -bold-italic versions of the normal fonts. If you use Times, Courier, -or Bookman to display any text you will get a different font out of -FLTK. If you are really desperate to fix this use the following code: + The "style" numbers have been changed because I wanted to insert +bold-italic versions of the normal fonts. If you use Times, Courier, +or Bookman to display any text you will get a different font out of +FLTK. If you are really desperate to fix this use the following code:
                 fl_font_name(3,"*courier-medium-r-no*");
                diff --git a/documentation/glut.html b/documentation/glut.html
                index c26ee7352..93d7b30e8 100644
                --- a/documentation/glut.html
                +++ b/documentation/glut.html
                @@ -1,31 +1,31 @@
                 
                 

                D - GLUT Compatibility

                - This appendix describes the GLUT compatibility header file supplied -with FLTK. + This appendix describes the GLUT compatibility header file supplied +with FLTK.

                Using the GLUT Compatibility Header File

                You should be able to compile existing GLUT source code by including -<FL/glut.H> instead of <GL/glut.h>. This can be done by -editing the source, by changing the -I switches to the +<FL/glut.H> instead of <GL/glut.h>. This can be done by +editing the source, by changing the -I switches to the compiler, or by providing a symbolic link from GL/glut.h to -FL/glut.H. -

                All files calling GLUT procedures must be compiled with C++. - You may have to alter them slightly to get them to compile without -warnings, and you may have to rename them to get make to use the C++ +FL/glut.H. +

                All files calling GLUT procedures must be compiled with C++. + You may have to alter them slightly to get them to compile without +warnings, and you may have to rename them to get make to use the C++ compiler.

                -

                You must link with the FLTK library. If you call any GLUT drawing +

                You must link with the FLTK library. If you call any GLUT drawing functions that FLTK does not emulate (glutExtensionsSupported() , glutWire*(), glutSolid*(), and glutStroke*() -), you will also have to link with the GLUT library (after the +), you will also have to link with the GLUT library (after the FLTK library!)

                -

                Most of FL/glut.H is inline functions. You should take a -look at it (and maybe at test/glpuzzle.cxx in the FLTK source) if +

                Most of FL/glut.H is inline functions. You should take a +look at it (and maybe at test/glpuzzle.cxx in the FLTK source) if you are having trouble porting your GLUT program.

                -

                This has been tested with most of the demo programs that come with +

                This has been tested with most of the demo programs that come with the GLUT 3.3 distribution.

                Known Problems

                - The following functions and/or arguments to functions are missing, and -you will have to replace them or comment them out for your code to -compile: + The following functions and/or arguments to functions are missing, and +you will have to replace them or comment them out for your code to +compile:
                • glutLayerGet(GLUT_LAYER_IN_USE)
                • glutLayerGet(GLUT_HAS_OVERLAY)
                • @@ -43,53 +43,53 @@ compile:
                • glutGet(GLUT_ELAPSED_TIME)
                • glutVideoResize() missing.
                - Most of the symbols/enumerations have different values than GLUT uses. - This will break code that relies on the actual values. The only + Most of the symbols/enumerations have different values than GLUT uses. + This will break code that relies on the actual values. The only symbols guaranteed to have the same values are true/false pairs like GLUT_DOWN and GLUT_UP, mouse buttons GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, GLUT_RIGHT_BUTTON, and -GLUT_KEY_F1 thru F12. +GLUT_KEY_F1 thru F12.

                The strings passed as menu labels are not copied.

                -

                glutPostRedisplay() does not work if called from inside a -display function. You must use glutIdleFunc() if you want +

                glutPostRedisplay() does not work if called from inside a +display function. You must use glutIdleFunc() if you want your display to update continuously.

                -

                glutSwapBuffers() does not work from inside a display +

                glutSwapBuffers() does not work from inside a display function. This is on purpose, because FLTK swaps the buffers for you.

                -

                glutUseLayer() does not work well, and should only be used -to initialize transformations inside a resize callback. You should +

                glutUseLayer() does not work well, and should only be used +to initialize transformations inside a resize callback. You should redraw overlays by using glutOverlayDisplayFunc().

                Overlays are cleared before the overlay display function is called. -glutLayerGet(GLUT_OVERLAY_DAMAGED) always returns true for -compatibility with some GLUT overlay programs. You must rewrite your -code so that gl_color() is used to choose colors in an +glutLayerGet(GLUT_OVERLAY_DAMAGED) always returns true for +compatibility with some GLUT overlay programs. You must rewrite your +code so that gl_color() is used to choose colors in an overlay, or you will get random overlay colors.

                -

                glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR) just results in a +

                glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR) just results in a small crosshair.

                The fonts used by glutBitmapCharacter() and glutBitmapWidth() may be different.

                -

                glutInit(argc,argv) will consume different switches than +

                glutInit(argc,argv) will consume different switches than GLUT does. It accepts the switches recognized by -Fl::args(), and will accept any abbreviation of these +Fl::args(), and will accept any abbreviation of these switches (such as "-di" for "-display").

                Mixing GLUT and FLTK Code

                - You can make your GLUT window a child of a Fl_Window with the + You can make your GLUT window a child of a Fl_Window with the following scheme. The biggest trick is that GLUT insists on show() 'ing the window at the point it is created, which means the -Fl_Window parent window must already be shown. +Fl_Window parent window must already be shown.
                • Don't call glutInit().
                • -
                • Create your Fl_Window, and any FLTK widgets. Leave a +
                • Create your Fl_Window, and any FLTK widgets. Leave a blank area in the window for your GLUT window.
                • show() the Fl_Window. Perhaps call show(argc,argv).
                • -
                • Call window->begin() so that the GLUT window will be +
                • Call window->begin() so that the GLUT window will be automatically added to it.
                • Use glutInitWindowSize() and glutInitWindowPosition() to set the location in the parent window to put the GLUT window.
                • -
                • Put your GLUT code next. It probably does not need many changes. +
                • Put your GLUT code next. It probably does not need many changes. Call window->end() immediately after the glutCreateWindow()!
                • -
                • You can call either glutMainLoop(), Fl::run(), or +
                • You can call either glutMainLoop(), Fl::run(), or loop calling Fl::wait() to run the program.

                @@ -110,18 +110,18 @@ loop calling Fl::wait() to run the program.

              Description

              - Each GLUT window is an instance of this class. You may find it useful -to manipulate instances directly rather than use GLUT window id's. - These may be created without opening the display, and thus can fit -better into FLTK's method of creating windows. + Each GLUT window is an instance of this class. You may find it useful +to manipulate instances directly rather than use GLUT window id's. + These may be created without opening the display, and thus can fit +better into FLTK's method of creating windows.

              The current GLUT window is available in the global variable glut_window.

              new Fl_Glut_Window(...) is the same as -glutCreateWindow() except it does not show() the window +glutCreateWindow() except it does not show() the window or make the window current.

              window->make_current() is the same as glutSetWindow(number). If the window has not had show() - called on it yet, some functions that assumme an OpenGL context will + called on it yet, some functions that assumme an OpenGL context will not work. If you do show() the window, call make_current() again to set the context.

              ~Fl_Glut_Window() is the same as glutDestroyWindow() @@ -192,15 +192,15 @@ be altered directly:

            • make_current

            -Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char +Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char *title = 0)
            Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *title = 0)

            - The first constructor takes 4 int arguments to create the window with -a preset position and size. The second constructor with 2 arguments -will create the window with a preset size, but the window manager will -choose the position according to it's own whims. -

            virtual + The first constructor takes 4 int arguments to create the window with +a preset position and size. The second constructor with 2 arguments +will create the window with a preset size, but the window manager will +choose the position according to it's own whims. +

            virtual Fl_Glut_Window::~Fl_Glut_Window()

            Destroys the GLUT window.

            void Fl_Glut_Window::make_current()

            diff --git a/documentation/index.html b/documentation/index.html index 79a8f83b8..b9483d57e 100644 --- a/documentation/index.html +++ b/documentation/index.html @@ -54,7 +54,7 @@
          • Fl::event_*() methods
          • Event Propagation
          - 7 - Adding and Extending + 7 - Adding and Extending Widgets diff --git a/documentation/intro.html b/documentation/intro.html index c92b860af..abdf5a454 100644 --- a/documentation/intro.html +++ b/documentation/intro.html @@ -20,7 +20,7 @@ operating system. The system only has to provide arbitrary shaped but featureless windows, a powerful set of graphics drawing calls, and a simple unalterable method of delivering events to the owners of the windows. NeXT (if you -ignored NextStep) provided this, but they chose to hide it and +ignored NextStep) provided this, but they chose to hide it and tried to push their own baroque toolkit instead.

          Many of the ideas in FLTK were developed on a NeXT (but @@ -54,7 +54,7 @@ he integrated his table-driven menus into it. Several very large programs were created using this version of Forms.

          The need to switch to OpenGL and GLX, portability, and a -desire to use C++ subclassing required a rewrite of Forms. +desire to use C++ subclassing required a rewrite of Forms. This produced the first version of FLTK. The conversion to C++ required so many changes it made it impossible to recompile any Forms objects. Since it was incompatible anyway, Bill decided @@ -106,7 +106,7 @@ is now included with several Linux distributions.

          WIN32 version - only about 10% of the code is different. -
        • Interactive user interface builder program. Output is +
        • Interactive user interface builder program. Output is human-readable and editable C++ source code.
        • Support for overlay hardware, with emulation if none @@ -145,7 +145,7 @@ functions and structures started with "fl_". This naming was extended to all new methods and widgets in the C++ library, and this prefix was taken as the name of the library. It is almost impossible to search for "FL" on the -Internet, due to the fact that it is also the abbreviation for +Internet, due to the fact that it is also the abbreviation for Florida. After much debating and searching for a new name for the toolkit, which was already in use by several people, Bill came up with "FLTK", including a bogus excuse that it @@ -159,7 +159,7 @@ everything.

          FLTK uses GNU autoconf to configure itself for your UNIX platform. The main things that the configure script will look -for are the X11 and OpenGL (or Mesa) header and library files. +for are the X11 and OpenGL (or Mesa) header and library files. If these cannot be found in the standard include/library locations you'll need to define the CFLAGS, CXXFLAGS, and LDFLAGS environment variables. @@ -231,13 +231,13 @@ tool, and all of the test programs.

          To install the library, become root and type "make install". This will copy the "fluid" executable -to "bindir", the header files to +to "bindir", the header files to "includedir", and the library files to "libdir".

          Building FLTK Under Microsoft Windows

          -

          There are three ways to build FLTK under Microsoft Windows. +

          There are three ways to build FLTK under Microsoft Windows. The first is to use the Visual C++ 5.0 project files under the "visualc" directory. Just open (or double-click on) the "fltk.dsw" file to get the whole shebang.

          @@ -286,7 +286,7 @@ EMX 0.9d and libExt (from posix2.sourceforge.net) is installed. -

          To build the XFree86 version of FLTK for OS/2, copy the appropriate +

          To build the XFree86 version of FLTK for OS/2, copy the appropriate makeinclude and config files to the main directory and do a make:

            @@ -320,9 +320,9 @@ interface, so XFree86 will no longer be required.

            Austria (gd.tuwien.ac.at)
            EMail
            -
            fltk@fltk.org [see +
            fltk@fltk.org [see instructions below] -
            fltk-bugs@fltk.org [for +
            fltk-bugs@fltk.org [for reporting bugs]
            News
            @@ -335,7 +335,7 @@ interface, so XFree86 will no longer be required.

            Non-member submissions are blocked to avoid problems with unsolicited email.

            -

            To join the FLTK mailing list, send a message to +

            To join the FLTK mailing list, send a message to "majordomo@fltk.org" with "subscribe fltk" in the message body. A digest of this list is available by subscribing to the "fltk-digest" mailing list.

            @@ -351,7 +351,7 @@ any kind of help without that basic information.

            Bugs can also be reported to the "fltk.bugs" newsgroup or on the SourceForge bug tracker pages.

            -

            For general support and questions, please use the FLTK mailing list +

            For general support and questions, please use the FLTK mailing list at "fltk@fltk.org" or one of the newsgroups.

            diff --git a/documentation/license.html b/documentation/license.html index 78b484e0f..cad2b3c6a 100644 --- a/documentation/license.html +++ b/documentation/license.html @@ -4,376 +4,376 @@

            Version 2, June 1991
            Copyright (C) 1991 Free Software Foundation, Inc.
            59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -
            Everyone is permitted to copy and distribute verbatim copies of +
            Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -
            [This is the first released version of the library GPL. It is +
            [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.]

            Preamble

            - The licenses for most software are designed to take away your freedom -to share and change it. By contrast, the GNU General Public Licenses -are intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. -

            This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public Licenses +are intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. +

            This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for your libraries, too.

            -

            When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it in +

            When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

            -

            To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you +

            To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it.

            -

            For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling +

            For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.

            -

            Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal +

            Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.

            -

            Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on +

            Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on the original authors' reputations.

            -

            Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's +

            Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

            -

            Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License, which was designed for utility -programs. This license, the GNU Library General Public License, -applies to certain designated libraries. This license is quite -different from the ordinary one; be sure to read it in full, and don't +

            Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License, which was designed for utility +programs. This license, the GNU Library General Public License, +applies to certain designated libraries. This license is quite +different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.

            -

            The reason we have a separate public license for some libraries is -that they blur the distinction we usually make between modifying or -adding to a program and simply using it. Linking a program with a -library, without changing the library, is in some sense simply using -the library, and is analogous to running a utility program or -application program. However, in a textual and legal sense, the linked -executable is a combined work, a derivative of the original library, +

            The reason we have a separate public license for some libraries is +that they blur the distinction we usually make between modifying or +adding to a program and simply using it. Linking a program with a +library, without changing the library, is in some sense simply using +the library, and is analogous to running a utility program or +application program. However, in a textual and legal sense, the linked +executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.

            -

            Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We +

            Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.

            -

            However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended -to permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to -achieve this as regards changes in header files, but we have achieved -it as regards changes in the actual functions of the Library.) The +

            However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended +to permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to +achieve this as regards changes in header files, but we have achieved +it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.

            -

            The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the libary" and a "work that uses the library". The -former contains code derived from the library, while the latter only +

            The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the libary" and a "work that uses the library". The +former contains code derived from the library, while the latter only works together with the library.

            -

            Note that it is possible for a library to be covered by the ordinary +

            Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.

            -

            TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND +

            TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

            -0. This License Agreement applies to any software -library which contains a notice placed by the copyright holder or other -authorized party saying it may be distributed under the terms of this -Library General Public License (also called "this License"). Each -licensee is addressed as "you". -

            A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs +0. This License Agreement applies to any software +library which contains a notice placed by the copyright holder or other +authorized party saying it may be distributed under the terms of this +Library General Public License (also called "this License"). Each +licensee is addressed as "you". +

            A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.

            -

            The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is +

            The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)

            -

            "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control +

            "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation and installation of the library.

            -

            Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does and +

            Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.

            -

            1. You may copy and distribute verbatim copies of -the Library's complete source code as you receive it, in any medium, -provided that you conspicuously and appropriately publish on each copy -an appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any +

            1. You may copy and distribute verbatim copies of +the Library's complete source code as you receive it, in any medium, +provided that you conspicuously and appropriately publish on each copy +an appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.

            -

            You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a +

            You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a fee.

            -

            2. You may modify your copy or copies of the -Library or any portion of it, thus forming a work based on the Library, -and copy and distribute such modifications or work under the terms of +

            2. You may modify your copy or copies of the +Library or any portion of it, thus forming a work based on the Library, +and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

            -a) The modified work must itself be a software -library. -

            b) You must cause the files modified to carry -prominent notices stating that you changed the files and the date of +a) The modified work must itself be a software +library. +

            b) You must cause the files modified to carry +prominent notices stating that you changed the files and the date of any change.

            -

            c) You must cause the whole of the work to be -licensed at no charge to all third parties under the terms of this +

            c) You must cause the whole of the work to be +licensed at no charge to all third parties under the terms of this License.

            -

            d) If a facility in the modified Library refers to -a function or a table of data to be supplied by an application program -that uses the facility, other than as an argument passed when the -facility is invoked, then you must make a good faith effort to ensure -that, in the event an application does not supply such function or -table, the facility still operates, and performs whatever part of its +

            d) If a facility in the modified Library refers to +a function or a table of data to be supplied by an application program +that uses the facility, other than as an argument passed when the +facility is invoked, then you must make a good faith effort to ensure +that, in the event an application does not supply such function or +table, the facility still operates, and performs whatever part of its purpose remains meaningful.

            -

            (For example, a function in a library to compute square roots has a -purpose that is entirely well-defined independent of the application. - Therefore, Subsection 2d requires that any application-supplied -function or table used by this function must be optional: if the -application does not supply it, the square root function must still +

            (For example, a function in a library to compute square roots has a +purpose that is entirely well-defined independent of the application. + Therefore, Subsection 2d requires that any application-supplied +function or table used by this function must be optional: if the +application does not supply it, the square root function must still compute square roots.)

            -

            These requirements apply to the modified work as a whole. -If identifiable sections of that work are not derived from the -Library, and can be reasonably considered independent and separate -works in themselves, then this License, and its terms, do not apply to -those sections when you distribute them as separate works. But when -you distribute the same sections as part of a whole which is a work -based on the Library, the distribution of the whole must be on the -terms of this License, whose permissions for other licensees extend to -the entire whole, and thus to each and every part regardless of who +

            These requirements apply to the modified work as a whole. +If identifiable sections of that work are not derived from the +Library, and can be reasonably considered independent and separate +works in themselves, then this License, and its terms, do not apply to +those sections when you distribute them as separate works. But when +you distribute the same sections as part of a whole which is a work +based on the Library, the distribution of the whole must be on the +terms of this License, whose permissions for other licensees extend to +the entire whole, and thus to each and every part regardless of who wrote it.

            -

            Thus, it is not the intent of this section to claim rights or -contest your rights to work written entirely by you; rather, the intent -is to exercise the right to control the distribution of derivative or +

            Thus, it is not the intent of this section to claim rights or +contest your rights to work written entirely by you; rather, the intent +is to exercise the right to control the distribution of derivative or collective works based on the Library.

            -

            In addition, mere aggregation of another work not based on the -Library with the Library (or with a work based on the Library) on a -volume of a storage or distribution medium does not bring the other +

            In addition, mere aggregation of another work not based on the +Library with the Library (or with a work based on the Library) on a +volume of a storage or distribution medium does not bring the other work under the scope of this License.

            -

            3. You may opt to apply the terms of the ordinary -GNU General Public License instead of this License to a given copy of -the Library. To do this, you must alter all the notices that refer to -this License, so that they refer to the ordinary GNU General Public -License, version 2, instead of to this License. (If a newer version -than version 2 of the ordinary GNU General Public License has appeared, -then you can specify that version instead if you wish.) Do not make +

            3. You may opt to apply the terms of the ordinary +GNU General Public License instead of this License to a given copy of +the Library. To do this, you must alter all the notices that refer to +this License, so that they refer to the ordinary GNU General Public +License, version 2, instead of to this License. (If a newer version +than version 2 of the ordinary GNU General Public License has appeared, +then you can specify that version instead if you wish.) Do not make any other change in these notices.

            -

            Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all +

            Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.

            -

            This option is useful when you wish to copy part of the code of the +

            This option is useful when you wish to copy part of the code of the Library into a program that is not a library.

            -

            4. You may copy and distribute the Library (or a -portion or derivative of it, under Section 2) in object code or -executable form under the terms of Sections 1 and 2 above provided that -you accompany it with the complete corresponding machine-readable -source code, which must be distributed under the terms of Sections 1 +

            4. You may copy and distribute the Library (or a +portion or derivative of it, under Section 2) in object code or +executable form under the terms of Sections 1 and 2 above provided that +you accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.

            -

            If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to distribute -the source code, even though third parties are not compelled to copy +

            If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to distribute +the source code, even though third parties are not compelled to copy the source along with the object code.

            -

            5. A program that contains no derivative of any -portion of the Library, but is designed to work with the Library by -being compiled or linked with it, is called a "work that uses the -Library". Such a work, in isolation, is not a derivative work of the +

            5. A program that contains no derivative of any +portion of the Library, but is designed to work with the Library by +being compiled or linked with it, is called a "work that uses the +Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

            -

            However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. Section +

            However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.

            -

            When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The +

            When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.

            -

            If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the +

            If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)

            -

            Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, whether +

            Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.

            -

            6. As an exception to the Sections above, you may -also compile or link a "work that uses the Library" with the Library to -produce a work containing portions of the Library, and distribute that -work under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse +

            6. As an exception to the Sections above, you may +also compile or link a "work that uses the Library" with the Library to +produce a work containing portions of the Library, and distribute that +work under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse engineering for debugging such modifications.

            -

            You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things:

            a) Accompany the work -with the complete corresponding machine-readable source code for the -Library including whatever changes were used in the work (which must -be distributed under Sections 1 and 2 above); and, if the work is an -executable linked with the Library, with the complete machine-readable -"work that uses the Library", as object code and/or source code, so -that the user can modify the Library and then relink to produce a -modified executable containing the modified Library. (It is -understood that the user who changes the contents of definitions files -in the Library will not necessarily be able to recompile the -application to use the modified definitions.) -

            b) Accompany the work with a written offer, valid -for at least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more than the cost +

            You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things:

            a) Accompany the work +with the complete corresponding machine-readable source code for the +Library including whatever changes were used in the work (which must +be distributed under Sections 1 and 2 above); and, if the work is an +executable linked with the Library, with the complete machine-readable +"work that uses the Library", as object code and/or source code, so +that the user can modify the Library and then relink to produce a +modified executable containing the modified Library. (It is +understood that the user who changes the contents of definitions files +in the Library will not necessarily be able to recompile the +application to use the modified definitions.) +

            b) Accompany the work with a written offer, valid +for at least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.

            -

            c) If distribution of the work is made by offering -access to copy from a designated place, offer equivalent access to +

            c) If distribution of the work is made by offering +access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.

            -

            d) Verify that the user has already received a copy +

            d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.

            -

            For an executable, the required form of the "work that -uses the Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major components -(compiler, kernel, and so on) of the operating system on which the -executable runs, unless that component itself accompanies the +

            For an executable, the required form of the "work that +uses the Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major components +(compiler, kernel, and so on) of the operating system on which the +executable runs, unless that component itself accompanies the executable.

            -

            It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you +

            It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you distribute.

            -

            7. You may place library facilities that are a work -based on the Library side-by-side in a single library together with -other library facilities not covered by this License, and distribute -such a combined library, provided that the separate distribution of the -work based on the Library and of the other library facilities is +

            7. You may place library facilities that are a work +based on the Library side-by-side in a single library together with +other library facilities not covered by this License, and distribute +such a combined library, provided that the separate distribution of the +work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:

            -a) Accompany the combined library with a copy of the -same work based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the Sections -above. -

            b) Give prominent notice with the combined library -of the fact that part of it is a work based on the Library, and -explaining where to find the accompanying uncombined form of the same +a) Accompany the combined library with a copy of the +same work based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the Sections +above. +

            b) Give prominent notice with the combined library +of the fact that part of it is a work based on the Library, and +explaining where to find the accompanying uncombined form of the same work.

            -

            8. You may not copy, modify, sublicense, -link with, or distribute the Library except as expressly provided under -this License. Any attempt otherwise to copy, modify, sublicense, link -with, or distribute the Library is void, and will automatically -terminate your rights under this License. However, parties who have -received copies, or rights, from you under this License will not have -their licenses terminated so long as such parties remain in full +

            8. You may not copy, modify, sublicense, +link with, or distribute the Library except as expressly provided under +this License. Any attempt otherwise to copy, modify, sublicense, link +with, or distribute the Library is void, and will automatically +terminate your rights under this License. However, parties who have +received copies, or rights, from you under this License will not have +their licenses terminated so long as such parties remain in full compliance.

            -

            9. You are not required to accept this License, -since you have not signed it. However, nothing else grants you -permission to modify or distribute the Library or its derivative works. - These actions are prohibited by law if you do not accept this License. - Therefore, by modifying or distributing the Library (or any work based -on the Library), you indicate your acceptance of this License to do so, -and all its terms and conditions for copying, distributing or modifying +

            9. You are not required to accept this License, +since you have not signed it. However, nothing else grants you +permission to modify or distribute the Library or its derivative works. + These actions are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Library (or any work based +on the Library), you indicate your acceptance of this License to do so, +and all its terms and conditions for copying, distributing or modifying the Library or works based on it.

            -

            10. Each time you redistribute the Library (or any -work based on the Library), the recipient automatically receives a -license from the original licensor to copy, distribute, link with or -modify the Library subject to these terms and conditions. You may not -impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance +

            10. Each time you redistribute the Library (or any +work based on the Library), the recipient automatically receives a +license from the original licensor to copy, distribute, link with or +modify the Library subject to these terms and conditions. You may not +impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

            -

            11. If, as a consequence of a court judgment or -allegation of patent infringement or for any other reason (not limited -to patent issues), conditions are imposed on you (whether by court -order, agreement or otherwise) that contradict the conditions of this -License, they do not excuse you from the conditions of this License. - If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, -then as a consequence you may not distribute the Library at all. For -example, if a patent license would not permit royalty-free -redistribution of the Library by all those who receive copies directly -or indirectly through you, then the only way you could satisfy both it -and this License would be to refrain entirely from distribution of the +

            11. If, as a consequence of a court judgment or +allegation of patent infringement or for any other reason (not limited +to patent issues), conditions are imposed on you (whether by court +order, agreement or otherwise) that contradict the conditions of this +License, they do not excuse you from the conditions of this License. + If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, +then as a consequence you may not distribute the Library at all. For +example, if a patent license would not permit royalty-free +redistribution of the Library by all those who receive copies directly +or indirectly through you, then the only way you could satisfy both it +and this License would be to refrain entirely from distribution of the Library.

            -

            If any portion of this section is held invalid or unenforceable -under any particular circumstance, the balance of the section is -intended to apply, and the section as a whole is intended to apply in +

            If any portion of this section is held invalid or unenforceable +under any particular circumstance, the balance of the section is +intended to apply, and the section as a whole is intended to apply in other circumstances.

            -

            It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is implemented -by public license practices. Many people have made generous -contributions to the wide range of software distributed through that -system in reliance on consistent application of that system; it is up -to the author/donor to decide if he or she is willing to distribute -software through any other system and a licensee cannot impose that +

            It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up +to the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that choice.

            -

            This section is intended to make thoroughly clear what is believed +

            This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

            -

            12. If the distribution and/or use of the Library -is restricted in certain countries either by patents or by copyrighted -interfaces, the original copyright holder who places the Library under -this License may add an explicit geographical distribution limitation -excluding those countries, so that distribution is permitted only in or -among countries not thus excluded. In such case, this License +

            12. If the distribution and/or use of the Library +is restricted in certain countries either by patents or by copyrighted +interfaces, the original copyright holder who places the Library under +this License may add an explicit geographical distribution limitation +excluding those countries, so that distribution is permitted only in or +among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

            -

            13. The Free Software Foundation may publish -revised and/or new versions of the Library General Public License from -time to time. Such new versions will be similar in spirit to the -present version, but may differ in detail to address new problems or +

            13. The Free Software Foundation may publish +revised and/or new versions of the Library General Public License from +time to time. Such new versions will be similar in spirit to the +present version, but may differ in detail to address new problems or concerns.

            -

            Each version is given a distinguishing version number. If the -Library specifies a version number of this License which applies to it -and "any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by +

            Each version is given a distinguishing version number. If the +Library specifies a version number of this License which applies to it +and "any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by the Free Software Foundation.

            -

            14. If you wish to incorporate parts of the Library -into other free programs whose distribution conditions are incompatible -with these, write to the author to ask for permission. For software -which is copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing +

            14. If you wish to incorporate parts of the Library +into other free programs whose distribution conditions are incompatible +with these, write to the author to ask for permission. For software +which is copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing and reuse of software generally.

            NO WARRANTY

            -

            15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, -THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT -WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE -OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU +

            15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, +THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

            -

            16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW -OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY -WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE -LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL -OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +

            16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW +OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY +WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE +LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL +OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

            END OF TERMS AND CONDITIONS

            diff --git a/documentation/migration.html b/documentation/migration.html index 45e032a2b..df84ff088 100644 --- a/documentation/migration.html +++ b/documentation/migration.html @@ -15,6 +15,6 @@ to be ported to the new Fl_File_Chooser class.

            The Image Class

            -

            The Fl_Image class +

            The Fl_Image class diff --git a/documentation/opengl.html b/documentation/opengl.html index a5336af42..b390e46b9 100644 --- a/documentation/opengl.html +++ b/documentation/opengl.html @@ -1,27 +1,27 @@

            9 - Using OpenGL

            - This chapter discusses using FLTK for your OpenGL applications. + This chapter discusses using FLTK for your OpenGL applications.

            Using OpenGL in FLTK

            The easiest way to make an OpenGL display is to subclass Fl_Gl_Window. Your subclass must implement a draw() -method which uses OpenGL calls to draw the display. Your main program -should call redraw() when the display needs to change, and -(somewhat later) FLTK will call draw(). -

            With a bit of care you can also use OpenGL to draw into normal FLTK -windows. This allows you to use Gouraud shading for +method which uses OpenGL calls to draw the display. Your main program +should call redraw() when the display needs to change, and +(somewhat later) FLTK will call draw(). +

            With a bit of care you can also use OpenGL to draw into normal FLTK +windows. This allows you to use Gouraud shading for drawing your widgets. To do this you use the gl_start() and gl_finish() functions around your OpenGL code.

            -

            You must include FLTK's <FL/gl.h> header file. It will -include the file <GL/gl.h>, define some extra drawing -functions provided by FLTK, and include the <windows.h> header +

            You must include FLTK's <FL/gl.h> header file. It will +include the file <GL/gl.h>, define some extra drawing +functions provided by FLTK, and include the <windows.h> header file needed by WIN32 applications.

            Making a Subclass of Fl_Gl_Window

            -To make a subclass of Fl_Gl_Window, you must provide: +To make a subclass of Fl_Gl_Window, you must provide:
            • A class definition.
            • A draw() method.
            • -
            • A handle() method (if you need to receive input from the +
            • A handle() method (if you need to receive input from the user).
            If your subclass provides static controls in the window, they must be @@ -43,7 +43,7 @@ glDrawBuffer(GL_BACK); considerably. The preprocessor instructions shown above will optimize your code based upon the graphics library used.

            Defining the Subclass

            -To define the subclass you just subclass the Fl_Gl_Window class: +To define the subclass you just subclass the Fl_Gl_Window class:
               class MyWindow : public Fl_Gl_Window {
              @@ -56,12 +56,12 @@ public:
               };
               
            - The draw() and handle() methods are described below. - Like any widget, you can include additional private and public data in -your class (such as scene graph information, etc.) + The draw() and handle() methods are described below. + Like any widget, you can include additional private and public data in +your class (such as scene graph information, etc.)

            The draw() Method

            - The draw() method is where you actually do your OpenGL -drawing: + The draw() method is where you actually do your OpenGL +drawing:
               void MyWindow::draw() {
              @@ -75,8 +75,8 @@ void MyWindow::draw() {
               

            The handle() Method

            - The handle() method handles mouse and keyboard events for the -window: + The handle() method handles mouse and keyboard events for the +window:
               int MyWindow::handle(int event) {
              @@ -88,7 +88,7 @@ int MyWindow::handle(int event) {
                 case FL_DRAG:
                   ... mouse moved while down event ...
                   return 1;
              -  case FL_RELEASE:    
              +  case FL_RELEASE:   
                   ... mouse up event ...
                   return 1;
                 case FL_FOCUS :
              @@ -110,11 +110,11 @@ int MyWindow::handle(int event) {
               }
               
            -When handle() is called, the OpenGL context is not set up! +When handle() is called, the OpenGL context is not set up! If your display changes, you should call redraw() and let -draw() do the work. Don't call any OpenGL drawing functions from -inside handle()! -

            You can call some OpenGL stuff like hit detection and texture +draw() do the work. Don't call any OpenGL drawing functions from +inside handle()! +

            You can call some OpenGL stuff like hit detection and texture loading functions by doing:

              @@ -128,26 +128,26 @@ loading functions by doing: 

              detection, loading textures, etc...
            -Your main program can now create one of your windows by doing new +Your main program can now create one of your windows by doing new MyWindow(...). You can also use FLUID -by: +by:
            1. Putting your class definition in a MyWindow.H file.
            2. Creating a Fl_Box widget in FLUID.
            3. -
            4. In the widget panel fill in the "class" field with MyWindow. +
            5. In the widget panel fill in the "class" field with MyWindow. This will make FLUID produce constructors for your new class.
            6. -
            7. In the "Extra Code" field put #include "MyWindow.H", so that +
            8. In the "Extra Code" field put #include "MyWindow.H", so that the FLUID output file will compile.
            You must put glwindow->show() in your main code after calling -show() on the window containing the OpenGL window. +show()
            on the window containing the OpenGL window.

            Using OpenGL in Normal FLTK Windows

            You can put OpenGL code into an Fl_Widget::draw() method or into the code for a boxtype -or other places with some care. -

            Most importantly, before you show any windows (including those -that don't have OpenGL drawing) you must initialize FLTK so that it -knows it is going to use OpenGL. You may use any of the symbols +or other places with some care. +

            Most importantly, before you show any windows (including those +that don't have OpenGL drawing) you must initialize FLTK so that it +knows it is going to use OpenGL. You may use any of the symbols described for Fl_Gl_Window::mode() to describe how you intend to use OpenGL:

              @@ -155,8 +155,8 @@ Fl_Gl_Window::mode() to describe how you intend to use OpenGL:

              Fl::gl_visual(FL_RGB);
          -You can then put OpenGL drawing code anywhere you can draw normally by -surrounding it with: +You can then put OpenGL drawing code anywhere you can draw normally by +surrounding it with:
             gl_start();
            @@ -165,18 +165,18 @@ gl_finish();
             
          gl_start() and -gl_finish() set up an OpenGL context with an orthographic -projection so that 0,0 is the lower-left corner of the window and each +gl_finish() set up an OpenGL context with an orthographic +projection so that 0,0 is the lower-left corner of the window and each pixel is one unit. The current clipping is reproduced with OpenGL -glScissor() commands. These also synchronize the OpenGL graphics -stream with the drawing done by other X, WIN32, or FLTK functions. -

          The same context is reused each time. If your code changes the +glScissor() commands. These also synchronize the OpenGL graphics +stream with the drawing done by other X, WIN32, or FLTK functions. +

          The same context is reused each time. If your code changes the projection transformation or anything else you should use -glPushMatrix() and glPopMatrix() functions to put the +glPushMatrix() and glPopMatrix() functions to put the state back before calling gl_finish().

          -

          You may want to use Fl_Window::current()->h() to get the +

          You may want to use Fl_Window::current()->h() to get the drawable height so that you can flip the Y coordinates.

          -

          Unfortunately, there are a bunch of limitations you must adhere to +

          Unfortunately, there are a bunch of limitations you must adhere to for maximum portability:

          -Do not call gl_start() or gl_finish() when +Do not call gl_start() or gl_finish() when drawing into an Fl_Gl_Window!

          OpenGL Drawing Functions

          -FLTK provides some useful OpenGL drawing functions. They can be +FLTK provides some useful OpenGL drawing functions. They can be freely mixed with any OpenGL calls, and are defined by including <FL/gl.H> (which you should include instead of the OpenGL header -<GL/gl.h>). +<GL/gl.h>).

          void gl_color(Fl_Color)

          -Set the current color to a FLTK color. For color-index modes -it will use fl_xpixel(c), which is only right if this window +Set the current color to a FLTK color. For color-index modes +it will use fl_xpixel(c), which is only right if this window uses the default colormap!

          void gl_rect(int x, int y, int w, int h)
          void gl_rectf(int x, int y, int w, int h)

          Outline or fill a rectangle with the current color. If
          Fl_Gl_Window::ortho() -has been called, then the rectangle will exactly fill the pixel -rectangle passed. +has been called, then the rectangle will exactly fill the pixel +rectangle passed.

          void gl_font(Fl_Font fontid, int size)

          Set the current OpenGL font to the same font you get by calling -fl_font(). +fl_font().

          int gl_height()
          int gl_descent()
          float gl_width(const char *)
          float gl_width(const char *, int n)
          float gl_width(uchar)

          - Return information about the current OpenGL font. + Return information about the current OpenGL font.

          void gl_draw(const char *)
          void gl_draw(const char *, int n)

          -Draw a nul-terminated string or an array of n characters in +Draw a nul-terminated string or an array of n characters in the current OpenGL font at the current raster position.

          void gl_draw(const char *, int x, int y)
          void gl_draw(const char *, int n, int x, int y)
          void gl_draw(const char *, float x, float y)
          void gl_draw(const char *, int n, float x, float y)

          - Draw a nul-terminated string or an array of n characters in -the current OpenGL font at the given position. + Draw a nul-terminated string or an array of n characters in +the current OpenGL font at the given position.

          void gl_draw(const char *, int x, int y, int w, int h, Fl_Align)

          - Draw a string formatted into a box, with newlines and tabs expanded, -other control characters changed to ^X, and aligned with the edges or + Draw a string formatted into a box, with newlines and tabs expanded, +other control characters changed to ^X, and aligned with the edges or center. Exactly the same output as fl_draw() -. +.

          Speeding up OpenGL

          @@ -265,14 +265,14 @@ exit and run the program again for it to see any changes to the environment variable.

          Using OpenGL Optimizer with FLTK

          -OpenGL Optimizer is a -scene graph toolkit for OpenGL available from Silicon Graphics for IRIX -and Microsoft Windows. Versions are in the works for Solaris and -HP-UX. It allows you to view large scenes without writing a lot of -OpenGL code. +OpenGL Optimizer is a +scene graph toolkit for OpenGL available from Silicon Graphics for IRIX +and Microsoft Windows. Versions are in the works for Solaris and +HP-UX. It allows you to view large scenes without writing a lot of +OpenGL code.

          OptimizerWindow Class Definition

          To use OpenGL Optimizer with FLTK you'll need to create a subclass of -Fl_Gl_Widget that includes several state variables: +Fl_Gl_Widget that includes several state variables:
             class OptimizerWindow : public Fl_Gl_Window {
            @@ -307,12 +307,12 @@ public:
             

          The camera() Method

          - The camera() method sets the camera (projection and -viewpoint) to use when drawing the scene. The scene is redrawn after -this call. + The camera() method sets the camera (projection and +viewpoint) to use when drawing the scene. The scene is redrawn after +this call.

          The draw() Method

          - The draw() method performs the needed initialization and does -the actual drawing: + The draw() method performs the needed initialization and does +the actual drawing:
             void OptimizerWindow::draw() {
            @@ -330,7 +330,7 @@ void OptimizerWindow::draw() {
                 context_->makeCurrent(fl_display, fl_window);
             #endif // WIN32
             
            -    ... perform other context setup as desired ...    
            +    ... perform other context setup as desired ...   
             
                 // Then create the draw action to handle drawing things...
             
            @@ -368,6 +368,6 @@ void OptimizerWindow::draw() {
             

          The scene() Method

          - The scene() method sets the scene to be drawn. The scene is -a collection of 3D objects in a csGroup. The scene is redrawn + The scene() method sets the scene to be drawn. The scene is +a collection of 3D objects in a csGroup. The scene is redrawn after this call. diff --git a/documentation/osissues.html b/documentation/osissues.html index 4eede262b..c52c1d615 100644 --- a/documentation/osissues.html +++ b/documentation/osissues.html @@ -1,56 +1,56 @@

          F - Operating System Issues

          - This appendix describes the X and WIN32 specific interfaces in FLTK. + This appendix describes the X and WIN32 specific interfaces in FLTK.

          X-Specific Interface

             #include <FL/x.H>
             
          - On X you can include this file to access FLTK's X-specific functions. - Be warned that some of the structures and calls in it are subject to -change in future version of FLTK. Try to avoid doing this so your code -is portable. + On X you can include this file to access FLTK's X-specific functions. + Be warned that some of the structures and calls in it are subject to +change in future version of FLTK. Try to avoid doing this so your code +is portable.

          Handling Other X Events

          void Fl::add_handler(int (*f)(int))

          - Installs a function to parse unrecognized events. If FLTK cannot -figure out what to do with an event, it calls each of these functions -(most recent first) until one of them returns non-zero. If none of -them returns non-zero then the event is ignored. -

          FLTK calls this for any X events it does not recognize, or X events -with a window id that FLTK does not recognize. You can look at the X + Installs a function to parse unrecognized events. If FLTK cannot +figure out what to do with an event, it calls each of these functions +(most recent first) until one of them returns non-zero. If none of +them returns non-zero then the event is ignored. +

          FLTK calls this for any X events it does not recognize, or X events +with a window id that FLTK does not recognize. You can look at the X event with the fl_xevent variable.

          -

          The argument is zero for unrecognized X events. These handlers are -also called for global shortcuts and some other events that the widget -they were passed to did not handle. In this case the argument is +

          The argument is zero for unrecognized X events. These handlers are +also called for global shortcuts and some other events that the widget +they were passed to did not handle. In this case the argument is non-zero (for example FL_SHORTCUT).

          extern XEvent *fl_xvent

          - The most recent X event. + The most recent X event.

          extern ulong fl_event_time

          - This is the time stamp from the most recent X event that reported it -(not all do). Many X calls (like cut and paste) need this value. + This is the time stamp from the most recent X event that reported it +(not all do). Many X calls (like cut and paste) need this value.

          Window fl_xid(const Fl_Window *)

          - Returns the XID for a window, or zero if not shown(). + Returns the XID for a window, or zero if not shown().

          Fl_Window *fl_find(ulong xid)

          Returns the Fl_Window that corresponds to the given XID, or -NULL if not found. This uses a cache so it is slightly faster -than iterating through the windows yourself. +NULL if not found. This uses a cache so it is slightly faster +than iterating through the windows yourself.

          int fl_handle(const XEvent &)

          - This call allows you to supply the X events to FLTK, which may allow -FLTK to cooperate with another toolkit or library. The return value is -true if FLTK understood the event (if the window does not belong to -FLTK and the add_handler() functions all ignore it this -returns false). + This call allows you to supply the X events to FLTK, which may allow +FLTK to cooperate with another toolkit or library. The return value is +true if FLTK understood the event (if the window does not belong to +FLTK and the add_handler() functions all ignore it this +returns false).

          Besides feeding events your code should call Fl::flush() periodically so that FLTK redraws its windows.

          -

          This function will call the callback functions. It will not return -until they complete. In particular if a callback pops up a modal -window (by calling fl_ask(), +

          This function will call the callback functions. It will not return +until they complete. In particular if a callback pops up a modal +window (by calling fl_ask(), for instance) it will not return until the modal function returns.

          Drawing using Xlib

          The following global variables are set before Fl_Widget::draw() is called, or by -Fl_Window::make_current(): +Fl_Window::make_current():
             extern Display *fl_display;
            @@ -61,69 +61,69 @@ extern XVisualInfo *fl_visual;
             extern Colormap fl_colormap;
             
          - You must use them to produce Xlib calls. Don't attempt to change -them. A typical X drawing call is written like this: + You must use them to produce Xlib calls. Don't attempt to change +them. A typical X drawing call is written like this:
             XDrawSomething(fl_display, fl_window, fl_gc, ...);
             
          - Other information such as the position or size of the X window can be + Other information such as the position or size of the X window can be found by looking at Fl_Window::current(), which returns a pointer to the -Fl_Window being drawn. +Fl_Window being drawn.

          unsigned long fl_xpixel(Fl_Color i)
          unsigned long fl_xpixel(uchar r, uchar g, uchar b)

          - Returns the X pixel number used to draw the given FLTK color index or + Returns the X pixel number used to draw the given FLTK color index or RGB color. This is the X pixel that fl_color() - would use. + would use.

          extern XFontStruct *fl_xfont

          Points at the font selected by the most recent fl_font(). This is not necessarily the current font of fl_gc, which is not set until fl_draw() - is called. + is called.

          Changing the Display, Screen, or X Visual

          - FLTK uses only a single display, screen, X visual, and X colormap. -This greatly simplifies its internal structure and makes it much -smaller and faster. You can change which it uses by setting global -variables before the first Fl_Window::show() is called. + FLTK uses only a single display, screen, X visual, and X colormap. +This greatly simplifies its internal structure and makes it much +smaller and faster. You can change which it uses by setting global +variables before the first Fl_Window::show() is called. You may also want to call Fl::visual() -, which is a portable interface to get a full color and/or double -buffered visual. +, which is a portable interface to get a full color and/or double +buffered visual.

          int Fl::display(const char *)

          Set which X display to use. This actually does -putenv("DISPLAY=...") so that child programs will display on the -same screen if called with exec(). This must be done before -the display is opened. This call is provided under WIN32 but it has no -effect. +putenv("DISPLAY=...") so that child programs will display on the +same screen if called with exec(). This must be done before +the display is opened. This call is provided under WIN32 but it has no +effect.

          extern Display *fl_display

          - The open X display. This is needed as an argument to most Xlib calls. -Don't attempt to change it! This is NULL before the display -is opened. + The open X display. This is needed as an argument to most Xlib calls. +Don't attempt to change it! This is NULL before the display +is opened.

          void fl_open_display()

          - Opens the display. Does nothing if it is already open. This will -make sure fl_display is non-zero. You should call this if you -wish to do X calls and there is a chance that your code will be called -before the first show() of a window. -

          This may call Fl::abort() if there is an error opening the + Opens the display. Does nothing if it is already open. This will +make sure fl_display is non-zero. You should call this if you +wish to do X calls and there is a chance that your code will be called +before the first show() of a window. +

          This may call Fl::abort() if there is an error opening the display.

          void fl_close_display()

          - This closes the X connection. You do not need to call this to -exit, and in fact it is faster to not do so! It may be useful to call -this if you want your program to continue without the X connection. You -cannot open the display again, and probably cannot call any FLTK -functions. + This closes the X connection. You do not need to call this to +exit, and in fact it is faster to not do so! It may be useful to call +this if you want your program to continue without the X connection. You +cannot open the display again, and probably cannot call any FLTK +functions.

          extern int fl_screen

          Which screen number to use. This is set by fl_open_display() - to the default screen. You can change it by setting this to a -different value immediately afterwards. It can also be set by changing -the last number in the Fl::display() string to "host:0,#". + to the default screen. You can change it by setting this to a +different value immediately afterwards. It can also be set by changing +the last number in the Fl::display() string to "host:0,#".

          extern XVisualInfo *fl_visual
          extern Colormap fl_colormap

          - The visual and colormap that FLTK will use for all windows. These are -set by fl_open_display() to the default visual and colormap. - You can change them before calling show() on the first -window. Typical code for changing the default visual is: + The visual and colormap that FLTK will use for all windows. These are +set by fl_open_display() to the default visual and colormap. + You can change them before calling show() on the first +window. Typical code for changing the default visual is:
             Fl::args(argc, argv); // do this first so $DISPLAY is set
            @@ -136,19 +136,19 @@ window->show(argc, argv);
             

          Using a Subclass of Fl_Window for Special X Stuff

          - FLTK can manage an X window on a different screen, visual and/or -colormap, you just can't use FLTK's drawing routines to draw into it. -But you can write your own draw() method that uses Xlib -(and/or OpenGL) calls only. -

          FLTK can also manage XID's provided by other libraries or programs, + FLTK can manage an X window on a different screen, visual and/or +colormap, you just can't use FLTK's drawing routines to draw into it. +But you can write your own draw() method that uses Xlib +(and/or OpenGL) calls only. +

          FLTK can also manage XID's provided by other libraries or programs, and call those libraries when the window needs to be redrawn.

          To do this, you need to make a subclass of Fl_Window and override some of these virtual functions:

          virtual void Fl_Window::show()

          - If the window is already shown() this must cause it to be -raised, this can usually be done by calling Fl_Window::show(). + If the window is already shown() this must cause it to be +raised, this can usually be done by calling Fl_Window::show(). If not shown() your implementation must call either -Fl_X::set_xid() or Fl_X::make_xid(). +Fl_X::set_xid() or Fl_X::make_xid().

          An example:

            @@ -168,29 +168,29 @@ void MyWindow::show() {
             

          Fl_X *Fl_X::set_xid(Fl_Window *, Window xid)

          - Allocate a hidden structure called an Fl_X, put the XID into + Allocate a hidden structure called an Fl_X, put the XID into it, and set a pointer to it from the Fl_Window. This causes -Fl_Window::shown() to return true. -

          void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, Colormap +Fl_Window::shown() to return true. +

          void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, Colormap = fl_colormap)

          - This static method does the most onerous parts of creating an X -window, including setting the label, resize limitations, etc. It then -does Fl_X::set_xid() with this new window and maps the window. + This static method does the most onerous parts of creating an X +window, including setting the label, resize limitations, etc. It then +does Fl_X::set_xid() with this new window and maps the window.

          virtual void Fl_Window::flush()

          - This virtual function is called by Fl::flush() to update the -window. For FLTK's own windows it does this by setting the global + This virtual function is called by Fl::flush() to update the +window. For FLTK's own windows it does this by setting the global variables fl_window and fl_gc and then calling the -draw() method. For your own windows you might just want to put -all the drawing code in here. -

          The X region that is a combination of all damage() calls +draw() method. For your own windows you might just want to put +all the drawing code in here. +

          The X region that is a combination of all damage() calls done so far is in Fl_X::i(this)->region. If NULL then you should redraw the entire window. The undocumented function -fl_clip_region(XRegion) will initialize the FLTK clip stack with a +fl_clip_region(XRegion) will initialize the FLTK clip stack with a region or NULL for no clipping. You must set region to -NULL afterwards as fl_clip_region() now owns it and will +NULL afterwards as fl_clip_region() now owns it and will delete it when done.

          -

          If damage() FL_DAMAGE_EXPOSE then only X expose events have -happened. This may be useful if you have an undamaged image (such as a +

          If damage() FL_DAMAGE_EXPOSE then only X expose events have +happened. This may be useful if you have an undamaged image (such as a backing buffer) around.

          Here is a sample where an undamaged image is kept somewhere:

            @@ -204,11 +204,11 @@ void MyWindow::flush() {

      virtual void Fl_Window::hide()

      - Destroy the window server copy of the window. Usually you will -destroy contexts, pixmaps, or other resources used by the window, and -then call Fl_Window::hide() to get rid of the main window -identified by xid(). If you override this, you must also -override the destructor as shown: + Destroy the window server copy of the window. Usually you will +destroy contexts, pixmaps, or other resources used by the window, and +then call Fl_Window::hide() to get rid of the main window +identified by xid(). If you override this, you must also +override the destructor as shown:
         void MyWindow::hide() {
        @@ -223,7 +223,7 @@ void MyWindow::hide() {
         

        virtual void Fl_Window::~Fl_Window()

        Because of the way C++ works, if you override hide() you must override the destructor as well (otherwise only the base class -hide() is called): +hide() is called):
           MyWindow::~MyWindow() {
          @@ -232,13 +232,13 @@ MyWindow::~MyWindow() {
           

        Setting the Icon of a Window

        -FLTK currently supports setting a window's icon *before* it is shown -using the Fl_Window::icon() method. +FLTK currently supports setting a window's icon *before* it is shown +using the Fl_Window::icon() method.

        void Fl_Window::icon(char *)

        -Sets the icon for the window to the passed pointer. You will need to -cast the icon Pixmap to a char * when calling this -method. To set the icon using a bitmap compiled with your application -use: +Sets the icon for the window to the passed pointer. You will need to +cast the icon Pixmap to a char * when calling this +method. To set the icon using a bitmap compiled with your application +use:
           #include "icon.xbm"
          @@ -260,45 +260,45 @@ window->icon((char *)p);
           #include <FL/x.H>
           
        - The <FL/x.H> header file defines the interface to FLTK's -WIN32-specific functions. Be warned that some of the structures and -calls in it are subject to change in future version of FLTK. Try to -avoid doing this so your code is portable. + The <FL/x.H> header file defines the interface to FLTK's +WIN32-specific functions. Be warned that some of the structures and +calls in it are subject to change in future version of FLTK. Try to +avoid doing this so your code is portable.

        Handling Other WIN32 Messages

        By default a single WNDCLASSEX called "FLTK" is created. All Fl_Windows are of this class unless you use Fl_Window::xclass() . The window class is created the first time Fl_Window::show() - is called. -

        You can probably combine FLTK with other libraries that make their + is called. +

        You can probably combine FLTK with other libraries that make their own WIN32 window classes. The easiest way is to call Fl::wait() -, it will call DispatchMessage for all messages to the other -windows. If necessary you can let the other library take over (as long -as it calls DispatchMessage()), but you will have to arrange -for the function Fl::flush() to be called regularily so that -widgets are updated, timeouts are handled, and the idle functions are +, it will call DispatchMessage for all messages to the other +windows. If necessary you can let the other library take over (as long +as it calls DispatchMessage()), but you will have to arrange +for the function Fl::flush() to be called regularily so that +widgets are updated, timeouts are handled, and the idle functions are called.

        extern MSG fl_msg

        - The most recent message read by GetMessage (which is called -by Fl::wait(). This may not -be the most recent message sent to an FLTK window, because silly WIN32 -calls the handle procedures directly for some events (sigh). + The most recent message read by GetMessage (which is called +by Fl::wait(). This may not +be the most recent message sent to an FLTK window, because silly WIN32 +calls the handle procedures directly for some events (sigh).

        void Fl::add_handler(int (*f)(int))

        - Install a function to parse unrecognized messages sent to FLTK -windows. If FLTK cannot figure out what to do with a message, it calls -each of these functions (most recent first) until one of them returns -non-zero. The argument passed to the fuctions is zero. If all the -handlers return zero then FLTK calls DefWindowProc(). + Install a function to parse unrecognized messages sent to FLTK +windows. If FLTK cannot figure out what to do with a message, it calls +each of these functions (most recent first) until one of them returns +non-zero. The argument passed to the fuctions is zero. If all the +handlers return zero then FLTK calls DefWindowProc().

        HWND fl_xid(const Fl_Window *)

        Returns the window handle for a Fl_Window, or zero if not -shown(). +shown().

        Fl_Window *fl_find(HWND xid)

        - Return the Fl_Window that corresponds to the given window -handle, or NULL if not found. This uses a cache so it is -slightly faster than iterating through the windows yourself. + Return the Fl_Window that corresponds to the given window +handle, or NULL if not found. This uses a cache so it is +slightly faster than iterating through the windows yourself.

        Drawing Things Using the WIN32 GDI

        - When the virtual function Fl_Widget::draw() is called, FLTK -has stashed in some global variables all the silly extra arguments you -need to make a proper GDI call. These are: + When the virtual function Fl_Widget::draw() is called, FLTK +has stashed in some global variables all the silly extra arguments you +need to make a proper GDI call. These are:
           extern HINSTANCE fl_display;
          @@ -311,25 +311,25 @@ HBRUSH fl_brush();
           
        These global variables are set before draw() is called, or by Fl_Window::make_current() -. You can refer to them when needed to produce GDI calls. Don't -attempt to change them. The functions return GDI objects for the -current color set by fl_color() and are created as needed and -cached. A typical GDI drawing call is written like this: +. You can refer to them when needed to produce GDI calls. Don't +attempt to change them. The functions return GDI objects for the +current color set by fl_color() and are created as needed and +cached. A typical GDI drawing call is written like this:
           DrawSomething(fl_gc, ..., fl_brush());
           
        It may also be useful to refer to -Fl_Window::current() to get the window's size or position. +Fl_Window::current() to get the window's size or position.

        Setting the Icon of a Window

        - FLTK currently supports setting a window's icon *before* it is shown -using the Fl_Window::icon() method. + FLTK currently supports setting a window's icon *before* it is shown +using the Fl_Window::icon() method.

        void Fl_Window::icon(char *)

        - Sets the icon for the window to the passed pointer. You will need to -cast the HICON handle to a char * when calling this -method. To set the icon using an icon resource compiled with your -application use: + Sets the icon for the window to the passed pointer. You will need to +cast the HICON handle to a char * when calling this +method. To set the icon using an icon resource compiled with your +application use:
           window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
          @@ -344,33 +344,33 @@ specific resolutions or create the icon from bitmap data.
           Fl_Window::show() method does not bind the icon to the window.
           
           

          How to Not Get a MSDOS Console Window

          - WIN32 has a really stupid mode switch stored in the executables that -controls whether or not to make a console window. -

          To always get a console window you simply create a console -application (the "/SUBSYSTEM:CONSOLE" option for the linker). For a -GUI-only application create a WIN32 application (the + WIN32 has a really stupid mode switch stored in the executables that +controls whether or not to make a console window. +

          To always get a console window you simply create a console +application (the "/SUBSYSTEM:CONSOLE" option for the linker). For a +GUI-only application create a WIN32 application (the "/SUBSYSTEM:WINDOWS" option for the linker).

          -

          FLTK includes a WinMain() function that calls the ANSI -standard main() entry point for you. This function creates +

          FLTK includes a WinMain() function that calls the ANSI +standard main() entry point for you. This function creates a console window when you use the debug version of the library.

          WIN32 applications without a console cannot write to stdout - or stderr, even if they are run from a console window. Any + or stderr, even if they are run from a console window. Any output is silently thrown away.

          Known Bugs

          - If a program is deactivated, Fl::wait() does not return until -it is activated again, even though many events are delivered to the -program. This can cause idle background processes to stop unexpectedly. - This also happens while the user is dragging or resizing windows or -otherwise holding the mouse down. I was forced to remove most of the -efficiency FLTK uses for redrawing in order to get windows to update -while being moved. This is a design error in WIN32 and probably -impossible to get around. -

          Fl_Gl_Window::can_do_overlay() returns true until the first -time it attempts to draw an overlay, and then correctly returns whether + If a program is deactivated, Fl::wait() does not return until +it is activated again, even though many events are delivered to the +program. This can cause idle background processes to stop unexpectedly. + This also happens while the user is dragging or resizing windows or +otherwise holding the mouse down. I was forced to remove most of the +efficiency FLTK uses for redrawing in order to get windows to update +while being moved. This is a design error in WIN32 and probably +impossible to get around. +

          Fl_Gl_Window::can_do_overlay() returns true until the first +time it attempts to draw an overlay, and then correctly returns whether or not there is overlay hardware.

          -

          Cut text contains ^J rather than ^M^J to break lines. This is a +

          Cut text contains ^J rather than ^M^J to break lines. This is a feature, not a bug.

          -

          SetCapture (used by Fl::grab()) doesn't work, and +

          SetCapture (used by Fl::grab()) doesn't work, and the main window title bar turns gray while menus are popped up.

          FLUID does not support BMP files yet.

          diff --git a/documentation/preface.html b/documentation/preface.html index d6bd1952f..11f10a245 100644 --- a/documentation/preface.html +++ b/documentation/preface.html @@ -29,14 +29,14 @@ interfaces.

        • Chapter 3 - Common Widgets and Attributes
        • -
        • Chapter 4 - Designing a Simple Text +
        • Chapter 4 - Designing a Simple Text Editor
        • Chapter 5 - Drawing Things in FLTK
        • Chapter 6 - Handling Events
        • -
        • Chapter 7 - Extending and +
        • Chapter 7 - Extending and Adding Widgets
        • Chapter 8 - Using OpenGL
        • @@ -47,7 +47,7 @@ interfaces.

        • Appendix B - Function Reference
        • -
        • Appendix C - Enumeration +
        • Appendix C - Enumeration Reference
        • Appendix D - GLUT Compatibility
        • @@ -92,12 +92,12 @@ interfaces.

          Copyrights and Trademarks

          -

          FLTK is Copyright 1998-2001 by Bill Spitzak and others. Use and -distribution of FLTK is governed by the GNU Library General Public +

          FLTK is Copyright 1998-2001 by Bill Spitzak and others. Use and +distribution of FLTK is governed by the GNU Library General Public License, located in Appendix G.

          -

          UNIX is a registered trademark of the X Open Group, Inc. Microsoft -and Windows are registered trademarks of Microsoft Corporation. OpenGL +

          UNIX is a registered trademark of the X Open Group, Inc. Microsoft +and Windows are registered trademarks of Microsoft Corporation. OpenGL is a registered trademark of Silicon Graphics, Inc.

          diff --git a/documentation/subclassing.html b/documentation/subclassing.html index ad2a1a6f0..9da68b134 100644 --- a/documentation/subclassing.html +++ b/documentation/subclassing.html @@ -1,51 +1,46 @@

          7 - Adding and Extending Widgets

          - This chapter describes how to add your own widgets or extend existing -widgets in FLTK. + This chapter describes how to add your own widgets or extend existing +widgets in FLTK.

          Subclassing

          - New widgets are created by subclassing an existing FLTK widget, -typically Fl_Widget for controls and Fl_Group for -composite widgets. -

          A control widget typically interacts with the user to receive and/or + New widgets are created by subclassing an existing FLTK widget, +typically Fl_Widget for controls and Fl_Group for +composite widgets. +

          A control widget typically interacts with the user to receive and/or display a value of some sort.

          -

          A composite widget widget holds a list of child widgets and handles moving, -sizing, showing, or hiding them as needed. Fl_Group is the +

          A composite widget widget holds a list of child widgets and handles moving, +sizing, showing, or hiding them as needed. Fl_Group is the main composite widget widget class in FLTK, and all of the other composite widgets ( -Fl_Pack, Fl_Scroll, Fl_Tabs, Fl_Tile, +Fl_Pack, Fl_Scroll, Fl_Tabs, Fl_Tile, and Fl_Window) are subclasses of it.

          -

          You can also subclass other existing widgets to provide a different -look or user-interface. For example, the button widgets are all -subclasses of Fl_Button since they all interact with the user -via a mouse button click. The only difference is the code that draws +

          You can also subclass other existing widgets to provide a different +look or user-interface. For example, the button widgets are all +subclasses of Fl_Button since they all interact with the user +via a mouse button click. The only difference is the code that draws the face of the button.

          Making a Subclass of Fl_Widget

          - Your subclasses can directly descend from Fl_Widget or any -subclass of Fl_Widget. Fl_Widget has only four -virtual methods, and overriding some or all of these may be necessary. + Your subclasses can directly descend from Fl_Widget or any +subclass of Fl_Widget. Fl_Widget has only four +virtual methods, and overriding some or all of these may be necessary.

          The Constructor

          - The constructor should have the following arguments: -
            -
            + The constructor should have the following arguments:
            +
               MyClass(int x, int y, int w, int h, const char *label = 0);
              -
              -
            +
          This will allow the class to be used in FLUID - without problems. -

          The constructor must call the constructor for the base class and + without problems. +

          The constructor must call the constructor for the base class and pass the same arguments:

          -
            -
            +
               MyClass::MyClass(int x, int y, int w, int h, const char *label)
               : Fl_Widget(x, y, w, h, label) {
               // do initialization stuff...
               }
              -
              -
            +
          Fl_Widget's protected constructor sets x(), y(), -w(), h(), and label() to the passed values -and initializes the other instance variables to: -
            -
            +w(), h(), and label() to the passed values
            +and initializes the other instance variables to:
            +
               type(0);
               box(FL_NO_BOX);
               color(FL_GRAY);
              @@ -57,14 +52,16 @@ labelcolor(FL_BLACK);
               align(FL_ALIGN_CENTER);
               callback(default_callback,0);
               flags(ACTIVE|VISIBLE);
              -
              -
            +image(0); +deimage(0); +

          Protected Methods of Fl_Widget

          - The following methods are provided for subclasses to use: + The following methods are provided for subclasses to use:
          • Fl_Widget::clear_visible
          • Fl_Widget::damage
          • Fl_Widget::draw_box
          • +
          • Fl_Widget::draw_focus
          • Fl_Widget::draw_label
          • Fl_Widget::set_flag
          • Fl_Widget::set_visible
          • @@ -74,16 +71,16 @@ flags(ACTIVE|VISIBLE);

            void Fl_Widget::damage(uchar mask)
            void Fl_Widget::damage(uchar mask, int x, int y, int w, int h)
            uchar Fl_Widget::damage()

            -The first form indicates that a partial update of the object is +The first form indicates that a partial update of the object is needed. The bits in mask are OR'd into damage(). Your draw() routine can examine these bits to limit what it is drawing. The public method Fl_Widget::redraw() simply does Fl_Widget::damage(FL_DAMAGE_ALL), but the implementation of -your widget can call the private damage(n). -

            The second form indicates that a region is damaged. If only these -calls are done in a window (no calls to damage(n)) then FLTK -will clip to the union of all these calls before drawing anything. - This can greatly speed up incremental displays. The mask bits are +your widget can call the private damage(n). +

            The second form indicates that a region is damaged. If only these +calls are done in a window (no calls to damage(n)) then FLTK +will clip to the union of all these calls before drawing anything. + This can greatly speed up incremental displays. The mask bits are OR'd into damage() unless this is a Fl_Window widget.

            The third form returns the bitwise-OR of all damage(n) calls done since the last draw().

            @@ -111,83 +108,89 @@ MyClass::draw() {

        void Fl_Widget::draw_box() const
        void Fl_Widget::draw_box(Fl_Boxtype b, ulong c) const

        - The first form draws this widget's box(), using the -dimensions of the widget. The second form uses b as the box -type and c as the color for the box. + The first form draws this widget's box(), using the +dimensions of the widget. The second form uses b as the box +type and c as the color for the box. + +

        void Fl_Widget::draw_focus() const +
        void Fl_Widget::draw_focus(Fl_Boxtype b, int x, int y, int w, int h) const

        + +

        Draws a focus box inside the widgets bounding box. The second +form allows you to specify a different bounding box. +

        void Fl_Widget::draw_label() const
        void Fl_Widget::draw_label(int x, int y, int w, int h) const -
        void Fl_Widget::draw_label(int x, int y, int w, int h, Fl_Align +
        void Fl_Widget::draw_label(int x, int y, int w, int h, Fl_Align align) const

        - This is the usual function for a draw() method to call to -draw the widget's label. It does not draw the label if it is supposed -to be outside the box (on the assumption that the enclosing group will -draw those labels). -

        The second form uses the passed bounding box instead of the widget's -bounding box. This is useful so "centered" labels are aligned with some + This is the usual function for a draw() method to call to +draw the widget's label. It does not draw the label if it is supposed +to be outside the box (on the assumption that the enclosing group will +draw those labels). +

        The second form uses the passed bounding box instead of the widget's +bounding box. This is useful so "centered" labels are aligned with some feature, like a moving slider.

        The third form draws the label anywhere. It acts as though -FL_ALIGN_INSIDE has been forced on so the label will appear inside -the passed bounding box. This is designed for parent groups to draw +FL_ALIGN_INSIDE has been forced on so the label will appear inside +the passed bounding box. This is designed for parent groups to draw labels with.

        void Fl_Widget::set_flag(SHORTCUT_LABEL)

        Modifies draw_label() so that '&' characters cause an underscore -to be printed under the next letter. +to be printed under the next letter.

        void Fl_Widget::set_visible()
        void Fl_Widget::clear_visible()

        Fast inline versions of Fl_Widget::hide() and Fl_Widget::show(). These do not send the FL_HIDE and -FL_SHOW events to the widget. +FL_SHOW events to the widget.

        int Fl_Widget::test_shortcut() const
        static int Fl_Widget::test_shortcut(const char *s)

        - The first version tests Fl_Widget::label() against the -current event (which should be a FL_SHORTCUT event). If the -label contains a '&' character and the character after it matches the key + The first version tests Fl_Widget::label() against the +current event (which should be a FL_SHORTCUT event). If the +label contains a '&' character and the character after it matches the key press, this returns true. This returns false if the SHORTCUT_LABEL -flag is off, if the label is NULL or does not have a -'&' character in it, or if the keypress does not match the character. -

        The second version lets you do this test against an arbitrary +flag is off, if the label is NULL or does not have a +'&' character in it, or if the keypress does not match the character. +

        The second version lets you do this test against an arbitrary string.

        uchar Fl_Widget::type() const
        void Fl_Widget::type(uchar t)

        - The property Fl_Widget::type() can return an arbitrary 8-bit + The property Fl_Widget::type() can return an arbitrary 8-bit identifier, and can be set with the protected method type(uchar t) -. This value had to be provided for Forms compatibility, but you can -use it for any purpose you want. Try to keep the value less than 100 -to not interfere with reserved values. -

        FLTK does not use RTTI (Run Time Typing Infomation), to enhance -portability. But this may change in the near future if RTTI becomes +. This value had to be provided for Forms compatibility, but you can +use it for any purpose you want. Try to keep the value less than 100 +to not interfere with reserved values. +

        FLTK does not use RTTI (Run Time Typing Infomation), to enhance +portability. But this may change in the near future if RTTI becomes standard everywhere.

        -

        If you don't have RTTI you can use the clumsy FLTK mechanisim, by -having type() use a unique value. These unique values must -be greater than the symbol FL_RESERVED_TYPE (which is 100). -Look through the header files for FL_RESERVED_TYPE to find an +

        If you don't have RTTI you can use the clumsy FLTK mechanisim, by +having type() use a unique value. These unique values must +be greater than the symbol FL_RESERVED_TYPE (which is 100). +Look through the header files for FL_RESERVED_TYPE to find an unused number. If you make a subclass of Fl_Window -you must use FL_WINDOW + n (n must be in the +you must use FL_WINDOW + n (n must be in the range 1 to 7).

        Handling Events

        - The virtual method int Fl_Widget::handle(int event) is called -to handle each event passed to the widget. It can: + The virtual method int Fl_Widget::handle(int event) is called +to handle each event passed to the widget. It can: - Events are identified by the integer argument. Other information -about the most recent event is stored in static locations and aquired + Events are identified by the integer argument. Other information +about the most recent event is stored in static locations and aquired by calling the Fl::event_*() - functions. This information remains valid until another event is -handled. -

        Here is a sample handle() method for a widget that acts as + functions. This information remains valid until another event is +handled. +

        Here is a sample handle() method for a widget that acts as a pushbutton and also accepts the keystroke 'x' to cause the callback:

        -
          -
          +
             int MyClass::handle(int event) {
               switch(event) {
                 case FL_PUSH:
            @@ -221,63 +224,66 @@ int MyClass::handle(int event) {
                   return Fl_Widget::handle(event);
               }
             }
            -
            -
          - You must return non-zero if your handle() method uses the -event. If you return zero it indicates to the parent widget that it can -try sending the event to another widget. +
        + +

        You must return non-zero if your handle() method +uses the event. If you return zero, the parent widget will try +sending the event to another widget. +

        Drawing the Widget

        - The draw() virtual method is called when FLTK wants you to -redraw your widget. It will be called if and only if damage() - is non-zero, and damage() will be cleared to zero after it -returns. draw() should be declared protected, so that it can't -be called from non-drawing code. -

        damage() contains the bitwise-OR of all the damage(n) - calls to this widget since it was last drawn. This can be used for -minimal update, by only redrawing the parts whose bits are set. FLTK -will turn on the FL_DAMAGE_ALL bit if it thinks the entire widget -must be redrawn (e.g. for an expose event).

        + +

        The draw() virtual method is called when FLTK wants +you to redraw your widget. It will be called if and only if +damage() is non-zero, and damage() will be +cleared to zero after it returns. The draw() method +should be declared protected so that it can't be called from +non-drawing code. + +

        The damage() value contains the bitwise-OR of all +the damage(n) calls to this widget since it was last +drawn. This can be used for minimal update, by only redrawing +the parts whose bits are set. FLTK will turn on the +FL_DAMAGE_ALL bit if it thinks the entire widget must +be redrawn, e.g. for an expose event.

        +

        Expose events (and the above damage(b,x,y,w,h)) will cause draw() to be called with FLTK's -clipping turned on. You can greatly speed up redrawing in some -cases by testing fl_not_clipped(x,y,w,h) or fl_clip_box(...) and +clipping turned on. You can greatly speed up redrawing in some +cases by testing fl_not_clipped(x,y,w,h) or fl_clip_box(...) and skipping invisible parts.

        -

        Besides the protected methods described above, FLTK provides a large +

        Besides the protected methods described above, FLTK provides a large number of basic drawing functions, which are described below.

        Resizing the Widget

        - The resize(int x, int y, int w, int h) method is called when -the widget is being resized or moved. The arguments are the new -position, width, and height. x(), y(), w(), + The resize(int x, int y, int w, int h) method is called when +the widget is being resized or moved. The arguments are the new +position, width, and height. x(), y(), w(), and h() still remain the old size. You must call resize() - on your base class with the same arguments to get the widget size to -actually change. + on your base class with the same arguments to get the widget size to +actually change.

        This should not call redraw(), at least if only the x() and y() change. This is because composite widgets like -Fl_Scroll may have a more efficient way of drawing the new +Fl_Scroll may have a more efficient way of drawing the new position.

        Making a Composite Widget

        A "composite" widget contains one or more "child" widgets. To make a composite widget you should subclass Fl_Group . It is possible to make a composite object that is not a subclass of Fl_Group, but you'll have to duplicate the code in Fl_Group - anyways. + anyways.

        Instances of the child widgets may be included in the parent:

        -
          -
          +
             class MyClass : public Fl_Group {
               Fl_Button the_button;
               Fl_Slider the_slider;
               ...
             };
            -
            -
          - The constructor has to initialize these instances. They are +
        + The constructor has to initialize these instances. They are automatically add()ed to the group, since the Fl_Group constructor does begin(). Don't forget to call end() or use the Fl_End pseudo-class: -
          -
          +
             MyClass::MyClass(int x, int y, int w, int h) :
               Fl_Group(x, y, w, h),
               the_button(x + 5, y + 5, 100, 20),
            @@ -286,41 +292,38 @@ MyClass::MyClass(int x, int y, int w, int h) :
               ...(you could add dynamically created child widgets here)...
               end(); // don't forget to do this!
             }
            -
            -
          - The child widgets need callbacks. These will be called with a pointer +
        + The child widgets need callbacks. These will be called with a pointer to the children, but the widget itself may be found in the parent() - pointer of the child. Usually these callbacks can be static private -methods, with a matching private method: -
          -
          -void MyClass::slider_cb(Fl_Widget* v, void *) { // static method
          + pointer of the child.  Usually these callbacks can be static private
          +methods, with a matching private method:
          +
            +void MyClass::static_slider_cb(Fl_Widget* v, void *) { // static method
               ((MyClass*)(v->parent())->slider_cb();
             }
             void MyClass::slider_cb() { // normal method
               use(the_slider->value());
             }
            -
            -
          - If you make the handle() method, you can quickly pass all the -events to the children using the Fl_Group::handle() method. +
        + If you make the handle() method, you can quickly pass all the +events to the children using the Fl_Group::handle() method. You don't need to override handle() if your composite widget -does nothing other than pass events to the children: -
          -
          +does nothing other than pass events to the children:
          +
             int MyClass::handle(int event) {
               if (Fl_Group::handle(event)) return 1;
               ... handle events that children don't want ...
             }
            -
            -
          - If you override draw() you need to draw all the children. If -redraw() or damage() is called on a child, -damage(FL_DAMAGE_CHILD) is done to the group, so this bit of -damage() can be used to indicate that a child needs to be drawn. - It is fastest if you avoid drawing anything else in this case: -
            -
            +
          + +

          If you override draw() you need to draw all the +children. If redraw() or damage() is called +on a child, damage(FL_DAMAGE_CHILD) is done to the +group, so this bit of damage() can be used to indicate +that a child needs to be drawn. It is fastest if you avoid +drawing anything else in this case: + +

             int MyClass::draw() {
               Fl_Widget *const*a = array();
               if (damage() == FL_DAMAGE_CHILD) { // only redraw some children
            @@ -330,14 +333,13 @@ int MyClass::draw() {
                 // now draw all the children atop the background:
                 for (int i = children_; i --; a ++) {
                   draw_child(**a);
            -      draw_outside_label(**a); // you may not want to do this
            +      draw_outside_label(**a); // you may not need to do this
                 }
               }
             }
            -
            -
          -Fl_Group provides some protected methods to make drawing -easier: +
        +Fl_Group provides some protected methods to make drawing +easier:

        void Fl_Group::draw_child(Fl_Widget&)

        This will force the child's damage() bits all to one and call -draw() on it, then clear the damage(). You should call -this on all children if a total redraw of your widget is requested, or -if you draw something (like a background box) that damages the child. - Nothing is done if the child is not visible() or if it is -clipped. -

        void +draw() on it, then clear the damage(). You should call +this on all children if a total redraw of your widget is requested, or +if you draw something (like a background box) that damages the child. + Nothing is done if the child is not visible() or if it is +clipped. +

        void Fl_Group::draw_outside_label(Fl_Widget&) const

        Draw the labels that are not drawn by -draw_label(). If you want more control over the label -positions you might want to call child->draw_label(x,y,w,h,a). +draw_label(). If you want more control over the label +positions you might want to call child->draw_label(x,y,w,h,a).

        void Fl_Group::update_child(Fl_Widget&)

        - Draws the child only if its damage() is non-zero. You -should call this on all the children if your own damage is equal to + Draws the child only if its damage() is non-zero. You +should call this on all the children if your own damage is equal to FL_DAMAGE_CHILD. Nothing is done if the child is not visible() - or if it is clipped. + or if it is clipped.

        Cut and Paste Support

        - FLTK provides routines to cut and paste 8-bit text (in the future this -may be UTF-8) between applications: +FLTK provides routines to cut and paste 8-bit text (in the future this +may be UTF-8) between applications: It may be possible to cut/paste non-text data by using -Fl::add_handler(). +Fl::add_handler().

        Making a subclass of Fl_Window

        -You may want your widget to be a subclass of Fl_Window. This -can be useful if your widget wants to occupy an entire window, and can -also be used to take advantage of system-provided clipping, or to work -with a library that expects a system window ID to indicate where to -draw. -

        Subclassing Fl_Window is almost exactly like subclassing -Fl_Widget, and in fact you can easily switch a subclass back and -forth. Watch out for the following differences:

        + +

        You may want your widget to be a subclass of +Fl_Window, Fl_Double_Window, or +FL_Gl_Window. This can be useful if your widget wants +to occupy an entire window, and can also be used to take +advantage of system-provided clipping, or to work with a library +that expects a system window ID to indicate where to draw. + +

        Subclassing Fl_Windowis almost exactly like +subclassing Fl_Group, and in fact you can easily +switch a subclass back and forth. Watch out for the following +differences:

        +
          -
        1. Fl_Window is a subclass of Fl_Group so make -sure your constructor calls end() (unless you actually -want children added to your window).
        2. -
        3. When handling events and drawing, the upper-left corner is at 0,0, -not x(),y() as in other Fl_Widget's. For instance, to -draw a box around the widget, call draw_box(0, 0, w(), h()), -rather than draw_box(x(), y(), w(), h()).
        4. + +
        5. Fl_Window is a subclass of + Fl_Group so make sure your constructor calls + end() unless you actually want children + added to your window.
        6. + +
        7. When handling events and drawing, the upper-left + corner is at 0,0, not x(),y() as in other + Fl_Widget's. For instance, to draw a box + around the widget, call draw_box(0, 0, w(), + h()), rather than draw_box(x(), y(), w(), + h()).
        8. +
        - You may also want to subclass Fl_Window in order to get -access to different visuals or to change other attributes of the -windows. See "Appendix F - Operating -System Issues" for more information. + +

        You may also want to subclass Fl_Window in order to +get access to different visuals or to change other attributes of +the windows. See "Appendix F - Operating +System Issues" for more information. + + + diff --git a/documentation/widgets.html b/documentation/widgets.html index 159913ca5..a3932e34b 100644 --- a/documentation/widgets.html +++ b/documentation/widgets.html @@ -1,7 +1,7 @@

        A - Widget Reference

        -This appendix describes all of the classes in FLTK. For a +This appendix describes all of the classes in FLTK. For a description of the fl_ functions, see Appendix B. -- cgit v1.2.3