#include "support/lyxlib.h" // for float_equal
#include "support/filetools.h" // for MakeAbsPath etc
+#include "BoostFormat.h"
+
#include FORMS_H_LOCATION
using std::endl;
file_.reset(build_graphics_file(this));
// disable for read-only documents
- bc().addReadOnly(file_->button_browse);
+ bc().addReadOnly(file_->button_browse);
bc().addReadOnly(file_->check_aspectratio);
bc().addReadOnly(file_->check_draft);
bc().addReadOnly(file_->check_nounzip);
// width default is scaling: use unsigned float filter
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);
fl_set_input_maxchars(file_->input_height, SIZE_MAXDIGITS);
-
+
string const display_List =
_("Default|Monochrome|Grayscale|Color|Do not display");
fl_addto_choice(file_->choice_display, display_List.c_str());
-
+
+#if USE_BOOST_FORMAT
+ string const width_list = boost::io::str(boost::format(_("Scale%%|%1$s")) % choice_Length_All);
+#else
string const width_list = _("Scale%%|") + choice_Length_All;
+#endif
fl_addto_choice(file_->choice_width, width_list.c_str());
fl_addto_choice(file_->choice_height, choice_Length_All.c_str());
tooltips().init(file_->input_height, str);
str = _("Select unit for height.");
tooltips().init(file_->choice_height, str);
- str = _("Do not distort the image. "
- "Keep image within \"width\" by \"height\" and obey "
+ str = _("Do not distort the image. "
+ "Keep image within \"width\" by \"height\" and obey "
"aspect ratio.");
tooltips().init(file_->check_aspectratio, str);
str = _("Pass a filename like \"file.eps.gz\" to the LaTeX output. "
fl_set_input_filter(bbox_->input_bb_y0, fl_unsigned_float_filter);
fl_set_input_filter(bbox_->input_bb_y1, fl_unsigned_float_filter);
- string const bb_units = "bp|cm|mm|in";
+ string const bb_units = getStringFromVector(frnt::getBBUnits(), "|");
fl_addto_choice(bbox_->choice_bb_units, bb_units.c_str());
// set up the tooltips for the bounding-box-section
// Store the identifiers for later
origins_ = getSecond(origindata);
- string const choice = "Default|" + getStringFromVector(getFirst(origindata), "|");
+ string const choice = getStringFromVector(getFirst(origindata), "|");
fl_addto_choice(extra_->choice_origin, choice.c_str());
// set up the tooltips for the extra section
str = _("Insert the rotation angle in degrees. "
- "Positive value rotates anti-clockwise, "
+ "Positive value rotates anti-clockwise, "
"negative value clockwise.");
tooltips().init(extra_->input_rotate_angle, str);
str = _("Insert the point of origin for rotation.");
str = _("Insert the optional subfigure caption.");
tooltips().init(extra_->input_subcaption, str);
str = _("Add any additional latex option, which is defined in the "
- "graphicx-package and not mentioned in the gui's tabfolders.");
+ "graphicx-package and not mentioned in the gui's tabfolders.");
tooltips().init(extra_->input_special, str);
// add the different tabfolders
if (igp.lyxscale == 0) {
igp.lyxscale = 100;
}
-
+
switch (fl_get_choice(file_->choice_display)) {
case 5:
igp.display = grfx::NoDisplay;
// the bb section
if (!controller().bbChanged) {
- // don't write anything
+ // don't write anything
igp.bb.erase();
} else {
// allow length + unit input only for x1 input field
bb += "0";
else
bb += getLengthFromWidgets(bbox_->input_bb_y1,
- bbox_->choice_bb_units);
+ bbox_->choice_bb_units);
igp.bb = bb;
}
// the extra section
igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle));
-
+
// map angle into -360 (clock-wise) to +360 (counter clock-wise)
while (igp.rotateAngle <= -360.0) {
igp.rotateAngle += 360.0;
if (origin_pos == 1) {
igp.rotateOrigin.erase();
} else {
- igp.rotateOrigin = origins_[origin_pos - 2];
+ igp.rotateOrigin = origins_[origin_pos - 1];
}
igp.subcaption = fl_get_button(extra_->check_subcaption);
bool const disable_height = !lyx::float_equal(igp.scale, 0.0, 0.05);
setEnabled(file_->input_height, !disable_height);
setEnabled(file_->choice_height, !disable_height);
-
+
fl_set_button(file_->check_aspectratio, igp.keepAspectRatio);
fl_set_button(file_->check_draft, igp.draft);
fl_set_button(file_->check_nounzip, igp.noUnzip);
bool const scaling = fl_get_choice(file_->choice_width) == 1;
setEnabled(file_->input_height, !scaling);
setEnabled(file_->choice_height, !scaling);
-
+
// allow only integer intput for scaling; float otherwise
if (scaling) {
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);