3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author Edwin Leuven <leuven@fee.uva.nl>
12 #pragma implementation
15 #include "ControlFloat.h"
16 #include "QFloatDialog.h"
20 #include "helper_funcs.h"
22 #include "support/lstrings.h"
24 #include <qradiobutton.h>
25 #include <qpushbutton.h>
26 #include <qcheckbox.h>
28 typedef Qt2CB<ControlFloat, Qt2DB<QFloatDialog> > base_class;
30 QFloat::QFloat(ControlFloat & c)
31 : base_class(c, _("LaTeX Information"))
36 void QFloat::build_dialog()
38 dialog_.reset(new QFloatDialog(this));
40 bc().setCancel(dialog_->closePB);
41 bc().setApply(dialog_->applyPB);
42 bc().setOK(dialog_->okPB);
43 bc().setRestore(dialog_->restorePB);
47 void QFloat::update_contents()
53 bool forcehere = false;
55 string placement(controller().params().placement);
57 if (contains(placement, "H")) {
60 if (contains(placement, "t")) {
63 if (contains(placement, "b")) {
66 if (contains(placement, "p")) {
69 if (contains(placement, "h")) {
74 dialog_->top->setChecked(top);
75 dialog_->bottom->setChecked(bottom);
76 dialog_->page->setChecked(page);
77 dialog_->here->setChecked(here);
78 dialog_->forcehere->setChecked(forcehere);
85 if (dialog_->forcehere->isChecked()) {
88 if (dialog_->top->isChecked()) {
91 if (dialog_->bottom->isChecked()) {
94 if (dialog_->page->isChecked()) {
97 if (dialog_->here->isChecked()) {
101 controller().params().placement = placement;