mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
f7ba7c8e9f
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3806 a592a061-630c-0410-9148-cb99ea01b6c8
103 lines
1.6 KiB
C
103 lines
1.6 KiB
C
/* This file is part of
|
|
* ======================================================
|
|
*
|
|
* LyX, The Document Processor
|
|
*
|
|
* Copyright 2000-2001 The LyX Team.
|
|
*
|
|
* ======================================================
|
|
*
|
|
* \file ButtonControllerBase.C
|
|
* \author Allan Rae
|
|
*/
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include <config.h>
|
|
#include "ButtonControllerBase.h"
|
|
#include "support/LAssert.h"
|
|
#include "debug.h"
|
|
|
|
|
|
ButtonControllerBase::ButtonControllerBase(string const & cancel,
|
|
string const & close)
|
|
: cancel_label_(cancel), close_label_(close)
|
|
{}
|
|
|
|
|
|
void ButtonControllerBase::ok()
|
|
{
|
|
input(ButtonPolicy::SMI_OKAY);
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::input(ButtonPolicy::SMInput in)
|
|
{
|
|
if (ButtonPolicy::SMI_NOOP == in) return;
|
|
bp().input(in);
|
|
refresh();
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::apply()
|
|
{
|
|
input(ButtonPolicy::SMI_APPLY);
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::cancel()
|
|
{
|
|
input(ButtonPolicy::SMI_CANCEL);
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::restore()
|
|
{
|
|
input(ButtonPolicy::SMI_RESTORE);
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::hide()
|
|
{
|
|
input(ButtonPolicy::SMI_HIDE);
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::valid(bool v)
|
|
{
|
|
if (v) {
|
|
input(ButtonPolicy::SMI_VALID);
|
|
} else {
|
|
input(ButtonPolicy::SMI_INVALID);
|
|
}
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::invalid()
|
|
{
|
|
input(ButtonPolicy::SMI_INVALID);
|
|
}
|
|
|
|
|
|
bool ButtonControllerBase::readOnly(bool ro)
|
|
{
|
|
lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl;
|
|
|
|
if (ro) {
|
|
bp().input(ButtonPolicy::SMI_READ_ONLY);
|
|
} else {
|
|
bp().input(ButtonPolicy::SMI_READ_WRITE);
|
|
}
|
|
refreshReadOnly();
|
|
refresh();
|
|
return ro;
|
|
}
|
|
|
|
|
|
void ButtonControllerBase::readWrite()
|
|
{
|
|
readOnly(false);
|
|
}
|