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
28 Fl_Group *hics214_tab = (Fl_Group *)0;
29 Fl_Tabs *hics214_tab_type = (Fl_Tabs *)0;
30 Fl_Group *hics214_tab_1 = (Fl_Group *)0;
31 Fl_Input2 *hics214_txt_incident = (Fl_Input2 *)0;
32 Fl_Input2 *hics214_txt_date = (Fl_Input2 *)0;
33 Fl_Input2 *hics214_txt_sec_brch = (Fl_Input2 *)0;
34 Fl_Input2 *hics214_txt_position = (Fl_Input2 *)0;
35 Fl_Button *hics214_btn_date = (Fl_Button *)0;
36 Fl_Input2 *hics214_txt_time = (Fl_Input2 *)0;
37 Fl_Button *hics214_btn_time = (Fl_Button *)0;
38 Fl_Input2 *hics214_txt_op_period = (Fl_Input2 *)0;
39 Fl_Input2 *hics214_txt_prepared_by = (Fl_Input2 *)0;
40 Fl_Input2 *hics214_txt_facility = (Fl_Input2 *)0;
41
42 Fl_Group *hics214_tab_2 = (Fl_Group *)0;
43 Fl_Input2 *hics214_txt_activity_time[30]={(Fl_Input2 *)0};
44 Fl_Input2 *hics214_txt_activity_event[30]={(Fl_Input2 *)0};
45
cb_hics214_btn_date(Fl_Button *,void *)46 static void cb_hics214_btn_date(Fl_Button*, void*) {
47 hics214_cb_set_date();
48 }
49
cb_hics214_btn_time(Fl_Button *,void *)50 static void cb_hics214_btn_time(Fl_Button*, void*) {
51 hics214_cb_set_time();
52 }
53
54
create_hics214_tab()55 void create_hics214_tab()
56 {
57 int Y = tab_top;
58 hics214_tab = new Fl_Group(0, Y, 570, 390);
59 hics214_tab->align(FL_ALIGN_TOP);
60
61 hics214_tab_type = new Fl_Tabs(0, Y, 570, 387);
62 hics214_tab_type->selection_color((Fl_Color)246);
63
64 hics214_tab_1 = new Fl_Group(0, Y+25, 570, 360, _("Incident"));
65 {
66 Fl_Group* o = new Fl_Group(2, Y+32, 566, 170);
67 o->box(FL_ENGRAVED_FRAME);
68 o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
69
70 hics214_txt_incident = new Fl_Input2(135, Y+38, 425, 24, _("Incident Name"));
71 hics214_txt_incident->tooltip(_("Incident name"));
72 hics214_txt_incident->box(FL_DOWN_BOX);
73 hics214_txt_incident->color((Fl_Color)FL_BACKGROUND2_COLOR);
74 hics214_txt_incident->selection_color((Fl_Color)FL_SELECTION_COLOR);
75 hics214_txt_incident->labeltype(FL_NORMAL_LABEL);
76 hics214_txt_incident->labelfont(0);
77 hics214_txt_incident->labelsize(14);
78 hics214_txt_incident->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
79 hics214_txt_incident->align(FL_ALIGN_LEFT);
80 hics214_txt_incident->callback(hics_changed);
81 hics214_txt_incident->when(FL_WHEN_CHANGED);
82
83 hics214_txt_date = new Fl_Input2(135, Y+65, 155, 24, _("Date Prepared"));
84 hics214_txt_date->tooltip(_("Date prepared"));
85 hics214_txt_date->box(FL_DOWN_BOX);
86 hics214_txt_date->color((Fl_Color)FL_BACKGROUND2_COLOR);
87 hics214_txt_date->selection_color((Fl_Color)FL_SELECTION_COLOR);
88 hics214_txt_date->labeltype(FL_NORMAL_LABEL);
89 hics214_txt_date->labelfont(0);
90 hics214_txt_date->labelsize(14);
91 hics214_txt_date->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
92 hics214_txt_date->align(FL_ALIGN_LEFT);
93 hics214_txt_date->callback(hics_changed);
94 hics214_txt_date->when(FL_WHEN_CHANGED);
95
96 hics214_btn_date = new Fl_Button(294, Y+67, 20, 20, _("..."));
97 hics214_btn_date->tooltip(_("Set today"));
98 hics214_btn_date->callback((Fl_Callback*)cb_hics214_btn_date);
99
100 hics214_txt_time = new Fl_Input2(135, Y+90, 103, 24, _("Time Prepared"));
101 hics214_txt_time->tooltip(_("Time prepared"));
102 hics214_txt_time->box(FL_DOWN_BOX);
103 hics214_txt_time->color((Fl_Color)FL_BACKGROUND2_COLOR);
104 hics214_txt_time->selection_color((Fl_Color)FL_SELECTION_COLOR);
105 hics214_txt_time->labeltype(FL_NORMAL_LABEL);
106 hics214_txt_time->labelfont(0);
107 hics214_txt_time->labelsize(14);
108 hics214_txt_time->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
109 hics214_txt_time->align(FL_ALIGN_LEFT);
110 hics214_txt_time->callback(hics_changed);
111 hics214_txt_time->when(FL_WHEN_CHANGED);
112
113 hics214_btn_time = new Fl_Button(247, Y+92, 20, 20, _("..."));
114 hics214_btn_time->tooltip(_("Set time now"));
115 hics214_btn_time->callback((Fl_Callback*)cb_hics214_btn_time);
116
117 hics214_txt_sec_brch = new Fl_Input2(135, Y+115, 425, 24, _("Unit Name"));
118 hics214_txt_sec_brch->tooltip(_("Name / Designation"));
119 hics214_txt_sec_brch->box(FL_DOWN_BOX);
120 hics214_txt_sec_brch->color((Fl_Color)FL_BACKGROUND2_COLOR);
121 hics214_txt_sec_brch->selection_color((Fl_Color)FL_SELECTION_COLOR);
122 hics214_txt_sec_brch->labeltype(FL_NORMAL_LABEL);
123 hics214_txt_sec_brch->labelfont(0);
124 hics214_txt_sec_brch->labelsize(14);
125 hics214_txt_sec_brch->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
126 hics214_txt_sec_brch->align(FL_ALIGN_LEFT);
127 hics214_txt_sec_brch->callback(hics_changed);
128 hics214_txt_sec_brch->when(FL_WHEN_CHANGED);
129
130 hics214_txt_position = new Fl_Input2(135, Y+140, 425, 24, _("Unit leader"));
131 hics214_txt_position->tooltip(_("Name and Position"));
132 hics214_txt_position->box(FL_DOWN_BOX);
133 hics214_txt_position->color((Fl_Color)FL_BACKGROUND2_COLOR);
134 hics214_txt_position->selection_color((Fl_Color)FL_SELECTION_COLOR);
135 hics214_txt_position->labeltype(FL_NORMAL_LABEL);
136 hics214_txt_position->labelfont(0);
137 hics214_txt_position->labelsize(14);
138 hics214_txt_position->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
139 hics214_txt_position->align(FL_ALIGN_LEFT);
140 hics214_txt_position->callback(hics_changed);
141 hics214_txt_position->when(FL_WHEN_CHANGED);
142
143 hics214_txt_op_period = new Fl_Input2(135, Y+165, 425, 24, _("Oper\' Period"));
144 hics214_txt_op_period->tooltip(_("Date / Time"));
145 hics214_txt_op_period->box(FL_DOWN_BOX);
146 hics214_txt_op_period->color((Fl_Color)FL_BACKGROUND2_COLOR);
147 hics214_txt_op_period->selection_color((Fl_Color)FL_SELECTION_COLOR);
148 hics214_txt_op_period->labeltype(FL_NORMAL_LABEL);
149 hics214_txt_op_period->labelfont(0);
150 hics214_txt_op_period->labelsize(14);
151 hics214_txt_op_period->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
152 hics214_txt_op_period->align(FL_ALIGN_LEFT);
153 hics214_txt_op_period->callback(hics_changed);
154 hics214_txt_op_period->when(FL_WHEN_CHANGED);
155
156 o->end();
157 }
158
159 {
160 Fl_Group* o = new Fl_Group(2, Y+203, 566, 60);
161 o->box(FL_ENGRAVED_FRAME);
162
163 hics214_txt_prepared_by = new Fl_Input2(135, Y+208, 425, 24, _("Prepared By"));
164 hics214_txt_prepared_by->tooltip(_("Name and Position"));
165 hics214_txt_prepared_by->box(FL_DOWN_BOX);
166 hics214_txt_prepared_by->color((Fl_Color)FL_BACKGROUND2_COLOR);
167 hics214_txt_prepared_by->selection_color((Fl_Color)FL_SELECTION_COLOR);
168 hics214_txt_prepared_by->labeltype(FL_NORMAL_LABEL);
169 hics214_txt_prepared_by->labelfont(0);
170 hics214_txt_prepared_by->labelsize(14);
171 hics214_txt_prepared_by->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
172 hics214_txt_prepared_by->align(FL_ALIGN_LEFT);
173 hics214_txt_prepared_by->callback(hics_changed);
174 hics214_txt_prepared_by->when(FL_WHEN_CHANGED);
175
176 hics214_txt_facility = new Fl_Input2(135, Y+234, 425, 24, _("Facility"));
177 hics214_txt_facility->tooltip(_(""));
178 hics214_txt_facility->box(FL_DOWN_BOX);
179 hics214_txt_facility->color((Fl_Color)FL_BACKGROUND2_COLOR);
180 hics214_txt_facility->selection_color((Fl_Color)FL_SELECTION_COLOR);
181 hics214_txt_facility->labeltype(FL_NORMAL_LABEL);
182 hics214_txt_facility->labelfont(0);
183 hics214_txt_facility->labelsize(14);
184 hics214_txt_facility->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
185 hics214_txt_facility->align(FL_ALIGN_LEFT);
186 hics214_txt_facility->callback(hics_changed);
187 hics214_txt_facility->when(FL_WHEN_CHANGED);
188
189 o->end();
190 }
191
192 hics214_tab_1->end();
193
194 hics214_tab_2 = new Fl_Group(0, Y+25, 570, 360, _("Activity Log"));
195 hics214_tab_2->hide();
196 hics214_tab_2->hide();
197
198 Fl_Group *sg1 = new Fl_Group(5, Y+32, 560, 350);
199 sg1->box(FL_FLAT_BOX);
200
201 Fl_Box* bx1 = new Fl_Box(5, Y+32, 100, 20, _("Time"));
202 bx1->box(FL_THIN_DOWN_BOX);
203 bx1->color((Fl_Color)215);
204
205 Fl_Box* bx2 = new Fl_Box(bx1->x() + bx1->w(), Y+32, 440, 20, _("Major Events"));
206 bx2->box(FL_THIN_DOWN_BOX);
207 bx2->color((Fl_Color)215);
208
209 Fl_Scroll* sc1 = new Fl_Scroll(4, Y+54, 560, 320);
210 sc1->type(2);
211 sc1->box(FL_THIN_DOWN_BOX);
212
213 for (int i = 0; i < 30; i++) {
214 hics214_txt_activity_time[i] = new Fl_Input2(5, Y+54 + i*24, 100, 24);
215 hics214_txt_activity_time[i]->tooltip(_(""));
216 hics214_txt_activity_time[i]->box(FL_DOWN_BOX);
217 hics214_txt_activity_time[i]->color((Fl_Color)FL_BACKGROUND2_COLOR);
218 hics214_txt_activity_time[i]->selection_color((Fl_Color)FL_SELECTION_COLOR);
219 hics214_txt_activity_time[i]->labeltype(FL_NORMAL_LABEL);
220 hics214_txt_activity_time[i]->labelfont(0);
221 hics214_txt_activity_time[i]->labelsize(14);
222 hics214_txt_activity_time[i]->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
223 hics214_txt_activity_time[i]->align(FL_ALIGN_CENTER);
224 hics214_txt_activity_time[i]->when(FL_WHEN_CHANGED);
225 hics214_txt_activity_event[i] = new Fl_Input2(106, Y+54 + i*24, 442, 24);
226 hics214_txt_activity_event[i]->tooltip(_(""));
227 hics214_txt_activity_event[i]->box(FL_DOWN_BOX);
228 hics214_txt_activity_event[i]->color((Fl_Color)FL_BACKGROUND2_COLOR);
229 hics214_txt_activity_event[i]->selection_color((Fl_Color)FL_SELECTION_COLOR);
230 hics214_txt_activity_event[i]->labeltype(FL_NORMAL_LABEL);
231 hics214_txt_activity_event[i]->labelfont(0);
232 hics214_txt_activity_event[i]->labelsize(14);
233 hics214_txt_activity_event[i]->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
234 hics214_txt_activity_event[i]->align(FL_ALIGN_CENTER);
235 hics214_txt_activity_event[i]->callback(hics_changed);
236 hics214_txt_activity_event[i]->when(FL_WHEN_CHANGED);
237 }
238 sc1->end();
239 sg1->end();
240 Fl_Group *sg2 = new Fl_Group(565, Y+32, 1, 350);
241 sg2->box(FL_FLAT_BOX);
242 sg2->end();
243
244 hics214_tab_2->end();
245 hics214_tab_2->resizable(sg2);
246
247 hics214_tab_type->end();
248 Fl_Group::current()->resizable(hics214_tab_type);
249 hics214_tab->end();
250
251 hics214_tab->hide();
252
253 }
254