summaryrefslogtreecommitdiff
path: root/third_party/windows/fltk-1.1.10/test/output.cxx
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
commita6163888f3c56123b1db313743c6147ba498732c (patch)
treeff7d15d991d1d09ba6cbc0cec80924f57445bfdd /third_party/windows/fltk-1.1.10/test/output.cxx
parentc3e4c9a25c2910d2d66d52215b3406b13d5b23d5 (diff)
Add third_party libs
Diffstat (limited to 'third_party/windows/fltk-1.1.10/test/output.cxx')
-rw-r--r--third_party/windows/fltk-1.1.10/test/output.cxx105
1 files changed, 105 insertions, 0 deletions
diff --git a/third_party/windows/fltk-1.1.10/test/output.cxx b/third_party/windows/fltk-1.1.10/test/output.cxx
new file mode 100644
index 0000000..56807a7
--- /dev/null
+++ b/third_party/windows/fltk-1.1.10/test/output.cxx
@@ -0,0 +1,105 @@
+//
+// "$Id: output.cxx 5519 2006-10-11 03:12:15Z mike $"
+//
+// Output test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2005 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems on the following page:
+//
+// http://www.fltk.org/str.php
+//
+
+#include <FL/Fl.H>
+#include <FL/Fl_Value_Input.H> // necessary for bug in mingw32?
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/Fl_Hor_Value_Slider.H>
+#include <FL/Fl_Toggle_Button.H>
+#include <FL/Fl_Input.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Output.H>
+#include <FL/Fl_Multiline_Output.H>
+
+Fl_Output *text;
+Fl_Multiline_Output *text2;
+Fl_Input *input;
+Fl_Value_Slider *fonts;
+Fl_Value_Slider *sizes;
+Fl_Window *window;
+
+void font_cb(Fl_Widget *,void *) {
+ text->textfont(int(fonts->value()));
+ text->redraw();
+ text2->textfont(int(fonts->value()));
+ text2->redraw();
+}
+
+void size_cb(Fl_Widget *,void *) {
+ text->textsize(int(sizes->value()));
+ text->redraw();
+ text2->textsize(int(sizes->value()));
+ text2->redraw();
+}
+
+void input_cb(Fl_Widget *,void *) {
+ text->value(input->value());
+ text2->value(input->value());
+}
+
+int main(int argc, char **argv) {
+ window = new Fl_Window(400,400);
+
+ input = new Fl_Input(50,0,350,25);
+ input->static_value("The quick brown fox\njumped over\nthe lazy dog.");
+ input->when(FL_WHEN_CHANGED);
+ input->callback(input_cb);
+
+ sizes = new Fl_Hor_Value_Slider(50,25,350,25,"Size");
+ sizes->align(FL_ALIGN_LEFT);
+ sizes->bounds(1,64);
+ sizes->step(1);
+ sizes->value(14);
+ sizes->callback(size_cb);
+
+ fonts = new Fl_Hor_Value_Slider(50,50,350,25,"Font");
+ fonts->align(FL_ALIGN_LEFT);
+ fonts->bounds(0,15);
+ fonts->step(1);
+ fonts->value(0);
+ fonts->callback(font_cb);
+
+ text2 = new Fl_Multiline_Output(100,150,200,100,"Fl_Multiline_Output");
+ text2->value(input->value());
+ text2->align(FL_ALIGN_BOTTOM);
+ text2->tooltip("This is an Fl_Multiline_Output widget.");
+ window->resizable(text2);
+
+ text = new Fl_Output(100,280,200,30,"Fl_Output");
+ text->value(input->value());
+ text->align(FL_ALIGN_BOTTOM);
+ text->tooltip("This is an Fl_Output widget.");
+
+ window->forms_end();
+ window->show(argc,argv);
+ return Fl::run();
+}
+
+//
+// End of "$Id: output.cxx 5519 2006-10-11 03:12:15Z mike $".
+//