diff --git a/documentation/examples.html b/documentation/examples.html
index 53101d396..74a483f0d 100644
--- a/documentation/examples.html
+++ b/documentation/examples.html
@@ -9,7 +9,7 @@
March 19, 2005
The FLTK distribution contains over 60 sample applications written
-in or ported to FLTK. If the FLTK archive you received does not
+in, or ported to, FLTK. If the FLTK archive you received does not
contain a 'test' directory, you can download the complete FLTK
distribution from
http://fltk.org/software.php.
@@ -118,8 +118,9 @@ generate some custom drawings. The sample drawings use the matrix
based arc drawing for some fun effects.
-ask shows some of FLTK's standard dialog boxes, but you
-may end up in a loop, but you may end up in a loop, but... .
+ask shows some of FLTK's standard dialog boxes. Click
+the correct answers or you may end up in a loop, or you may end
+up in a loop, or you... .
This simple test shows the use of a single color bitmap as a
@@ -134,8 +135,9 @@ bundle format.
boxtype gives an overview of readily available boxes and
-frames in FLTK. More types can be added by the user. When using
-themes, FLTK shuffles boxtypes around to give an app a new look.
+frames in FLTK. More types can be added by the application programmer.
+When using themes, FLTK shuffles boxtypes around to give your program
+a new look.
browser shows the capabilities of the Fl_Browser widget.
@@ -143,28 +145,28 @@ Important features tested are loading of files, line formatting, and
correct positioning of the browser data window.
-The button test is a very simple demo of buttons and callbacks.
+The button test is a simple demo of push-buttons and callbacks.
buttons shows a sample of FLTK button types.
Written by Steve Poulsen in early 1979, checkers shows
-how to polish a VT100 text terminal based program into a neat
-program with a graphical UI. Check out the code that drags the
+how to convert a VT100 text-terminal based program into a neat
+application with a graphical UI. Check out the code that drags the
pieces, and how the pieces are drawn by layering. Then tell me
-how to beat this program.
+how to beat the computer at Checkers.
The clock demo shows two analog clocks. The innards of
-teh Fl_Clock widget are pretty interesting as they explain
+the Fl_Clock widget are pretty interesting, explaining
the use of timeouts and matrix based drawing.
colbrowser runs only on X11 systems. It reads
/usr/lib/X11/rgb.txt to show the color representation
of every text entry in the file. This is beautiful, but
-only mederatly useful unless your UI is written in Motif.
+only moderatly useful unless your UI is written in Motif.
The color_chooser gives a short demo of FLTK's palette based
@@ -176,12 +178,12 @@ the ability to render two OpenGL buffers into a single window,
and shows OpenGL text.
-CubeView shows how to create a UI containing OpenGL with fluid.
+CubeView shows how to create a UI containing OpenGL with Fluid.
The cursor demo show all mouse cursor shapes that come standard
with FLTK. The fgcolor and bgcolor sliders work only
-on few systems like Irix.
+on few systems (some version of Irix for example).
curve draws a nice Bezier curve into a custom widget. The
@@ -189,8 +191,8 @@ on few systems like Irix.
This tool allows quick access to all programs in the test directory.
-demo is viaully based on the IrixGL demo program and cna be
-extended by editing test/demo.menu.
+demo is based on the visuals of the IrixGL demo program. The menu
+tree can be changed by editing test/demo.menu.
The doublebuffer demo show the difference between a single
@@ -203,7 +205,7 @@ to not tripple buffer a window in that case.
FLTK has two very different text input widgets. Fl_Input
and derived classes are rather leight weight, however
-Fl_Text_Editor is a complete port of nedit (with permission).
+Fl_Text_Editor is a complete port of nedit (with permission).
The editor test is almost a full application, showing custom
syntax highlighting and dialog creation.
@@ -235,18 +237,18 @@ application compile just fine.
This demo shows how to do many of the window manipulations that
-are popular on SGI programs, even though X does not really like
-them. You can toggle the border on/off, change the visual to
-switch between single/double buffer, and make the window take
-over the screen. More information in the source code.
+are popular for games.
+You can toggle the border on/off, switch between single-
+and double-buffered rendering, and take over the entire
+screen. More information in the source code.
gl_overlay shows OpenGL overlay plane rendering. If no
hardware overly plane is available, FLTK will simulate it
-automatically.
+for you.
-The glpuzzle test dhows how most Glut source code compiles
+The glpuzzle test shows how most Glut source code compiles
easily under FLTK.
@@ -257,12 +259,12 @@ running with FLTK. Quite impressive, I'd say.
help displays the built-in FLTK help browser. The
Fl_Help_Dialog understands a subset of html and renders
-various image formats. It is a great help to provide help
+various image formats. This widget makes it easy to provide help
pages to the user without depending on the operating system's
html browser.
-iconize demonstrates the efeect of the window functions
+iconize demonstrates the effect of the window functions
hide(), iconize(), and show().
@@ -273,11 +275,11 @@ transparency or by using screen door transparency (pixelation).
inactive tests the correct rendering of inactive widgets.
-To see the inactive version of images, you can check the pixmap
+To see the inactive version of images, you can check out the pixmap
or image test.
-This tool shows and tests differnet types of text input fields based on
+This tool shows and tests different types of text input fields based on
Fl_Input_. The input program also tests various
settings of Fl_Input::when().
@@ -327,12 +329,12 @@ arbitrary sub menu depth, and global shortcuts.
The minimum test program verifies that the update regions
are set correctly. In a real life application, the trail would
-be avoided by choosing a smaller label or by setting label clipping.
-correctly.
+be avoided by choosing a smaller label or by setting label clipping
+differently.
navigation demonstrates how the text cursor moves from
-text field to text field by using the arrow keys, tab and shift-tab..
+text field to text field when using the arrow keys, tab, and shift-tab.
output shows the difference between the single line and
@@ -349,11 +351,11 @@ provides a new function to draw custom overlays.
The pack test program demonstrates the resizing
and repositioning of children of the Fl_Pack group.
Putting an Fl_Pack into an Fl_Scroll is
-a useful way to create a kind of browser.
+a useful way to create a browser for large sets of data.
-pixmap_browser tests the shared image interface. When using
-the same image multiple times Fl_Shared_Image will keep it
+pixmap_browser tests the shared-image interface. When using
+the same image multiple times, Fl_Shared_Image will keep it
only once in memory.
@@ -365,11 +367,11 @@ one transparent color.
I do have my preferences in the morning, but sometimes I
just can't remember a thing. This is where the Fl_Preferences
-come in handy. The remember any kind of data between program launches.
+come in handy. They remember any kind of data between program launches.
The radio tool was created entirely with fluid. It
-shows some of the available btton types and tests radio
+shows some of the available button types and tests radio
button behavior.
@@ -384,7 +386,7 @@ the given window manager.
scroll shows how to scroll an area of widgets, one of
them beeing a slow custom drawing. Fl_Scroll uses
clipping and smart window area copying to improve redraw speed.
-The buttons at the bottom of the window test decoration rendering
+The buttons at the bottom of the window control decoration rendering
and updates.
@@ -394,7 +396,7 @@ and write that flight simulator you always dreamt of.
The subwindow demo tests messaging and drawing between
-the main window and 'true' sub windows. A sub window is differnt
+the main window and 'true' sub windows. A sub window is different
to a group by resetting the FLTK coordinate stystem to 0, 0 in the
top left corner. On Win32 and X11, subwindows have their own
operating system specific handle.
@@ -402,7 +404,7 @@ operating system specific handle.
Another highly addictive game - don't play it, I warned you.
The implementation shows how to create application icons,
-how to deal with OS specific, and how to generate sound.
+how to deal with OS specifics, and how to generate sound.
symbols are a speciality of FLTK. These little vector
diff --git a/test/blocks.cxx b/test/blocks.cxx
index 02999d6f2..d221bed7d 100644
--- a/test/blocks.cxx
+++ b/test/blocks.cxx
@@ -476,6 +476,7 @@ class BlockWindow : public Fl_Double_Window
int handle(int event);
void new_game();
int score() { return (score_); }
+ void up_level();
};
@@ -734,6 +735,12 @@ BlockWindow::handle(int event) {
else if (interval_ < 0.0 || paused_) return (0);
switch (event) {
+ case FL_KEYBOARD:
+ if (Fl::event_text()) {
+ if (strcmp(Fl::event_text(), "+") == 0)
+ up_level();
+ }
+ break;
case FL_PUSH :
mx = w() - Fl::event_x() + BLOCK_SIZE;
my = h() - Fl::event_y();
@@ -841,6 +848,15 @@ BlockWindow::play_cb(Fl_Widget *wi, BlockWindow *bw) {
}
}
+void BlockWindow::up_level() {
+ interval_ *= 0.95;
+ opened_columns_ = 0;
+ if (num_colors_ < 7) num_colors_ ++;
+ level_ ++;
+ sprintf(title_, "Level: %d", level_);
+ title_y_ = h();
+ Fl::repeat_timeout(interval_, (Fl_Timeout_Handler)timeout_cb, (void *)this);
+}
// Animate the game...
void
@@ -940,14 +956,7 @@ BlockWindow::timeout_cb(BlockWindow *bw) {
bw->opened_columns_ ++;
if (bw->opened_columns_ > (2 * BLOCK_COLS)) {
- bw->interval_ *= 0.95;
- bw->opened_columns_ = 0;
-
- if (bw->num_colors_ < 7) bw->num_colors_ ++;
-
- bw->level_ ++;
- sprintf(bw->title_, "Level: %d", bw->level_);
- bw->title_y_ = bw->h();
+ bw->up_level();
}
c = bw->columns_;