// the text class specific preamble
LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
ostringstream tcpreamble;
-
+
tcpreamble << tclass.preamble();
for (layout_type i = 0; i < tclass.numLayouts(); ++i) {
if (layout[i]) {
- tcpreamble << tclass[i].preamble();
+ tcpreamble << tclass[i].preamble();
}
}
+ // DEC's implementation of ostringstream has a bug which can be
+ // overcome with this forcing.
+ tcpreamble.seekp(std::ios::beg);
+
return tcpreamble.str().c_str();
}
* xforms-helpers.h: added two choice const for the LyXLength
one with all and one only with length which have a unit.
+2002-01-29 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * forms/form_minipage.fd: add text_warning field.
+
+ *FormMinipage.[Ch]: added input filters and warnings
+ (ButtonPolicy::SMInput FormMinipage::input)
+
2002-01-28 Angus Leeming <a.leeming@ic.ac.uk>
* FormAboutlyx.[Ch]: Removed redundant form() method and
break;
}
}
+
+ButtonPolicy::SMInput FormMinipage::input(FL_OBJECT * ob, long)
+{
+ ButtonPolicy::SMInput action = ButtonPolicy::SMI_NOOP;
+
+ // disallow senseless data
+ // warnings if input is senseless
+ //
+ string input = fl_get_input(dialog_->input_width);
+ bool invalid = false;
+
+ if (ob == dialog_->input_width) {
+ invalid = !isValidLength(input) && !isStrDbl(input);
+ if (invalid) {
+ fl_set_object_label(dialog_->text_warning,
+ _("Warning: Invalid Length!"));
+ fl_show_object(dialog_->text_warning);
+ action = ButtonPolicy::SMI_INVALID;
+ } else {
+ fl_hide_object(dialog_->text_warning);
+ action = ButtonPolicy::SMI_VALID;
+ }
+ }
+ return action;
+}
virtual void build();
/// Update dialog before/whilst showing it.
virtual void update();
+ /// Filter the inputs on callback from xforms
+ virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/// Fdesign generated method
FD_form_minipage * build_minipage();
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
+ fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 90, 210, 30, "");
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *button_apply;
FL_OBJECT *button_ok;
FL_OBJECT *button_restore;
+ FL_OBJECT *text_warning;
};
#endif /* FD_form_minipage_h_ */
Name: form_minipage
Width: 430
Height: 170
-Number of Objects: 14
+Number of Objects: 15
--------------------
class: FL_BOX
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 10 10 0
+box: 0 0 0 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
callback: C_FormBaseRestoreCB
argument: 0
+--------------------
+class: FL_TEXT
+type: NORMAL_TEXT
+box: 20 90 210 30
+boxtype: FL_FLAT_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label:
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: text_warning
+callback:
+argument:
+
==============================
create_the_forms