+2002-02-03 Herbert Voss <voss@lyx.org>
+
+ * xforms_helpers.C: fix bug with unit "%" in
+ updateWidgetsFromLengthString(...)
+
+2002-02-02 Herbert Voss <voss@lyx.org>
+
+ * FormGraphic.C: fix bug with filename, rearrange the code,
+ delete choice "referencePoint" which is only possible for
+ rotatebox
+ * forms/form_graphics.fd: position options in a logical way,
+ add folder and scale for LyXView
+
2002-02-01 Angus Leeming <a.leeming@ic.ac.uk>
* FormGraphics.C (apply, update): respect the new DEFAULT state of
*
* \file FormGraphics.C
* \author Baruch Even, baruch.even@writeme.com
+ * \author Herbert Voss, voss@perce.de
*/
#include <config.h>
fl_redraw_form(form());
else
return;
-
FL_FORM * outer_form = fl_get_active_folder(dialog_->tabFolder);
if (outer_form && outer_form->visible)
fl_redraw_form(outer_form);
// Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
-// bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_cancel);
bc().setRestore(dialog_->button_restore);
+ bc().setRestore(dialog_->button_help);
// the file section
file_.reset(build_file());
fl_set_input_return (file_->input_filename, FL_RETURN_CHANGED);
fl_set_input_return (file_->input_subcaption, FL_RETURN_CHANGED);
- fl_set_input_return (file_->input_lyxwidth, FL_RETURN_CHANGED);
- fl_set_input_return (file_->input_lyxheight, FL_RETURN_CHANGED);
+ fl_set_input_return (file_->input_rotate_angle, FL_RETURN_CHANGED);
fl_set_input_maxchars(file_->input_filename, FILENAME_MAXCHARS);
+ fl_set_input_maxchars(file_->input_rotate_angle, ROTATE_MAXCHARS);
+ fl_set_input_filter(file_->input_rotate_angle, fl_float_filter);
- fl_addto_choice(file_->choice_width_lyxwidth, choice_Length_All.c_str());
- fl_addto_choice(file_->choice_width_lyxheight, choice_Length_All.c_str());
- fl_addto_choice(file_->choice_display,
- _(" Default | Monochrome | Grayscale | Color | Do not display "));
- //FIXME: This does not work (always set to monochrome by default. Why? JSpitzm)
- fl_set_choice(file_->choice_display, 1);
+ string const choice_origin =
+ "center|" // c
+ "leftTop|leftBottom|leftBaseline|" // lt lb lB
+ "centerTop|centerBottom|centerBaseline|" // ct cb cB
+ "rightTop|rightBottom|rightBaseline"; // rt rb rB
+ fl_addto_choice(file_->choice_origin, choice_origin.c_str());
bc().addReadOnly(file_->button_browse);
bc().addReadOnly(file_->check_subcaption);
- bc().addReadOnly(file_->choice_display);
+ bc().addReadOnly(file_->button_clip);
+ bc().addReadOnly(file_->button_draft);
+
+ // the lyxview section
+ lyxview_.reset(build_lyxview());
+
+ fl_set_input_return (lyxview_->input_lyxwidth, FL_RETURN_CHANGED);
+ fl_set_input_return (lyxview_->input_lyxheight, FL_RETURN_CHANGED);
+ fl_set_input_return (lyxview_->input_lyxscale, FL_RETURN_CHANGED);
+
+ fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_WithUnit.c_str());
+ fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_WithUnit.c_str());
+ fl_addto_choice(lyxview_->choice_display,
+ _(" Default | Monochrome | Grayscale | Color | Do not display "));
+ fl_set_choice(lyxview_->choice_display, 1);
+
+ bc().addReadOnly(lyxview_->choice_display);
// the size section
size_.reset(build_size());
fl_set_input_return (bbox_->input_bb_x1, FL_RETURN_CHANGED);
fl_set_input_return (bbox_->input_bb_y1, FL_RETURN_CHANGED);
- bc().addReadOnly(bbox_->button_getBB);
- bc().addReadOnly(bbox_->button_clip);
- bc().addReadOnly(bbox_->button_draft);
-
string const bb_units = "pt|cm|in";
fl_addto_choice(bbox_->choice_bb_x0, bb_units.c_str());
fl_addto_choice(bbox_->choice_bb_y0, bb_units.c_str());
fl_addto_choice(bbox_->choice_bb_x1, bb_units.c_str());
fl_addto_choice(bbox_->choice_bb_y1, bb_units.c_str());
-
+ bc().addReadOnly(bbox_->button_getBB);
// the rotate section
special_.reset(build_special());
- fl_set_input_return (special_->input_rotate_angle, FL_RETURN_CHANGED);
-
- string const choice_origin =
- "default|" // not important
- "leftTop|leftBottom|leftBaseline|" // lt lb lB
- "center|" // c
- "centerTop|centerBottom|centerBaseline|" // ct cb cB
- "rightTop|rightBottom|rightBaseline|" // rt rb rB
- "referencePoint"; // special
- fl_addto_choice(special_->choice_origin, choice_origin.c_str());
-
fl_set_input_return (special_->input_special, FL_RETURN_CHANGED);
- fl_set_input_maxchars(special_->input_rotate_angle, ROTATE_MAXCHARS);
- fl_set_input_filter(special_->input_rotate_angle, fl_float_filter);
// add the different tabfolders
fl_addto_tabfolder(dialog_->tabFolder, _("File"), file_->form);
+ fl_addto_tabfolder(dialog_->tabFolder, _("LyXView"), lyxview_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Size"), size_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Bounding Box"), bbox_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Extras"), special_->form);
{
// Create the parameters structure and fill the data from the dialog.
InsetGraphicsParams & igp = controller().params();
+ // the file section
igp.filename = getStringFromInput(file_->input_filename);
- if (!controller().bbChanged) // different to the original one?
- igp.bb = string(); // don't write anything
- else {
- string bb;
- if (getStringFromInput(bbox_->input_bb_x0).empty())
- bb = "0 ";
- else
- bb = getLengthFromWidgets(bbox_->input_bb_x0,
- bbox_->choice_bb_x0)+" ";
- if (getStringFromInput(bbox_->input_bb_y0).empty())
- bb += "0 ";
- else
- bb += (getLengthFromWidgets(bbox_->input_bb_y0,
- bbox_->choice_bb_y0)+" ");
- if (getStringFromInput(bbox_->input_bb_x1).empty())
- bb += "0 ";
- else
- bb += (getLengthFromWidgets(bbox_->input_bb_x1,
- bbox_->choice_bb_x1)+" ");
- if (getStringFromInput(bbox_->input_bb_y1).empty())
- bb += "0 ";
- else
- bb += (getLengthFromWidgets(bbox_->input_bb_y1,
- bbox_->choice_bb_y1)+" ");
- igp.bb = bb;
- }
- igp.draft = fl_get_button(bbox_->button_draft);
- igp.clip = fl_get_button(bbox_->button_clip);
igp.subcaption = fl_get_button(file_->check_subcaption);
igp.subcaptionText = getStringFromInput(file_->input_subcaption);
+ igp.rotateAngle =
+ strToDbl(getStringFromInput(file_->input_rotate_angle));
+ while (igp.rotateAngle < 0.0 || igp.rotateAngle > 360.0) {
+ if (igp.rotateAngle < 0.0) {
+ igp.rotateAngle += 360.0;
+ } else if (igp.rotateAngle > 360.0) {
+ igp.rotateAngle -= 360.0;
+ }
+ }
+ if (fl_get_choice(file_->choice_origin) > 0)
+ igp.rotateOrigin = fl_get_choice_text(file_->choice_origin);
+ else
+ igp.rotateOrigin = string();
+ igp.scale = strToInt(getStringFromInput(size_->input_scale));
+ igp.keepAspectRatio = fl_get_button(size_->check_aspectratio);
- switch (fl_get_choice(file_->choice_display)) {
+ // the lyxview section
+ switch (fl_get_choice(lyxview_->choice_display)) {
case 1:
igp.display = InsetGraphicsParams::DEFAULT;
break;
igp.display = InsetGraphicsParams::NONE;
break;
}
+ igp.lyxwidth = LyXLength(getLengthFromWidgets(lyxview_->input_lyxwidth,
+ lyxview_->choice_width_lyxwidth));
+ igp.lyxheight = LyXLength(getLengthFromWidgets(lyxview_->input_lyxheight,
+ lyxview_->choice_width_lyxheight));
+ // the size section
+ igp.draft = fl_get_button(file_->button_draft);
+ igp.clip = fl_get_button(file_->button_clip);
if (fl_get_button(size_->button_default))
igp.size_type = InsetGraphicsParams::DEFAULT_SIZE;
else if (fl_get_button(size_->button_wh))
size_->choice_width_units));
igp.height = LyXLength(getLengthFromWidgets(size_->input_height,
size_->choice_height_units));
- igp.scale = strToInt(getStringFromInput(size_->input_scale));
- igp.keepAspectRatio = fl_get_button(size_->check_aspectratio);
- igp.lyxwidth = LyXLength(getLengthFromWidgets(file_->input_lyxwidth,
- file_->choice_width_lyxwidth));
- igp.lyxheight = LyXLength(getLengthFromWidgets(file_->input_lyxheight,
- file_->choice_width_lyxheight));
- igp.rotateAngle =
- strToDbl(getStringFromInput(special_->input_rotate_angle));
- while (igp.rotateAngle < 0.0 || igp.rotateAngle > 360.0) {
- if (igp.rotateAngle < 0.0) {
- igp.rotateAngle += 360.0;
- } else if (igp.rotateAngle > 360.0) {
- igp.rotateAngle -= 360.0;
- }
+ // the bb section
+ if (!controller().bbChanged) // different to the original one?
+ igp.bb = string(); // don't write anything
+ else {
+ string bb;
+ if (getStringFromInput(bbox_->input_bb_x0).empty())
+ bb = "0 ";
+ else
+ bb = getLengthFromWidgets(bbox_->input_bb_x0,
+ bbox_->choice_bb_x0)+" ";
+ if (getStringFromInput(bbox_->input_bb_y0).empty())
+ bb += "0 ";
+ else
+ bb += (getLengthFromWidgets(bbox_->input_bb_y0,
+ bbox_->choice_bb_y0)+" ");
+ if (getStringFromInput(bbox_->input_bb_x1).empty())
+ bb += "0 ";
+ else
+ bb += (getLengthFromWidgets(bbox_->input_bb_x1,
+ bbox_->choice_bb_x1)+" ");
+ if (getStringFromInput(bbox_->input_bb_y1).empty())
+ bb += "0 ";
+ else
+ bb += (getLengthFromWidgets(bbox_->input_bb_y1,
+ bbox_->choice_bb_y1)+" ");
+ igp.bb = bb;
}
- if (fl_get_choice(special_->choice_origin) > 0)
- igp.rotateOrigin = fl_get_choice_text(special_->choice_origin);
- else
- igp.rotateOrigin = string();
+
+ // the special section
igp.special = getStringFromInput(special_->input_special);
- igp.testInvariant();
}
-void FormGraphics::update()
-{ string unit = "cm";
+void FormGraphics::update() {
+ string unit = "cm";
if (lyxrc.default_papersize < 3)
unit = "in";
string const defaultUnit = string(unit);
// Update dialog with details from inset
InsetGraphicsParams & igp = controller().params();
+
+ // the file section
fl_set_input(file_->input_filename, igp.filename.c_str());
- // set the bounding box values, if exists. First we need the whole
- // path, because the controller knows nothing about the doc-dir
- lyxerr << "GraphicsUpdate::BoundingBox = " << igp.bb << "\n";
- controller().bbChanged = false;
- if (igp.bb.empty()) {
- string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename));
- string bb = controller().readBB(fileWithAbsPath);
- lyxerr << "file::BoundingBox = " << bb << "\n";
- if (!bb.empty()) {
- // get the values from the file
- // in this case we always have the point-unit
- fl_set_input(bbox_->input_bb_x0, token(bb,' ',0).c_str());
- fl_set_input(bbox_->input_bb_y0, token(bb,' ',1).c_str());
- fl_set_input(bbox_->input_bb_x1, token(bb,' ',2).c_str());
- fl_set_input(bbox_->input_bb_y1, token(bb,' ',3).c_str());
- }
- } else { // get the values from the inset
- controller().bbChanged = true;
- LyXLength anyLength;
- anyLength = LyXLength(token(igp.bb,' ',0));
- updateWidgetsFromLength(bbox_->input_bb_x0,
- bbox_->choice_bb_x0,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',1));
- updateWidgetsFromLength(bbox_->input_bb_y0,
- bbox_->choice_bb_y0,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',2));
- updateWidgetsFromLength(bbox_->input_bb_x1,
- bbox_->choice_bb_x1,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',3));
- updateWidgetsFromLength(bbox_->input_bb_y1,
- bbox_->choice_bb_y1,anyLength,"pt");
- }
- // Update the draft and clip mode
- fl_set_button(bbox_->button_draft, igp.draft);
- fl_set_button(bbox_->button_clip, igp.clip);
- // Update the subcaption check button and input field
fl_set_button(file_->check_subcaption, igp.subcaption);
fl_set_input(file_->input_subcaption, igp.subcaptionText.c_str());
setEnabled(file_->input_subcaption,
fl_get_button(file_->check_subcaption));
+ fl_set_input(file_->input_rotate_angle,
+ tostr(igp.rotateAngle).c_str());
+ if (igp.rotateOrigin.empty())
+ fl_set_choice(file_->choice_origin,0);
+ else
+ fl_set_choice_text(file_->choice_origin,igp.rotateOrigin.c_str());
+ fl_set_button(file_->button_draft, igp.draft);
+ fl_set_button(file_->button_clip, igp.clip);
+ // the lyxview section
switch (igp.display) {
case InsetGraphicsParams::DEFAULT:
- fl_set_choice(file_->choice_display, 1);
+ fl_set_choice(lyxview_->choice_display, 1);
break;
case InsetGraphicsParams::MONOCHROME:
- fl_set_choice(file_->choice_display, 2);
+ fl_set_choice(lyxview_->choice_display, 2);
break;
case InsetGraphicsParams::GRAYSCALE:
- fl_set_choice(file_->choice_display, 3);
+ fl_set_choice(lyxview_->choice_display, 3);
break;
case InsetGraphicsParams::COLOR:
- fl_set_choice(file_->choice_display, 4);
+ fl_set_choice(lyxview_->choice_display, 4);
break;
case InsetGraphicsParams::NONE:
- fl_set_choice(file_->choice_display, 5);
+ fl_set_choice(lyxview_->choice_display, 5);
break;
}
+ updateWidgetsFromLength(lyxview_->input_lyxwidth,
+ lyxview_->choice_width_lyxwidth, igp.lyxwidth,defaultUnit);
+ updateWidgetsFromLength(lyxview_->input_lyxheight,
+ lyxview_->choice_width_lyxheight, igp.lyxheight,defaultUnit);
+ // the size section
+ // Update the draft and clip mode
updateWidgetsFromLength(size_->input_width,
size_->choice_width_units,igp.width,defaultUnit);
updateWidgetsFromLength(size_->input_height,
}
}
fl_set_button(size_->check_aspectratio, igp.keepAspectRatio);
- // now the lyx-internally viewsize
- updateWidgetsFromLength(file_->input_lyxwidth,
- file_->choice_width_lyxwidth, igp.lyxwidth,defaultUnit);
- updateWidgetsFromLength(file_->input_lyxheight,
- file_->choice_width_lyxheight, igp.lyxheight,defaultUnit);
- // Update the rotate angle and special commands
- fl_set_input(special_->input_rotate_angle,
- tostr(igp.rotateAngle).c_str());
- if (igp.rotateOrigin.empty())
- fl_set_choice(special_->choice_origin,0);
- else
- fl_set_choice_text(special_->choice_origin,igp.rotateOrigin.c_str());
+
+ // the bb section
+ // set the bounding box values, if exists. First we need the whole
+ // path, because the controller knows nothing about the doc-dir
+ lyxerr << "GraphicsUpdate::BoundingBox = " << igp.bb << "\n";
+ controller().bbChanged = false;
+ if (igp.bb.empty()) {
+ string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename));
+ string bb = controller().readBB(fileWithAbsPath);
+ lyxerr << "file::BoundingBox = " << bb << "\n";
+ if (!bb.empty()) {
+ // get the values from the file
+ // in this case we always have the point-unit
+ fl_set_input(bbox_->input_bb_x0, token(bb,' ',0).c_str());
+ fl_set_input(bbox_->input_bb_y0, token(bb,' ',1).c_str());
+ fl_set_input(bbox_->input_bb_x1, token(bb,' ',2).c_str());
+ fl_set_input(bbox_->input_bb_y1, token(bb,' ',3).c_str());
+ }
+ } else { // get the values from the inset
+ controller().bbChanged = true;
+ LyXLength anyLength;
+ anyLength = LyXLength(token(igp.bb,' ',0));
+ updateWidgetsFromLength(bbox_->input_bb_x0,
+ bbox_->choice_bb_x0,anyLength,"pt");
+ anyLength = LyXLength(token(igp.bb,' ',1));
+ updateWidgetsFromLength(bbox_->input_bb_y0,
+ bbox_->choice_bb_y0,anyLength,"pt");
+ anyLength = LyXLength(token(igp.bb,' ',2));
+ updateWidgetsFromLength(bbox_->input_bb_x1,
+ bbox_->choice_bb_x1,anyLength,"pt");
+ anyLength = LyXLength(token(igp.bb,' ',3));
+ updateWidgetsFromLength(bbox_->input_bb_y1,
+ bbox_->choice_bb_y1,anyLength,"pt");
+ }
+
+ // the special section
fl_set_input(special_->input_special, igp.special.c_str());
}
invalid = invalid || !isValid(bbox_->input_bb_y1);
invalid = invalid || !isValid(size_->input_width);
invalid = invalid || !isValid(size_->input_height);
- invalid = invalid || !isValid(file_->input_lyxwidth);
- invalid = invalid || !isValid(file_->input_lyxheight);
+ invalid = invalid || !isValid(lyxview_->input_lyxwidth);
+ invalid = invalid || !isValid(lyxview_->input_lyxheight);
// deactivate OK/ Apply buttons and
// spit out warnings if invalid
- if (ob == bbox_->input_bb_x0
- || ob == bbox_->input_bb_x1
- || ob == bbox_->input_bb_y0
- || ob == bbox_->input_bb_y1
- || ob == size_->input_width
- || ob == size_->input_height
- || ob == file_->input_lyxwidth
- || ob == file_->input_lyxheight) {
+ if (ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_x1 ||
+ ob == bbox_->input_bb_y0 || ob == bbox_->input_bb_y1 ||
+ ob == size_->input_width || ob == size_->input_height ||
+ ob == lyxview_->input_lyxwidth || ob == lyxview_->input_lyxheight) {
if (invalid) {
fl_set_object_label(dialog_->text_warning,
_("Warning: Invalid Length!"));
}
}
- return checkInput();
-}
-
-
-ButtonPolicy::SMInput FormGraphics::checkInput()
-{
- // Put verifications that the dialog shows some sane values,
- // if not disallow clicking on ok/apply.
- // Possibly use a label in the bottom of the dialog to give the reason.
- ButtonPolicy::SMInput activate = ButtonPolicy::SMI_VALID;
- // We verify now that there is a filename, it exists, it's a file
- // and it's readable.
- string filename = getStringFromInput(file_->input_filename);
- FileInfo file(filename);
- if (filename.empty() || !file.isOK() || !file.exist()
- || !file.isRegular() || !file.readable()
- )
- activate = ButtonPolicy::SMI_INVALID;
-
- return activate;
+ return ButtonPolicy::SMI_VALID;
}
class ControlGraphics;
struct FD_form_graphics;
struct FD_form_file;
+struct FD_form_lyxview;
struct FD_form_size;
struct FD_form_bbox;
struct FD_form_special;
///
void help();
- /// Verify that the input is correct. If not disable ok/apply buttons.
- ButtonPolicy::SMInput checkInput();
-
/// Fdesign generated method
FD_form_graphics * build_graphics();
///
FD_form_file * build_file();
///
+ FD_form_lyxview * build_lyxview();
+ ///
FD_form_size * build_size();
///
FD_form_bbox * build_bbox();
/// Real GUI implementation.
boost::scoped_ptr<FD_form_file> file_;
///
+ boost::scoped_ptr<FD_form_lyxview> lyxview_;
+ ///
boost::scoped_ptr<FD_form_size> size_;
///
boost::scoped_ptr<FD_form_bbox> bbox_;
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 65, 460, 95, _("Screen Display"));
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 50, 460, 50, _("Subfigure"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
{
- char const * const dummy = N_("Show:|#o");
- fdui->choice_display = obj = fl_add_choice(FL_NORMAL_CHOICE, 85, 80, 160, 30, idex(_(dummy)));
+ char const * const dummy = N_("Subfigure|#S");
+ fdui->check_subcaption = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 60, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Width:|#w");
- fdui->input_lyxwidth = obj = fl_add_input(FL_NORMAL_INPUT, 85, 120, 95, 30, idex(_(dummy)));
+ char const * const dummy = N_("Title:|#T");
+ fdui->input_subcaption = obj = fl_add_input(FL_NORMAL_INPUT, 180, 60, 280, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->choice_width_lyxwidth = obj = fl_add_choice(FL_NORMAL_CHOICE, 185, 120, 60, 30, "");
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 110, 460, 60, _("Rotation"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
{
- char const * const dummy = N_("Height:|#h");
- fdui->input_lyxheight = obj = fl_add_input(FL_NORMAL_INPUT, 315, 120, 85, 30, idex(_(dummy)));
+ char const * const dummy = N_("Angle:|#n");
+ fdui->input_rotate_angle = obj = fl_add_input(FL_INT_INPUT, 105, 130, 72, 28, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->choice_width_lyxheight = obj = fl_add_choice(FL_NORMAL_CHOICE, 405, 120, 60, 30, "");
+ obj = fl_add_text(FL_NORMAL_TEXT, 175, 130, 66, 30, _("degrees"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ {
+ char const * const dummy = N_("Origin:|#O");
+ fdui->choice_origin = obj = fl_add_choice(FL_NORMAL_CHOICE, 340, 130, 118, 28, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 175, 460, 50, _("Sub figure"));
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 180, 460, 50, _("Options"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
{
- char const * const dummy = N_("Subfigure|#S");
- fdui->check_subcaption = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 185, 30, 30, idex(_(dummy)));
+ char const * const dummy = N_("clip to bounding box|#b");
+ fdui->button_clip = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 145, 190, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Title:|#T");
- fdui->input_subcaption = obj = fl_add_input(FL_NORMAL_INPUT, 180, 185, 280, 30, idex(_(dummy)));
+ char const * const dummy = N_("draft mode|#m");
+ fdui->button_draft = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 190, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 235, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 15, 455, 205, _("Size"));
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 10, 470, 210, _("Size"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_size = fl_bgn_group();
{
char const * const dummy = N_("Default|#D");
- fdui->button_default = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 80, 30, 30, 30, idex(_(dummy)));
+ fdui->button_default = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 50, 20, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Custom|#C");
- fdui->button_wh = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 80, 65, 30, 30, idex(_(dummy)));
+ fdui->button_wh = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 50, 80, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Scale|#S");
- fdui->button_scale = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 80, 145, 30, 30, idex(_(dummy)));
+ fdui->button_scale = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 50, 175, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_color(obj, FL_COL1, FL_YELLOW);
{
char const * const dummy = N_("Width:|#W");
- fdui->input_width = obj = fl_add_input(FL_NORMAL_INPUT, 270, 65, 85, 30, idex(_(dummy)));
+ fdui->input_width = obj = fl_add_input(FL_NORMAL_INPUT, 325, 80, 85, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->choice_width_units = obj = fl_add_choice(FL_NORMAL_CHOICE, 360, 65, 60, 30, "");
+ fdui->choice_width_units = obj = fl_add_choice(FL_NORMAL_CHOICE, 415, 80, 60, 30, "");
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Height:|#H");
- fdui->input_height = obj = fl_add_input(FL_NORMAL_INPUT, 270, 100, 85, 30, idex(_(dummy)));
+ fdui->input_height = obj = fl_add_input(FL_NORMAL_INPUT, 325, 115, 85, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- fdui->choice_height_units = obj = fl_add_choice(FL_NORMAL_CHOICE, 360, 100, 60, 30, "");
+ fdui->choice_height_units = obj = fl_add_choice(FL_NORMAL_CHOICE, 415, 115, 60, 30, "");
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Factor:|#F");
- fdui->input_scale = obj = fl_add_input(FL_NORMAL_INPUT, 270, 145, 85, 30, idex(_(dummy)));
+ char const * const dummy = N_("Value:|#V");
+ fdui->input_scale = obj = fl_add_input(FL_NORMAL_INPUT, 325, 175, 85, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
// xgettext:no-c-format
- obj = fl_add_text(FL_NORMAL_TEXT, 360, 145, 25, 30, _("%"));
+ obj = fl_add_text(FL_NORMAL_TEXT, 420, 175, 25, 30, _("%"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
{
- char const * const dummy = N_("keep aspect ratio|#k");
- fdui->check_aspectratio = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 185, 30, 30, idex(_(dummy)));
+ char const * const dummy = N_("keep aspectratio|#k");
+ fdui->check_aspectratio = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 115, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("clip to bounding box|#c");
- fdui->button_clip = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 260, 145, 30, 30, idex(_(dummy)));
+ char const * const dummy = N_("Get bounding box from file|#G");
+ fdui->button_getBB = obj = fl_add_button(FL_NORMAL_BUTTON, 135, 160, 220, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- {
- char const * const dummy = N_("draft mode|#d");
- fdui->button_draft = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 260, 180, 30, 30, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
+ fl_end_form();
+
+ fdui->form->fdui = fdui;
+
+ return fdui;
+}
+/*---------------------------------------*/
+
+FD_form_special::~FD_form_special()
+{
+ if ( form->visible ) fl_hide_form( form );
+ fl_free_form( form );
+}
+
+
+FD_form_special * FormGraphics::build_special()
+{
+ FL_OBJECT *obj;
+ FD_form_special *fdui = new FD_form_special;
+
+ fdui->form = fl_bgn_form(FL_NO_BOX, 505, 235);
+ fdui->form->u_vdata = this;
+ obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 235, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 15, 455, 70, _("Special Options"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Get bounding box from file|#G");
- fdui->button_getBB = obj = fl_add_button(FL_NORMAL_BUTTON, 30, 160, 220, 30, idex(_(dummy)));
+ char const * const dummy = N_("LaTeX Options:|#L");
+ fdui->input_special = obj = fl_add_input(FL_NORMAL_INPUT, 190, 40, 265, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
}
/*---------------------------------------*/
-FD_form_special::~FD_form_special()
+FD_form_lyxview::~FD_form_lyxview()
{
if ( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
-FD_form_special * FormGraphics::build_special()
+FD_form_lyxview * FormGraphics::build_lyxview()
{
FL_OBJECT *obj;
- FD_form_special *fdui = new FD_form_special;
+ FD_form_lyxview *fdui = new FD_form_lyxview;
fdui->form = fl_bgn_form(FL_NO_BOX, 505, 235);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 505, 235, "");
+ obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 10, 470, 205, _("Screen Display"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 15, 455, 75, _("Rotation"));
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ {
+ char const * const dummy = N_("Show:|#o");
+ fdui->choice_display = obj = fl_add_choice(FL_NORMAL_CHOICE, 30, 45, 100, 30, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Angle:|#n");
- fdui->input_rotate_angle = obj = fl_add_input(FL_INT_INPUT, 125, 40, 70, 30, idex(_(dummy)));
+ char const * const dummy = N_("Width:|#w");
+ fdui->input_lyxwidth = obj = fl_add_input(FL_NORMAL_INPUT, 305, 70, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- obj = fl_add_text(FL_NORMAL_TEXT, 200, 40, 80, 30, _("degrees"));
+ fdui->choice_width_lyxwidth = obj = fl_add_choice(FL_NORMAL_CHOICE, 410, 70, 60, 30, "");
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 15, 105, 455, 70, _("Special Options"));
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ {
+ char const * const dummy = N_("Height:|#h");
+ fdui->input_lyxheight = obj = fl_add_input(FL_NORMAL_INPUT, 305, 110, 90, 30, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fdui->choice_width_lyxheight = obj = fl_add_choice(FL_NORMAL_CHOICE, 410, 110, 60, 30, "");
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("LaTeX Options:|#L");
- fdui->input_special = obj = fl_add_input(FL_NORMAL_INPUT, 190, 130, 265, 30, idex(_(dummy)));
+ char const * const dummy = N_("Value:|#V");
+ fdui->input_lyxscale = obj = fl_add_input(FL_NORMAL_INPUT, 305, 175, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_bgn_group();
+ obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 205, 20, 30, 30, "Default|#D");
+ fl_set_object_color(obj, FL_COL1, FL_YELLOW);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 205, 70, 30, 30, "Custom|#C");
+ fl_set_object_color(obj, FL_COL1, FL_YELLOW);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
- char const * const dummy = N_("Origin:|#O");
- fdui->choice_origin = obj = fl_add_choice(FL_NORMAL_CHOICE, 335, 40, 115, 30, idex(_(dummy)));
+ char const * const dummy = N_("Scale|#S");
+ fdui->button_lyxscale = obj = fl_add_round3dbutton(FL_RADIO_BUTTON, 205, 175, 30, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_color(obj, FL_COL1, FL_YELLOW);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ fl_end_group();
+
+ // xgettext:no-c-format
+ obj = fl_add_text(FL_NORMAL_TEXT, 410, 175, 25, 30, _("%"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_end_form();
fdui->form->fdui = fdui;
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+
/**** Forms and Objects ****/
struct FD_form_graphics {
FL_FORM *form;
FL_OBJECT *input_filename;
FL_OBJECT *button_browse;
- FL_OBJECT *choice_display;
- FL_OBJECT *input_lyxwidth;
- FL_OBJECT *choice_width_lyxwidth;
- FL_OBJECT *input_lyxheight;
- FL_OBJECT *choice_width_lyxheight;
FL_OBJECT *check_subcaption;
FL_OBJECT *input_subcaption;
+ FL_OBJECT *input_rotate_angle;
+ FL_OBJECT *choice_origin;
+ FL_OBJECT *button_clip;
+ FL_OBJECT *button_draft;
};
struct FD_form_size {
~FD_form_size();
FL_OBJECT *choice_bb_y0;
FL_OBJECT *input_bb_y1;
FL_OBJECT *choice_bb_y1;
- FL_OBJECT *button_clip;
- FL_OBJECT *button_draft;
FL_OBJECT *button_getBB;
};
struct FD_form_special {
~FD_form_special();
FL_FORM *form;
- FL_OBJECT *input_rotate_angle;
FL_OBJECT *input_special;
- FL_OBJECT *choice_origin;
+};
+struct FD_form_lyxview {
+ ~FD_form_lyxview();
+
+ FL_FORM *form;
+ FL_OBJECT *choice_display;
+ FL_OBJECT *input_lyxwidth;
+ FL_OBJECT *choice_width_lyxwidth;
+ FL_OBJECT *input_lyxheight;
+ FL_OBJECT *choice_width_lyxheight;
+ FL_OBJECT *input_lyxscale;
+ FL_OBJECT *button_lyxscale;
};
#endif /* FD_form_graphics_h_ */
Internal Form Definition File
(do not change)
-Number of forms: 5
+Number of forms: 6
Unit of measure: FL_COORD_PIXEL
SnapGrid: 5
Name: form_file
Width: 505
Height: 235
-Number of Objects: 12
+Number of Objects: 13
--------------------
class: FL_BOX
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 15 65 460 95
+box: 15 50 460 50
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
-style: FL_NORMAL_STYLE
+style: FL_BOLD_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Screen Display
+label: Subfigure
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
argument:
--------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 85 80 160 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 20 60 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Show:|#o
+label: Subfigure|#S
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: choice_display
+name: check_subcaption
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 85 120 95 30
+box: 180 60 280 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Width:|#w
+label: Title:|#T
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: input_lyxwidth
+name: input_subcaption
callback: C_FormBaseInputCB
argument: 0
--------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 185 120 60 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 15 110 460 60
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_BOLD_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label:
+label: Rotation
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: choice_width_lyxwidth
-callback: C_FormBaseInputCB
-argument: 0
+name:
+callback:
+argument:
--------------------
class: FL_INPUT
-type: NORMAL_INPUT
-box: 315 120 85 30
+type: INT_INPUT
+box: 105 130 72 28
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Height:|#h
+label: Angle:|#n
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: input_lyxheight
+name: input_rotate_angle
callback: C_FormBaseInputCB
argument: 0
+--------------------
+class: FL_TEXT
+type: NORMAL_TEXT
+box: 175 130 66 30
+boxtype: FL_FLAT_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: degrees
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 405 120 60 30
+box: 340 130 118 28
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label:
+label: Origin:|#O
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: choice_width_lyxheight
+name: choice_origin
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 15 175 460 50
+box: 15 180 460 50
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
-style: FL_NORMAL_STYLE
+style: FL_BOLD_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Sub figure
+label: Options
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 20 185 30 30
+box: 145 190 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Subfigure|#S
+label: clip to bounding box|#b
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: check_subcaption
+name: button_clip
callback: C_FormBaseInputCB
argument: 0
--------------------
-class: FL_INPUT
-type: NORMAL_INPUT
-box: 180 185 280 30
-boxtype: FL_DOWN_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 20 190 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Title:|#T
+label: draft mode|#m
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: input_subcaption
+name: button_draft
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 15 15 455 205
+box: 15 10 470 210
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
-style: FL_NORMAL_STYLE
+style: FL_BOLD_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Size
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 0 0 0
+box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 80 30 30 30
+box: 50 20 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 80 65 30 30
+box: 50 80 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 80 145 30 30
+box: 50 175 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 270 65 85 30
+box: 325 80 85 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 360 65 60 30
+box: 415 80 60 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 270 100 85 30
+box: 325 115 85 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 360 100 60 30
+box: 415 115 60 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 270 145 85 30
+box: 325 175 85 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Factor:|#F
+label: Value:|#V
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_TEXT
type: NORMAL_TEXT
-box: 360 145 25 30
+box: 420 175 25 30
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 270 185 30 30
+box: 85 115 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: keep aspect ratio|#k
+label: keep aspectratio|#k
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
Name: form_bbox
Width: 505
Height: 235
-Number of Objects: 15
+Number of Objects: 13
--------------------
class: FL_BOX
callback: C_FormBaseInputCB
argument: 0
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 260 145 30 30
-boxtype: FL_NO_BOX
-colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_RIGHT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: clip to bounding box|#c
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: button_clip
-callback: C_FormBaseInputCB
-argument: 0
-
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 260 180 30 30
-boxtype: FL_NO_BOX
-colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_RIGHT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: draft mode|#d
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: button_draft
-callback: C_FormBaseInputCB
-argument: 0
-
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 30 160 220 30
+box: 135 160 220 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
Name: form_special
Width: 505
Height: 235
-Number of Objects: 7
+Number of Objects: 3
--------------------
class: FL_BOX
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 15 15 455 75
+box: 15 15 455 70
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Rotation
+label: Special Options
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_INPUT
-type: INT_INPUT
-box: 125 40 70 30
+type: NORMAL_INPUT
+box: 190 40 265 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Angle:|#n
+label: LaTeX Options:|#L
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: input_rotate_angle
+name: input_special
callback: C_FormBaseInputCB
argument: 0
+=============== FORM ===============
+Name: form_lyxview
+Width: 505
+Height: 235
+Number of Objects: 14
+
--------------------
-class: FL_TEXT
-type: NORMAL_TEXT
-box: 200 40 80 30
+class: FL_BOX
+type: FLAT_BOX
+box: 0 0 505 235
boxtype: FL_FLAT_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
+size: FL_DEFAULT_SIZE
lcol: FL_BLACK
-label: degrees
+label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
-box: 15 105 455 70
+box: 15 10 470 205
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
-style: FL_NORMAL_STYLE
+style: FL_BOLD_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Special Options
+label: Screen Display
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
callback:
argument:
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 30 45 100 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Show:|#o
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: choice_display
+callback: C_FormBaseInputCB
+argument: 0
+
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 190 130 265 30
+box: 305 70 90 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: LaTeX Options:|#L
+label: Width:|#w
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: input_special
+name: input_lyxwidth
callback: C_FormBaseInputCB
argument: 0
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 335 40 115 30
+box: 410 70 60 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Origin:|#O
+label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: choice_origin
+name: choice_width_lyxwidth
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_INPUT
+type: NORMAL_INPUT
+box: 305 110 90 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Height:|#h
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: input_lyxheight
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 410 110 60 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: choice_width_lyxheight
callback: C_FormBaseInputCB
argument: 0
+--------------------
+class: FL_INPUT
+type: NORMAL_INPUT
+box: 305 175 90 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Value:|#V
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: input_lyxscale
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_BEGIN_GROUP
+type: 0
+box: 0 10 10 0
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
+--------------------
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 205 20 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Default|#D
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 205 70 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Custom|#C
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_ROUND3DBUTTON
+type: RADIO_BUTTON
+box: 205 175 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Scale|#S
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: button_lyxscale
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_END_GROUP
+type: 0
+box: 0 0 0 0
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
+--------------------
+class: FL_TEXT
+type: NORMAL_TEXT
+box: 410 175 25 30
+boxtype: FL_FLAT_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: %
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name:
+callback:
+argument:
+
==============================
--------------------
}
// The unit is presumed to begin at the first char a-z
+ // or with the char '%'
string const tmp = lowercase(strip(frontStrip(str)));
string::const_iterator p = tmp.begin();
for (; p != tmp.end(); ++p) {
- if (*p >= 'a' && *p <= 'z')
+ if ((*p >= 'a' && *p <= 'z') || *p == '%')
break;
}
+2002-02-04 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * insetgraphicsParams.C (init): set display to DEFAULT.
+ No longer #include "lyxrc.h".
+
+2002-02-04 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * insetgraphics.C (readFigInset): comment out the "zippedFile" stuff
+ for now (so that the code compiles).
+
+2002-02-02 Herbert Voss <voss@lyx.org>
+
+ * insetgraphic.C: delete inVariant() and some minor changes
+ * insetgraphicsParams.[C]:
+
2002-02-01 Angus Leeming <a.leeming@ic.ac.uk>
* insetgraphics.C (updateInset): if params.display == DEFAULT,
}
}
-
+// FormatVersion < 1.0 (LyX < 1.2)
void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
{
std::vector<string> const oldUnits =
//
// Get the extension (format) of the original file.
// we handle it like a virtual one, so we can have
- // different extensions with the same type
+ // different extensions with the same type.
+ // if it's a zipped one, than let LaTeX do the rest!!!
+ //if (zippedFile(params.filename))
+ // return params.filename;
+ // now we have unzipped files
string const extension = getExtFromContents(params.filename);
// Are we creating a PDF or a PS file?
// (Should actually mean, are we usind latex or pdflatex).
#endif
#include "insetgraphicsParams.h"
-
-#include "lyxrc.h"
#include "support/translator.h"
#include "support/filetools.h"
#include "support/lyxlib.h"
bb = string(); // bounding box
draft = false; // draft mode
clip = false; // clip image
- if (lyxrc.display_graphics == "mono")
- display = MONOCHROME;
- else if (lyxrc.display_graphics == "gray")
- display = GRAYSCALE;
- else if (lyxrc.display_graphics == "color")
- display = COLOR;
- else
- display = NONE;
+ display = DEFAULT;
subcaption = false; // subfigure
width = LyXLength(); // set to 0pt
height = LyXLength();
rotateOrigin = "center"; //
rotateAngle = 0.0; // in degrees
special = string(); // userdefined stuff
-
- testInvariant();
}
void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
rotateOrigin = igp.rotateOrigin;
rotateAngle = igp.rotateAngle;
special = igp.special;
-
- testInvariant();
-}
-
-void InsetGraphicsParams::testInvariant() const
-{
- // Filename might be empty (when the dialog is first created).
- // Assert(!filename.empty());
- lyx::Assert(display == DEFAULT ||
- display == COLOR ||
- display == MONOCHROME ||
- display == GRAYSCALE ||
- display == NONE
- );
- // Angle is in degrees and ranges -360 < angle < 360
- // The reason for this is that in latex there is a meaning for the
- // different angles and they are not necessarliy interchangeable,
- // it depends on the rotation origin.
- lyx::Assert(rotateAngle < 360.0);
- lyx::Assert(rotateAngle > -360.0);
-
}
bool operator==(InsetGraphicsParams const & left,
void Write(Buffer const * buf, ostream & os) const;
/// If the token belongs to our parameters, read it.
bool Read(Buffer const * buf, LyXLex & lex, string const & token);
- /// Test the struct to make sure that all the options have legal values.
- void testInvariant() const;
private:
/// Initialize the object to a default status.