| 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 <string> |
| 22 |
|
| 23 |
#include "gettext.h" |
| 24 |
#include "status.h" |
| 25 |
#include "util.h" |
| 26 |
|
| 27 |
#include "flmsg_dialog.h" |
| 28 |
#include "flmsg.h" |
| 29 |
#include "fileselect.h" |
| 30 |
#include "calendar.h" |
| 31 |
#include "wx_strings.h" |
| 32 |
|
| 33 |
Fl_Group *tab_storm = (Fl_Group *)0; |
| 34 |
Fl_Tabs *tab_storm_type = (Fl_Tabs *)0; |
| 35 |
|
| 36 |
Fl_Group *tab_storm_1 = (Fl_Group *)0; |
| 37 |
|
| 38 |
Fl_DateInput *w_storm_date = (Fl_DateInput *)0; |
| 39 |
Fl_Input2 *w_storm_time = (Fl_Input2 *)0; |
| 40 |
Fl_Button *w_storm_btn_time = (Fl_Button *)0; |
| 41 |
Fl_ListBox *w_storm_zone = (Fl_ListBox *)0; |
| 42 |
|
| 43 |
Fl_ListBox *w_storm_state = (Fl_ListBox *)0; |
| 44 |
Fl_ListBox *w_storm_county = (Fl_ListBox *)0; |
| 45 |
Fl_Input2 *w_storm_location = (Fl_Input2 *)0; |
| 46 |
|
| 47 |
Fl_Button *use_storm_default = (Fl_Button *)0; |
| 48 |
Fl_Button *make_storm_default = (Fl_Button *)0; |
| 49 |
|
| 50 |
Fl_Check_Button *w_storm_tornado = (Fl_Check_Button *)0; |
| 51 |
Fl_ListBox *w_storm_tornado_cat = (Fl_ListBox *)0; |
| 52 |
|
| 53 |
Fl_Check_Button *w_storm_hail = (Fl_Check_Button *)0; |
| 54 |
Fl_ListBox *w_storm_hail_size = (Fl_ListBox *)0; |
| 55 |
|
| 56 |
Fl_Check_Button *w_storm_wind = (Fl_Check_Button *)0; |
| 57 |
Fl_ListBox *w_storm_wind_cat = (Fl_ListBox *)0;; |
| 58 |
|
| 59 |
Fl_Check_Button *w_storm_flood = (Fl_Check_Button *)0; |
| 60 |
Fl_ListBox *w_storm_flood_cat = (Fl_ListBox *)0; |
| 61 |
|
| 62 |
Fl_Check_Button *w_storm_damage = (Fl_Check_Button *)0; |
| 63 |
Fl_ListBox *w_storm_damage_cat = (Fl_ListBox *)0; |
| 64 |
|
| 65 |
Fl_Check_Button *w_storm_snow = (Fl_Check_Button *)0; |
| 66 |
Fl_ListBox *w_storm_snow_tot = (Fl_ListBox *)0; |
| 67 |
Fl_ListBox *w_storm_snow_dur = (Fl_ListBox *)0; |
| 68 |
|
| 69 |
Fl_Check_Button *w_storm_f_rain = (Fl_Check_Button *)0; |
| 70 |
Fl_ListBox *w_storm_f_rain_tot = (Fl_ListBox *)0; |
| 71 |
Fl_ListBox *w_storm_f_rain_dur = (Fl_ListBox *)0; |
| 72 |
|
| 73 |
Fl_Check_Button *w_storm_h_rain = (Fl_Check_Button *)0; |
| 74 |
Fl_ListBox *w_storm_h_rain_tot = (Fl_ListBox *)0; |
| 75 |
Fl_ListBox *w_storm_h_rain_dur = (Fl_ListBox *)0; |
| 76 |
|
| 77 |
Fl_Input2 *w_storm_o_name = (Fl_Input2 *)0; |
| 78 |
Fl_Input2 *w_storm_o_email = (Fl_Input2 *)0; |
| 79 |
Fl_Input2 *w_storm_o_tele = (Fl_Input2 *)0; |
| 80 |
Fl_ListBox *w_storm_o_profile = (Fl_ListBox *)0; |
| 81 |
|
| 82 |
Fl_Group *tab_storm_2 = (Fl_Group *)0; |
| 83 |
FTextEdit *w_storm_details = (FTextEdit *)0; |
| 84 |
|
| 85 |
//---------------------------------------------------------------------- |
| 86 |
|
| 87 |
// widget callbacks & support |
| 88 |
|
| 89 |
//---------------------------------------------------------------------- |
| 90 |
|
| 91 |
void set_storm_counties(int ndx) |
| 92 |
{ |
| 93 |
std::string st = states[ndx]; |
| 94 |
size_t p = st.find(','); |
| 95 |
if (p != std::string::npos) { |
| 96 |
st.erase(p+1); |
| 97 |
size_t p1 = counties.find(st); |
| 98 |
size_t p2 = counties.rfind(st); |
| 99 |
std::string cnty = counties.substr(p1+3, p2 - p1 - 3); |
| 100 |
size_t pc = cnty.find(','); |
| 101 |
p1 = 0; |
| 102 |
w_storm_county->clear(); |
| 103 |
while (pc != std::string::npos) { |
| 104 |
w_storm_county->add(cnty.substr(p1, pc - p1).c_str()); |
| 105 |
p1 = pc + 1; |
| 106 |
pc = cnty.find(',', pc + 1); |
| 107 |
} |
| 108 |
} |
| 109 |
w_storm_county->index(0); |
| 110 |
} |
| 111 |
|
| 112 |
static void set_storm_combos() |
| 113 |
{ |
| 114 |
w_storm_state->clear(); |
| 115 |
for (int i = 0; i < numstates; i++) { |
| 116 |
if (i == 0) |
| 117 |
w_storm_state->add("--Select State--"); |
| 118 |
else |
| 119 |
w_storm_state->add(states[i].c_str()); |
| 120 |
} |
| 121 |
w_storm_state->index(0); |
| 122 |
|
| 123 |
w_storm_zone->clear(); |
| 124 |
for (int i = 0; i < num_us_tzones; i++) |
| 125 |
w_storm_zone->add(us_tzones[i].c_str()); |
| 126 |
w_storm_zone->index(0); |
| 127 |
|
| 128 |
w_storm_flood_cat->clear(); |
| 129 |
for (int i = 0; i < num_flood_categories; i++) |
| 130 |
w_storm_flood_cat->add(flood_categories[i].c_str()); |
| 131 |
w_storm_flood_cat->index(0); |
| 132 |
|
| 133 |
w_storm_hail_size->clear(); |
| 134 |
for (int i = 0; i < num_hail_size; i++) |
| 135 |
w_storm_hail_size->add(hail_size[i].c_str()); |
| 136 |
w_storm_hail_size->index(0); |
| 137 |
|
| 138 |
w_storm_tornado_cat->clear(); |
| 139 |
for (int i = 0; i < num_tornado_categories; i++) |
| 140 |
w_storm_tornado_cat->add(tornado_categories[i].c_str()); |
| 141 |
w_storm_tornado_cat->index(0); |
| 142 |
|
| 143 |
w_storm_wind_cat->clear(); |
| 144 |
for (int i = 0; i < num_wind_speeds; i++) |
| 145 |
w_storm_wind_cat->add(wind_speeds[i].c_str()); |
| 146 |
w_storm_wind_cat->index(0); |
| 147 |
|
| 148 |
w_storm_damage_cat->clear(); |
| 149 |
for (int i = 0; i < num_damage; i++) |
| 150 |
w_storm_damage_cat->add(damage[i].c_str()); |
| 151 |
w_storm_damage_cat->index(0); |
| 152 |
|
| 153 |
w_storm_snow_dur->clear(); |
| 154 |
for (int i = 0; i < num_snow_dur; i++) |
| 155 |
w_storm_snow_dur->add(snow_dur[i].c_str()); |
| 156 |
w_storm_snow_dur->index(0); |
| 157 |
|
| 158 |
w_storm_snow_tot->clear(); |
| 159 |
for (int i = 0; i < num_snow_tot; i++) |
| 160 |
w_storm_snow_tot->add(snow_tot[i].c_str()); |
| 161 |
w_storm_snow_tot->index(0); |
| 162 |
|
| 163 |
w_storm_f_rain_dur->clear(); |
| 164 |
for (int i = 0; i < num_ice_dur; i++) |
| 165 |
w_storm_f_rain_dur->add(ice_dur[i].c_str()); |
| 166 |
w_storm_f_rain_dur->index(0); |
| 167 |
|
| 168 |
w_storm_f_rain_tot->clear(); |
| 169 |
for (int i = 0; i < num_ice_tot; i++) |
| 170 |
w_storm_f_rain_tot->add(ice_tot[i].c_str()); |
| 171 |
w_storm_f_rain_tot->index(0); |
| 172 |
|
| 173 |
w_storm_h_rain_dur->clear(); |
| 174 |
for (int i = 0; i < num_rainfall_dur; i++) |
| 175 |
w_storm_h_rain_dur->add(rainfall_dur[i].c_str()); |
| 176 |
w_storm_h_rain_dur->index(0); |
| 177 |
|
| 178 |
w_storm_h_rain_tot->clear(); |
| 179 |
for (int i = 0; i < num_rainfall; i++) |
| 180 |
w_storm_h_rain_tot->add(rainfall[i].c_str()); |
| 181 |
w_storm_h_rain_tot->index(0); |
| 182 |
|
| 183 |
w_storm_o_profile->clear(); |
| 184 |
for (int i = 0; i < num_profiles; i++) |
| 185 |
w_storm_o_profile->add(profiles[i].c_str()); |
| 186 |
w_storm_o_profile->index(0); |
| 187 |
|
| 188 |
set_storm_counties(0); |
| 189 |
} |
| 190 |
|
| 191 |
static void cb_btn_time(Fl_Button*, void*) { |
| 192 |
w_storm_time->value(szTime(7)); |
| 193 |
} |
| 194 |
|
| 195 |
static void cb_make_storm_default(Fl_Button*, void*) |
| 196 |
{ |
| 197 |
progStatus.swx_index_default_county = w_storm_county->index(); |
| 198 |
progStatus.swx_index_default_state = w_storm_state->index(); |
| 199 |
progStatus.swx_default_location = w_storm_location->value(); |
| 200 |
progStatus.swx_default_zone = w_storm_zone->value(); |
| 201 |
progStatus.swx_default_profile = w_storm_o_profile->value(); |
| 202 |
} |
| 203 |
|
| 204 |
static void cb_use_storm_default(Fl_Button*, void*) |
| 205 |
{ |
| 206 |
w_storm_state->index(progStatus.swx_index_default_state); |
| 207 |
set_storm_counties(progStatus.swx_index_default_state); |
| 208 |
w_storm_county->index(progStatus.swx_index_default_county); |
| 209 |
w_storm_location->value(progStatus.swx_default_location.c_str()); |
| 210 |
w_storm_zone->value(progStatus.swx_default_zone.c_str()); |
| 211 |
w_storm_o_name->value(progStatus.my_name.c_str()); |
| 212 |
w_storm_o_tele->value(progStatus.my_tel.c_str()); |
| 213 |
w_storm_o_email->value(progStatus.my_email.c_str()); |
| 214 |
w_storm_o_profile->value(progStatus.swx_default_profile.c_str()); |
| 215 |
} |
| 216 |
|
| 217 |
void storm_changed(Fl_Widget *, void *) |
| 218 |
{ |
| 219 |
estimate(); |
| 220 |
} |
| 221 |
|
| 222 |
void cb_storm_state(Fl_Widget *, void *) |
| 223 |
{ |
| 224 |
int n = w_storm_state->index(); |
| 225 |
set_storm_counties(n); |
| 226 |
estimate(); |
| 227 |
} |
| 228 |
|
| 229 |
void cb_flood(Fl_Widget *, void *) |
| 230 |
{ |
| 231 |
w_storm_flood_cat->index(0); |
| 232 |
if (w_storm_flood->value()) |
| 233 |
w_storm_flood_cat->activate(); |
| 234 |
else |
| 235 |
w_storm_flood_cat->deactivate(); |
| 236 |
estimate(); |
| 237 |
} |
| 238 |
|
| 239 |
void cb_hail(Fl_Widget *, void *) |
| 240 |
{ |
| 241 |
w_storm_hail_size->index(0); |
| 242 |
if (w_storm_hail->value()) |
| 243 |
w_storm_hail_size->activate(); |
| 244 |
else |
| 245 |
w_storm_hail_size->deactivate(); |
| 246 |
estimate(); |
| 247 |
} |
| 248 |
|
| 249 |
void cb_high_wind(Fl_Widget *, void *) |
| 250 |
{ |
| 251 |
w_storm_wind_cat->index(0); |
| 252 |
if (w_storm_wind->value()) |
| 253 |
w_storm_wind_cat->activate(); |
| 254 |
else |
| 255 |
w_storm_wind_cat->deactivate(); |
| 256 |
estimate(); |
| 257 |
} |
| 258 |
|
| 259 |
void cb_tornado(Fl_Widget *, void *) |
| 260 |
{ |
| 261 |
w_storm_tornado_cat->index(0); |
| 262 |
if (w_storm_tornado->value()) |
| 263 |
w_storm_tornado_cat->activate(); |
| 264 |
else |
| 265 |
w_storm_tornado_cat->deactivate(); |
| 266 |
estimate(); |
| 267 |
} |
| 268 |
|
| 269 |
void cb_damage(Fl_Widget *, void *) |
| 270 |
{ |
| 271 |
w_storm_damage_cat->index(0); |
| 272 |
if (w_storm_damage->value()) |
| 273 |
w_storm_damage_cat->activate(); |
| 274 |
else |
| 275 |
w_storm_damage_cat->deactivate(); |
| 276 |
estimate(); |
| 277 |
} |
| 278 |
|
| 279 |
void cb_snow(Fl_Widget *, void *) |
| 280 |
{ |
| 281 |
w_storm_snow_tot->index(0); |
| 282 |
w_storm_snow_dur->index(0); |
| 283 |
if (w_storm_snow->value()) { |
| 284 |
w_storm_snow_tot->activate(); |
| 285 |
w_storm_snow_dur->activate(); |
| 286 |
} else { |
| 287 |
w_storm_snow_tot->deactivate(); |
| 288 |
w_storm_snow_dur->deactivate(); |
| 289 |
} |
| 290 |
estimate(); |
| 291 |
} |
| 292 |
|
| 293 |
void cb_f_rain(Fl_Widget *, void *) |
| 294 |
{ |
| 295 |
w_storm_f_rain_tot->index(0); |
| 296 |
w_storm_f_rain_dur->index(0); |
| 297 |
if (w_storm_f_rain->value()) { |
| 298 |
w_storm_f_rain_tot->activate(); |
| 299 |
w_storm_f_rain_dur->activate(); |
| 300 |
} else { |
| 301 |
w_storm_f_rain_tot->deactivate(); |
| 302 |
w_storm_f_rain_dur->deactivate(); |
| 303 |
} |
| 304 |
estimate(); |
| 305 |
} |
| 306 |
|
| 307 |
void cb_h_rain(Fl_Widget *, void *) |
| 308 |
{ |
| 309 |
w_storm_h_rain_tot->index(0); |
| 310 |
w_storm_h_rain_dur->index(0); |
| 311 |
if (w_storm_h_rain->value()) { |
| 312 |
w_storm_h_rain_tot->activate(); |
| 313 |
w_storm_h_rain_dur->activate(); |
| 314 |
} else { |
| 315 |
w_storm_h_rain_tot->deactivate(); |
| 316 |
w_storm_h_rain_dur->deactivate(); |
| 317 |
} |
| 318 |
estimate(); |
| 319 |
} |
| 320 |
|
| 321 |
void create_storm_tab() |
| 322 |
{ |
| 323 |
int Y = tab_top; |
| 324 |
tab_storm = new Fl_Group(0, Y, 570, 390, "tab_storm"); |
| 325 |
tab_storm->begin(); |
| 326 |
tab_storm->copy_label(""); |
| 327 |
tab_storm->align(FL_ALIGN_INSIDE); |
| 328 |
|
| 329 |
tab_storm_type = new Fl_Tabs(0, Y+2, 570, 387, "wx_tabs"); |
| 330 |
tab_storm_type->selection_color((Fl_Color)246); |
| 331 |
tab_storm_type->copy_label(""); |
| 332 |
tab_storm_type->align(FL_ALIGN_INSIDE); |
| 333 |
|
| 334 |
tab_storm_1 = new Fl_Group(0, Y+25, 570, 360, "Report"); |
| 335 |
tab_storm_1->begin(); |
| 336 |
|
| 337 |
Y += 35; |
| 338 |
|
| 339 |
w_storm_date = new Fl_DateInput(70, Y, 140, 22, _("Date")); |
| 340 |
w_storm_date->tooltip(_("Observation date : month/day/year")); |
| 341 |
w_storm_date->align(FL_ALIGN_LEFT); |
| 342 |
w_storm_date->box(FL_DOWN_BOX); |
| 343 |
w_storm_date->color((Fl_Color)FL_BACKGROUND2_COLOR); |
| 344 |
w_storm_date->selection_color((Fl_Color)FL_SELECTION_COLOR); |
| 345 |
w_storm_date->labeltype(FL_NORMAL_LABEL); |
| 346 |
w_storm_date->labelfont(0); |
| 347 |
w_storm_date->labelsize(14); |
| 348 |
w_storm_date->labelcolor((Fl_Color)FL_FOREGROUND_COLOR); |
| 349 |
w_storm_date->when(FL_WHEN_CHANGED); |
| 350 |
w_storm_date->callback(storm_changed); |
| 351 |
w_storm_date->local_datetime(); |
| 352 |
|
| 353 |
w_storm_time = new Fl_Input2(250, Y, 60, 22, _("Time")); |
| 354 |
w_storm_time->tooltip(_("Observation time : HHMM")); |
| 355 |
w_storm_time->align(FL_ALIGN_LEFT); |
| 356 |
w_storm_time->when(FL_WHEN_CHANGED); |
| 357 |
w_storm_time->callback(storm_changed); |
| 358 |
|
| 359 |
w_storm_btn_time = new Fl_Button(312, Y, 22, 22, _("...")); |
| 360 |
w_storm_btn_time->tooltip(_("Current local time")); |
| 361 |
w_storm_btn_time->callback((Fl_Callback*)cb_btn_time); |
| 362 |
|
| 363 |
w_storm_zone = new Fl_ListBox(335, Y, 80, 22, ""); |
| 364 |
w_storm_zone->begin(); |
| 365 |
w_storm_zone->align(FL_ALIGN_TOP || FL_ALIGN_INSIDE); |
| 366 |
w_storm_zone->tooltip(_("Time Zone, ie: EDT")); |
| 367 |
w_storm_zone->when(FL_WHEN_CHANGED); |
| 368 |
w_storm_zone->align(FL_ALIGN_RIGHT); |
| 369 |
for (int n = 0; n < num_us_tzones; n++) |
| 370 |
w_storm_zone->add(us_tzones[n].c_str()); |
| 371 |
w_storm_zone->callback(storm_changed); |
| 372 |
w_storm_zone->end(); |
| 373 |
|
| 374 |
Y += 25; |
| 375 |
w_storm_state = new Fl_ListBox(70, Y, 200, 22, _("State")); |
| 376 |
w_storm_state->begin(); |
| 377 |
w_storm_state->tooltip(_("Select state / territory")); |
| 378 |
w_storm_state->align(FL_ALIGN_LEFT); |
| 379 |
w_storm_state->when(FL_WHEN_CHANGED); |
| 380 |
w_storm_state->callback((Fl_Callback*)cb_storm_state); |
| 381 |
w_storm_state->end(); |
| 382 |
|
| 383 |
w_storm_county = new Fl_ListBox(325, Y, 235, 22, _("County")); |
| 384 |
w_storm_county->begin(); |
| 385 |
w_storm_county->tooltip(_("Select county")); |
| 386 |
w_storm_county->align(FL_ALIGN_LEFT); |
| 387 |
w_storm_county->when(FL_WHEN_CHANGED); |
| 388 |
w_storm_county->callback((Fl_Callback*)storm_changed); |
| 389 |
w_storm_county->end(); |
| 390 |
|
| 391 |
Y += 25; |
| 392 |
int y1 = Y; |
| 393 |
w_storm_location = new Fl_Input2(70, Y, 200, 22, _("Location")); |
| 394 |
w_storm_location->tooltip(_("Enter location/town")); |
| 395 |
w_storm_location->align(FL_ALIGN_LEFT); |
| 396 |
w_storm_location->when(FL_WHEN_CHANGED); |
| 397 |
w_storm_location->callback((Fl_Callback*)storm_changed); |
| 398 |
|
| 399 |
// flood |
| 400 |
Y += 35; |
| 401 |
w_storm_flood = new Fl_Check_Button(20, Y, 180, 22, _("Flood")); |
| 402 |
w_storm_flood->tooltip(_("Report flooding")); |
| 403 |
w_storm_flood->when(FL_WHEN_CHANGED); |
| 404 |
w_storm_flood->callback((Fl_Callback*)cb_flood); |
| 405 |
|
| 406 |
w_storm_flood_cat = new Fl_ListBox(200, Y, 365, 22, ""); |
| 407 |
w_storm_flood_cat->tooltip(_("Select a flooding category")); |
| 408 |
w_storm_flood_cat->when(FL_WHEN_CHANGED); |
| 409 |
w_storm_flood_cat->callback((Fl_Callback*)storm_changed); |
| 410 |
w_storm_flood_cat->deactivate(); |
| 411 |
//hail |
| 412 |
Y += 25; |
| 413 |
w_storm_hail = new Fl_Check_Button(20, Y, 180, 22, _("Hail")); |
| 414 |
w_storm_hail->tooltip(_("Report incidence of hail")); |
| 415 |
w_storm_hail->when(FL_WHEN_CHANGED); |
| 416 |
w_storm_hail->callback((Fl_Callback*)cb_hail); |
| 417 |
|
| 418 |
w_storm_hail_size = new Fl_ListBox(200, Y, 365, 22, ""); |
| 419 |
w_storm_hail_size->tooltip(_("Select a Hail size")); |
| 420 |
w_storm_hail_size->when(FL_WHEN_CHANGED); |
| 421 |
w_storm_hail_size->callback((Fl_Callback*)storm_changed); |
| 422 |
w_storm_hail_size->deactivate(); |
| 423 |
//high speed wind |
| 424 |
Y += 25; |
| 425 |
w_storm_wind = new Fl_Check_Button(20, Y, 180, 22, _("High Wind Speed")); |
| 426 |
w_storm_wind->tooltip(_("Report high winds")); |
| 427 |
w_storm_wind->when(FL_WHEN_CHANGED); |
| 428 |
w_storm_wind->callback((Fl_Callback*)cb_high_wind); |
| 429 |
|
| 430 |
w_storm_wind_cat = new Fl_ListBox(200, Y, 365, 22, ""); |
| 431 |
w_storm_wind_cat->tooltip(_("Select a wind speed")); |
| 432 |
w_storm_wind_cat->when(FL_WHEN_CHANGED); |
| 433 |
w_storm_wind_cat->callback((Fl_Callback*)storm_changed); |
| 434 |
w_storm_wind_cat->deactivate(); |
| 435 |
//tornado/funnel cloud |
| 436 |
Y += 25; |
| 437 |
w_storm_tornado = new Fl_Check_Button(20, Y, 180, 22, _("Tornado/Funnel cloud")); |
| 438 |
w_storm_tornado->tooltip(_("Report tornado sighting")); |
| 439 |
w_storm_tornado->when(FL_WHEN_CHANGED); |
| 440 |
w_storm_tornado->callback((Fl_Callback*)cb_tornado); |
| 441 |
|
| 442 |
w_storm_tornado_cat = new Fl_ListBox(200, Y, 365, 22, ""); |
| 443 |
w_storm_tornado_cat->tooltip(_("Select a report")); |
| 444 |
w_storm_tornado_cat->when(FL_WHEN_CHANGED); |
| 445 |
w_storm_tornado_cat->callback((Fl_Callback*)storm_changed); |
| 446 |
w_storm_tornado_cat->deactivate(); |
| 447 |
//wind damage |
| 448 |
Y += 25; |
| 449 |
w_storm_damage = new Fl_Check_Button(20, Y, 180, 22, _("Wind Damage?")); |
| 450 |
w_storm_damage->tooltip("Report wind damage"); |
| 451 |
w_storm_damage->when(FL_WHEN_CHANGED); |
| 452 |
w_storm_damage->callback((Fl_Callback*)cb_damage); |
| 453 |
|
| 454 |
w_storm_damage_cat = new Fl_ListBox(200, Y, 365, 22, ""); |
| 455 |
w_storm_damage_cat->tooltip(_("Select a Damage Desc'")); |
| 456 |
w_storm_damage_cat->when(FL_WHEN_CHANGED); |
| 457 |
w_storm_damage_cat->callback((Fl_Callback*)storm_changed); |
| 458 |
w_storm_damage_cat->deactivate(); |
| 459 |
//snow |
| 460 |
Y += 25; |
| 461 |
w_storm_snow = new Fl_Check_Button(20, Y, 180, 22, _("Snow")); |
| 462 |
w_storm_snow->tooltip("Report Snowfall"); |
| 463 |
w_storm_snow->when(FL_WHEN_CHANGED); |
| 464 |
w_storm_snow->callback((Fl_Callback*)cb_snow); |
| 465 |
|
| 466 |
w_storm_snow_tot = new Fl_ListBox(200, Y, 180, 22, ""); |
| 467 |
w_storm_snow_tot->tooltip(_("Select a snow tot'")); |
| 468 |
w_storm_snow_tot->when(FL_WHEN_CHANGED); |
| 469 |
w_storm_snow_tot->callback((Fl_Callback*)storm_changed); |
| 470 |
w_storm_snow_tot->deactivate(); |
| 471 |
|
| 472 |
w_storm_snow_dur = new Fl_ListBox(385, Y, 180, 22, ""); |
| 473 |
w_storm_snow_dur->tooltip(_("Select a snow total")); |
| 474 |
w_storm_snow_dur->when(FL_WHEN_CHANGED); |
| 475 |
w_storm_snow_dur->callback((Fl_Callback*)storm_changed); |
| 476 |
w_storm_snow_dur->deactivate(); |
| 477 |
|
| 478 |
//freezing rain/icing |
| 479 |
Y += 25; |
| 480 |
w_storm_f_rain = new Fl_Check_Button(20, Y, 180, 22, _("Freezing Rain/Icing")); |
| 481 |
w_storm_f_rain->tooltip("Report freezing rain / ice"); |
| 482 |
w_storm_f_rain->when(FL_WHEN_CHANGED); |
| 483 |
w_storm_f_rain->callback((Fl_Callback*)cb_f_rain); |
| 484 |
|
| 485 |
w_storm_f_rain_tot = new Fl_ListBox(200, Y, 180, 22, ""); |
| 486 |
w_storm_f_rain_tot->tooltip(_("Select an ice total")); |
| 487 |
w_storm_f_rain_tot->when(FL_WHEN_CHANGED); |
| 488 |
w_storm_f_rain_tot->callback((Fl_Callback*)storm_changed); |
| 489 |
w_storm_f_rain_tot->deactivate(); |
| 490 |
|
| 491 |
w_storm_f_rain_dur = new Fl_ListBox(385, Y, 180, 22, ""); |
| 492 |
w_storm_f_rain_dur->tooltip(_("Select a duration")); |
| 493 |
w_storm_f_rain_dur->when(FL_WHEN_CHANGED); |
| 494 |
w_storm_f_rain_dur->callback((Fl_Callback*)storm_changed); |
| 495 |
w_storm_f_rain_dur->deactivate(); |
| 496 |
//heavy rain |
| 497 |
Y += 25; |
| 498 |
w_storm_h_rain = new Fl_Check_Button(20, Y, 180, 22, _("Heavy Rain")); |
| 499 |
w_storm_h_rain->tooltip("Report heavy rain"); |
| 500 |
w_storm_h_rain->when(FL_WHEN_CHANGED); |
| 501 |
w_storm_h_rain->callback((Fl_Callback*)cb_h_rain); |
| 502 |
|
| 503 |
w_storm_h_rain_tot = new Fl_ListBox(200, Y, 180, 22, ""); |
| 504 |
w_storm_h_rain_tot->tooltip(_("Select rain total")); |
| 505 |
w_storm_h_rain_tot->when(FL_WHEN_CHANGED); |
| 506 |
w_storm_h_rain_tot->callback((Fl_Callback*)storm_changed); |
| 507 |
w_storm_h_rain_tot->deactivate(); |
| 508 |
|
| 509 |
w_storm_h_rain_dur = new Fl_ListBox(385, Y, 180, 22, ""); |
| 510 |
w_storm_h_rain_dur->tooltip(_("Select a duration")); |
| 511 |
w_storm_h_rain_dur->when(FL_WHEN_CHANGED); |
| 512 |
w_storm_h_rain_dur->callback((Fl_Callback*)storm_changed); |
| 513 |
w_storm_h_rain_dur->deactivate(); |
| 514 |
//contact information |
| 515 |
Y += 35; |
| 516 |
w_storm_o_name = new Fl_Input2(70, Y, 240, 22, _("Name")); |
| 517 |
w_storm_o_name->when(FL_WHEN_CHANGED); |
| 518 |
w_storm_o_name->align(FL_ALIGN_LEFT); |
| 519 |
|
| 520 |
w_storm_o_tele = new Fl_Input2(380, Y, 185, 22, _("Phone")); |
| 521 |
w_storm_o_tele->when(FL_WHEN_CHANGED); |
| 522 |
w_storm_o_tele->align(FL_ALIGN_LEFT); |
| 523 |
|
| 524 |
Y += 25; |
| 525 |
w_storm_o_email = new Fl_Input2(70, Y, 240, 22, _("Email")); |
| 526 |
w_storm_o_email->when(FL_WHEN_CHANGED); |
| 527 |
w_storm_o_email->align(FL_ALIGN_LEFT); |
| 528 |
|
| 529 |
w_storm_o_profile = new Fl_ListBox(380, Y, 185, 22, _("Profile")); |
| 530 |
w_storm_o_profile->begin(); |
| 531 |
w_storm_o_profile->align(FL_ALIGN_LEFT); |
| 532 |
w_storm_o_profile->tooltip(_("Select a profile")); |
| 533 |
w_storm_o_profile->when(FL_WHEN_CHANGED); |
| 534 |
w_storm_o_profile->callback((Fl_Callback*)storm_changed); |
| 535 |
w_storm_o_profile->end(); |
| 536 |
|
| 537 |
make_storm_default = new Fl_Button(415, y1, 70, 24, _("Store")); |
| 538 |
make_storm_default->tooltip(_("Store state/county/location\ntime-zone\nname, email, tele, profile\nas default")); |
| 539 |
make_storm_default->callback((Fl_Callback*)cb_make_storm_default); |
| 540 |
|
| 541 |
use_storm_default = new Fl_Button(490, y1, 70, 24, _("Default")); |
| 542 |
use_storm_default->tooltip(_("Use state/county/location\ntime-zone\nname, email, tele, profile\nas default")); |
| 543 |
use_storm_default->callback((Fl_Callback*)cb_use_storm_default); |
| 544 |
tab_storm_1->end(); |
| 545 |
|
| 546 |
Y = tab_top; |
| 547 |
tab_storm_2 = new Fl_Group(0, Y+25, 570, 360, _("Details")); |
| 548 |
tab_storm_2->begin(); |
| 549 |
|
| 550 |
Y += 35; |
| 551 |
w_storm_details = new FTextEdit(5, Y, 560, 340, _("")); |
| 552 |
w_storm_details->when(FL_WHEN_RELEASE); |
| 553 |
w_storm_details->callback((Fl_Callback*)storm_changed); |
| 554 |
|
| 555 |
tab_storm_2->end(); |
| 556 |
|
| 557 |
tab_storm->end(); |
| 558 |
|
| 559 |
set_storm_combos(); |
| 560 |
|
| 561 |
tab_storm->hide(); |
| 562 |
|
| 563 |
}; |
| 564 |
|