Skip to content

Commit

Permalink
Most test demos converted to use Fl_Double_Window
Browse files Browse the repository at this point in the history
to prevent flicker when new users run test/demo programs.

For details, see fltk.development thread started 04/16/09,
"Subject: browser demo flicker".




git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6772 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
erco77 committed Apr 21, 2009
1 parent 03ec459 commit b475bab
Show file tree
Hide file tree
Showing 28 changed files with 72 additions and 72 deletions.
4 changes: 2 additions & 2 deletions test/adjuster.cxx
Expand Up @@ -27,7 +27,7 @@

#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Adjuster.H>
#include <FL/Fl_Box.H>

Expand All @@ -39,7 +39,7 @@ void adjcb(Fl_Widget *o, void *v) {
}

int main(int argc, char ** argv) {
Fl_Window window(320,100,argv[0]);
Fl_Double_Window window(320,100,argv[0]);

char buf1[100];
Fl_Box b1(FL_DOWN_BOX,20,30,80,25,buf1);
Expand Down
4 changes: 2 additions & 2 deletions test/ask.cxx
Expand Up @@ -35,7 +35,7 @@
#include <stdio.h>
#include <string.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Return_Button.H>
Expand Down Expand Up @@ -77,7 +77,7 @@ int main(int argc, char **argv) {
// the question dialog several times and make sure it doesn't crash.
// fc: added more fl_ask common dialogs for test cases purposes.

Fl_Window window(200, 105);
Fl_Double_Window window(200, 105);
Fl_Return_Button b(20, 10, 160, 35, buffer); b.callback(rename_me);
Fl_Button b2(20, 50, 160, 35, buffer2); b2.callback(rename_me_pwd);
window.end();
Expand Down
6 changes: 3 additions & 3 deletions test/bitmap.cxx
Expand Up @@ -26,7 +26,7 @@
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Bitmap.H>
#include <stdio.h>
Expand Down Expand Up @@ -102,7 +102,7 @@ static uchar sorceress_bits[] = {

Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;

void button_cb(Fl_Widget *,void *) {
int i = 0;
Expand All @@ -119,7 +119,7 @@ void button_cb(Fl_Widget *,void *) {
}

int main(int argc, char **argv) {
w = new Fl_Window(400,400);
w = new Fl_Double_Window(400,400);
b = new Fl_Button(140,160,120,120,"Bitmap");
b->image(new Fl_Bitmap(sorceress_bits,sorceress_width,sorceress_height));
leftb = new Fl_Toggle_Button(25,50,50,25,"left");
Expand Down
2 changes: 1 addition & 1 deletion test/boxtype.cxx
Expand Up @@ -36,7 +36,7 @@ int N = 0;
#define H 50
#define ROWS 14

Fl_Window *window;
Fl_Double_Window *window;

void bt(const char *name, Fl_Boxtype type, int square=0) {
int x = N%4;
Expand Down
2 changes: 1 addition & 1 deletion test/browser.cxx
Expand Up @@ -126,7 +126,7 @@ int main(int argc, char **argv) {
int i;
if (!Fl::args(argc,argv,i)) Fl::fatal(Fl::help);
const char* fname = (i < argc) ? argv[i] : "browser.cxx";
Fl_Window window(480,400,fname);
Fl_Double_Window window(480,400,fname);
browser = new Fl_Select_Browser(0,0,480,350,0);
browser->type(FL_MULTI_BROWSER);
//browser->type(FL_HOLD_BROWSER);
Expand Down
6 changes: 3 additions & 3 deletions test/clock.cxx
Expand Up @@ -26,16 +26,16 @@
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Clock.H>
#include <FL/Fl_Round_Clock.H>

int main(int argc, char **argv) {
Fl_Window window(220,220,"Fl_Clock");
Fl_Double_Window window(220,220,"Fl_Clock");
Fl_Clock c1(0,0,220,220); // c1.color(2,1);
window.resizable(c1);
window.end();
Fl_Window window2(220,220,"Fl_Round_Clock");
Fl_Double_Window window2(220,220,"Fl_Round_Clock");
Fl_Round_Clock c2(0,0,220,220); // c2.color(3,4);
window2.resizable(c2);
window2.end();
Expand Down
4 changes: 2 additions & 2 deletions test/cursor.cxx
Expand Up @@ -26,7 +26,7 @@
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Hor_Value_Slider.H>
#include <FL/Fl_Choice.H>
#include <FL/fl_draw.H>
Expand Down Expand Up @@ -100,7 +100,7 @@ class CharBox : public Fl_Box {
};

int main(int argc, char **argv) {
Fl_Window window(400,300);
Fl_Double_Window window(400,300);

Fl_Choice choice(80,100,200,25,"Cursor:");
choice.menu(choices);
Expand Down
6 changes: 3 additions & 3 deletions test/demo.cxx
Expand Up @@ -40,7 +40,7 @@
# include <unistd.h>
#endif
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Choice.H>
Expand All @@ -56,12 +56,12 @@ void doscheme(Fl_Choice *c, void *) {
Fl::scheme(c->text(c->value()));
}

Fl_Window *form;
Fl_Double_Window *form;
Fl_Button *but[9];

void create_the_forms() {
Fl_Widget *obj;
form = new Fl_Window(350, 440);
form = new Fl_Double_Window(350, 440);
obj = new Fl_Box(FL_FRAME_BOX,10,15,330,40,"FLTK Demonstration");
obj->color(FL_GRAY-4);
obj->labelsize(24);
Expand Down
9 changes: 5 additions & 4 deletions test/file_chooser.cxx
Expand Up @@ -48,6 +48,7 @@
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_PNM_Image.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Double_Window.H>
#include <string.h>


Expand Down Expand Up @@ -91,9 +92,9 @@ int // O - Exit status
main(int argc, // I - Number of command-line arguments
char *argv[]) // I - Command-line arguments
{
Fl_Window *window;// Main window
Fl_Button *button;// Buttons
Fl_File_Icon *icon; // New file icon
Fl_Double_Window *window;// Main window
Fl_Button *button;// Buttons
Fl_File_Icon *icon; // New file icon


// Make the file chooser...
Expand All @@ -108,7 +109,7 @@ main(int argc, // I - Number of command-line arguments
Fl_Shared_Image::add_handler(ps_check);

// Make the main window...
window = new Fl_Window(400, 215, "File Chooser Test");
window = new Fl_Double_Window(400, 215, "File Chooser Test");

filter = new Fl_Input(50, 10, 315, 25, "Filter:");
if (argc > 1)
Expand Down
6 changes: 3 additions & 3 deletions test/image.cxx
Expand Up @@ -30,7 +30,7 @@
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Image.H>
#include <stdio.h>
Expand Down Expand Up @@ -65,7 +65,7 @@ void make_image() {

Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb,*inactb;
Fl_Button *b;
Fl_Window *w;
Fl_Double_Window *w;

void button_cb(Fl_Widget *,void *) {
int i = 0;
Expand Down Expand Up @@ -121,7 +121,7 @@ int main(int argc, char **argv) {
}
#endif

Fl_Window window(400,400); ::w = &window;
Fl_Double_Window window(400,400); ::w = &window;
window.color(FL_WHITE);
Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;

Expand Down
4 changes: 2 additions & 2 deletions test/input_choice.cxx
Expand Up @@ -23,7 +23,7 @@

#include <stdio.h>
#include <FL/Fl_Button.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input_Choice.H>

void buttcb(Fl_Widget*,void*data) {
Expand All @@ -44,7 +44,7 @@ void input_choice_cb(Fl_Widget*,void*data) {
}

int main(int argc, char **argv) {
Fl_Window win(300, 200);
Fl_Double_Window win(300, 200);

Fl_Input_Choice in(40,40,100,28,"Test");
in.callback(input_choice_cb, (void*)&in);
Expand Down
2 changes: 1 addition & 1 deletion test/keyboard.cxx
Expand Up @@ -100,7 +100,7 @@ struct keycode_table{int n; const char* text;} table[] = {

int main(int argc, char** argv) {
Fl::add_handler(handle);
Fl_Window *window = make_window();
MyWindow *window = make_window();
window->show(argc,argv);
while (Fl::wait()) {
const char *str;
Expand Down
12 changes: 6 additions & 6 deletions test/line_style.cxx
Expand Up @@ -26,27 +26,27 @@
//

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Box.H>

Fl_Window *form;
Fl_Double_Window *form;
Fl_Slider *sliders[8];
Fl_Choice *choice[3];
Fl_Check_Button *draw_line;

class test_box: public Fl_Window {
class test_box: public Fl_Double_Window {
void draw();
public:
test_box(int x,int y,int w,int h,const char *l=0)
: Fl_Window(x,y,w,h,l) {}
: Fl_Double_Window(x,y,w,h,l) {}
}*test;

void test_box::draw() {
Fl_Window::draw();
Fl_Double_Window::draw();
fl_color((uchar)(sliders[0]->value()),
(uchar)(sliders[1]->value()),
(uchar)(sliders[2]->value()));
Expand Down Expand Up @@ -111,7 +111,7 @@ void do_redraw(Fl_Widget*,void*)
}

void makeform(const char *) {
form = new Fl_Window(500,230,"fl_line_style() test");
form = new Fl_Double_Window(500,230,"fl_line_style() test");
sliders[0]= new Fl_Value_Slider(280,10,180,20,"R");
sliders[0]->bounds(0,255);
sliders[1]= new Fl_Value_Slider(280,30,180,20,"G");
Expand Down
2 changes: 1 addition & 1 deletion test/mandelbrot.h
Expand Up @@ -28,7 +28,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Slider.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Input.H>

class Drawing_Area : public Fl_Box {
Expand Down
4 changes: 2 additions & 2 deletions test/mandelbrot_ui.fl
@@ -1,5 +1,5 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0108
version 1.0300
header_name {.h}
code_name {.cxx}
decl {\#include "mandelbrot.h"} {public
Expand All @@ -12,7 +12,7 @@ class Drawing_Window {open
Function {make_window()} {open return_type void
} {
Fl_Window window {open selected
xywh {178 479 450 520} type Single resizable
xywh {178 479 450 520} type Double resizable
code0 {o->size_range(220,220);} visible
} {
Fl_Box d {
Expand Down
6 changes: 3 additions & 3 deletions test/menubar.cxx
Expand Up @@ -27,7 +27,7 @@

#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Toggle_Button.H>
#include <FL/Fl_Menu_Button.H>
Expand All @@ -39,7 +39,7 @@

void window_cb(Fl_Widget* w, void*) {
puts("window callback called");
((Fl_Window *)w)->hide();
((Fl_Double_Window *)w)->hide();
}

void test_cb(Fl_Widget* w, void*) {
Expand Down Expand Up @@ -178,7 +178,7 @@ int main(int argc, char **argv) {
sprintf(buf,"item %d",i);
hugemenu[i].text = strdup(buf);
}
Fl_Window window(WIDTH,400);
Fl_Double_Window window(WIDTH,400);
window.callback(window_cb);
Fl_Menu_Bar menubar(0,0,WIDTH,30); menubar.menu(menutable);
menubar.callback(test_cb);
Expand Down
4 changes: 2 additions & 2 deletions test/minimum.cxx
Expand Up @@ -44,13 +44,13 @@

#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Slider.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Return_Button.H>

int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(400,320,argv[0]);
Fl_Double_Window *window = new Fl_Double_Window(400,320,argv[0]);
window->resizable(*(new Fl_Box(FL_ENGRAVED_FRAME,10,10,300,300,
"MINIMUM UPDATE TEST\n"
"\n"
Expand Down
6 changes: 3 additions & 3 deletions test/output.cxx
Expand Up @@ -27,7 +27,7 @@

#include <FL/Fl.H>
#include <FL/Fl_Value_Input.H> // necessary for bug in mingw32?
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Hor_Value_Slider.H>
#include <FL/Fl_Toggle_Button.H>
Expand All @@ -41,7 +41,7 @@ Fl_Multiline_Output *text2;
Fl_Input *input;
Fl_Value_Slider *fonts;
Fl_Value_Slider *sizes;
Fl_Window *window;
Fl_Double_Window *window;

void font_cb(Fl_Widget *,void *) {
text->textfont(int(fonts->value()));
Expand All @@ -63,7 +63,7 @@ void input_cb(Fl_Widget *,void *) {
}

int main(int argc, char **argv) {
window = new Fl_Window(400,400);
window = new Fl_Double_Window(400,400);

input = new Fl_Input(50,375,350,25);
input->static_value("The quick brown fox\njumped over\nthe lazy dog.");
Expand Down
6 changes: 3 additions & 3 deletions test/pack.cxx
Expand Up @@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Pack.H>
Expand All @@ -57,8 +57,8 @@ void spacing_cb(Fl_Value_Slider*o, long) {
}

int main(int argc, char **argv) {
Fl_Window *w;
{Fl_Window* o = new Fl_Window(360, 370);
Fl_Double_Window *w;
{Fl_Double_Window* o = new Fl_Double_Window(360, 370);
w = o;
scroll = new Fl_Scroll(10,10,340,285);
{Fl_Pack* o = new Fl_Pack(10, 10, 340, 285);
Expand Down

0 comments on commit b475bab

Please sign in to comment.