mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-08 18:19:42 +00:00
Squash bug 1345 in the 14x tree: xforms frontend doesn't have
%theight or %pheight as a graphics sizing choice. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8603 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
65aa219f2e
commit
90e427465d
@ -1,4 +1,8 @@
|
|||||||
2004-05-04 Angus Leeming <leeming@lyx.org>
|
2004-04-05 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* lyxlength.[Ch] (unit_name et al.): const-correct.
|
||||||
|
|
||||||
|
2004-04-05 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* BufferView_pimpl.C:
|
* BufferView_pimpl.C:
|
||||||
* buffer.C:
|
* buffer.C:
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-04-05 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* QGraphics.C (getUnitNo): const-correct.
|
||||||
|
|
||||||
2004-04-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
2004-04-05 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||||
|
|
||||||
* floatplacement.[Ch]: check whether we are in the float or
|
* floatplacement.[Ch]: check whether we are in the float or
|
||||||
|
@ -109,7 +109,7 @@ int getItemNo(vector<string> v, string const & s) {
|
|||||||
|
|
||||||
// returns the number of the unit in the array unit_name,
|
// returns the number of the unit in the array unit_name,
|
||||||
// which is defined in lengthcommon.C
|
// which is defined in lengthcommon.C
|
||||||
int getUnitNo(char const * c[], string const & s) {
|
int getUnitNo(char const * const c[], string const & s) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < num_units && s != c[i])
|
while (i < num_units && s != c[i])
|
||||||
++i;
|
++i;
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2004-05-04 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* FormExternal.C (build):
|
||||||
|
* FormGraphics.C (build): use buildChoiceLengthString rather than
|
||||||
|
choice_Length_All.
|
||||||
|
|
||||||
|
* xforms_helpers.[Ch]: remove choice_Length_WithUnit (unused).
|
||||||
|
Replace choice_Length_All with buildChoiceLengthString,
|
||||||
|
which builds the string dynamically from lengthcommon.h's
|
||||||
|
unit_name_gui.
|
||||||
|
|
||||||
2004-03-31 Angus Leeming <leeming@lyx.org>
|
2004-03-31 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* Dialogs2.C:
|
* Dialogs2.C:
|
||||||
|
@ -422,11 +422,11 @@ void FormExternal::build()
|
|||||||
fl_addto_choice(rotate_->choice_origin,
|
fl_addto_choice(rotate_->choice_origin,
|
||||||
external::origin_gui_str(i).c_str());
|
external::origin_gui_str(i).c_str());
|
||||||
|
|
||||||
string const width_list = bformat(_("Scale%%%%|%1$s"),
|
string const height_list = buildChoiceLengthString();
|
||||||
choice_Length_All);
|
string const width_list = bformat(_("Scale%%%%|%1$s"), height_list);
|
||||||
fl_addto_choice(scale_->choice_width, width_list.c_str());
|
|
||||||
|
|
||||||
fl_addto_choice(scale_->choice_height, choice_Length_All.c_str());
|
fl_addto_choice(scale_->choice_width, width_list.c_str());
|
||||||
|
fl_addto_choice(scale_->choice_height, height_list.c_str());
|
||||||
|
|
||||||
// Set up the tooltips.
|
// Set up the tooltips.
|
||||||
string str = _("The file you want to insert.");
|
string str = _("The file you want to insert.");
|
||||||
|
@ -130,10 +130,11 @@ void FormGraphics::build()
|
|||||||
_("Default|Monochrome|Grayscale|Color|Do not display");
|
_("Default|Monochrome|Grayscale|Color|Do not display");
|
||||||
fl_addto_choice(file_->choice_display, display_List.c_str());
|
fl_addto_choice(file_->choice_display, display_List.c_str());
|
||||||
|
|
||||||
string const width_list = bformat(_("Scale%%%%|%1$s"), choice_Length_All);
|
string const height_list = buildChoiceLengthString();
|
||||||
fl_addto_choice(file_->choice_width, width_list.c_str());
|
string const width_list = bformat(_("Scale%%%%|%1$s"), height_list);
|
||||||
|
|
||||||
fl_addto_choice(file_->choice_height, choice_Length_All.c_str());
|
fl_addto_choice(file_->choice_width, width_list.c_str());
|
||||||
|
fl_addto_choice(file_->choice_height, height_list.c_str());
|
||||||
|
|
||||||
// set up the tooltips for the filesection
|
// set up the tooltips for the filesection
|
||||||
string str = _("The file you want to insert.");
|
string str = _("The file you want to insert.");
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
#include "lengthcommon.h"
|
||||||
#include "lyxgluelength.h"
|
#include "lyxgluelength.h"
|
||||||
#include "lyxlex.h"
|
#include "lyxlex.h"
|
||||||
|
|
||||||
@ -43,6 +44,18 @@ using std::vector;
|
|||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
|
||||||
|
std::string const buildChoiceLengthString()
|
||||||
|
{
|
||||||
|
string data;
|
||||||
|
for (int i = 0; i != num_units; ++i) {
|
||||||
|
if (i != 0)
|
||||||
|
data += "|";
|
||||||
|
data += subst(unit_name_gui[i], "%", "%%");
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isActive(FL_OBJECT * ob)
|
bool isActive(FL_OBJECT * ob)
|
||||||
{
|
{
|
||||||
return ob && ob->active > 0;
|
return ob && ob->active > 0;
|
||||||
|
@ -29,11 +29,10 @@ std::pair<std::string, std::string> parse_shortcut(std::string const & str);
|
|||||||
unsigned long fl_getmcolor(int i, unsigned int * r, unsigned int * g,
|
unsigned long fl_getmcolor(int i, unsigned int * r, unsigned int * g,
|
||||||
unsigned int * b);
|
unsigned int * b);
|
||||||
|
|
||||||
// what we always need for lengths
|
/** Generate a string of available length units with which to
|
||||||
std::string const choice_Length_All =
|
* populate a choice widget.
|
||||||
"cm|mm|in|text%%|col%%|page%%|line%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
|
*/
|
||||||
std::string const choice_Length_WithUnit =
|
std::string const buildChoiceLengthString();
|
||||||
"cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu"; // all with a Unit
|
|
||||||
|
|
||||||
/// return the (in)active state of the object
|
/// return the (in)active state of the object
|
||||||
bool isActive(FL_OBJECT * ob);
|
bool isActive(FL_OBJECT * ob);
|
||||||
|
@ -26,14 +26,14 @@ int const num_units = LyXLength::UNIT_NONE;
|
|||||||
// unit_name is for compatibility. Can be deleted when all works well.
|
// unit_name is for compatibility. Can be deleted when all works well.
|
||||||
// means, when we have full language support for the lengths
|
// means, when we have full language support for the lengths
|
||||||
// in all gui's (Herbert 2002-11-01)
|
// in all gui's (Herbert 2002-11-01)
|
||||||
char const * unit_name[num_units + 1] = {
|
char const * const unit_name[num_units + 1] = {
|
||||||
"sp", "pt", "bp", "dd", "mm", "pc",
|
"sp", "pt", "bp", "dd", "mm", "pc",
|
||||||
"cc", "cm", "in", "ex", "em", "mu",
|
"cc", "cm", "in", "ex", "em", "mu",
|
||||||
"text%", "col%", "page%", "line%",
|
"text%", "col%", "page%", "line%",
|
||||||
"theight%", "pheight%", "" };
|
"theight%", "pheight%", "" };
|
||||||
|
|
||||||
// the latex units
|
// the latex units
|
||||||
char const * unit_name_ltx[num_units + 1] = {
|
char const * const unit_name_ltx[num_units + 1] = {
|
||||||
"sp", "pt", "bp", "dd", "mm", "pc",
|
"sp", "pt", "bp", "dd", "mm", "pc",
|
||||||
"cc", "cm", "in", "ex", "em", "mu",
|
"cc", "cm", "in", "ex", "em", "mu",
|
||||||
// in 1.4 the following names should be used. then no
|
// in 1.4 the following names should be used. then no
|
||||||
@ -44,7 +44,7 @@ char const * unit_name_ltx[num_units + 1] = {
|
|||||||
"theight%", "pheight%", "" };
|
"theight%", "pheight%", "" };
|
||||||
|
|
||||||
// the LyX gui units
|
// the LyX gui units
|
||||||
char const * unit_name_gui[num_units + 1] = {
|
char const * const unit_name_gui[num_units + 1] = {
|
||||||
N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"),
|
N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"),
|
||||||
N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"),
|
N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"),
|
||||||
N_("text%"), N_("col%"), N_("page%"), N_("line%"),
|
N_("text%"), N_("col%"), N_("page%"), N_("line%"),
|
||||||
|
@ -26,9 +26,9 @@ extern int const num_units;
|
|||||||
*
|
*
|
||||||
* FIXME: I am not sure if "mu" should be possible to select (Lgb)
|
* FIXME: I am not sure if "mu" should be possible to select (Lgb)
|
||||||
*/
|
*/
|
||||||
extern char const * unit_name[];
|
extern char const * const unit_name[];
|
||||||
extern char const * unit_name_gui[];
|
extern char const * const unit_name_gui[];
|
||||||
extern char const * unit_name_ltx[];
|
extern char const * const unit_name_ltx[];
|
||||||
|
|
||||||
/// return the unit given a string representation such as "cm"
|
/// return the unit given a string representation such as "cm"
|
||||||
LyXLength::UNIT unitFromString(std::string const & data);
|
LyXLength::UNIT unitFromString(std::string const & data);
|
||||||
|
Loading…
Reference in New Issue
Block a user