2001-03-26 19:34:45 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
2001-06-05 17:05:51 +00:00
|
|
|
* LyX, The Document Processor
|
2001-03-26 19:34:45 +00:00
|
|
|
*
|
2001-06-05 17:05:51 +00:00
|
|
|
* Copyright 2000 The LyX Team.
|
2001-03-26 19:34:45 +00:00
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \author Angus Leeming <a.leeming@ic.ac.uk>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <qdialog.h>
|
|
|
|
#undef emit
|
|
|
|
|
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "Qt2Base.h"
|
|
|
|
#include "qt2BC.h"
|
|
|
|
#include "support/LAssert.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
|
2001-03-26 19:34:45 +00:00
|
|
|
: ViewBC<qt2BC>(c), title_(t)
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::show()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
if (!form()) {
|
|
|
|
build();
|
|
|
|
}
|
|
|
|
|
|
|
|
update(); // make sure its up-to-date
|
|
|
|
|
|
|
|
if (form()->isVisible()) {
|
|
|
|
form()->raise();
|
|
|
|
} else {
|
|
|
|
form()->setCaption( title_ );
|
|
|
|
form()->show();
|
|
|
|
}
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::hide()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
if (form() && form()->isVisible() )
|
|
|
|
form()->hide();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PENDING(kalle) Handle this with QValidator?
|
|
|
|
// void Qt2Base::InputCB(FL_OBJECT * ob, long data)
|
|
|
|
// {
|
|
|
|
// bc().input(input(ob, data));
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
ButtonPolicy::SMInput Qt2Base::input(QWidget*, long)
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
return ButtonPolicy::SMI_VALID;
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotWMHide()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
CancelButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotApply()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
ApplyButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotOK()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
OKButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotCancel()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
CancelButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotRestore()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
RestoreButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PENDING(kalle) How to handle this?
|
|
|
|
// extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d)
|
|
|
|
// {
|
|
|
|
// GetForm(ob)->InputCB(ob, d);
|
|
|
|
// }
|