2 * \file xforms/FormUrl.C
3 * Copyright 2000-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Angus Leeming <leeming@lyx.org>
13 #pragma implementation
17 #include "ControlUrl.h"
19 #include "forms/form_url.h"
20 #include FORMS_H_LOCATION
22 typedef FormCB<ControlUrl, FormDB<FD_url> > base_class;
25 : base_class(_("Url"))
31 dialog_.reset(build_url(this));
33 fl_set_input_return(dialog_->input_name, FL_RETURN_CHANGED);
34 fl_set_input_return(dialog_->input_url, FL_RETURN_CHANGED);
36 setPrehandler(dialog_->input_name);
37 setPrehandler(dialog_->input_url);
39 // Manage the ok, apply, restore and cancel/close buttons
40 bc().setOK(dialog_->button_ok);
41 bc().setApply(dialog_->button_apply);
42 bc().setCancel(dialog_->button_close);
43 bc().setRestore(dialog_->button_restore);
45 bc().addReadOnly(dialog_->input_name);
46 bc().addReadOnly(dialog_->input_url);
47 bc().addReadOnly(dialog_->check_html);
51 void FormUrl::update()
53 fl_set_input(dialog_->input_url,
54 controller().params().getContents().c_str());
55 fl_set_input(dialog_->input_name,
56 controller().params().getOptions().c_str());
58 if (controller().params().getCmdName() == "url")
59 fl_set_button(dialog_->check_html, 0);
61 fl_set_button(dialog_->check_html, 1);
67 controller().params().setContents(fl_get_input(dialog_->input_url));
68 controller().params().setOptions(fl_get_input(dialog_->input_name));
70 if (fl_get_button(dialog_->check_html))
71 controller().params().setCmdName("htmlurl");
73 controller().params().setCmdName("url");