From 7ebaf77cdcbcadb4706c87f1662730a4687caf20 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 5 Aug 2001 23:58:54 +0000 Subject: Image labels! image() method to set active image, deimage() method to set inactive image. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/image.cxx | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'test/image.cxx') diff --git a/test/image.cxx b/test/image.cxx index d0158067a..43840c0c4 100644 --- a/test/image.cxx +++ b/test/image.cxx @@ -1,5 +1,5 @@ // -// "$Id: image.cxx,v 1.6.2.3 2001/01/22 15:13:41 easysw Exp $" +// "$Id: image.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $" // // Fl_Image test program for the Fast Light Tool Kit (FLTK). // @@ -54,19 +54,20 @@ void make_image() { #include -Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb; +Fl_Toggle_Button *leftb,*rightb,*topb,*bottomb,*insideb,*overb; Fl_Button *b; Fl_Window *w; void button_cb(Fl_Widget *,void *) { - int i = 0; - if (leftb->value()) i |= FL_ALIGN_LEFT; - if (rightb->value()) i |= FL_ALIGN_RIGHT; - if (topb->value()) i |= FL_ALIGN_TOP; - if (bottomb->value()) i |= FL_ALIGN_BOTTOM; - if (insideb->value()) i |= FL_ALIGN_INSIDE; - b->align(i); - w->redraw(); + int i = 0; + if (leftb->value()) i |= FL_ALIGN_LEFT; + if (rightb->value()) i |= FL_ALIGN_RIGHT; + if (topb->value()) i |= FL_ALIGN_TOP; + if (bottomb->value()) i |= FL_ALIGN_BOTTOM; + if (insideb->value()) i |= FL_ALIGN_INSIDE; + if (overb->value()) i |= FL_ALIGN_TEXT_OVER_IMAGE; + b->align(i); + w->redraw(); } #include @@ -113,19 +114,21 @@ int main(int argc, char **argv) { #endif Fl_Window window(400,400); ::w = &window; - Fl_Button b(140,160,120,120,0); ::b = &b; + Fl_Button b(140,160,120,120,"Image"); ::b = &b; make_image(); - (new Fl_Image(image, width, height))->label(&b); - leftb = new Fl_Toggle_Button(50,75,50,25,"left"); + (new Fl_RGB_Image(image, width, height))->label(&b); + leftb = new Fl_Toggle_Button(25,75,50,25,"left"); leftb->callback(button_cb); - rightb = new Fl_Toggle_Button(100,75,50,25,"right"); + rightb = new Fl_Toggle_Button(75,75,50,25,"right"); rightb->callback(button_cb); - topb = new Fl_Toggle_Button(150,75,50,25,"top"); + topb = new Fl_Toggle_Button(125,75,50,25,"top"); topb->callback(button_cb); - bottomb = new Fl_Toggle_Button(200,75,50,25,"bottom"); + bottomb = new Fl_Toggle_Button(175,75,50,25,"bottom"); bottomb->callback(button_cb); - insideb = new Fl_Toggle_Button(250,75,50,25,"inside"); + insideb = new Fl_Toggle_Button(225,75,50,25,"inside"); insideb->callback(button_cb); + overb = new Fl_Toggle_Button(275,75,100,25,"text over"); + overb->callback(button_cb); window.resizable(window); window.end(); window.show(argc, argv); @@ -133,5 +136,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: image.cxx,v 1.6.2.3 2001/01/22 15:13:41 easysw Exp $". +// End of "$Id: image.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $". // -- cgit v1.2.3