lyx_mirror/src/frontends/controllers/ControlBox.C
Lars Gullik Bjønnes 43b77ba2d7 Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14952 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-09 15:27:44 +00:00

90 lines
2.2 KiB
C

/**
* \file ControlBox.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Martin Vermeer (with useful hints from Angus Leeming)
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "ControlBox.h"
#include "funcrequest.h"
#include "insets/insetbox.h"
#include "gettext.h"
using std::string;
using std::vector;
namespace lyx {
namespace frontend {
ControlBox::ControlBox(Dialog & parent)
: Dialog::Controller(parent)
{}
bool ControlBox::initialiseParams(string const & data)
{
InsetBoxParams params("");
InsetBoxMailer::string2params(data, params);
params_.reset(new InsetBoxParams(params));
return true;
}
void ControlBox::clearParams()
{
params_.reset();
}
void ControlBox::dispatchParams()
{
string const lfun = InsetBoxMailer::params2string(params());
kernel().dispatch(FuncRequest(getLfun(), lfun));
}
void box_gui_tokens(vector<string> & ids, vector<string> & gui_names)
{
char const * const ids_[] = {
"Frameless", "Boxed", "ovalbox",
"Ovalbox", "Shadowbox", "Doublebox"};
size_t const ids_size = sizeof(ids_) / sizeof(char *);
ids = vector<string>(ids_, ids_ + ids_size);
gui_names.clear();
// FIXME UNICODE
gui_names.push_back(lyx::to_utf8(_("No frame drawn")));
gui_names.push_back(lyx::to_utf8(_("Rectangular box")));
gui_names.push_back(lyx::to_utf8(_("Oval box, thin")));
gui_names.push_back(lyx::to_utf8(_("Oval box, thick")));
gui_names.push_back(lyx::to_utf8(_("Shadow box")));
gui_names.push_back(lyx::to_utf8(_("Double box")));
}
void box_gui_tokens_special_length(vector<string> & ids,
vector<string> & gui_names)
{
char const * const ids_[] = {
"none", "height", "depth",
"totalheight", "width"};
size_t const ids_size = sizeof(ids_) / sizeof(char *);
ids = vector<string>(ids_, ids_ + ids_size);
gui_names.clear();
// FIXME UNICODE
gui_names.push_back(lyx::to_utf8(_("None")));
gui_names.push_back(lyx::to_utf8(_("Height")));
gui_names.push_back(lyx::to_utf8(_("Depth")));
gui_names.push_back(lyx::to_utf8(_("Total Height")));
gui_names.push_back(lyx::to_utf8(_("Width")));
}
} // namespace frontend
} // namespace lyx