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 "flmsg.h"
22 #include "flmsg_dialog.h"
23 
24 hx_TEXT hx_list[] = {
25 {"HXA",   "HXAnn", "\
26 Collect landline delivery authorized within\n___ miles" },
27 {"HXB",   "HXBnn", "\
28 Cancel message if not delivered within\n\
29 ___ hours of filing time." },
30 {"HXC",   "HXC", "\
31 Report date & time of delivery back to the\n\
32 originating station" },
33 {"HXD",   "HXD", "\
34 Report to originating station the identity\n\
35 of station from which received, plus date\nand time" },
36 {"HXE",   "HXE", "\
37 Delivering station get reply from addressee,\n\
38 originate message back." },
39 {"HXF",   "HXFnn", "\
40 Hold delivery until ___ [date]" },
41 {"HXG",   "HXG", "\
42 Delivery by mail or landline toll call not required\n\
43 If toll call or other expenses involved, cancel\n\
44 message and send service message back to\n\
45 originating station." },
46 {0, 0, 0}
47 };
48 
49 int hx_nbr = 0;
50 
cb_hx()51 void cb_hx()
52 {
53 	if (!hxwindow) {
54 		hxwindow = hx_dialog();
55 		int n = 0;
56 		while (hx_list[n].sznbr) {
57 			sel_hx_select->add(hx_list[n].sznbr);
58 			n++;
59 		}
60 		sel_hx_select->index(0);
61 		txt_hx_instructions->value(hx_list[0].instruct);
62 	}
63 	hxwindow->show();
64 }
65 
cb_hx_select()66 void cb_hx_select()
67 {
68 	int n = sel_hx_select->index();
69 	txt_hx_instructions->value(hx_list[n].instruct);
70 }
71 
cb_hx_select_add()72 void cb_hx_select_add()
73 {
74 	string hxadd = txt_hx_select_text->value();
75 	int n = sel_hx_select->index();
76 	if (n < 0) return;
77 	if (hxadd.empty())
78 		hxadd = hx_list[n].text;
79 	else
80 		hxadd.append(" ").append(hx_list[n].text);
81 	txt_hx_select_text->value(hxadd.c_str());
82 }
83 
cb_hx_select_cancel()84 void cb_hx_select_cancel()
85 {
86 	hxwindow->hide();
87 }
88 
cb_hx_select_ok()89 void cb_hx_select_ok()
90 {
91 	txt_rg_hx->value(txt_hx_select_text->value());
92 	hxwindow->hide();
93 }
94 
95