Debian Codegraph @

test/unittest_viewport.cxx

raw symbols SCIP
1 //
2 // "$Id$"
3 //
4 // Unit tests for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18
19 #include <FL/Fl_Box.H>
20 #include <FL/fl_draw.H>
21
22 //
23 //------- test viewport clipping ----------
24 //
25 class ViewportTest : public Fl_Box {
26 public:
27 static Fl_Widget *create() {
28 return new ViewportTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H);
29 }
30 ViewportTest(int x, int y, int w, int h) : Fl_Box(x, y, w, h) {
31 label("Testing Viewport Alignment\n\n"
32 "Only green lines should be visible.\n"
33 "If red lines are visible in the corners of this window,\n"
34 "your viewport alignment and clipping is off.\n"
35 "If there is a space between the green lines and the window border,\n"
36 "the viewport is off, but some clipping may be working.\n"
37 "Also, your window size may be off to begin with.");
38 align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER|FL_ALIGN_WRAP);
39 box(FL_BORDER_BOX);
40 }
41 void show() {
42 Fl_Box::show();
43 mainwin->testAlignment(1);
44 }
45 void hide() {
46 Fl_Box::hide();
47 mainwin->testAlignment(0);
48 }
49 };
50
51 UnitTest viewport("viewport test", ViewportTest::create);
52
53 //
54 // End of "$Id$
55 //