diff --git a/documentation/Fl_Button.html b/documentation/Fl_Button.html index f0bb3fd67..3c713852d 100644 --- a/documentation/Fl_Button.html +++ b/documentation/Fl_Button.html @@ -26,7 +26,7 @@ control exactly when and how by changing the values for type()

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 +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 @@ -86,7 +86,7 @@ group (calling value(1) or set() does not do this).
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 +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 of 0 disables the shortcut.

diff --git a/documentation/Fl_Choice.html b/documentation/Fl_Choice.html index e6f52706a..c13d95ddb 100644 --- a/documentation/Fl_Choice.html +++ b/documentation/Fl_Choice.html @@ -33,10 +33,10 @@ to that item and then the callback is done.

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 -putting a ''character in the label(). See +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 +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.

Methods

Description

- This is a dummy class that allows you to end a group in a constructor -list of a class: +This is a dummy class that allows you to end a Fl_Group in a constructor list of a +class:

Description

- The Fl_Menu_Item structure defines a single menu item that is -used by the Fl_Menu_ class. This structure is defined in -<FL/Fl_Menu_Item.H> + +The Fl_Menu_Item structure defines a single menu item that +is used by the Fl_Menu_ class. This +structure is defined in <FL/Fl_Menu_Item.H> + @@ -78,10 +78,11 @@ to call redraw() after these.

  • show
  • size
  • take_focus
  • -
  • type
  • +
  • takesevents
  • If this function is not called, FLTK tries to figure out the range from the setting of resizeable() @@ -250,7 +252,9 @@ 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(). -

    This method has no effect under Microsoft Windows.

    +

    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 diff --git a/documentation/common.html b/documentation/common.html index ae42af388..b98ec9c75 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -62,7 +62,7 @@ input->value("Now is the time for all good men...");

    The string is copied to the widget's own storage when you set the -value() of the widget. +value() of the widget.

    Valuators

    Unlike text widgets, valuators keep track of numbers instead of strings. FLTK provides the following valuators: diff --git a/documentation/enumerations.html b/documentation/enumerations.html index 2bb19ce69..be8d012c7 100644 --- a/documentation/enumerations.html +++ b/documentation/enumerations.html @@ -2,6 +2,8 @@

    C - FLTK Enumerations

    This appendix lists the enumerations provided in the <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: @@ -16,7 +18,8 @@ the major and minor release numbers, currently 1.0. Events are identified by an Fl_Event enumeration value. The following events are currently defined:
      -
    • FL_NO_EVENT - No event occurred.
    • +
    • FL_NO_EVENT - No event (or an event fltk does not +understand) occurred (0).
    • FL_PUSH - A mouse button was pushed.
    • FL_RELEASE - A mouse button was released.
    • FL_ENTER - The mouse pointer entered a widget.
    • @@ -42,7 +45,7 @@ following events are currently defined:

      Callback "When" Conditions

      The following constants determine when a callback is performed:
        -
      • FL_WHEN_NEVER - Never call the callback.
      • +
      • FL_WHEN_NEVER - Never call the callback (0).
      • FL_WHEN_CHANGED - Do the callback only when the widget value changes.
      • FL_WHEN_NOT_CHANGED - Do the callback whenever the user @@ -116,18 +119,29 @@ FL_KEYBOARD and FL_SHORTCUT events: Fl_Widget::align() to control the positioning of the label:
          -
        • FL_ALIGN_CENTER - The label is centered.
        • +
        • FL_ALIGN_CENTER - The label is centered (0).
        • FL_ALIGN_TOP - The label is top-aligned.
        • FL_ALIGN_BOTTOM - The label is bottom-aligned.
        • FL_ALIGN_LEFT - The label is left-aligned.
        • FL_ALIGN_RIGHT - The label is right-aligned.
        • -
        • FL_ALIGN_INSIDE - The label is put inside the widget.
        • FL_ALIGN_CLIP - The label is clipped to the widget.
        • FL_ALIGN_WRAP - The label text is wrapped as needed.
        • +
        • FL_ALIGN_TOP_LEFT
        • +
        • FL_ALIGN_TOP_RIGHT
        • +
        • FL_ALIGN_BOTTOM_LEFT
        • +
        • FL_ALIGN_BOTTOM_RIGHT
        • +
        • FL_ALIGN_LEFT_TOP
        • +
        • FL_ALIGN_RIGHT_TOP
        • +
        • FL_ALIGN_LEFT_BOTTOM
        • +
        • FL_ALIGN_RIGHT_BOTTOM
        • +
        • FL_ALIGN_INSIDE - 'or' this with other values to put +label inside the widget.
        • +

        Fonts

        The following constants define the standard FLTK fonts: -
      • FL_HELVETICA - Helvetica (or Arial) normal.
      • +
          +
        • 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) @@ -144,32 +158,49 @@ bold-oblique.
        • FL_SCREEN - Default monospaced screen font.
        • FL_SCREEN_BOLD - Default monospaced bold screen 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:
          -
        • FL_BLACK
        • +
        • FL_BLACK - the default label color (0)
        • FL_RED
        • FL_GREEN
        • FL_YELLOW
        • FL_BLUE
        • FL_MAGENTA
        • FL_CYAN
        • -
        • FL_WHITE
        • -
        • FL_GRAY0
        • -
        • FL_DARK3
        • -
        • FL_DARK2
        • -
        • FL_DARK1
        • -
        • FL_GRAY
        • -
        • FL_LIGHT1
        • -
        • FL_LIGHT2
        • -
        • FL_LIGHT3
        • +
        • FL_WHITE - the default background for text
        • +
        • FL_SELECTION_COLOR - change to dark blue for Windows style
        • +
        • FL_GRAY - the default color.
        + +In addition there are two inline functions to allow you to select +grays or colors from the FLTK colormap: + +

        Fl_Color fl_gray_ramp(int i) +
        Returs a gray color. Returns black for zero, returns white for +FL_NUM_GRAY (which is 24) minus 1. To get the closest to an +8-bit gray value 'I' use +fl_gray_ramp(I*FL_NUM_GRAY/256) + +

        Fl_Color fl_color_cube(int r, int g, int b) +
        Returns a color out of the color cube. + +r must be in the range 0 to FL_NUM_RED (5) minus 1. +g must be in the range 0 to FL_NUM_GREEN (8) minus 1. +b must be in the range 0 to FL_NUM_BLUE (5) minus 1. + +To get the closest color to a 8-bit set of R,G,B values use +fl_color_cube(R*FL_NUM_RED/256, G*FL_NUM_GREEN/256, +B*FL_NUM_BLUE/256); +

        Cursors

        The following constants define the mouse cursors that are available in FLTK:
          -
        • FL_CURSOR_DEFAULT - the default cursor, usually an arrow
        • +
        • FL_CURSOR_DEFAULT - the default cursor, usually an arrow (0)
        • FL_CURSOR_ARROW - an arrow pointer
        • FL_CURSOR_CROSS - crosshair
        • FL_CURSOR_WAIT - watch or hourglass
        • diff --git a/documentation/functions.html b/documentation/functions.html index 96ddc536b..d8943d3b7 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -38,25 +38,27 @@ the user types ESC or clicks outside the window. waits for the user to hit the button. The message will wrap to fit the window, or may be many lines by putting \n characters into it. The enter key is a shortcut for the OK button. -

          +

          void fl_alert(const char *, ...)

          Same as fl_message() except for the "!" symbol. -

          +

          int fl_ask(const char *, ...)

          Displays a printf-style message in a pop-up box with an "Yes" and "No" button and waits for the user to hit a button. The return value is 1 if the user hits Yes, 0 if they pick No. The enter key is a shortcut for Yes and ESC is a shortcut for No. -

          +

          int fl_choice(const char *q, const char *b0, const char *b1, const char *b2, ...)

          - Shows the message with three buttons below it marked with the strings -b0, b1, and b2. Returns 0, 1, or 2 depending on -which button is hit. ESC is a shortcut for button 0 and the enter key -is a shortcut for button 1. Notice the "misordered" position of the -buttons. You can hide buttons by passing NULL as their -labels. -

          + + Shows the message with three buttons below it marked with the strings + b0, b1, and b2. Returns 0, 1, or 2 +depending on which button is hit. ESC is a shortcut for button 0 and +the enter key is a shortcut for button 1. Notice the buttons are +positioned "backwards" You can hide buttons by passing +NULL as their labels. + +

          const char *fl_input(const char *label, const char *deflt = 0, ...)

          Pops up a window displaying a string, lets the user edit it, and @@ -64,12 +66,12 @@ return the new value. The cancel button returns NULL. The returned pointer is only valid until the next time fl_input() is called. Due to back-compatability, the arguments to any printf commands in the label are after the default value. -

          +

          const char *fl_password(const char *label, const char *deflt = 0, ...)

          Same as fl_input() except an Fl_Secret_Input field is used. -

          +

          void fl_message_font(Fl_Font fontid, uchar size)

          Change the font and font size used for the messages in all the popups. @@ -269,7 +271,9 @@ index of each word. The callback should return zero if the switch is unrecognized, and not change i. It should return non-zero if the switch is recognized, and add at least 1 to i (it can add more to consume words after the switch). This function is called -before any other tests, so you can override any FLTK switch.

          +before any other tests, so you can override any FLTK +switch (this is why fltk can use very short switches instead of +the long ones all other toolkits force you to use).

          On return i is set to the index of the first non-switch. This is either:

            @@ -282,7 +286,7 @@ This is either:

            in which case it is zero. If your program takes no arguments other than switches you should produce an error if the return value is less than argc. -

            All switches may be abbreviated to two letters and case is ignored:

            +

            All switches except -bg2 may be abbreviated one letter and case is ignored:

            • -display host:n.n The X display to use (ignored under WIN32).
            • @@ -354,8 +358,10 @@ windows are displayed.

              static int Fl::damage()

              If true then flush() will do something.

              static void Fl::display(const char *)

              - Sets the X display to use for all windows. This function is ignored -under WIN32. + Sets the X display to use for all windows. Actually this just sets + the environment variable $DISPLAY to the passed string, so this only + works before you show() the first window or otherwise open the display, + and does nothing useful under WIN32.

              static void Fl::enable_symbols()

              Enables the symbol drawing code.

              static int Fl::event_button()

              @@ -501,10 +507,10 @@ colormap.
              static void Fl::get_color(Fl_Color, uchar &r, uchar &g, uchar &b) Returns the color index or RGB value for the given FLTK color index. -

              static const char *Fl::get_font(int face) Get the +

              static const char *Fl::get_font(int face)

              Get the string for this face. This string is different for each face. Under X this value is passed to XListFonts to get all the sizes of this face. -

              +

              static const char *Fl::get_font_name(int face, int *attributes = 0)

              Get a human-readable string describing the family of this face. This @@ -550,8 +556,8 @@ call this so your X windows use the same visual as an See Fl_Gl_Window for a list of additional values for the argument.

              -

              static void Fl::grab(Fl_Window static Fl_Window -*Fl::grab()

              +

              static void Fl::grab(Fl_Window&) +
              static Fl_Window* Fl::grab()

              This is used when pop-up menu systems are active. Send all events to the passed window no matter where the pointer or focus is (including in other programs). The window does not have to be shown() @@ -575,13 +581,14 @@ widget uses the event. This is the usage string that is displayed if Fl::args() detects an invalid argument on the command-line.

              static Fl_Window *Fl::modal()

              - The modal() window has its handle() method called -for all events, and no other windows will have handle() - called. If grab() has been done then this -is equal to grab(). Otherwise this is the most recently +Returns the top-most modal() window currently shown. +This is the most recently shown() window with modal() true, or NULL if there are no modal() - windows shown(). +windows shown(). +The modal() window has its handle() method called +for all events, and no other windows will have handle() +called (grab() overrides this).

              static Fl_Window *Fl::next_window(Fl_Window *)

              Returns the next top-level window in the widget hierarchy. diff --git a/documentation/widgets.html b/documentation/widgets.html index ccebf0e97..452d709b7 100644 --- a/documentation/widgets.html +++ b/documentation/widgets.html @@ -32,7 +32,7 @@ see Appendix B. Fl_Hold_Browser
              -Fl_Input
              +Fl_Input
              Fl_Input_
              Fl_Int_Input
              Fl_Light_Button
              diff --git a/src/fl_symbols.cxx b/src/fl_symbols.cxx index fa54e44c3..8b87edf34 100644 --- a/src/fl_symbols.cxx +++ b/src/fl_symbols.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_symbols.cxx,v 1.6 1999/01/07 19:17:43 mike Exp $" +// "$Id: fl_symbols.cxx,v 1.7 1999/01/27 08:45:11 bill Exp $" // // Symbol drawing code for the Fast Light Tool Kit (FLTK). // @@ -157,11 +157,16 @@ int fl_draw_symbol(const char *label,int x,int y,int w,int h,Fl_Color col) { #define EC fl_end_loop() #define vv(x,y) fl_vertex(x,y) -static void rectangle(double x,double y,double x2,double y2,Fl_Color c) { - fl_color(c); +//for the outline color +static void set_outline_color(Fl_Color c) { + fl_color(fl_color_average(c, FL_BLACK, .5)); +} + +static void rectangle(double x,double y,double x2,double y2,Fl_Color col) { + fl_color(col); BP; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EP; - //fl_color(FL_BLACK); - //BC; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EC; + set_outline_color(col); + BC; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EC; } /* The drawing routines */ @@ -171,6 +176,9 @@ static void draw_arrow1(Fl_Color col) fl_color(col); BP; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,-0.4); EP; BP; vv(0.0,0.8); vv(0.8,0.0); vv(0.0,-0.8); vv(0.0,-0.4); vv(0.0,0.4); EP; + set_outline_color(col); + BC; vv(-0.8,-0.4); vv(-0.8,0.4); vv(0.0,0.4); vv(0.0,0.8); vv(0.8,0.0); + vv(0.0,-0.8); vv(0.0,-0.4); EC; } static void draw_arrow1bar(Fl_Color col) @@ -183,6 +191,8 @@ static void draw_arrow2(Fl_Color col) { fl_color(col); BP; vv(-0.3,0.8); vv(0.50,0.0); vv(-0.3,-0.8); EP; + set_outline_color(col); + BC; vv(-0.3,0.8); vv(0.50,0.0); vv(-0.3,-0.8); EC; } static void draw_arrow3(Fl_Color col) @@ -190,6 +200,9 @@ static void draw_arrow3(Fl_Color col) fl_color(col); BP; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EP; BP; vv(-0.7,0.8); vv(0.1,0.0); vv(-0.7,-0.8); EP; + set_outline_color(col); + BC; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EC; + BC; vv(-0.7,0.8); vv(0.1,0.0); vv(-0.7,-0.8); EC; } static void draw_arrowbar(Fl_Color col) @@ -197,6 +210,9 @@ static void draw_arrowbar(Fl_Color col) fl_color(col); BP; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EP; BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP; + set_outline_color(col); + BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC; + BC; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EC; } static void draw_arrowbox(Fl_Color col) @@ -204,6 +220,9 @@ static void draw_arrowbox(Fl_Color col) fl_color(col); BP; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EP; BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC; + set_outline_color(col); + BC; vv(0.2,0.8); vv(0.6,0.8); vv(0.6,-0.8); vv(0.2,-0.8); EC; + BC; vv(-0.6,0.8); vv(0.2,0.0); vv(-0.6,-0.8); EC; } static void draw_bararrow(Fl_Color col) @@ -211,6 +230,9 @@ static void draw_bararrow(Fl_Color col) fl_color(col); BP; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EP; BP; vv(-0.5,0.8); vv(-0.1,0.8); vv(-0.1,-0.8); vv(-0.5,-0.8); EP; + set_outline_color(col); + BC; vv(0.1,0.8); vv(0.9,0.0); vv(0.1,-0.8); EC; + BC; vv(-0.5,0.8); vv(-0.1,0.8); vv(-0.1,-0.8); vv(-0.5,-0.8); EC; } static void draw_doublebar(Fl_Color col) { @@ -242,6 +264,10 @@ static void draw_doublearrow(Fl_Color col) BP; vv(-0.35,-0.4); vv(-0.35,0.4); vv(0.35,0.4); vv(0.35,-0.4); EP; BP; vv(0.15,0.8); vv(0.95,0.0); vv(0.15,-0.8); EP; BP; vv(-0.15,0.8); vv(-0.95,0.0); vv(-0.15,-0.8); EP; + set_outline_color(col); + BC; vv(-0.15,0.4); vv(0.15,0.4); vv(0.15,0.8); vv(0.95,0.0); + vv(0.15,-0.8); vv(0.15,-0.4); vv(-0.15,-0.4); vv(-0.15,-0.8); + vv(-0.95,0.0); vv(-0.15,0.8); EC; } static void draw_arrow(Fl_Color col) @@ -249,6 +275,9 @@ static void draw_arrow(Fl_Color col) fl_color(col); BP; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EP; BL; vv(-1.0,0.0); vv(0.65,0.0); EL; + set_outline_color(col); + BL; vv(-1.0,0.0); vv(0.65,0.0); EL; + BC; vv(0.65,0.1); vv(1.0,0.0); vv(0.65,-0.1); EC; } #if 0 @@ -257,6 +286,9 @@ static void fl_draw_returnarrow(Fl_Color col) { fl_begin_polygon(); vv(-0.8,0.0); vv(-0.1,0.7); vv(-0.1,-0.7); fl_end_polygon(); + set_outline_color(col); + fl_begin_loop(); vv(-0.8,0.0); vv(-0.1,0.7); vv(-0.1,-0.7);fl_end_loop(); + fl_begin_line(); vv(-0.1,0.0); vv(0.8,0.0); vv(0.8,-0.7); fl_end_line(); } #endif @@ -264,7 +296,9 @@ static void draw_square(Fl_Color col) { rectangle(-1,-1,1,1,col); } static void draw_circle(Fl_Color col) { - fl_color(col); BP; fl_circle(0,0,1); EP; + fl_color(col); BP; fl_circle(0,0,1); EP; + set_outline_color(col); + BC; fl_circle(0,0,1); EC; } static void draw_line(Fl_Color col) @@ -275,6 +309,12 @@ static void draw_plus(Fl_Color col) fl_color(col); BP; vv(-0.9,-0.15); vv(-0.9,0.15); vv(0.9,0.15); vv(0.9,-0.15); EP; BP; vv(-0.15,-0.9); vv(-0.15,0.9); vv(0.15,0.9); vv(0.15,-0.9); EP; + set_outline_color(col); + BC; + vv(-0.9,-0.15); vv(-0.9,0.15); vv(-0.15,0.15); vv(-0.15,0.9); + vv(0.15,0.9); vv(0.15,0.15); vv(0.9,0.15); vv(0.9,-0.15); + vv(0.15,-0.15); vv(0.15,-0.9); vv(-0.15,-0.9); vv(-0.15,-0.15); + EC; } static void draw_uparrow(Fl_Color) { @@ -355,5 +395,5 @@ void Fl::enable_symbols() { } // -// End of "$Id: fl_symbols.cxx,v 1.6 1999/01/07 19:17:43 mike Exp $". +// End of "$Id: fl_symbols.cxx,v 1.7 1999/01/27 08:45:11 bill Exp $". //