1 // ----------------------------------------------------------------------------
2 // Copyright (C) 2014
3 // David Freese, W1HKJ
4 //
5 // This file is part of flmsg
6 //
7 // flrig is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // flrig is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 // ----------------------------------------------------------------------------
20
21 #include "gettext.h"
22 #include "status.h"
23 #include "util.h"
24
25 #include "flmsg_dialog.h"
26 #include "flmsg.h"
27 #include "combo.h"
28
29 Fl_Group *tab_cap105 = (Fl_Group *)0;
30 Fl_Tabs *tabs_cap105 = (Fl_Tabs *)0;
31 Fl_Group *tab_cap105_message = (Fl_Group *)0;
32 Fl_Group *tab_cap105_information = (Fl_Group *)0;
33
34 Fl_Input2 *cap105_txt_nbr = (Fl_Input2 *)0;
35 Fl_ListBox *cap105_sel_prec = (Fl_ListBox *)0;
36
37 Fl_Input2 *cap105_txt_dtm = (Fl_Input2 *)0;
38 Fl_Button *cap105_btn_dtm = (Fl_Button *)0;
39
40 Fl_Input2 *cap105_txt_from = (Fl_Input2 *)0;
41 Fl_Input2 *cap105_txt_to = (Fl_Input2 *)0;
42 Fl_Input2 *cap105_txt_info = (Fl_Input2 *)0;
43
44 Fl_Input2 *cap105_txt_subj = (Fl_Input2 *)0;
45
46 Fl_Input2 *cap105_txt_grpcnt = (Fl_Input2 *)0;
47 Fl_Button *cap105_btn_check = (Fl_Button *)0;
48
49 FTextEdit *cap105_txt_msg = (FTextEdit *)0;
50
51 Fl_Input2 *cap105_txt_rcvd_fm = (Fl_Input2 *)0;
52 Fl_Input2 *cap105_txt_rcvd_dtm = (Fl_Input2 *)0;
53 Fl_Button *cap105_btn_rcvd_dtm = (Fl_Button *)0;
54
55 Fl_Input2 *cap105_txt_sent_to = (Fl_Input2 *)0;
56 Fl_Input2 *cap105_txt_sent_dtm = (Fl_Input2 *)0;
57 Fl_Button *cap105_btn_sent_dtm = (Fl_Button *)0;
58
59 Fl_Input2 *cap105_txt_rcvop = (Fl_Input2 *)0;
60 Fl_Input2 *cap105_txt_sendop = (Fl_Input2 *)0;
61
cb_cap105_txt_nbr(Fl_Input2 *,void *)62 static void cb_cap105_txt_nbr(Fl_Input2*, void*) {
63 cap105_cb_nbr(cap105_txt_nbr);
64 estimate();
65 }
66
cb_cap105_txt_from(Fl_Input2 *,void *)67 static void cb_cap105_txt_from(Fl_Input2*, void*) {
68 cap105_cb_filter_input(cap105_txt_from);
69 estimate();
70 }
71
cb_cap105_txt_to(Fl_Input2 *,void *)72 static void cb_cap105_txt_to(Fl_Input2*, void*) {
73 cap105_cb_filter_input(cap105_txt_to);
74 estimate();
75 }
76
cb_cap105_txt_info(Fl_Input2 *,void *)77 static void cb_cap105_txt_info(Fl_Input2*, void*) {
78 cap105_cb_filter_input(cap105_txt_info);
79 estimate();
80 }
81
cb_cap105_txt_subj(Fl_Input2 *,void *)82 static void cb_cap105_txt_subj(Fl_Input2*, void*) {
83 cap105_cb_filter_input(cap105_txt_subj);
84 estimate();
85 }
86
cb_cap105_txt_rcvop(Fl_Input2 *,void *)87 static void cb_cap105_txt_rcvop(Fl_Input2*, void*) {
88 cap105_cb_filter_input(cap105_txt_rcvop);
89 estimate();
90 }
91
cb_cap105_txt_sendop(Fl_Input2 *,void *)92 static void cb_cap105_txt_sendop(Fl_Input2*, void*) {
93 cap105_cb_filter_input(cap105_txt_sendop);
94 estimate();
95 }
96
cb_cap105_txt_rcvd_fm(Fl_Input2 *,void *)97 static void cb_cap105_txt_rcvd_fm (Fl_Input2*, void*) {
98 cap105_cb_filter_input(cap105_txt_rcvd_fm);
99 estimate();
100 }
101
cb_cap105_txt_sent_to(Fl_Input2 *,void *)102 static void cb_cap105_txt_sent_to (Fl_Input2*, void*) {
103 cap105_cb_filter_input(cap105_txt_sent_to);
104 estimate();
105 }
106
cb_cap105_btn_dtm(Fl_Button *,void *)107 static void cb_cap105_btn_dtm(Fl_Button*, void*) {
108 cap105_cb_set_dtm();
109 estimate();
110 }
111
cb_cap105_btn_rcvd_dtm(Fl_Button *,void *)112 static void cb_cap105_btn_rcvd_dtm(Fl_Button*, void*) {
113 cap105_cb_set_rcvd_dtm();
114 estimate();
115 }
116
cb_cap105_btn_sent_dtm(Fl_Button *,void *)117 static void cb_cap105_btn_sent_dtm(Fl_Button*, void*) {
118 cap105_cb_set_sent_dtm();
119 estimate();
120 }
121
cb_cap105_txt_msg(FTextEdit *,void *)122 static void cb_cap105_txt_msg(FTextEdit*, void*) {
123 cap105_btn_check->labelcolor(FL_RED);
124 cap105_btn_check->redraw_label();
125 estimate();
126 }
127
cb_cap105_btn_check(Fl_Button *,void *)128 static void cb_cap105_btn_check(Fl_Button*, void*) {
129 cap105_cb_check();
130 }
131
cap105_changed(Fl_Widget *,void *)132 void cap105_changed(Fl_Widget *, void *)
133 {
134 estimate();
135 }
136
create_cap105_tab()137 void create_cap105_tab()
138 {
139 int Y = tab_top;
140 tab_cap105 = new Fl_Group(0, Y, 570, 380);
141 tab_cap105->align(FL_ALIGN_TOP);
142
143 Y += 4;
144 cap105_txt_nbr = new Fl_Input2(80, Y, 80, 22, _("MSG NR:"));
145 cap105_txt_nbr->tooltip(_("* Optional Field\nMessage number at station of origin"));
146 cap105_txt_nbr->box(FL_DOWN_BOX);
147 cap105_txt_nbr->color((Fl_Color)FL_BACKGROUND2_COLOR);
148 cap105_txt_nbr->selection_color((Fl_Color)FL_SELECTION_COLOR);
149 cap105_txt_nbr->labeltype(FL_NORMAL_LABEL);
150 cap105_txt_nbr->labelfont(0);
151 cap105_txt_nbr->labelsize(14);
152 cap105_txt_nbr->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
153 cap105_txt_nbr->callback((Fl_Callback*)cb_cap105_txt_nbr);
154 cap105_txt_nbr->align(FL_ALIGN_LEFT);
155 cap105_txt_nbr->callback(cap105_changed);
156 cap105_txt_nbr->when(FL_WHEN_CHANGED);
157
158 Y += 24;
159 cap105_sel_prec = new Fl_ListBox(80, Y, 120, 22, _("PREC"));
160 cap105_sel_prec->tooltip(_("Message Precedence"));
161 cap105_sel_prec->align(FL_ALIGN_LEFT);
162
163 Y += 24;
164 cap105_txt_dtm = new Fl_Input2(80, Y, 160, 22, _("DTG:"));
165 cap105_txt_dtm->tooltip(_("Date of filing"));
166 cap105_txt_dtm->box(FL_DOWN_BOX);
167 cap105_txt_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
168 cap105_txt_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
169 cap105_txt_dtm->labeltype(FL_NORMAL_LABEL);
170 cap105_txt_dtm->labelfont(0);
171 cap105_txt_dtm->labelsize(14);
172 cap105_txt_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
173 cap105_txt_dtm->align(FL_ALIGN_LEFT);
174 cap105_txt_dtm->callback(cap105_changed);
175 cap105_txt_dtm->when(FL_WHEN_CHANGED);
176
177 cap105_btn_dtm = new Fl_Button(244, Y, 20, 20, _("..."));
178 cap105_btn_dtm->tooltip(_("Today's date time group"));
179 cap105_btn_dtm->callback((Fl_Callback*)cb_cap105_btn_dtm);
180
181 Y += 24;
182 cap105_txt_from = new Fl_Input2(80, Y, 250, 22, _("FROM:"));
183 cap105_txt_from->tooltip(_("Station call sign / name"));
184 cap105_txt_from->box(FL_DOWN_BOX);
185 cap105_txt_from->color((Fl_Color)FL_BACKGROUND2_COLOR);
186 cap105_txt_from->selection_color((Fl_Color)FL_SELECTION_COLOR);
187 cap105_txt_from->labeltype(FL_NORMAL_LABEL);
188 cap105_txt_from->labelfont(0);
189 cap105_txt_from->labelsize(14);
190 cap105_txt_from->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
191 cap105_txt_from->callback((Fl_Callback*)cb_cap105_txt_from);
192 cap105_txt_from->align(FL_ALIGN_LEFT);
193 cap105_txt_from->when(FL_WHEN_CHANGED);
194
195 Y += 24;
196 cap105_txt_to = new Fl_Input2(80, Y, 486, 22, _("TO"));
197 cap105_txt_to->tooltip(_("Addressee"));
198 cap105_txt_to->type(4);
199 cap105_txt_to->box(FL_DOWN_BOX);
200 cap105_txt_to->color((Fl_Color)FL_BACKGROUND2_COLOR);
201 cap105_txt_to->selection_color((Fl_Color)FL_SELECTION_COLOR);
202 cap105_txt_to->labeltype(FL_NORMAL_LABEL);
203 cap105_txt_to->labelfont(0);
204 cap105_txt_to->labelsize(14);
205 cap105_txt_to->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
206 cap105_txt_to->callback((Fl_Callback*)cb_cap105_txt_to);
207 cap105_txt_to->align(FL_ALIGN_LEFT);
208 cap105_txt_to->when(FL_WHEN_CHANGED);
209
210 Y += 24;
211 cap105_txt_info = new Fl_Input2(80, Y, 486, 22, _("INFO:"));
212 cap105_txt_info->tooltip(_("* Optional Field\nInfo addressee(s)"));
213 cap105_txt_info->type(4);
214 cap105_txt_info->box(FL_DOWN_BOX);
215 cap105_txt_info->color((Fl_Color)FL_BACKGROUND2_COLOR);
216 cap105_txt_info->selection_color((Fl_Color)FL_SELECTION_COLOR);
217 cap105_txt_info->labeltype(FL_NORMAL_LABEL);
218 cap105_txt_info->labelfont(0);
219 cap105_txt_info->labelsize(14);
220 cap105_txt_info->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
221 cap105_txt_info->callback((Fl_Callback*)cb_cap105_txt_info);
222 cap105_txt_info->align(FL_ALIGN_LEFT);
223 cap105_txt_info->when(FL_WHEN_CHANGED);
224
225 Y += 24;
226 cap105_txt_subj = new Fl_Input2(80, Y, 486, 22, _("SUBJ:"));
227 cap105_txt_subj->tooltip(_("* Optional Field\nMessage subject"));
228 cap105_txt_subj->type(4);
229 cap105_txt_subj->box(FL_DOWN_BOX);
230 cap105_txt_subj->color((Fl_Color)FL_BACKGROUND2_COLOR);
231 cap105_txt_subj->selection_color((Fl_Color)FL_SELECTION_COLOR);
232 cap105_txt_subj->labeltype(FL_NORMAL_LABEL);
233 cap105_txt_subj->labelfont(0);
234 cap105_txt_subj->labelsize(14);
235 cap105_txt_subj->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
236 cap105_txt_subj->callback((Fl_Callback*)cb_cap105_txt_subj);
237 cap105_txt_subj->align(FL_ALIGN_LEFT);
238 cap105_txt_subj->when(FL_WHEN_CHANGED);
239
240 Y += 24;
241 cap105_txt_grpcnt = new Fl_Input2(488, Y, 50, 22, _("GROUP COUNT"));
242 cap105_txt_grpcnt->tooltip(_("* Optional Field\n# words in message"));
243 cap105_txt_grpcnt->box(FL_DOWN_BOX);
244 cap105_txt_grpcnt->color((Fl_Color)FL_BACKGROUND2_COLOR);
245 cap105_txt_grpcnt->selection_color((Fl_Color)FL_SELECTION_COLOR);
246 cap105_txt_grpcnt->labeltype(FL_NORMAL_LABEL);
247 cap105_txt_grpcnt->labelfont(0);
248 cap105_txt_grpcnt->labelsize(14);
249 cap105_txt_grpcnt->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
250 cap105_txt_grpcnt->align(FL_ALIGN_LEFT);
251 cap105_txt_grpcnt->callback(cap105_changed);
252 cap105_txt_grpcnt->when(FL_WHEN_CHANGED);
253
254 cap105_btn_check = new Fl_Button(544, Y, 22, 22, _("ck"));
255 cap105_btn_check->tooltip(_("* Optional Field\nCompute group count"));
256 cap105_btn_check->callback((Fl_Callback*)cb_cap105_btn_check);
257
258 Y += 24;
259 cap105_txt_msg = new FTextEdit(4, Y, 562, 118, _("MESSAGE"));
260 cap105_txt_msg->tooltip(_("Message contents"));
261 cap105_txt_msg->box(FL_DOWN_BOX);
262 cap105_txt_msg->color((Fl_Color)FL_BACKGROUND2_COLOR);
263 cap105_txt_msg->selection_color((Fl_Color)FL_SELECTION_COLOR);
264 cap105_txt_msg->labeltype(FL_NORMAL_LABEL);
265 cap105_txt_msg->labelfont(0);
266 cap105_txt_msg->labelsize(14);
267 cap105_txt_msg->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
268 cap105_txt_msg->callback((Fl_Callback*)cb_cap105_txt_msg);
269 cap105_txt_msg->align(FL_ALIGN_TOP_LEFT);
270 cap105_txt_msg->callback(cap105_changed);
271 cap105_txt_msg->when(FL_WHEN_CHANGED);
272
273 Y += 122;
274 cap105_txt_rcvd_fm = new Fl_Input2(60, Y, 220, 22, _("FROM:"));
275 cap105_txt_rcvd_fm->tooltip(_("Call sign of sender"));
276 cap105_txt_rcvd_fm->box(FL_DOWN_BOX);
277 cap105_txt_rcvd_fm->color((Fl_Color)FL_BACKGROUND2_COLOR);
278 cap105_txt_rcvd_fm->selection_color((Fl_Color)FL_SELECTION_COLOR);
279 cap105_txt_rcvd_fm->labeltype(FL_NORMAL_LABEL);
280 cap105_txt_rcvd_fm->labelfont(0);
281 cap105_txt_rcvd_fm->labelsize(14);
282 cap105_txt_rcvd_fm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
283 cap105_txt_rcvd_fm->align(FL_ALIGN_LEFT);
284 cap105_txt_rcvd_fm->callback((Fl_Callback*)cb_cap105_txt_rcvd_fm);
285 cap105_txt_rcvd_fm->when(FL_WHEN_CHANGED);
286
287 cap105_txt_sent_to = new Fl_Input2(336, Y, 220, 22, _("TO:"));
288 cap105_txt_sent_to->tooltip(_("Call sign of sender"));
289 cap105_txt_sent_to->box(FL_DOWN_BOX);
290 cap105_txt_sent_to->color((Fl_Color)FL_BACKGROUND2_COLOR);
291 cap105_txt_sent_to->selection_color((Fl_Color)FL_SELECTION_COLOR);
292 cap105_txt_sent_to->labeltype(FL_NORMAL_LABEL);
293 cap105_txt_sent_to->labelfont(0);
294 cap105_txt_sent_to->labelsize(14);
295 cap105_txt_sent_to->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
296 cap105_txt_sent_to->align(FL_ALIGN_LEFT);
297 cap105_txt_sent_to->callback((Fl_Callback*)cb_cap105_txt_sent_to);
298 cap105_txt_sent_to->when(FL_WHEN_CHANGED);
299
300 Y += 24;
301 cap105_txt_rcvd_dtm = new Fl_Input2(60, Y, 160, 22, _("DTG:"));
302 cap105_txt_rcvd_dtm->tooltip(_("date of receipt"));
303 cap105_txt_rcvd_dtm->box(FL_DOWN_BOX);
304 cap105_txt_rcvd_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
305 cap105_txt_rcvd_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
306 cap105_txt_rcvd_dtm->labeltype(FL_NORMAL_LABEL);
307 cap105_txt_rcvd_dtm->labelfont(0);
308 cap105_txt_rcvd_dtm->labelsize(14);
309 cap105_txt_rcvd_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
310 cap105_txt_rcvd_dtm->align(FL_ALIGN_LEFT);
311 cap105_txt_rcvd_dtm->callback(cap105_changed);
312 cap105_txt_rcvd_dtm->when(FL_WHEN_CHANGED);
313
314 cap105_btn_rcvd_dtm = new Fl_Button(224, Y, 20, 20, _("..."));
315 cap105_btn_rcvd_dtm->tooltip(_("Today's date time group"));
316 cap105_btn_rcvd_dtm->callback((Fl_Callback*)cb_cap105_btn_rcvd_dtm);
317
318 cap105_txt_sent_dtm = new Fl_Input2(336, Y, 160, 22, _("DTG:"));
319 cap105_txt_sent_dtm->tooltip(_("date of receipt"));
320 cap105_txt_sent_dtm->box(FL_DOWN_BOX);
321 cap105_txt_sent_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
322 cap105_txt_sent_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
323 cap105_txt_sent_dtm->labeltype(FL_NORMAL_LABEL);
324 cap105_txt_sent_dtm->labelfont(0);
325 cap105_txt_sent_dtm->labelsize(14);
326 cap105_txt_sent_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
327 cap105_txt_sent_dtm->align(FL_ALIGN_LEFT);
328 cap105_txt_sent_dtm->callback(cap105_changed);
329 cap105_txt_sent_dtm->when(FL_WHEN_CHANGED);
330
331 cap105_btn_sent_dtm = new Fl_Button(500, Y, 20, 20, _("..."));
332 cap105_btn_sent_dtm->tooltip(_("Today's date time group"));
333 cap105_btn_sent_dtm->callback((Fl_Callback*)cb_cap105_btn_sent_dtm);
334
335 Y += 24;
336 cap105_txt_rcvop = new Fl_Input2(200, Y, 80, 22, _("RCVG OPERATOR INIT'S:"));
337 cap105_txt_rcvop->tooltip(_(""));
338 cap105_txt_rcvop->box(FL_DOWN_BOX);
339 cap105_txt_rcvop->color((Fl_Color)FL_BACKGROUND2_COLOR);
340 cap105_txt_rcvop->selection_color((Fl_Color)FL_SELECTION_COLOR);
341 cap105_txt_rcvop->labeltype(FL_NORMAL_LABEL);
342 cap105_txt_rcvop->labelfont(0);
343 cap105_txt_rcvop->labelsize(14);
344 cap105_txt_rcvop->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
345 cap105_txt_rcvop->align(FL_ALIGN_LEFT);
346 cap105_txt_rcvop->callback((Fl_Callback*)cb_cap105_txt_rcvop);
347 cap105_txt_rcvop->when(FL_WHEN_CHANGED);
348
349 cap105_txt_sendop = new Fl_Input2(476, Y, 80, 22, _("SNDG OPERATOR INIT'S:"));
350 cap105_txt_sendop->tooltip(_(""));
351 cap105_txt_sendop->box(FL_DOWN_BOX);
352 cap105_txt_sendop->color((Fl_Color)FL_BACKGROUND2_COLOR);
353 cap105_txt_sendop->selection_color((Fl_Color)FL_SELECTION_COLOR);
354 cap105_txt_sendop->labeltype(FL_NORMAL_LABEL);
355 cap105_txt_sendop->labelfont(0);
356 cap105_txt_sendop->labelsize(14);
357 cap105_txt_sendop->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
358 cap105_txt_sendop->align(FL_ALIGN_LEFT);
359 cap105_txt_sendop->callback((Fl_Callback*)cb_cap105_txt_sendop);
360 cap105_txt_sendop->when(FL_WHEN_CHANGED);
361
362 tab_cap105->end();
363 tab_cap105->hide();
364 }
365
366