summaryrefslogtreecommitdiff
path: root/test/image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 23:58:54 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-08-05 23:58:54 +0000
commit7ebaf77cdcbcadb4706c87f1662730a4687caf20 (patch)
tree07340f24b863b23f716b9cf9f657026c76c62fbf /test/image.cxx
parent208cf399a6ab801951bf28a82a0e07adefc60028 (diff)
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
Diffstat (limited to 'test/image.cxx')
-rw-r--r--test/image.cxx39
1 files changed, 21 insertions, 18 deletions
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/Fl_Toggle_Button.H>
-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 <FL/x.H>
@@ -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 $".
//