2 * \file xforms/FormUrl.C
3 * See the file COPYING.
5 * \author Angus Leeming
7 * Full author contact details are available in file CREDITS
14 #pragma implementation
18 #include "ControlUrl.h"
20 #include "forms/form_url.h"
21 #include FORMS_H_LOCATION
23 typedef FormCB<ControlUrl, FormDB<FD_url> > base_class;
26 : base_class(_("Url"))
32 dialog_.reset(build_url(this));
34 fl_set_input_return(dialog_->input_name, FL_RETURN_CHANGED);
35 fl_set_input_return(dialog_->input_url, FL_RETURN_CHANGED);
37 setPrehandler(dialog_->input_name);
38 setPrehandler(dialog_->input_url);
40 // Manage the ok, apply, restore and cancel/close buttons
41 bc().setOK(dialog_->button_ok);
42 bc().setApply(dialog_->button_apply);
43 bc().setCancel(dialog_->button_close);
44 bc().setRestore(dialog_->button_restore);
46 bc().addReadOnly(dialog_->input_name);
47 bc().addReadOnly(dialog_->input_url);
48 bc().addReadOnly(dialog_->check_html);
52 void FormUrl::update()
54 fl_set_input(dialog_->input_url,
55 controller().params().getContents().c_str());
56 fl_set_input(dialog_->input_name,
57 controller().params().getOptions().c_str());
59 if (controller().params().getCmdName() == "url")
60 fl_set_button(dialog_->check_html, 0);
62 fl_set_button(dialog_->check_html, 1);
68 controller().params().setContents(fl_get_input(dialog_->input_url));
69 controller().params().setOptions(fl_get_input(dialog_->input_name));
71 if (fl_get_button(dialog_->check_html))
72 controller().params().setCmdName("htmlurl");
74 controller().params().setCmdName("url");