void delete_entry(FL_OBJECT *ob, long data)
{
int current_line, max;
/* do we have authority to delete? ie is this the second click? */
/* (This should be read as a xevent (FL_DBLCLICK) but I don't see */
/* how to get it, so I've implemented this nasty code here ) */
delete_click++;
if (delete_click == 2) {
/* Delete the currently selected line only */
/* first up, where the hell am I? */
current_line = fl_get_browser(disp_dest); /* any display would do */
max = fl_get_browser_maxline(disp_dest);
/* beware of zero entries! or we'll segv */
/* right, are we on the end of the list? */
if ((max != 0)) {
/* humm maxline will have been decreased by one */
max--;
/* and now reselect the line (being careful of the end of the list) */
if (max - current_line < 0)
current_line--;
if (current_line != 0)
set_browsers(current_line, fl_get_browser_topline(disp_dest));
}
delete_click = 0;
}
}
void append_entry(FL_OBJECT *ob, long data)
{
int curr;
char temp[64]; /* for getting values from the system */
curr = fl_get_browser(disp_dest); /* any display would have done */
curr++; /* so that we insert UNDER the current selected entry */
/* argh! specialist behaviour from the forms library!,
means I'll have to watch out for cases where we are
appending to the end of a list (segv) in which case we
call add_entry (same action) */
if (curr > fl_get_browser_maxline(disp_dest)) {
add_entry(ob, data);
return; /* run away! */
}
/* this set are choices and will always have values */
/* and finally, move our select to the new line */
set_browsers(curr, fl_get_browser_topline(disp_dest));
}
void quit_program(FL_OBJECT *ob, long data)
{
/* if (fl_show_question("Argh! you don't really want to kill me do you?","","") == TRUE) */
exit(1);
}
void opt_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_opt);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_opt));
}
void tosa_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_tosa);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_tosa));
}
void tosx_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_tosx);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_tosx));
}
void ifname_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_ifname);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_ifname));
}
void ifaddr_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_ifaddr);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_ifaddr));
}
void pkts_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_pkts);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_pkts));
}
void bytes_cb(FL_OBJECT *ob, long data)
{
int line_num=0;
line_num = fl_get_browser(disp_bytes);
/* do it smoothly with a freeze/unfreeze */
set_browsers(line_num, fl_get_browser_topline(disp_bytes));
}
void ifaddr_input(FL_OBJECT *ob, long data)
{
}
void ifname_input(FL_OBJECT *ob, long data)
{
}
void type_input(FL_OBJECT *ob, long data)
{
}
void prot_input(FL_OBJECT *ob, long data)
{
}
void opt_input(FL_OBJECT *ob, long data)
{
}
void tosa_input(FL_OBJECT *ob, long data)
{
}
void tosx_input(FL_OBJECT *ob, long data)
{
}
void forwarding_setup(FL_OBJECT *ob, long data)
{
}
void accounting_setup(FL_OBJECT *ob, long data)
{
}
void input_setup(FL_OBJECT *ob, long data)
{
}
void output_setup(FL_OBJECT *ob, long data)
{
}
void save_entrys(FL_OBJECT *ob, long data)
{
}
void load_entrys(FL_OBJECT *ob, long data)
{
}
void set_browsers(int line_num, int top_line)
{
/* this s a cosmetic touch for delete_entry
I just couldn't think of an elegant solution */
delete_click = 0;
/* this is a pretty type thing which moves all the other
browsers in line with a selected member
as such it's a long nasty thing with sets, deselects
and reselects (hatefull really) */