From 59c96f54635aed579fcb40a1980ff3694af46bd8 Mon Sep 17 00:00:00 2001
From: Bill Spitzak 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).
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
void Fl_Button::shortcut(ulong key)
The first form returns the current shortcut key for the button.
FL_ALT | 'a'
, FL_ALT | (FL_F + 10), or just 'a'. A value
of 0 disables the shortcut.
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.
-Fl_Group----Fl_End +Fl_End
class MyClass {
Fl_Group group;
diff --git a/documentation/Fl_Gl_Window.html b/documentation/Fl_Gl_Window.html
index f4010f756..6e5ad96be 100644
--- a/documentation/Fl_Gl_Window.html
+++ b/documentation/Fl_Gl_Window.html
@@ -124,7 +124,7 @@ mode.
void Fl_Gl_Window::valid(char i)
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
-afterdraw() is called. You can use this inside your
+after draw() is called. You can use this inside your
draw() method to avoid unneccessarily initializing the OpenGL
context. Just do this:
@@ -139,24 +139,6 @@ void mywindow::draw() {
}
-Fl_Gl_Window::valid() is turned off when FLTK creates a
-new context for this window and by the window resizing, 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:
-
-
-void mywindow::draw() {
- if (!valid()) {
- glViewport(0,0,w(),h());
- glFrustum(...);
- glLight(...);
- ...other initilization...
- }
- ... draw your geometry here ...
-}
-
-
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
diff --git a/documentation/Fl_Group.html b/documentation/Fl_Group.html
index e307d71b4..ccf7a3c45 100644
--- a/documentation/Fl_Group.html
+++ b/documentation/Fl_Group.html
@@ -69,14 +69,28 @@ and label string. The default boxtype is FL_NO_BOX.
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_Groupfirst, so
+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)
- Adds a widget to the group at the end of the child array.
-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 at the end of the child array. If the
+widget is already in a group it is removed from that group before
+adding to this one.
+
+void Fl_Group::insert(Fl_Widget &w, int n)
+
void Fl_Group::insert(Fl_Widget &w, Fl_Widget
+*beforethis)
+
+The widget is removed from it's current group (if any) and then
+inserted into this group. It is put at index n (or at the end
+if n >= children(). The second version does a
+find(beforethis) and inserts using that index (at the end if
+beforethis is not in this 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.
+
const Fl_Widget **Fl_Group::array() const
Returns a pointer to the array of children. This pointer can change
when children are added or removed!
@@ -84,33 +98,25 @@ when children are added or removed!
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() does current(this).
+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.
+static Fl_Group *Fl_Group::current()
+
static void Fl_Group::current(Fl_Group *w)
+current() returns the currently active group. The Fl_Widget
+ 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).
Fl_Widget *Fl_Group::child(int n) const
Returns child n, where 0 <= n < children().
int Fl_Group::children() const
Returns how many child widgets the group has.
-static Fl_Group *Fl_Group::current()
-
static void Fl_Group::current(Fl_Group *w)
-current() returns the currently active group in the widget
-tree. To prevent widgets from being added to a group, call current()
- with a NULL group.
-void Fl_Group::end()
-end() does current(this->parent()). Any new widgets
-added to the widget tree will be added to the parent of the group.
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.
-void Fl_Group::insert(Fl_Widget &w, int n)
-
void Fl_Group::insert(Fl_Widget &w, Fl_Widget *beforethis)
- Inserts a widget into the child array. It is put at index n
- which must be less or equal to children(). The second version does a
-find(beforethis) and inserts using that index.
-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.
void Fl_Group::resizable(Fl_Widget *box)
void Fl_Group::resizable(Fl_Widget &box)
Fl_Widget *Fl_Group::resizable() const
@@ -121,8 +127,8 @@ 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:
-

+
![]()
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.
@@ -131,4 +137,8 @@ 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
of child Fl_Group's.
+
+Fl_Group
+&Fl_Group::add_resizable(Fl_Widget &box)
+ Adds a widget to the group and makes it the resizable widget.