You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.6KB

  1. //
  2. // "$Id: tile.cxx 7903 2010-11-28 21:06:39Z matt $"
  3. //
  4. // Tile test program for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. #include <FL/Fl.H>
  28. #include <FL/Fl_Double_Window.H>
  29. #include <FL/Fl_Tile.H>
  30. #include <FL/Fl_Box.H>
  31. //#define TEST_INACTIVE
  32. int main(int argc, char** argv) {
  33. Fl_Double_Window window(300,300);
  34. window.box(FL_NO_BOX);
  35. window.resizable(window);
  36. Fl_Tile tile(0,0,300,300);
  37. Fl_Box box0(0,0,150,150,"0");
  38. box0.box(FL_DOWN_BOX);
  39. box0.color(9);
  40. box0.labelsize(36);
  41. box0.align(FL_ALIGN_CLIP);
  42. Fl_Double_Window w1(150,0,150,150,"1");
  43. w1.box(FL_NO_BOX);
  44. Fl_Box box1(0,0,150,150,"1\nThis is a\nchild\nwindow");
  45. box1.box(FL_DOWN_BOX);
  46. box1.color(19);
  47. box1.labelsize(18);
  48. box1.align(FL_ALIGN_CLIP);
  49. w1.resizable(box1);
  50. w1.end();
  51. // Fl_Tile tile2(0,150,150,150);
  52. Fl_Box box2a(0,150,70,150,"2a");
  53. box2a.box(FL_DOWN_BOX);
  54. box2a.color(12);
  55. box2a.labelsize(36);
  56. box2a.align(FL_ALIGN_CLIP);
  57. Fl_Box box2b(70,150,80,150,"2b");
  58. box2b.box(FL_DOWN_BOX);
  59. box2b.color(13);
  60. box2b.labelsize(36);
  61. box2b.align(FL_ALIGN_CLIP);
  62. //tile2.end();
  63. //Fl_Tile tile3(150,150,150,150);
  64. Fl_Box box3a(150,150,150,70,"3a");
  65. box3a.box(FL_DOWN_BOX);
  66. box3a.color(12);
  67. box3a.labelsize(36);
  68. box3a.align(FL_ALIGN_CLIP);
  69. Fl_Box box3b(150,150+70,150,80,"3b");
  70. box3b.box(FL_DOWN_BOX);
  71. box3b.color(13);
  72. box3b.labelsize(36);
  73. box3b.align(FL_ALIGN_CLIP);
  74. //tile3.end();
  75. Fl_Box r(10,0,300-10,300-10);
  76. tile.resizable(r);
  77. // r.box(FL_BORDER_FRAME);
  78. tile.end();
  79. window.end();
  80. #ifdef TEST_INACTIVE // test inactive case
  81. tile.deactivate();
  82. #endif
  83. w1.show();
  84. window.show(argc,argv);
  85. return Fl::run();
  86. }
  87. //
  88. // End of "$Id: tile.cxx 7903 2010-11-28 21:06:39Z matt $".
  89. //