aboutsummaryrefslogtreecommitdiff
path: root/SrcUnix/espws-2.0/HelpApp.fl
blob: 0d37d5b45a0388fab5e6d50e11cd13308b3ef20a (plain)
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# data file for the Fltk User Interface Designer (fluid)
version 1.0008 
header_name {.h} 
code_name {.cxx} 
gridx 5 
gridy 5 
snap 3
class HelpApp {open
} {
  decl {static Fl_Menu_Item *bookmenu_;} {}
  decl {static HelpApp *first_;} {}
  decl {struct bookmark { char title[256], url[1024]; };} {}
  decl {static int nbookmarks_;} {}
  decl {static bookmark *bookmarks_;} {}
  decl {static int prop_bookmark_;} {}
  decl {static char homepage_[1024];} {}
  decl {static char proxy_[1024];} {}
  decl {int index_;} {}
  decl {int max_;} {}
  decl {HelpApp *next_;} {}
  decl {int line_[100];} {}
  decl {char file_[100][256];} {}
  decl {static void add_bookmark(const char *title, const char *url);} {}
  decl {static const char *link(const char *f);} {}
  decl {static void load_bookmarks();} {}
  decl {static void save_bookmarks();} {}
  decl {static void set_status(const char *format, ...);} {}
  decl {void back();} {}
  decl {void forward();} {}
  decl {void edit_bookmarks();} {}
  decl {void list_cb(int clicks);} {}
  decl {void prop_cb();} {}
  decl {void show_bookmark();} {}
  Function {HelpApp()} {open
  } {
    Fl_Window window_ {
      label {Help Application} open
      private xywh {444 35 530 385} hide resizable
      code0 {\#include <string.h>}
      code1 {\#include <FL/fl_ask.H>}
    } {
      Fl_Group view_ {
        callback {if (view_->changed())
{
  index_ ++;

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

  max_ = index_;

  strcpy(file_[index_], view_->filename());
  line_[index_] = view_->topline();

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

  forward_->deactivate();
  window_->label(view_->title());
  location_->value(view_->filename());
}
else if (view_->filename())
{
  strncpy(file_[index_], view_->filename(), 255);
  file_[index_][255] = '\\0';
  line_[index_] = view_->topline();
}} open
        private xywh {0 95 530 270} box DOWN_BOX resizable
        code0 {\#include "HelpView.h"}
        class HelpView
      } {}
      Fl_Box status_ {
        label {Ready.}
        private xywh {0 365 530 20} box FLAT_BOX labelsize 12 align 20
      }
      Fl_Pack toolbar_ {
        private xywh {0 25 530 35} type HORIZONTAL
      } {
        Fl_Button back_ {
          label {@-5<-}
          callback {back();}
          private xywh {0 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX shortcut 0xff51 labeltype SYMBOL_LABEL labelcolor 2
        }
        Fl_Button forward_ {
          label {@-5->}
          callback {forward();}
          private xywh {35 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX shortcut 0xff53 labeltype SYMBOL_LABEL 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 xywh {70 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX 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 xywh {105 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX labelfont 1 labelsize 16
        }
        Fl_Button home_ {
          label {home.xbm}
          callback {load(homepage_);}
          private xywh {140 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX labeltype image labelfont 1 labelsize 16
        }
        Fl_Button reload_ {
          label {reload.xbm}
          callback {int top = view_->topline();
view_->load(location_->value());
view_->topline(top);}
          private xywh {175 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX shortcut 0x40072 labeltype image labelfont 1 labelsize 16 labelcolor 4
        }
        Fl_Button stop_ {
          label {stop.xbm}
          private xywh {210 25 35 35} box FLAT_BOX down_box THIN_DOWN_BOX shortcut 0xff1b labeltype image labelfont 1 labelsize 16 labelcolor 1 deactivate
        }
      }
      Fl_Menu_Bar menubar_ {open
        private xywh {0 0 530 25}
      } {
        submenu {} {
          label {&File} open
          xywh {0 0 100 20}
        } {
          menuitem {} {
            label {&New}
            callback {new HelpApp;}
            xywh {0 0 100 20} shortcut 0x4006e
          }
          menuitem {} {
            label {&Open...}
            xywh {0 0 100 20} shortcut 0x4006f
          }
          menuitem {} {
            label {&Close}
            callback {window_->hide();}
            xywh {0 0 100 20} shortcut 0x40077 divider
          }
          menuitem {} {
            label {Set &Home Page}
            callback {strcpy(homepage_, location_->value());
save_bookmarks();}
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {Set &Proxy}
            callback {const char *proxy;

if ((proxy = fl_input("Enter the URL for the proxy server:", proxy_)) != NULL)
{
  strcpy(proxy_, proxy);
  save_bookmarks();
}}
            xywh {10 10 100 20} divider
          }
          menuitem {} {
            label {E&xit}
            callback {exit(0);}
            xywh {0 0 100 20} shortcut 0x40071
            code0 {\#include <stdlib.h>}
          }
        }
        submenu {} {
          label {&Options} open
          xywh {0 0 100 20}
        } {
          menuitem {} {
            label {&Toolbar}
            xywh {0 0 100 20} type Toggle value 1
          }
          menuitem {} {
            label {&Location}
            xywh {0 0 100 20} type Toggle value 1 divider
          }
        }
        submenu {} {
          label {&Go} open
          xywh {0 0 100 20}
        } {
          menuitem {} {
            label {&Back}
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {&Forward}
            xywh {0 0 100 20}
          }
          menuitem {} {
            label {&Home}
            xywh {0 0 100 20}
          }
        }
      }
      Fl_Group locationbar_ {open
        private xywh {0 60 530 35} box UP_FRAME
      } {
        Fl_Input location_ {
          label {Location:}
          callback {load(location_->value());}
          private xywh {180 65 345 25} when 10 resizable
        }
        Fl_Menu_Button bookmark_ {
          label Bookmarks
          callback {show_bookmark();} open
          private xywh {5 65 105 25} box THIN_UP_BOX down_box FLAT_BOX align 20
        } {
          menuitem {} {
            label Add
            callback {add_bookmark(view_->title(), location_->value());
save_bookmarks();}
            xywh {0 0 100 20} shortcut 0x40062
          }
          menuitem {} {
            label {Edit...}
            callback {edit_bookmarks();}
            xywh {0 0 100 20} divider
          }
        }
      }
    }
    Fl_Window bmWindow_ {
      label Bookmarks open
      private xywh {604 456 239 386} hide resizable
    } {
      Fl_Browser bmList_ {
        callback {list_cb(Fl::event_clicks());}
        private xywh {0 25 240 360} type Multi resizable
      }
      Fl_Menu_Bar bmMenubar_ {open
        private xywh {0 0 240 25}
      } {
        submenu {} {
          label {&Edit} open
          xywh {0 0 100 20}
        } {
          menuitem bmDelete_ {
            label Delete
            private xywh {0 0 100 20} shortcut 0xffff
          }
          menuitem bmMoveUp_ {
            label {Move Up} selected
            private xywh {0 0 100 20} shortcut 0xffbf
          }
          menuitem bmMoveDown_ {
            label {Move Down}
            private xywh {0 0 100 20} shortcut 0xffc0 divider
          }
          menuitem bmProperties_ {
            label Properties
            callback {list_cb(1);}
            private xywh {0 0 100 20} shortcut 0xff0d divider
          }
          menuitem {} {
            label Close
            callback {bmWindow_->hide();}
            private xywh {0 0 100 20} shortcut 0x40077
          }
        }
      }
    }
    Fl_Window propWindow_ {
      label {Bookmark Properties} open
      private xywh {340 68 385 111} hide modal
    } {
      Fl_Input propTitle_ {
        label {Title: }
        private xywh {50 10 325 25} labelfont 1
      }
      Fl_Input propURL_ {
        label {URL: }
        private xywh {50 40 325 25} labelfont 1
      }
      Fl_Button {} {
        label Cancel
        callback {propWindow_->hide();}
        xywh {310 75 65 25}
      }
      Fl_Return_Button {} {
        label OK
        callback {prop_cb();
propWindow_->hide();}
        xywh {240 75 65 25}
      }
    }
    code {back_->deactivate();
forward_->deactivate();

index_ = -1;
max_  = 0;
next_ = first_;
first_ = this;
view_->link(link);
if (!bookmenu_)
  load_bookmarks();
window_->show();
load(homepage_);} {}
  }
  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 {textsize(uchar 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 uchar
  } {
    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 {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());} {}
  }
}