2002-03-11 17:00:41 +00:00
|
|
|
/**
|
2001-03-28 13:11:08 +00:00
|
|
|
* \file FormGraphics.C
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-11 17:00:41 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Baruch Even
|
|
|
|
* \author Herbert Voss
|
2002-10-24 11:53:46 +00:00
|
|
|
* \author Rob Lahaye
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2000-07-31 12:30:10 +00:00
|
|
|
*/
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <config.h>
|
2000-08-14 09:44:53 +00:00
|
|
|
|
2001-03-28 13:11:08 +00:00
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "ControlGraphics.h"
|
2000-07-31 12:30:10 +00:00
|
|
|
#include "FormGraphics.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
#include "forms/form_graphics.h"
|
2000-07-31 12:30:10 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
#include "checkedwidgets.h"
|
2001-03-28 13:11:08 +00:00
|
|
|
#include "input_validators.h"
|
2002-10-24 11:53:46 +00:00
|
|
|
#include "Tooltips.h"
|
|
|
|
#include "xforms_helpers.h"
|
|
|
|
|
2000-07-31 12:30:10 +00:00
|
|
|
#include "debug.h" // for lyxerr
|
2002-10-24 11:53:46 +00:00
|
|
|
#include "lyxrc.h" // for lyxrc.display_graphics
|
|
|
|
|
|
|
|
#include "insets/insetgraphicsParams.h"
|
|
|
|
|
|
|
|
#include "controllers/helper_funcs.h" // for getStringFromVector
|
|
|
|
|
|
|
|
#include "frontends/Alert.h"
|
|
|
|
|
2003-05-13 14:36:24 +00:00
|
|
|
#include "support/tostr.h"
|
2003-05-14 09:17:22 +00:00
|
|
|
#include "support/lstrings.h" // for strToDbl
|
2002-10-24 12:34:59 +00:00
|
|
|
#include "support/lyxlib.h" // for float_equal
|
2002-01-29 09:26:24 +00:00
|
|
|
#include "support/filetools.h" // for MakeAbsPath etc
|
2002-10-24 11:53:46 +00:00
|
|
|
|
2003-03-30 20:25:44 +00:00
|
|
|
#include "support/BoostFormat.h"
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2003-05-14 09:17:22 +00:00
|
|
|
#include "lyx_forms.h"
|
2000-07-31 12:30:10 +00:00
|
|
|
|
2000-07-31 13:36:03 +00:00
|
|
|
using std::endl;
|
2002-05-01 09:25:51 +00:00
|
|
|
using std::vector;
|
2000-08-14 09:44:53 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
|
2001-10-23 09:03:17 +00:00
|
|
|
namespace {
|
|
|
|
|
2002-01-29 09:26:24 +00:00
|
|
|
// Bound the number of input characters
|
2002-08-27 20:30:20 +00:00
|
|
|
int const SIZE_MAXDIGITS = 10;
|
2001-10-23 09:03:17 +00:00
|
|
|
int const FILENAME_MAXCHARS = 1024;
|
2002-08-24 22:02:30 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
string defaultUnit("cm");
|
|
|
|
|
2003-04-09 21:34:50 +00:00
|
|
|
#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
|
|
|
|
bool const scalableTabfolders = false;
|
|
|
|
#else
|
|
|
|
bool const scalableTabfolders = true;
|
|
|
|
#endif
|
|
|
|
|
2001-10-23 09:03:17 +00:00
|
|
|
} // namespace anon
|
|
|
|
|
2001-09-13 09:34:39 +00:00
|
|
|
|
2003-03-07 18:44:57 +00:00
|
|
|
typedef FormController<ControlGraphics, FormView<FD_graphics> > base_class;
|
2001-03-28 13:11:08 +00:00
|
|
|
|
2003-03-07 18:44:57 +00:00
|
|
|
FormGraphics::FormGraphics(Dialog & parent)
|
2003-04-09 21:34:50 +00:00
|
|
|
: base_class(parent, _("Graphics"), scalableTabfolders)
|
2001-03-28 13:11:08 +00:00
|
|
|
{}
|
2000-07-31 12:30:10 +00:00
|
|
|
|
|
|
|
|
2002-01-29 09:26:24 +00:00
|
|
|
void FormGraphics::redraw()
|
|
|
|
{
|
2002-02-16 15:59:55 +00:00
|
|
|
if (form() && form()->visible)
|
2002-01-29 09:26:24 +00:00
|
|
|
fl_redraw_form(form());
|
|
|
|
else
|
|
|
|
return;
|
2002-03-12 14:11:15 +00:00
|
|
|
FL_FORM * outer_form = fl_get_active_folder(dialog_->tabfolder);
|
2002-01-29 09:26:24 +00:00
|
|
|
if (outer_form && outer_form->visible)
|
|
|
|
fl_redraw_form(outer_form);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-07-31 12:30:10 +00:00
|
|
|
void FormGraphics::build()
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
dialog_.reset(build_graphics(this));
|
2000-08-14 09:44:53 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
// Manage the ok, apply, restore and cancel/close buttons
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().setOK(dialog_->button_ok);
|
|
|
|
bcview().setApply(dialog_->button_apply);
|
|
|
|
bcview().setCancel(dialog_->button_close);
|
|
|
|
bcview().setRestore(dialog_->button_restore);
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2002-01-29 09:26:24 +00:00
|
|
|
// the file section
|
2002-06-13 13:43:51 +00:00
|
|
|
file_.reset(build_graphics_file(this));
|
2002-01-29 09:26:24 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable for read-only documents
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().addReadOnly(file_->button_browse);
|
|
|
|
bcview().addReadOnly(file_->check_aspectratio);
|
|
|
|
bcview().addReadOnly(file_->check_draft);
|
|
|
|
bcview().addReadOnly(file_->check_nounzip);
|
2002-10-24 11:53:46 +00:00
|
|
|
|
|
|
|
// check validity of "length + unit" input
|
2003-03-10 03:13:28 +00:00
|
|
|
addCheckedGlueLength(bcview(), file_->input_width);
|
|
|
|
addCheckedGlueLength(bcview(), file_->input_height);
|
2002-01-29 09:26:24 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// trigger an input event for cut&paste with middle mouse button.
|
2002-03-11 18:24:31 +00:00
|
|
|
setPrehandler(file_->input_filename);
|
2002-08-24 22:02:30 +00:00
|
|
|
setPrehandler(file_->input_lyxscale);
|
|
|
|
setPrehandler(file_->input_width);
|
|
|
|
setPrehandler(file_->input_height);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// for activate ok/apply immediately upon input
|
|
|
|
fl_set_input_return(file_->input_filename, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(file_->input_lyxscale, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(file_->input_width, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(file_->input_height, FL_RETURN_CHANGED);
|
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_input_maxchars(file_->input_filename, FILENAME_MAXCHARS);
|
2002-10-31 11:25:02 +00:00
|
|
|
fl_set_input_filter(file_->input_lyxscale, fl_unsigned_int_filter);
|
2002-05-01 09:25:51 +00:00
|
|
|
|
2002-10-31 11:25:02 +00:00
|
|
|
// width default is scaling: use unsigned float filter
|
|
|
|
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);
|
2002-08-27 20:30:20 +00:00
|
|
|
fl_set_input_maxchars(file_->input_height, SIZE_MAXDIGITS);
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
string const display_List =
|
|
|
|
_("Default|Monochrome|Grayscale|Color|Do not display");
|
2002-08-27 20:30:20 +00:00
|
|
|
fl_addto_choice(file_->choice_display, display_List.c_str());
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2003-05-13 09:48:57 +00:00
|
|
|
string const width_list = bformat(_("Scale%%%%|%1$s"), choice_Length_All);
|
2002-08-27 20:30:20 +00:00
|
|
|
fl_addto_choice(file_->choice_width, width_list.c_str());
|
2002-07-02 19:23:10 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_addto_choice(file_->choice_height, choice_Length_All.c_str());
|
2002-01-29 09:26:24 +00:00
|
|
|
|
2002-07-22 12:36:41 +00:00
|
|
|
// set up the tooltips for the filesection
|
2002-10-24 12:34:59 +00:00
|
|
|
string str = _("The file you want to insert.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(file_->input_filename, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Browse the directories.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(file_->button_browse, str);
|
|
|
|
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Scale the image to inserted percentage value.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->input_lyxscale, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Select display mode for this image.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->choice_display, str);
|
|
|
|
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Set the image width to the inserted value.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->input_width, str);
|
2002-12-08 20:45:21 +00:00
|
|
|
// xgettext:no-c-format
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Select unit for width; Scale% for scaling whole image.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->choice_width, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Set the image height to the inserted value.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->input_height, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Select unit for height.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->choice_height, str);
|
2002-11-21 18:33:09 +00:00
|
|
|
str = _("Do not distort the image. "
|
|
|
|
"Keep image within \"width\" by \"height\" and obey "
|
2002-10-24 12:34:59 +00:00
|
|
|
"aspect ratio.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(file_->check_aspectratio, str);
|
2002-07-22 12:36:41 +00:00
|
|
|
str = _("Pass a filename like \"file.eps.gz\" to the LaTeX output. "
|
2002-10-24 12:34:59 +00:00
|
|
|
"Useful when LaTeX should unzip the file. Needs an additional "
|
|
|
|
"file like \"file.eps.bb\" which holds the values for "
|
|
|
|
"the bounding box.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(file_->check_nounzip, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Show image only as a rectangle of the original size.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(file_->check_draft, str);
|
|
|
|
|
2002-01-30 14:55:27 +00:00
|
|
|
// the bounding box selection
|
2002-06-13 13:43:51 +00:00
|
|
|
bbox_.reset(build_graphics_bbox(this));
|
2002-01-30 14:55:27 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable for read-only documents
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().addReadOnly(bbox_->button_getBB);
|
|
|
|
bcview().addReadOnly(bbox_->check_clip);
|
2002-03-11 18:24:31 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// check validity of "length + unit" input
|
2003-03-10 03:13:28 +00:00
|
|
|
addCheckedLyXLength(bcview(), bbox_->input_bb_x1, bbox_->text_X);
|
2002-10-24 11:53:46 +00:00
|
|
|
|
|
|
|
// trigger an input event for cut&paste with middle mouse button.
|
2002-03-11 18:24:31 +00:00
|
|
|
setPrehandler(bbox_->input_bb_x0);
|
|
|
|
setPrehandler(bbox_->input_bb_y0);
|
|
|
|
setPrehandler(bbox_->input_bb_x1);
|
|
|
|
setPrehandler(bbox_->input_bb_y1);
|
2002-02-26 10:50:48 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// for activate ok/apply immediately upon input
|
|
|
|
fl_set_input_return(bbox_->input_bb_x0, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(bbox_->input_bb_y0, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(bbox_->input_bb_x1, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(bbox_->input_bb_y1, FL_RETURN_CHANGED);
|
|
|
|
|
|
|
|
fl_set_input_filter(bbox_->input_bb_x0, fl_unsigned_float_filter);
|
|
|
|
fl_set_input_filter(bbox_->input_bb_y0, fl_unsigned_float_filter);
|
|
|
|
fl_set_input_filter(bbox_->input_bb_y1, fl_unsigned_float_filter);
|
|
|
|
|
2002-11-04 14:53:03 +00:00
|
|
|
string const bb_units = getStringFromVector(frnt::getBBUnits(), "|");
|
2002-02-11 10:42:11 +00:00
|
|
|
fl_addto_choice(bbox_->choice_bb_units, bb_units.c_str());
|
2002-01-29 09:26:24 +00:00
|
|
|
|
2002-07-22 12:36:41 +00:00
|
|
|
// set up the tooltips for the bounding-box-section
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("The lower left x-value of the bounding box.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->input_bb_x0, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("The lower left y-value of the bounding box.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->input_bb_y0, str);
|
2002-10-24 11:53:46 +00:00
|
|
|
str = _("The upper right x-value of the bounding box; "
|
|
|
|
"only this input field allows length + unit, e.g. 5cm "
|
2002-10-24 12:34:59 +00:00
|
|
|
"and sets the unit for the other input fields.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->input_bb_x1, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("The upper right y-value of the bounding box.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->input_bb_y1, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Select unit for the bounding box values.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->choice_bb_units, str);
|
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
str = _("Read the image coordinates new from file. For (e)ps-file "
|
|
|
|
"the bounding box is read, otherwise the imagesize in pixels. "
|
2002-10-24 12:34:59 +00:00
|
|
|
"Default unit is \"bp\", the PostScript's b(ig) p(oint).");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->button_getBB, str);
|
|
|
|
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Clip image to the bounding box values.");
|
2002-07-22 12:36:41 +00:00
|
|
|
tooltips().init(bbox_->check_clip, str);
|
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
// the extra section
|
|
|
|
extra_.reset(build_graphics_extra(this));
|
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable for read-only documents
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().addReadOnly(extra_->input_rotate_angle);
|
|
|
|
bcview().addReadOnly(extra_->choice_origin);
|
|
|
|
bcview().addReadOnly(extra_->check_subcaption);
|
|
|
|
bcview().addReadOnly(extra_->input_special);
|
2002-01-29 09:26:24 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// trigger an input event for cut&paste with middle mouse button.
|
2002-08-24 22:02:30 +00:00
|
|
|
setPrehandler(extra_->input_rotate_angle);
|
|
|
|
setPrehandler(extra_->input_subcaption);
|
|
|
|
setPrehandler(extra_->input_special);
|
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
fl_set_input_return(extra_->input_rotate_angle, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(extra_->input_subcaption, FL_RETURN_CHANGED);
|
|
|
|
fl_set_input_return(extra_->input_special, FL_RETURN_CHANGED);
|
|
|
|
|
|
|
|
fl_set_input_filter(extra_->input_rotate_angle, fl_float_filter);
|
2002-08-24 22:02:30 +00:00
|
|
|
|
|
|
|
using namespace frnt;
|
|
|
|
vector<RotationOriginPair> origindata = getRotationOriginData();
|
|
|
|
|
|
|
|
// Store the identifiers for later
|
|
|
|
origins_ = getSecond(origindata);
|
|
|
|
|
2002-11-07 00:21:28 +00:00
|
|
|
string const choice = getStringFromVector(getFirst(origindata), "|");
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_addto_choice(extra_->choice_origin, choice.c_str());
|
|
|
|
|
|
|
|
// set up the tooltips for the extra section
|
|
|
|
str = _("Insert the rotation angle in degrees. "
|
2002-11-21 18:33:09 +00:00
|
|
|
"Positive value rotates anti-clockwise, "
|
2002-10-24 12:34:59 +00:00
|
|
|
"negative value clockwise.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(extra_->input_rotate_angle, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Insert the point of origin for rotation.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(extra_->choice_origin, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Enables use of subfigure with its own caption.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(extra_->check_subcaption, str);
|
2002-10-24 12:34:59 +00:00
|
|
|
str = _("Insert the optional subfigure caption.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(extra_->input_subcaption, str);
|
2003-01-06 14:02:24 +00:00
|
|
|
str = _("Add any additional LaTeX option, which is defined in the "
|
2002-11-21 18:33:09 +00:00
|
|
|
"graphicx-package and not mentioned in the gui's tabfolders.");
|
2002-08-24 22:02:30 +00:00
|
|
|
tooltips().init(extra_->input_special, str);
|
2002-07-22 12:36:41 +00:00
|
|
|
|
2003-04-09 21:34:50 +00:00
|
|
|
// Enable the tabfolder to be rescaled correctly.
|
|
|
|
if (scalableTabfolders)
|
|
|
|
fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
|
|
|
|
|
|
|
|
// Stack tabs
|
2002-03-12 14:11:15 +00:00
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("File"), file_->form);
|
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("Bounding Box"), bbox_->form);
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("Extra"), extra_->form);
|
2002-07-22 12:36:41 +00:00
|
|
|
|
2002-03-11 11:17:49 +00:00
|
|
|
// set the right default unit
|
2002-08-24 22:02:30 +00:00
|
|
|
switch (lyxrc.default_papersize) {
|
|
|
|
case BufferParams::PAPER_DEFAULT: break;
|
|
|
|
case BufferParams::PAPER_USLETTER:
|
|
|
|
case BufferParams::PAPER_LEGALPAPER:
|
|
|
|
case BufferParams::PAPER_EXECUTIVEPAPER: defaultUnit = "in"; break;
|
|
|
|
case BufferParams::PAPER_A3PAPER:
|
|
|
|
case BufferParams::PAPER_A4PAPER:
|
|
|
|
case BufferParams::PAPER_A5PAPER:
|
|
|
|
case BufferParams::PAPER_B5PAPER: defaultUnit = "cm"; break;
|
|
|
|
}
|
2000-07-31 12:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormGraphics::apply()
|
|
|
|
{
|
2000-08-14 09:44:53 +00:00
|
|
|
// Create the parameters structure and fill the data from the dialog.
|
2001-03-28 13:11:08 +00:00
|
|
|
InsetGraphicsParams & igp = controller().params();
|
2002-02-05 18:43:28 +00:00
|
|
|
|
2002-02-04 15:36:45 +00:00
|
|
|
// the file section
|
2002-07-21 15:51:07 +00:00
|
|
|
igp.filename = getString(file_->input_filename);
|
2002-08-24 22:02:30 +00:00
|
|
|
|
|
|
|
igp.lyxscale = strToInt(getString(file_->input_lyxscale));
|
2002-08-27 20:30:20 +00:00
|
|
|
if (igp.lyxscale == 0) {
|
|
|
|
igp.lyxscale = 100;
|
|
|
|
}
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
switch (fl_get_choice(file_->choice_display)) {
|
2002-10-24 11:53:46 +00:00
|
|
|
case 5:
|
|
|
|
igp.display = grfx::NoDisplay;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
igp.display = grfx::ColorDisplay;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
igp.display = grfx::GrayscaleDisplay;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
igp.display = grfx::MonochromeDisplay;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
igp.display = grfx::DefaultDisplay;
|
2002-02-04 15:36:45 +00:00
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
|
|
|
|
// first item in choice_width means scaling
|
|
|
|
if (fl_get_choice(file_->choice_width) == 1) {
|
2002-10-24 11:53:46 +00:00
|
|
|
igp.scale = strToDbl(getString(file_->input_width));
|
2002-10-24 12:34:59 +00:00
|
|
|
if (lyx::float_equal(igp.scale, 0.0, 0.05)) {
|
2002-10-24 11:53:46 +00:00
|
|
|
igp.scale = 100.0;
|
2002-08-27 20:30:20 +00:00
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
igp.width = LyXLength();
|
2002-08-27 20:30:20 +00:00
|
|
|
} else {
|
2002-10-24 11:53:46 +00:00
|
|
|
igp.scale = 0.0;
|
|
|
|
igp.width = LyXLength(getLengthFromWidgets(file_->input_width,
|
|
|
|
file_->choice_width));
|
2002-08-24 22:02:30 +00:00
|
|
|
}
|
2002-10-24 11:53:46 +00:00
|
|
|
igp.height = LyXLength(getLengthFromWidgets(file_->input_height,
|
|
|
|
file_->choice_height));
|
2002-08-24 22:02:30 +00:00
|
|
|
igp.keepAspectRatio = fl_get_button(file_->check_aspectratio);
|
2002-05-01 09:25:51 +00:00
|
|
|
|
2002-03-12 14:11:15 +00:00
|
|
|
igp.draft = fl_get_button(file_->check_draft);
|
|
|
|
igp.noUnzip = fl_get_button(file_->check_nounzip);
|
2002-02-01 18:53:50 +00:00
|
|
|
|
2002-02-04 15:36:45 +00:00
|
|
|
// the bb section
|
2002-10-24 11:53:46 +00:00
|
|
|
if (!controller().bbChanged) {
|
2002-11-21 18:33:09 +00:00
|
|
|
// don't write anything
|
2002-10-24 11:53:46 +00:00
|
|
|
igp.bb.erase();
|
2002-08-27 20:30:20 +00:00
|
|
|
} else {
|
2002-10-24 11:53:46 +00:00
|
|
|
// allow length + unit input only for x1 input field
|
|
|
|
string x1_str = "0";
|
|
|
|
if (!getString(bbox_->input_bb_x1).empty()) {
|
|
|
|
x1_str = getLengthFromWidgets(bbox_->input_bb_x1,
|
|
|
|
bbox_->choice_bb_units);
|
|
|
|
LyXLength x1 = LyXLength(x1_str);
|
|
|
|
x1_str = x1.asString();
|
|
|
|
|
|
|
|
string unit;
|
|
|
|
switch (x1.unit()) {
|
|
|
|
case LyXLength::IN:
|
|
|
|
unit = "in";
|
|
|
|
break;
|
|
|
|
case LyXLength::MM:
|
|
|
|
unit = "mm";
|
|
|
|
break;
|
|
|
|
case LyXLength::CM:
|
|
|
|
unit = "cm";
|
|
|
|
break;
|
|
|
|
case LyXLength::BP:
|
|
|
|
default:
|
|
|
|
unit = "bp";
|
|
|
|
}
|
|
|
|
fl_set_choice_text(bbox_->choice_bb_units, unit.c_str());
|
|
|
|
}
|
|
|
|
|
2002-03-21 16:51:33 +00:00
|
|
|
string bb;
|
2002-07-21 15:51:07 +00:00
|
|
|
if (getString(bbox_->input_bb_x0).empty())
|
2002-10-24 11:53:46 +00:00
|
|
|
bb = "0";
|
2002-03-21 16:51:33 +00:00
|
|
|
else
|
|
|
|
bb = getLengthFromWidgets(bbox_->input_bb_x0,
|
2002-10-24 11:53:46 +00:00
|
|
|
bbox_->choice_bb_units);
|
|
|
|
|
2002-11-27 10:30:28 +00:00
|
|
|
bb += ' ';
|
2002-10-24 11:53:46 +00:00
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
if (getString(bbox_->input_bb_y0).empty())
|
2002-11-27 10:30:28 +00:00
|
|
|
bb += '0';
|
2002-03-21 16:51:33 +00:00
|
|
|
else
|
2002-10-24 11:53:46 +00:00
|
|
|
bb += getLengthFromWidgets(bbox_->input_bb_y0,
|
|
|
|
bbox_->choice_bb_units);
|
|
|
|
|
2002-11-27 10:30:28 +00:00
|
|
|
bb += ' ' + x1_str + ' ';
|
2002-10-24 11:53:46 +00:00
|
|
|
|
2002-07-21 15:51:07 +00:00
|
|
|
if (getString(bbox_->input_bb_y1).empty())
|
2002-11-27 10:30:28 +00:00
|
|
|
bb += '0';
|
2002-03-21 16:51:33 +00:00
|
|
|
else
|
2002-10-24 11:53:46 +00:00
|
|
|
bb += getLengthFromWidgets(bbox_->input_bb_y1,
|
2002-11-21 18:33:09 +00:00
|
|
|
bbox_->choice_bb_units);
|
2002-10-24 11:53:46 +00:00
|
|
|
|
2002-03-21 16:51:33 +00:00
|
|
|
igp.bb = bb;
|
2001-09-13 09:34:39 +00:00
|
|
|
}
|
2002-03-12 14:11:15 +00:00
|
|
|
igp.clip = fl_get_button(bbox_->check_clip);
|
2002-02-04 15:36:45 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
// the extra section
|
|
|
|
igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle));
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
// map angle into -360 (clock-wise) to +360 (counter clock-wise)
|
2002-08-27 20:30:20 +00:00
|
|
|
while (igp.rotateAngle <= -360.0) {
|
|
|
|
igp.rotateAngle += 360.0;
|
|
|
|
}
|
|
|
|
while (igp.rotateAngle >= 360.0) {
|
|
|
|
igp.rotateAngle -= 360.0;
|
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_input(extra_->input_rotate_angle, tostr(igp.rotateAngle).c_str());
|
|
|
|
|
|
|
|
int const origin_pos = fl_get_choice(extra_->choice_origin);
|
2003-02-04 11:40:06 +00:00
|
|
|
if (origin_pos == 0) {
|
2002-09-11 18:37:50 +00:00
|
|
|
igp.rotateOrigin.erase();
|
|
|
|
} else {
|
2002-11-07 00:21:28 +00:00
|
|
|
igp.rotateOrigin = origins_[origin_pos - 1];
|
2002-09-11 18:37:50 +00:00
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
|
|
|
|
igp.subcaption = fl_get_button(extra_->check_subcaption);
|
|
|
|
igp.subcaptionText = getString(extra_->input_subcaption);
|
|
|
|
|
|
|
|
igp.special = getString(extra_->input_special);
|
2000-07-31 12:30:10 +00:00
|
|
|
}
|
|
|
|
|
2000-10-13 05:57:05 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
void FormGraphics::update() {
|
2000-08-14 09:44:53 +00:00
|
|
|
// Update dialog with details from inset
|
2001-03-28 13:11:08 +00:00
|
|
|
InsetGraphicsParams & igp = controller().params();
|
2002-02-04 15:36:45 +00:00
|
|
|
|
|
|
|
// the file section
|
2002-01-29 09:26:24 +00:00
|
|
|
fl_set_input(file_->input_filename, igp.filename.c_str());
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_input(file_->input_lyxscale, tostr(igp.lyxscale).c_str());
|
|
|
|
|
|
|
|
switch (igp.display) {
|
2002-10-24 11:53:46 +00:00
|
|
|
case grfx::NoDisplay:
|
|
|
|
fl_set_choice(file_->choice_display, 5);
|
|
|
|
break;
|
|
|
|
case grfx::ColorDisplay:
|
|
|
|
fl_set_choice(file_->choice_display, 4);
|
|
|
|
break;
|
|
|
|
case grfx::GrayscaleDisplay:
|
|
|
|
fl_set_choice(file_->choice_display, 3);
|
|
|
|
break;
|
|
|
|
case grfx::MonochromeDisplay:
|
|
|
|
fl_set_choice(file_->choice_display, 2);
|
|
|
|
break;
|
|
|
|
case grfx::DefaultDisplay:
|
|
|
|
fl_set_choice(file_->choice_display, 1);
|
2002-08-24 22:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set width input fields according to scaling or width/height input
|
2002-10-31 11:25:02 +00:00
|
|
|
if (!lyx::float_equal(igp.scale, 0.0, 0.05)) {
|
2002-10-24 11:53:46 +00:00
|
|
|
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);
|
2002-08-27 20:30:20 +00:00
|
|
|
fl_set_input_maxchars(file_->input_width, 0);
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_input(file_->input_width, tostr(igp.scale).c_str());
|
|
|
|
fl_set_choice(file_->choice_width, 1);
|
2002-08-27 20:30:20 +00:00
|
|
|
} else {
|
|
|
|
fl_set_input_filter(file_->input_width, NULL);
|
|
|
|
fl_set_input_maxchars(file_->input_width, SIZE_MAXDIGITS);
|
2002-10-24 11:53:46 +00:00
|
|
|
updateWidgetsFromLength(file_->input_width, file_->choice_width,
|
|
|
|
igp.width, defaultUnit);
|
2002-05-01 09:25:51 +00:00
|
|
|
}
|
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
updateWidgetsFromLength(file_->input_height, file_->choice_height,
|
|
|
|
igp.height, defaultUnit);
|
|
|
|
|
|
|
|
// disable height input in case of scaling
|
2002-10-31 11:25:02 +00:00
|
|
|
bool const disable_height = !lyx::float_equal(igp.scale, 0.0, 0.05);
|
2002-10-24 11:53:46 +00:00
|
|
|
setEnabled(file_->input_height, !disable_height);
|
|
|
|
setEnabled(file_->choice_height, !disable_height);
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_button(file_->check_aspectratio, igp.keepAspectRatio);
|
2002-03-12 14:11:15 +00:00
|
|
|
fl_set_button(file_->check_draft, igp.draft);
|
|
|
|
fl_set_button(file_->check_nounzip, igp.noUnzip);
|
2002-01-30 14:55:27 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable aspectratio button in case of scaling or one of width/height
|
|
|
|
// is empty
|
|
|
|
bool const disable_aspectRatio = disable_height ||
|
2002-08-24 22:02:30 +00:00
|
|
|
getString(file_->input_width).empty() ||
|
|
|
|
getString(file_->input_height).empty();
|
|
|
|
setEnabled(file_->check_aspectratio, !disable_aspectRatio);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
|
|
// the bb section
|
2002-02-04 15:36:45 +00:00
|
|
|
// set the bounding box values, if exists. First we need the whole
|
|
|
|
// path, because the controller knows nothing about the doc-dir
|
2002-04-04 14:49:54 +00:00
|
|
|
updateBB(igp.filename, igp.bb);
|
|
|
|
fl_set_button(bbox_->check_clip, igp.clip);
|
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
// the extra section
|
|
|
|
fl_set_input(extra_->input_rotate_angle,
|
|
|
|
tostr(igp.rotateAngle).c_str());
|
2002-08-27 20:30:20 +00:00
|
|
|
|
2002-09-11 18:37:50 +00:00
|
|
|
int origin_pos;
|
|
|
|
if (igp.rotateOrigin.empty()) {
|
|
|
|
origin_pos = 1;
|
|
|
|
} else {
|
2003-02-04 11:40:06 +00:00
|
|
|
origin_pos = 1 + findPos(origins_, igp.rotateOrigin);
|
2002-09-11 18:37:50 +00:00
|
|
|
}
|
|
|
|
fl_set_choice(extra_->choice_origin, origin_pos);
|
2002-08-27 20:30:20 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_button(extra_->check_subcaption, igp.subcaption);
|
|
|
|
fl_set_input(extra_->input_subcaption, igp.subcaptionText.c_str());
|
|
|
|
setEnabled(extra_->input_subcaption,
|
|
|
|
fl_get_button(extra_->check_subcaption));
|
|
|
|
fl_set_input(extra_->input_special, igp.special.c_str());
|
|
|
|
|
|
|
|
// open dialog in the file-tab, whenever filename is empty
|
2002-08-27 20:30:20 +00:00
|
|
|
if (igp.filename.empty()) {
|
|
|
|
fl_set_folder(dialog_->tabfolder, file_->form);
|
|
|
|
}
|
2002-04-04 14:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FormGraphics::updateBB(string const & filename, string const & bb_inset)
|
|
|
|
{
|
|
|
|
// Update dialog with details from inset
|
|
|
|
// set the bounding box values, if exists. First we need the whole
|
|
|
|
// path, because the controller knows nothing about the doc-dir
|
2002-02-04 15:36:45 +00:00
|
|
|
controller().bbChanged = false;
|
2002-04-04 14:49:54 +00:00
|
|
|
if (bb_inset.empty()) {
|
2002-10-24 11:53:46 +00:00
|
|
|
lyxerr[Debug::GRAPHICS]
|
|
|
|
<< "FormGraphics::updateBB() [no BoundingBox]" << endl;
|
2002-04-05 09:18:26 +00:00
|
|
|
string const bb = controller().readBB(filename);
|
2002-03-21 21:21:28 +00:00
|
|
|
if (!bb.empty()) {
|
2002-03-21 16:51:33 +00:00
|
|
|
// get the values from the file
|
|
|
|
// in this case we always have the point-unit
|
2002-04-04 14:49:54 +00:00
|
|
|
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 {
|
|
|
|
// no bb from file
|
2002-03-21 16:51:33 +00:00
|
|
|
fl_set_input(bbox_->input_bb_x0, bb.c_str());
|
|
|
|
fl_set_input(bbox_->input_bb_y0, bb.c_str());
|
|
|
|
fl_set_input(bbox_->input_bb_x1, bb.c_str());
|
|
|
|
fl_set_input(bbox_->input_bb_y1, bb.c_str());
|
|
|
|
}
|
2002-04-05 14:10:56 +00:00
|
|
|
// "bp"
|
2002-04-04 14:49:54 +00:00
|
|
|
fl_set_choice(bbox_->choice_bb_units, 1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// get the values from the inset
|
2002-10-24 11:53:46 +00:00
|
|
|
lyxerr[Debug::GRAPHICS]
|
|
|
|
<< "FormGraphics::updateBB(): igp has BoundingBox"
|
|
|
|
<< " ["<< bb_inset << "]" << endl;
|
2002-03-21 16:51:33 +00:00
|
|
|
controller().bbChanged = true;
|
2002-08-27 20:30:20 +00:00
|
|
|
|
2002-03-21 16:51:33 +00:00
|
|
|
LyXLength anyLength;
|
2002-04-04 14:49:54 +00:00
|
|
|
anyLength = LyXLength(token(bb_inset,' ',0));
|
2002-03-21 16:51:33 +00:00
|
|
|
updateWidgetsFromLength(bbox_->input_bb_x0,
|
2002-04-05 14:10:56 +00:00
|
|
|
bbox_->choice_bb_units,anyLength,"bp");
|
2002-04-04 14:49:54 +00:00
|
|
|
anyLength = LyXLength(token(bb_inset,' ',1));
|
2002-03-21 16:51:33 +00:00
|
|
|
updateWidgetsFromLength(bbox_->input_bb_y0,
|
2002-04-05 14:10:56 +00:00
|
|
|
bbox_->choice_bb_units,anyLength,"bp");
|
2002-04-04 14:49:54 +00:00
|
|
|
anyLength = LyXLength(token(bb_inset,' ',2));
|
2002-03-21 16:51:33 +00:00
|
|
|
updateWidgetsFromLength(bbox_->input_bb_x1,
|
2002-04-05 14:10:56 +00:00
|
|
|
bbox_->choice_bb_units,anyLength,"bp");
|
2002-04-04 14:49:54 +00:00
|
|
|
anyLength = LyXLength(token(bb_inset,' ',3));
|
2002-03-21 16:51:33 +00:00
|
|
|
updateWidgetsFromLength(bbox_->input_bb_y1,
|
2002-04-05 14:10:56 +00:00
|
|
|
bbox_->choice_bb_units,anyLength,"bp");
|
2002-02-04 15:36:45 +00:00
|
|
|
}
|
2000-07-31 12:30:10 +00:00
|
|
|
}
|
|
|
|
|
2002-08-27 20:30:20 +00:00
|
|
|
|
2001-09-13 09:34:39 +00:00
|
|
|
ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
|
2000-10-24 13:13:59 +00:00
|
|
|
{
|
2002-02-05 12:19:32 +00:00
|
|
|
// the file section
|
2002-01-29 09:26:24 +00:00
|
|
|
if (ob == file_->button_browse) {
|
2001-03-30 09:51:46 +00:00
|
|
|
// Get the filename from the dialog
|
2002-07-21 15:51:07 +00:00
|
|
|
string const in_name = getString(file_->input_filename);
|
2001-03-30 09:51:46 +00:00
|
|
|
string const out_name = controller().Browse(in_name);
|
2002-10-24 11:53:46 +00:00
|
|
|
lyxerr[Debug::GRAPHICS]
|
|
|
|
<< "[FormGraphics]out_name: " << out_name << endl;
|
2001-03-30 09:51:46 +00:00
|
|
|
if (out_name != in_name && !out_name.empty()) {
|
2002-01-29 09:26:24 +00:00
|
|
|
fl_set_input(file_->input_filename, out_name.c_str());
|
2001-03-30 09:51:46 +00:00
|
|
|
}
|
2002-05-02 08:48:41 +00:00
|
|
|
if (controller().isFilenameValid(out_name) &&
|
2002-08-27 20:30:20 +00:00
|
|
|
!controller().bbChanged) {
|
2002-07-02 19:23:10 +00:00
|
|
|
updateBB(out_name, string());
|
2002-08-27 20:30:20 +00:00
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
} else if (ob == file_->input_width || ob == file_->input_height) {
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable aspectratio button in case of scaling or one of
|
|
|
|
// width/height is empty
|
2002-08-24 22:02:30 +00:00
|
|
|
bool const disable = fl_get_choice(file_->choice_width) == 1 ||
|
|
|
|
getString(file_->input_width).empty() ||
|
|
|
|
getString(file_->input_height).empty();
|
|
|
|
setEnabled(file_->check_aspectratio, !disable);
|
|
|
|
} else if (ob == file_->choice_width) {
|
|
|
|
// disable height input in case of scaling
|
|
|
|
bool const scaling = fl_get_choice(file_->choice_width) == 1;
|
|
|
|
setEnabled(file_->input_height, !scaling);
|
|
|
|
setEnabled(file_->choice_height, !scaling);
|
2002-11-21 18:33:09 +00:00
|
|
|
|
2002-08-24 22:02:30 +00:00
|
|
|
// allow only integer intput for scaling; float otherwise
|
2002-08-27 20:30:20 +00:00
|
|
|
if (scaling) {
|
2002-10-31 11:25:02 +00:00
|
|
|
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);
|
2002-08-27 20:30:20 +00:00
|
|
|
fl_set_input_maxchars(file_->input_width, 0);
|
|
|
|
} else {
|
|
|
|
fl_set_input_filter(file_->input_width, NULL);
|
|
|
|
fl_set_input_maxchars(file_->input_width, SIZE_MAXDIGITS);
|
|
|
|
}
|
2002-02-05 12:19:32 +00:00
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
// disable aspectratio button in case of scaling or height
|
|
|
|
// input is empty
|
|
|
|
bool const disable_aspectratio =
|
|
|
|
scaling || getString(file_->input_height).empty();
|
2002-08-24 22:02:30 +00:00
|
|
|
setEnabled(file_->check_aspectratio, !disable_aspectratio);
|
|
|
|
// the bb section
|
2002-03-21 21:21:28 +00:00
|
|
|
} else if (!controller().bbChanged &&
|
2002-04-08 20:00:02 +00:00
|
|
|
(ob == bbox_->check_clip || ob == bbox_->choice_bb_units ||
|
2002-03-21 16:51:33 +00:00
|
|
|
ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_y0 ||
|
|
|
|
ob == bbox_->input_bb_x1 || ob == bbox_->input_bb_y1)) {
|
2002-03-21 21:21:28 +00:00
|
|
|
controller().bbChanged = true;
|
2002-02-05 12:19:32 +00:00
|
|
|
} else if (ob == bbox_->button_getBB) {
|
2002-07-21 15:51:07 +00:00
|
|
|
string const filename = getString(file_->input_filename);
|
2002-03-21 16:51:33 +00:00
|
|
|
if (!filename.empty()) {
|
2002-04-05 09:18:26 +00:00
|
|
|
string bb = controller().readBB(filename);
|
2002-03-21 16:51:33 +00:00
|
|
|
if (!bb.empty()) {
|
|
|
|
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());
|
2002-08-24 22:02:30 +00:00
|
|
|
fl_set_choice_text(bbox_->choice_bb_units, "bp");
|
2002-03-21 16:51:33 +00:00
|
|
|
}
|
|
|
|
controller().bbChanged = false;
|
|
|
|
} else {
|
|
|
|
fl_set_input(bbox_->input_bb_x0, "");
|
|
|
|
fl_set_input(bbox_->input_bb_y0, "");
|
|
|
|
fl_set_input(bbox_->input_bb_x1, "");
|
|
|
|
fl_set_input(bbox_->input_bb_y1, "");
|
2002-04-05 14:10:56 +00:00
|
|
|
fl_set_choice_text(bbox_->choice_bb_units, "bp");
|
2002-02-05 12:19:32 +00:00
|
|
|
}
|
2002-08-24 22:02:30 +00:00
|
|
|
// the extra section
|
|
|
|
} else if (ob == extra_->check_subcaption) {
|
|
|
|
setEnabled(extra_->input_subcaption,
|
|
|
|
fl_get_button(extra_->check_subcaption));
|
2002-02-05 12:19:32 +00:00
|
|
|
|
2002-01-30 14:55:27 +00:00
|
|
|
}
|
|
|
|
|
2002-10-24 11:53:46 +00:00
|
|
|
return ButtonPolicy::SMI_VALID;
|
2000-07-31 12:30:10 +00:00
|
|
|
}
|