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.

266 lines
6.6KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0108
  3. header_name {../FL/Fl_Help_Dialog.H}
  4. code_name {.cxx}
  5. comment {//
  6. // "$Id: Fl_Help_Dialog.fl 7913 2010-11-29 18:18:27Z greg.ercolano $"
  7. //
  8. // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
  9. //
  10. // Copyright 1998-2010 by Bill Spitzak and others.
  11. //
  12. // This library is free software; you can redistribute it and/or
  13. // modify it under the terms of the GNU Library General Public
  14. // License as published by the Free Software Foundation; either
  15. // version 2 of the License, or (at your option) any later version.
  16. //
  17. // This library is distributed in the hope that it will be useful,
  18. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. // Library General Public License for more details.
  21. //
  22. // You should have received a copy of the GNU Library General Public
  23. // License along with this library; if not, write to the Free Software
  24. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  25. // USA.
  26. //
  27. // Please report all bugs and problems on the following page:
  28. //
  29. // http://www.fltk.org/str.php
  30. //
  31. } {in_source in_header
  32. }
  33. decl {\#include "flstring.h"} {}
  34. decl {\#include <FL/fl_ask.H>} {}
  35. class FL_EXPORT Fl_Help_Dialog {open
  36. } {
  37. decl {int index_;} {}
  38. decl {int max_;} {}
  39. decl {int line_[100];} {}
  40. decl {char file_[100][256];} {}
  41. decl {int find_pos_;} {}
  42. Function {Fl_Help_Dialog()} {open
  43. } {
  44. Fl_Window window_ {
  45. label {Help Dialog} open
  46. private xywh {398 64 530 385} type Double resizable size_range {260 150 0 0} visible
  47. } {
  48. Fl_Group {} {open selected
  49. xywh {10 10 511 25}
  50. } {
  51. Fl_Button back_ {
  52. label {@<-}
  53. callback {if (index_ > 0)
  54. index_ --;
  55. if (index_ == 0)
  56. back_->deactivate();
  57. forward_->activate();
  58. int l = line_[index_];
  59. if (strcmp(view_->filename(), file_[index_]) != 0)
  60. view_->load(file_[index_]);
  61. view_->topline(l);}
  62. private tooltip {Show the previous help page.} xywh {10 10 25 25} shortcut 0xff51 labelcolor 2
  63. }
  64. Fl_Button forward_ {
  65. label {@->}
  66. callback {if (index_ < max_)
  67. index_ ++;
  68. if (index_ >= max_)
  69. forward_->deactivate();
  70. back_->activate();
  71. int l = view_->topline();
  72. if (strcmp(view_->filename(), file_[index_]) != 0)
  73. view_->load(file_[index_]);
  74. view_->topline(l);}
  75. private tooltip {Show the next help page.} xywh {45 10 25 25} shortcut 0xff53 labelcolor 2
  76. }
  77. Fl_Button smaller_ {
  78. label F
  79. callback {if (view_->textsize() > 8)
  80. view_->textsize(view_->textsize() - 2);
  81. if (view_->textsize() <= 8)
  82. smaller_->deactivate();
  83. larger_->activate();}
  84. private tooltip {Make the help text smaller.} xywh {80 10 25 25} labelfont 1 labelsize 10
  85. }
  86. Fl_Button larger_ {
  87. label F
  88. callback {if (view_->textsize() < 18)
  89. view_->textsize(view_->textsize() + 2);
  90. if (view_->textsize() >= 18)
  91. larger_->deactivate();
  92. smaller_->activate();}
  93. private tooltip {Make the help text larger.} xywh {115 10 25 25} labelfont 1 labelsize 16
  94. }
  95. Fl_Group {} {open
  96. xywh {350 10 171 25} box DOWN_BOX color 7
  97. } {
  98. Fl_Input find_ {
  99. label {@search}
  100. callback {find_pos_ = view_->find(find_->value(), find_pos_);}
  101. private tooltip {find text in document} xywh {375 12 143 21} box FLAT_BOX labelsize 13 when 10 textfont 4
  102. }
  103. }
  104. Fl_Box {} {
  105. xywh {150 10 190 25} resizable
  106. }
  107. }
  108. Fl_Help_View view_ {
  109. callback {if (view_->filename())
  110. {
  111. if (view_->changed())
  112. {
  113. index_ ++;
  114. if (index_ >= 100)
  115. {
  116. memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
  117. memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
  118. index_ -= 10;
  119. }
  120. max_ = index_;
  121. strlcpy(file_[index_], view_->filename(),sizeof(file_[0]));
  122. line_[index_] = view_->topline();
  123. if (index_ > 0)
  124. back_->activate();
  125. else
  126. back_->deactivate();
  127. forward_->deactivate();
  128. window_->label(view_->title());
  129. }
  130. else // if ! view_->changed()
  131. {
  132. strlcpy(file_[index_], view_->filename(), sizeof(file_[0]));
  133. line_[index_] = view_->topline();
  134. }
  135. } else { // if ! view_->filename()
  136. index_ = 0; // hitting an internal page will disable the back/fwd buffer
  137. file_[index_][0] = 0; // unnamed internal page
  138. line_[index_] = view_->topline();
  139. back_->deactivate();
  140. forward_->deactivate();
  141. }}
  142. private xywh {10 45 510 330} box DOWN_BOX resizable
  143. }
  144. }
  145. code {back_->deactivate();
  146. forward_->deactivate();
  147. index_ = -1;
  148. max_ = 0;
  149. find_pos_ = 0;
  150. fl_register_images();} {}
  151. }
  152. Function {~Fl_Help_Dialog()} {} {
  153. code {delete window_;} {}
  154. }
  155. Function {h()} {return_type int
  156. } {
  157. code {return (window_->h());} {}
  158. }
  159. Function {hide()} {return_type void
  160. } {
  161. code {window_->hide();} {}
  162. }
  163. Function {load(const char *f)} {return_type void
  164. } {
  165. code {view_->set_changed();
  166. view_->load(f);
  167. window_->label(view_->title());} {}
  168. }
  169. Function {position(int xx, int yy)} {return_type void
  170. } {
  171. code {window_->position(xx, yy);} {}
  172. }
  173. Function {resize(int xx, int yy, int ww, int hh)} {return_type void
  174. } {
  175. code {window_->resize(xx, yy, ww, hh);} {}
  176. }
  177. Function {show()} {return_type void
  178. } {
  179. code {window_->show();} {}
  180. }
  181. Function {show(int argc, char **argv)} {return_type void
  182. } {
  183. code {window_->show(argc, argv);} {}
  184. }
  185. Function {textsize(Fl_Fontsize s)} {return_type void
  186. } {
  187. code {view_->textsize(s);
  188. if (s <= 8)
  189. smaller_->deactivate();
  190. else
  191. smaller_->activate();
  192. if (s >= 18)
  193. larger_->deactivate();
  194. else
  195. larger_->activate();} {}
  196. }
  197. Function {textsize()} {return_type Fl_Fontsize
  198. } {
  199. code {return (view_->textsize());} {}
  200. }
  201. Function {topline(const char *n)} {return_type void
  202. } {
  203. code {view_->topline(n);} {}
  204. }
  205. Function {topline(int n)} {return_type void
  206. } {
  207. code {view_->topline(n);} {}
  208. }
  209. Function {value(const char *f)} {return_type void
  210. } {
  211. code {view_->set_changed();
  212. view_->value(f);
  213. window_->label(view_->title());} {}
  214. }
  215. Function {value() const} {return_type {const char *}
  216. } {
  217. code {return view_->value();} {}
  218. }
  219. Function {visible()} {return_type int
  220. } {
  221. code {return (window_->visible());} {}
  222. }
  223. Function {w()} {return_type int
  224. } {
  225. code {return (window_->w());} {}
  226. }
  227. Function {x()} {return_type int
  228. } {
  229. code {return (window_->x());} {}
  230. }
  231. Function {y()} {return_type int
  232. } {
  233. code {return (window_->y());} {}
  234. }
  235. }
  236. comment {
  237. //
  238. // End of "$Id: Fl_Help_Dialog.fl 7913 2010-11-29 18:18:27Z greg.ercolano $".
  239. //} {in_source in_header
  240. }