2 * \file xforms/FormUrl.C
3 * Copyright 2000-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Angus Leeming, a.leeming@ic.ac.uk
13 #pragma implementation
17 #include "ControlUrl.h"
21 typedef FormCB<ControlUrl, FormDB<FD_form_url> > base_class;
23 FormUrl::FormUrl(ControlUrl & c)
24 : base_class(c, _("Url"))
30 dialog_.reset(build_url());
32 fl_set_input_return(dialog_->input_name, FL_RETURN_CHANGED);
33 fl_set_input_return(dialog_->input_url, FL_RETURN_CHANGED);
35 setPrehandler(dialog_->input_name);
36 setPrehandler(dialog_->input_url);
38 // Manage the ok, apply, restore and cancel/close buttons
39 bc().setOK(dialog_->button_ok);
40 bc().setApply(dialog_->button_apply);
41 bc().setCancel(dialog_->button_close);
42 bc().setRestore(dialog_->button_restore);
44 bc().addReadOnly(dialog_->input_name);
45 bc().addReadOnly(dialog_->input_url);
46 bc().addReadOnly(dialog_->check_html);
50 void FormUrl::update()
52 fl_set_input(dialog_->input_url,
53 controller().params().getContents().c_str());
54 fl_set_input(dialog_->input_name,
55 controller().params().getOptions().c_str());
57 if (controller().params().getCmdName() == "url")
58 fl_set_button(dialog_->check_html, 0);
60 fl_set_button(dialog_->check_html, 1);
66 controller().params().setContents(fl_get_input(dialog_->input_url));
67 controller().params().setOptions(fl_get_input(dialog_->input_name));
69 if (fl_get_button(dialog_->check_html))
70 controller().params().setCmdName("htmlurl");
72 controller().params().setCmdName("url");