lyx_mirror/src/frontends/controllers/ButtonControllerBase.C
Angus Leeming 467323b2b8 Removed // -*- C++ -*- from all .C files!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2121 a592a061-630c-0410-9148-cb99ea01b6c8
2001-06-13 15:11:17 +00:00

99 lines
1.5 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"
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)
{
if (ro) {
bp().input(ButtonPolicy::SMI_READ_ONLY);
} else {
bp().input(ButtonPolicy::SMI_READ_WRITE);
}
refreshReadOnly();
return ro;
}
void ButtonControllerBase::readWrite()
{
readOnly(false);
}