2002-01-25 17:46:18 +00:00
|
|
|
/**
|
|
|
|
* \file QFloatDialog.C
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-01-25 17:46:18 +00:00
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
* \author Edwin Leuven
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-01-25 17:46:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
#include "ControlFloat.h"
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
#include <qpushbutton.h>
|
2002-09-08 06:16:40 +00:00
|
|
|
#include <qcheckbox.h>
|
2002-06-19 03:38:44 +00:00
|
|
|
|
2002-01-25 17:46:18 +00:00
|
|
|
#include "QFloatDialog.h"
|
|
|
|
#include "QFloat.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
|
2002-01-25 17:46:18 +00:00
|
|
|
QFloatDialog::QFloatDialog(QFloat * form)
|
|
|
|
: QFloatDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
|
|
|
{
|
|
|
|
connect(restorePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotRestore()));
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotOK()));
|
|
|
|
connect(applyPB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotApply()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form, SLOT(slotClose()));
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-25 17:46:18 +00:00
|
|
|
void QFloatDialog::change_adaptor()
|
|
|
|
{
|
|
|
|
form_->changed();
|
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-01-25 17:46:18 +00:00
|
|
|
void QFloatDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
|
|
|
}
|
2002-09-08 06:16:40 +00:00
|
|
|
|
|
|
|
void QFloatDialog::tbhpClicked()
|
|
|
|
{
|
|
|
|
heredefinitelyCB->setChecked(false);
|
|
|
|
bool allow(topCB->isChecked());
|
|
|
|
allow |= bottomCB->isChecked();
|
|
|
|
allow |= pageCB->isChecked();
|
|
|
|
allow |= herepossiblyCB->isChecked();
|
|
|
|
ignoreCB->setEnabled(allow);
|
|
|
|
}
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-09-08 06:16:40 +00:00
|
|
|
|
|
|
|
void QFloatDialog::heredefinitelyClicked()
|
|
|
|
{
|
2002-09-11 17:53:15 +00:00
|
|
|
if (heredefinitelyCB->isChecked());
|
|
|
|
ignoreCB->setEnabled(false);
|
|
|
|
|
2002-09-08 06:16:40 +00:00
|
|
|
topCB->setChecked(false);
|
|
|
|
bottomCB->setChecked(false);
|
|
|
|
pageCB->setChecked(false);
|
|
|
|
herepossiblyCB->setChecked(false);
|
2002-09-11 17:53:15 +00:00
|
|
|
ignoreCB->setChecked(false);
|
2002-09-08 06:16:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QFloatDialog::spanClicked()
|
|
|
|
{
|
|
|
|
bool const span(spanCB->isChecked());
|
2002-09-11 17:53:15 +00:00
|
|
|
|
2002-09-08 06:16:40 +00:00
|
|
|
if (!defaultsCB->isChecked()) {
|
2002-10-20 01:48:28 +00:00
|
|
|
herepossiblyCB->setEnabled(!span);
|
|
|
|
heredefinitelyCB->setEnabled(!span);
|
2002-09-08 06:16:40 +00:00
|
|
|
}
|
2002-09-11 17:53:15 +00:00
|
|
|
|
2002-09-08 06:16:40 +00:00
|
|
|
if (!span)
|
|
|
|
return;
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-09-08 06:16:40 +00:00
|
|
|
herepossiblyCB->setChecked(false);
|
|
|
|
heredefinitelyCB->setChecked(false);
|
|
|
|
}
|