DRC | 2ff39b8 | 2011-07-28 08:38:59 +0000 | [diff] [blame^] | 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 | |
| 34 | decl {\#include "flstring.h"} {} |
| 35 | |
| 36 | decl {\#include <FL/fl_ask.H>} {} |
| 37 | |
| 38 | class FL_EXPORT Fl_Help_Dialog {open |
| 39 | } { |
| 40 | decl {int index_;} {} |
| 41 | decl {int max_;} {} |
| 42 | decl {int line_[100];} {} |
| 43 | decl {char file_[100][256];} {} |
| 44 | decl {int find_pos_;} {} |
| 45 | Function {Fl_Help_Dialog()} {open |
| 46 | } { |
| 47 | Fl_Window window_ { |
| 48 | label {Help Dialog} open |
| 49 | private xywh {398 64 530 385} type Double resizable size_range {260 150 0 0} visible |
| 50 | } { |
| 51 | Fl_Group {} {open selected |
| 52 | xywh {10 10 511 25} |
| 53 | } { |
| 54 | Fl_Button back_ { |
| 55 | label {@<-} |
| 56 | callback {if (index_ > 0) |
| 57 | index_ --; |
| 58 | |
| 59 | if (index_ == 0) |
| 60 | back_->deactivate(); |
| 61 | |
| 62 | forward_->activate(); |
| 63 | |
| 64 | int l = line_[index_]; |
| 65 | |
| 66 | if (strcmp(view_->filename(), file_[index_]) != 0) |
| 67 | view_->load(file_[index_]); |
| 68 | |
| 69 | view_->topline(l);} |
| 70 | private tooltip {Show the previous help page.} xywh {10 10 25 25} shortcut 0xff51 labelcolor 2 |
| 71 | } |
| 72 | Fl_Button forward_ { |
| 73 | label {@->} |
| 74 | callback {if (index_ < max_) |
| 75 | index_ ++; |
| 76 | |
| 77 | if (index_ >= max_) |
| 78 | forward_->deactivate(); |
| 79 | |
| 80 | back_->activate(); |
| 81 | |
| 82 | int l = view_->topline(); |
| 83 | |
| 84 | if (strcmp(view_->filename(), file_[index_]) != 0) |
| 85 | view_->load(file_[index_]); |
| 86 | |
| 87 | view_->topline(l);} |
| 88 | private tooltip {Show the next help page.} xywh {45 10 25 25} shortcut 0xff53 labelcolor 2 |
| 89 | } |
| 90 | Fl_Button smaller_ { |
| 91 | label F |
| 92 | callback {if (view_->textsize() > 8) |
| 93 | view_->textsize(view_->textsize() - 2); |
| 94 | |
| 95 | if (view_->textsize() <= 8) |
| 96 | smaller_->deactivate(); |
| 97 | larger_->activate();} |
| 98 | private tooltip {Make the help text smaller.} xywh {80 10 25 25} labelfont 1 labelsize 10 |
| 99 | } |
| 100 | Fl_Button larger_ { |
| 101 | label F |
| 102 | callback {if (view_->textsize() < 18) |
| 103 | view_->textsize(view_->textsize() + 2); |
| 104 | |
| 105 | if (view_->textsize() >= 18) |
| 106 | larger_->deactivate(); |
| 107 | smaller_->activate();} |
| 108 | private tooltip {Make the help text larger.} xywh {115 10 25 25} labelfont 1 labelsize 16 |
| 109 | } |
| 110 | Fl_Group {} {open |
| 111 | xywh {350 10 171 25} box DOWN_BOX color 7 |
| 112 | } { |
| 113 | Fl_Input find_ { |
| 114 | label {@search} |
| 115 | callback {find_pos_ = view_->find(find_->value(), find_pos_);} |
| 116 | private tooltip {find text in document} xywh {375 12 143 21} box FLAT_BOX labelsize 13 when 10 textfont 4 |
| 117 | } |
| 118 | } |
| 119 | Fl_Box {} { |
| 120 | xywh {150 10 190 25} resizable |
| 121 | } |
| 122 | } |
| 123 | Fl_Help_View view_ { |
| 124 | callback {if (view_->filename()) |
| 125 | { |
| 126 | if (view_->changed()) |
| 127 | { |
| 128 | index_ ++; |
| 129 | |
| 130 | if (index_ >= 100) |
| 131 | { |
| 132 | memmove(line_, line_ + 10, sizeof(line_[0]) * 90); |
| 133 | memmove(file_, file_ + 10, sizeof(file_[0]) * 90); |
| 134 | index_ -= 10; |
| 135 | } |
| 136 | |
| 137 | max_ = index_; |
| 138 | |
| 139 | strlcpy(file_[index_], view_->filename(),sizeof(file_[0])); |
| 140 | line_[index_] = view_->topline(); |
| 141 | |
| 142 | if (index_ > 0) |
| 143 | back_->activate(); |
| 144 | else |
| 145 | back_->deactivate(); |
| 146 | |
| 147 | forward_->deactivate(); |
| 148 | window_->label(view_->title()); |
| 149 | } |
| 150 | else // if ! view_->changed() |
| 151 | { |
| 152 | strlcpy(file_[index_], view_->filename(), sizeof(file_[0])); |
| 153 | line_[index_] = view_->topline(); |
| 154 | } |
| 155 | } else { // if ! view_->filename() |
| 156 | index_ = 0; // hitting an internal page will disable the back/fwd buffer |
| 157 | file_[index_][0] = 0; // unnamed internal page |
| 158 | line_[index_] = view_->topline(); |
| 159 | back_->deactivate(); |
| 160 | forward_->deactivate(); |
| 161 | }} |
| 162 | private xywh {10 45 510 330} box DOWN_BOX resizable |
| 163 | } |
| 164 | } |
| 165 | code {back_->deactivate(); |
| 166 | forward_->deactivate(); |
| 167 | |
| 168 | index_ = -1; |
| 169 | max_ = 0; |
| 170 | find_pos_ = 0; |
| 171 | |
| 172 | fl_register_images();} {} |
| 173 | } |
| 174 | Function {~Fl_Help_Dialog()} {} { |
| 175 | code {delete window_;} {} |
| 176 | } |
| 177 | Function {h()} {return_type int |
| 178 | } { |
| 179 | code {return (window_->h());} {} |
| 180 | } |
| 181 | Function {hide()} {return_type void |
| 182 | } { |
| 183 | code {window_->hide();} {} |
| 184 | } |
| 185 | Function {load(const char *f)} {return_type void |
| 186 | } { |
| 187 | code {view_->set_changed(); |
| 188 | view_->load(f); |
| 189 | window_->label(view_->title());} {} |
| 190 | } |
| 191 | Function {position(int xx, int yy)} {return_type void |
| 192 | } { |
| 193 | code {window_->position(xx, yy);} {} |
| 194 | } |
| 195 | Function {resize(int xx, int yy, int ww, int hh)} {return_type void |
| 196 | } { |
| 197 | code {window_->resize(xx, yy, ww, hh);} {} |
| 198 | } |
| 199 | Function {show()} {return_type void |
| 200 | } { |
| 201 | code {window_->show();} {} |
| 202 | } |
| 203 | Function {show(int argc, char **argv)} {return_type void |
| 204 | } { |
| 205 | code {window_->show(argc, argv);} {} |
| 206 | } |
| 207 | Function {textsize(Fl_Fontsize s)} {return_type void |
| 208 | } { |
| 209 | code {view_->textsize(s); |
| 210 | |
| 211 | if (s <= 8) |
| 212 | smaller_->deactivate(); |
| 213 | else |
| 214 | smaller_->activate(); |
| 215 | |
| 216 | if (s >= 18) |
| 217 | larger_->deactivate(); |
| 218 | else |
| 219 | larger_->activate();} {} |
| 220 | } |
| 221 | Function {textsize()} {return_type Fl_Fontsize |
| 222 | } { |
| 223 | code {return (view_->textsize());} {} |
| 224 | } |
| 225 | Function {topline(const char *n)} {return_type void |
| 226 | } { |
| 227 | code {view_->topline(n);} {} |
| 228 | } |
| 229 | Function {topline(int n)} {return_type void |
| 230 | } { |
| 231 | code {view_->topline(n);} {} |
| 232 | } |
| 233 | Function {value(const char *f)} {return_type void |
| 234 | } { |
| 235 | code {view_->set_changed(); |
| 236 | view_->value(f); |
| 237 | window_->label(view_->title());} {} |
| 238 | } |
| 239 | Function {value() const} {return_type {const char *} |
| 240 | } { |
| 241 | code {return view_->value();} {} |
| 242 | } |
| 243 | Function {visible()} {return_type int |
| 244 | } { |
| 245 | code {return (window_->visible());} {} |
| 246 | } |
| 247 | Function {w()} {return_type int |
| 248 | } { |
| 249 | code {return (window_->w());} {} |
| 250 | } |
| 251 | Function {x()} {return_type int |
| 252 | } { |
| 253 | code {return (window_->x());} {} |
| 254 | } |
| 255 | Function {y()} {return_type int |
| 256 | } { |
| 257 | code {return (window_->y());} {} |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | comment { |
| 262 | // |
| 263 | // End of "$Id: Fl_Help_Dialog.fl 7913 2010-11-29 18:18:27Z greg.ercolano $". |
| 264 | //} {in_source in_header |
| 265 | } |