better (and localizable) display of vertical spaces

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9968 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-05-24 10:23:30 +00:00
parent 9e5d7cddf3
commit 0f51d7cabf
6 changed files with 42 additions and 1 deletions

View File

@ -153,6 +153,7 @@ src/frontends/xforms/FormVSpace.C
src/frontends/xforms/FormWrap.C
src/frontends/xforms/XFormsMenubar.C
src/frontends/xforms/XMiniBuffer.C
src/frontends/xforms/checkedwidgets.C
src/frontends/xforms/xformsBC.h
src/frontends/xforms/xforms_helpers.C
src/gettext.h

View File

@ -1,3 +1,8 @@
2005-05-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* vspace.C (asGUIName): new method. A version of the space
suitable for showing on screen.
2005-05-20 Michael Schmitt <michael.schmitt@teststep.org>
* MenuBackend.C:

View File

@ -1,3 +1,7 @@
2005-05-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* insetvspace.C (draw): use VSpace::asGUIName.
2005-05-17 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insetbase.C (getStatus): allow LFUN_INSET_MODIFY unconditionally

View File

@ -144,7 +144,7 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
// y-values for bottom arrow
int by1, by2;
str = label + " (" + space_.asLyXCommand() + ")";
str = label + " (" + space_.asGUIName() + ")";
if (space_.kind() == VSpace::VFILL) {
ty1 = ty2 = start;

View File

@ -14,6 +14,7 @@
#include "buffer.h"
#include "bufferparams.h"
#include "BufferView.h"
#include "gettext.h"
#include "lengthcommon.h"
#include "lyxtext.h"
@ -478,6 +479,34 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
}
string const VSpace::asGUIName() const
{
string result;
switch (kind_) {
case DEFSKIP:
result = _("Default skip");
break;
case SMALLSKIP:
result = _("Small skip");
break;
case MEDSKIP:
result = _("Medium skip");
break;
case BIGSKIP:
result = _("Big skip");
break;
case VFILL:
result = _("Vertical fill");
break;
case LENGTH:
result = len_.asString();
break;
}
if (keep_)
result += ", " + _("protected");
return result;
}
int VSpace::inPixels(BufferView const & bv) const
{

View File

@ -61,6 +61,8 @@ public:
std::string const asLyXCommand() const;
/// the latex representation
std::string const asLatexCommand(BufferParams const & params) const;
/// how it is seen in the LyX window
std::string const VSpace::asGUIName() const;
/// the size of the space on-screen
int inPixels(BufferView const & bv) const;