[go: up one dir, main page]

File: Fl_Help_Dialog.fl

package info (click to toggle)
fltk1.3 1.3.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 24,212 kB
  • sloc: cpp: 104,591; ansic: 88,673; sh: 6,607; makefile: 1,887; perl: 27; xml: 7
file content (270 lines) | stat: -rw-r--r-- 6,836 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# data file for the Fltk User Interface Designer (fluid)
version 1.0305
header_name {../FL/Fl_Help_Dialog.H}
code_name {.cxx}
comment {//
// "$Id$"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2015 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file.  If this
// file is missing or damaged, see the license at:
//
//     http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
//     http://www.fltk.org/str.php
//
// ========================================================================
//  DO NOT EDIT FL/Fl_Help_Dialog.H and src/Fl_Help_Dialog.cxx !!!
// ========================================================================
//  Please use fluid to change src/Fl_Help_Dialog.fl interactively
//  and then use fluid to "write code" or edit and use fluid -c .
// ========================================================================
//
} {in_source in_header
}

decl {\#include "flstring.h"} {private local
}

decl {\#include <FL/fl_ask.H>} {private local
}

class FL_EXPORT Fl_Help_Dialog {open
} {
  decl {int index_;} {private local
  }
  decl {int max_;} {private local
  }
  decl {int line_[100];                 // FIXME: we must remove those static numbers} {private local
  }
  decl {char file_[100][FL_PATH_MAX];   // FIXME: we must remove those static numbers} {private local
  }
  decl {int find_pos_;} {private local
  }
  Function {Fl_Help_Dialog()} {open
  } {
    Fl_Window window_ {
      label {Help Dialog} open
      private xywh {398 64 530 385} type Double hide resizable size_range {260 150 0 0}
    } {
      Fl_Group {} {open selected
        xywh {10 10 511 25}
      } {
        Fl_Button back_ {
          label {@<-}
          callback {if (index_ > 0)
  index_ --;

if (index_ == 0)
  back_->deactivate();

forward_->activate();

int l = line_[index_];

if (strcmp(view_->filename(), file_[index_]) != 0)
  view_->load(file_[index_]);

view_->topline(l);}
          private tooltip {Show the previous help page.} xywh {10 10 25 25} shortcut 0xff51 labelcolor 2
        }
        Fl_Button forward_ {
          label {@->}
          callback {if (index_ < max_)
  index_ ++;

if (index_ >= max_)
  forward_->deactivate();

back_->activate();

int l = view_->topline();

if (strcmp(view_->filename(), file_[index_]) != 0)
  view_->load(file_[index_]);

view_->topline(l);}
          private tooltip {Show the next help page.} xywh {45 10 25 25} shortcut 0xff53 labelcolor 2
        }
        Fl_Button smaller_ {
          label F
          callback {if (view_->textsize() > 8)
  view_->textsize(view_->textsize() - 2);

if (view_->textsize() <= 8)
  smaller_->deactivate();
larger_->activate();}
          private tooltip {Make the help text smaller.} xywh {80 10 25 25} labelfont 1 labelsize 10
        }
        Fl_Button larger_ {
          label F
          callback {if (view_->textsize() < 18)
  view_->textsize(view_->textsize() + 2);

if (view_->textsize() >= 18)
  larger_->deactivate();
smaller_->activate();}
          private tooltip {Make the help text larger.} xywh {115 10 25 25} labelfont 1 labelsize 16
        }
        Fl_Group {} {open
          xywh {350 10 171 25} box DOWN_BOX color 7
        } {
          Fl_Input find_ {
            label {@search}
            callback {find_pos_ = view_->find(find_->value(), find_pos_);}
            private tooltip {find text in document} xywh {375 12 143 21} box FLAT_BOX labelsize 13 when 10 textfont 4
          }
        }
        Fl_Box {} {
          xywh {150 10 190 25} resizable
        }
      }
      Fl_Help_View view_ {
        callback {if (view_->filename())
{
  if (view_->changed())
  {
    index_ ++;

    if (index_ >= 100)
    {
      memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
      memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
      index_ -= 10;
    }

    max_ = index_;

    strlcpy(file_[index_], view_->filename(),sizeof(file_[0]));
    line_[index_] = view_->topline();

    if (index_ > 0)
      back_->activate();
    else
      back_->deactivate();

    forward_->deactivate();
    window_->label(view_->title());
  }
  else // if ! view_->changed()
  {
    strlcpy(file_[index_], view_->filename(), sizeof(file_[0]));
    line_[index_] = view_->topline();
  }
} else { // if ! view_->filename()
  index_ = 0; // hitting an internal page will disable the back/fwd buffer
  file_[index_][0] = 0; // unnamed internal page
  line_[index_] = view_->topline();
  back_->deactivate();
  forward_->deactivate();
}}
        private xywh {10 45 510 330} box DOWN_BOX resizable
      }
    }
    code {back_->deactivate();
forward_->deactivate();

index_    = -1;
max_      = 0;
find_pos_ = 0;

fl_register_images();} {}
  }
  Function {~Fl_Help_Dialog()} {} {
    code {delete window_;} {}
  }
  Function {h()} {return_type int
  } {
    code {return (window_->h());} {}
  }
  Function {hide()} {return_type void
  } {
    code {window_->hide();} {}
  }
  Function {load(const char *f)} {return_type void
  } {
    code {view_->set_changed();
view_->load(f);
window_->label(view_->title());} {}
  }
  Function {position(int xx, int yy)} {return_type void
  } {
    code {window_->position(xx, yy);} {}
  }
  Function {resize(int xx, int yy, int ww, int hh)} {return_type void
  } {
    code {window_->resize(xx, yy, ww, hh);} {}
  }
  Function {show()} {return_type void
  } {
    code {window_->show();} {}
  }
  Function {show(int argc, char **argv)} {return_type void
  } {
    code {window_->show(argc, argv);} {}
  }
  Function {textsize(Fl_Fontsize s)} {return_type void
  } {
    code {view_->textsize(s);

if (s <= 8)
  smaller_->deactivate();
else
  smaller_->activate();

if (s >= 18)
  larger_->deactivate();
else
  larger_->activate();} {}
  }
  Function {textsize()} {return_type Fl_Fontsize
  } {
    code {return (view_->textsize());} {}
  }
  Function {topline(const char *n)} {return_type void
  } {
    code {view_->topline(n);} {}
  }
  Function {topline(int n)} {return_type void
  } {
    code {view_->topline(n);} {}
  }
  Function {value(const char *f)} {return_type void
  } {
    code {view_->set_changed();
view_->value(f);
window_->label(view_->title());} {}
  }
  Function {value() const} {return_type {const char *}
  } {
    code {return view_->value();} {}
  }
  Function {visible()} {return_type int
  } {
    code {return (window_->visible());} {}
  }
  Function {w()} {return_type int
  } {
    code {return (window_->w());} {}
  }
  Function {x()} {return_type int
  } {
    code {return (window_->x());} {}
  }
  Function {y()} {return_type int
  } {
    code {return (window_->y());} {}
  }
}

comment {
//
// End of "$Id$".
//} {in_source in_header
}