1# data file for the Fltk User Interface Designer (fluid)
2version 1.0105
3header_name {.h}
4code_name {.cxx}
5decl {/*
6    Copyright 1998-2004 Ward Cunningham and Jim Wilson
7    Distributed under the GNU GPL V2 license
8    See http://c2.com/morse
9
10    This file is part of Morse.
11
12    Morse is free software; you can redistribute it and/or modify
13    it under the terms of the GNU General Public License as published by
14    the Free Software Foundation; either version 2 of the License, or
15    (at your option) any later version.
16
17    Morse 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
20    GNU General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with Morse; if not, write to the Free Software Foundation, Inc.,
24    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25*/} {public
26}
27
28decl {\#include "Bargraph.h"} {}
29
30decl {\#include "Codebox.h"} {}
31
32decl {\#include "Knob.h"} {public
33}
34
35decl {\#include "Cw.h"} {}
36
37decl {\#include <cstdlib>} {}
38
39decl {\#include "Help.h"} {}
40
41Function {adjust(Fl_Widget*, void*)} {private return_type void
42} {
43  code {set_cw(Speed->value(), Tone->value(), 1.0);} {}
44}
45
46Function {full_screen(bool fs)} {private
47} {
48  code {static int X,Y,W,H;	// Shrunken Morse window size
49
50if (fs) {
51  X = Morse->x(); Y = Morse->y();
52  W = Morse->w(); H = Morse->h();
53  Morse->fullscreen();
54} else Morse->fullscreen_off(X,Y,W,H);} {}
55}
56
57Function {} {open
58} {
59  Fl_Window About {
60    xywh {88 120 480 280} type Single box ENGRAVED_BOX hide modal noborder
61  } {
62    Fl_Return_Button {} {
63      label OK
64      callback {o->window()->hide();}
65      xywh {210 240 60 35} labelfont 1
66    }
67    Fl_Box {} {
68      image {pix/fltklogo.gif} xywh {20 131 110 89} box EMBOSSED_BOX align 64
69    }
70    Fl_Box {} {
71      label {(c) 1998-2004 Ward Cunningham and Jim Wilson}
72      xywh {0 60 480 25}
73    }
74    Fl_Box {} {
75      label {Distributed under the GNU GPL V2 license}
76      xywh {0 85 480 25}
77    }
78    Fl_Box {} {
79      label {See http://c2.com/morse}
80      xywh {0 110 480 25}
81    }
82    Fl_Box {} {
83      label {Built with the}
84      xywh {150 140 180 20}
85    }
86    Fl_Box {} {
87      label {http://www.fltk.org}
88      xywh {20 220 110 25}
89    }
90    Fl_Box {} {
91      label {A Fully Automatic Morse Code Teaching Machine}
92      xywh {0 10 480 25} labelfont 1
93    }
94    Fl_Box {} {
95      label {Originally described in QST, May 1977, ARRL, Newington, CT}
96      xywh {0 35 480 25}
97    }
98    Fl_Box {} {
99      image {pix/sdl_button.gif} xywh {335 146 128 64} box EMBOSSED_BOX align 64
100    }
101    Fl_Box {} {
102      label {Simple Directmedia Layer}
103      xywh {150 210 180 20}
104    }
105    Fl_Box {} {
106      label {http://www.libsdl.org}
107      xywh {335 215 128 25}
108    }
109    Fl_Box {} {
110      label {and the}
111      xywh {150 190 180 20}
112    }
113    Fl_Box {} {
114      label {Fast Light ToolKit}
115      xywh {150 160 180 20}
116    }
117  }
118  Fl_Window Help {
119    label Help
120    private xywh {527 20 530 385} type Double hide resizable
121  } {
122    Fl_Help_View View {
123      xywh {10 10 510 330} resizable
124      code0 {View->value(HelpString);}
125    }
126    Fl_Button smaller {
127      label F
128      callback {View->textsize(View->textsize()-2);
129if (View->textsize() <= 8)
130  smaller->deactivate();
131larger->activate();}
132      private tooltip {Make help text smaller.} xywh {105 350 30 25} labelfont 1 labelsize 10
133    }
134    Fl_Button larger {
135      label F
136      callback {View->textsize(View->textsize()+2);
137if (View->textsize() >= 18)
138  larger->deactivate();
139smaller->activate();}
140      tooltip {Make help text larger.} xywh {145 350 30 25} labelfont 1 labelsize 16
141    }
142    Fl_Button {} {
143      label Close
144      callback {Help->hide();}
145      private tooltip help xywh {330 350 95 25}
146    }
147  }
148  Fl_Window Morse {
149    callback {exit(0);} open
150    xywh {761 105 640 240} type Double resizable
151    code0 {o->size_range(o->w()>>1, o->h());} visible
152  } {
153    Fl_Roller Speed {
154      label Speed
155      callback adjust
156      tooltip {Words per minute} xywh {385 0 80 25} type Horizontal align 8 minimum 10 maximum 30 step 0.5 value 20
157      class Knob
158    }
159    Fl_Roller Tone {
160      label Tone
161      callback adjust
162      tooltip {Adjust tone frequency} xywh {520 0 80 25} type Horizontal align 8 minimum 440 maximum 2000 step 50 value 1000
163      class Knob
164    }
165    Fl_Group Lesson {
166      label {Q7ZG098O1JPW.LRAM6B/XD=YCKN23?FU45VHSITE} open
167      private tooltip {Click the white box, below, to start.} xywh {0 25 640 185} box UP_BOX align 5 resizable
168      code0 {o->disable("./=?");}
169      code1 {o->activate("Q7ZG");}
170      code3 {o->tesselate(2);}
171      class Bargraph
172    } {}
173    Fl_Input Teacher {
174      private tooltip {Click here to begin; press Enter to rest} xywh {0 210 640 30} when 1 textfont 1
175      class Codebox
176    }
177    Fl_Menu_Bar {} {open
178      private xywh {0 0 385 25}
179    } {
180      submenu {} {
181        label Morse selected
182        xywh {0 0 100 20}
183      } {
184        menuitem {} {
185          label {Full Screen}
186          callback {full_screen(o->mvalue()->value());}
187          xywh {0 0 100 20} type Toggle
188        }
189        menuitem {} {
190          label Numbers
191          callback {const char* nrs = "0123456789";
192if (o->mvalue()->value())
193  Lesson->enable(nrs);
194else
195  Lesson->disable(nrs);
196Lesson->tesselate();
197Lesson->redraw();}
198          xywh {0 0 100 20} type Toggle value 1
199        }
200        menuitem {} {
201          label Symbols
202          callback {const char* syms = "./=?";
203if (o->mvalue()->value())
204  Lesson->enable(syms);
205else
206  Lesson->disable(syms);
207Lesson->tesselate();
208Lesson->redraw();}
209          xywh {0 0 100 20} type Toggle
210        }
211        menuitem {} {
212          label Quit
213          callback {exit(0);}
214          xywh {0 0 100 20}
215        }
216      }
217      submenu {} {
218        label Help
219        xywh {6 0 100 20}
220      } {
221        menuitem {} {
222          label {Using Morse...}
223          callback {Help->show();}
224          xywh {0 0 100 20}
225        }
226        menuitem {} {
227          label {About Morse...}
228          callback {About->show();}
229          xywh {0 0 100 20}
230        }
231      }
232    }
233  }
234  code {Morse->show(argc, argv);
235while (1) {
236  int c = Lesson->select();	// Select random letter
237  bool pass = Teacher->teach(c);// Teach/test student
238  Lesson->grade(c , pass);	// Update scores
239  Lesson->graduate();		// Maybe add a letter
240}} {}
241}
242