src/debug.C
src/exporter.C
src/ext_l10n.h
-src/figureForm.C
src/figure_form.C
+src/figureForm.C
src/FontLoader.C
src/frontends/controllers/biblio.C
src/frontends/controllers/ButtonController.h
src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C
-src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_aboutlyx.C
-src/frontends/xforms/FormBibitem.C
+src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_bibitem.C
-src/frontends/xforms/FormBibtex.C
+src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
+src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
-src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
-src/frontends/xforms/FormCitation.C
+src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
-src/frontends/xforms/FormDocument.C
+src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_document.C
-src/frontends/xforms/FormError.C
+src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
-src/frontends/xforms/FormExternal.C
+src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C
-src/frontends/xforms/FormFiledialog.C
+src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
-src/frontends/xforms/FormGraphics.C
+src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
-src/frontends/xforms/FormInclude.C
+src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
-src/frontends/xforms/FormIndex.C
+src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
+src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
-src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C
-src/frontends/xforms/FormMathsDelim.C
+src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
-src/frontends/xforms/FormMathsMatrix.C
+src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
-src/frontends/xforms/FormMathsPanel.C
+src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
-src/frontends/xforms/FormMathsSpace.C
+src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
-src/frontends/xforms/FormMinipage.C
+src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
-src/frontends/xforms/FormParagraph.C
+src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
-src/frontends/xforms/FormPreamble.C
+src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
-src/frontends/xforms/FormPreferences.C
+src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
-src/frontends/xforms/FormPrint.C
+src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
-src/frontends/xforms/FormRef.C
+src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
-src/frontends/xforms/FormSearch.C
+src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
-src/frontends/xforms/FormSpellchecker.C
+src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_spellchecker.C
-src/frontends/xforms/FormTabular.C
+src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/form_tabular.C
-src/frontends/xforms/FormTabularCreate.C
+src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
-src/frontends/xforms/FormToc.C
+src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
-src/frontends/xforms/FormUrl.C
+src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
+src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetindex.C
+src/insets/insetinfo.C
src/insets/insetlabel.C
src/insets/insetlist.C
src/insets/insetmarginal.C
src/minibuffer.C
src/paragraph.C
src/print_form.C
-src/sp_form.C
src/support/filetools.C
src/support/getUserName.C
src/support/path.C
+2001-07-23 Juergen Vigna <jug@sad.it>
+
+ * insetert.C (InsetERT): use setLabel with "true" flag.
+
+ * insetcollapsable.C: modified various functions to set the draw_label
+ string right in any condition.
+ (setLabel): added a bool parameter to set change_label_with_text.
+
+ * insetcollapsable.h: added draw_label string which is set to the
+ actual drawn label-string, while label is the original static label
+ of this collapsable inset. Added bool change_label_with_text to set
+ if we want that the label changes to the start of the InsetText's
+ text when collabpsed. You can set this flag with the setLabel funciton.
+ Added bool inlined for inlined collapsable insets, but not handled
+ yet.
+
+ * insetcollapsable.C (get_new_label): added should get a new label
+ from the InsetText beginning (for now 10 chars).
+
2001-07-21 Yves Bastide <stid@libd-pc11.univ-bpclermont.fr>
* insetquotes.C (latex): fix the handling of french double quotes
InsetCollapsable::InsetCollapsable(bool collapsed)
: UpdatableInset(), collapsed_(collapsed),
- button_length(0), button_top_y(0), button_bottom_y(0),
- label("Label"), autocollapse(true),
- widthCollapsed(0), oldWidth(0), need_update(FULL)
+ button_length(0), button_top_y(0), button_bottom_y(0),
+ label("Label"), draw_label(label), autocollapse(true),
+ widthCollapsed(0), oldWidth(0), need_update(FULL),
+ inlined(false), change_label_with_text(false)
+
{
inset.setOwner(this);
}
}
inset.read(buf, lex);
+ if (collapsed_ && change_label_with_text) {
+ draw_label = get_new_label();
+ } else {
+ draw_label = label;
+ }
}
int width = 0;
int ascent = 0;
int descent = 0;
- pain.buttonText(0, 0, label, labelfont, false,
+ pain.buttonText(0, 0, draw_label, labelfont, false,
width, ascent, descent);
return ascent;
}
int width = 0;
int ascent = 0;
int descent = 0;
- pain.buttonText(0, 0, label, labelfont, false,
+ pain.buttonText(0, 0, draw_label, labelfont, false,
width, ascent, descent);
return descent;
}
int width;
int ascent;
int descent;
- pain.buttonText(TEXT_TO_INSET_OFFSET, 0, label, labelfont, false,
+ pain.buttonText(TEXT_TO_INSET_OFFSET, 0, draw_label, labelfont, false,
width, ascent, descent);
return width + (2*TEXT_TO_INSET_OFFSET);
}
int InsetCollapsable::width(BufferView * bv, LyXFont const & font) const
{
- if (!widthCollapsed)
- widthCollapsed = width_collapsed(bv->painter(), font);
+ widthCollapsed = width_collapsed(bv->painter(), font);
if (collapsed_)
return widthCollapsed;
void InsetCollapsable::draw_collapsed(Painter & pain, LyXFont const &,
- int baseline, float & x) const
+ int baseline, float & x) const
{
int width = 0;
pain.buttonText(int(x) + TEXT_TO_INSET_OFFSET,
- baseline, label, labelfont, true, width);
+ baseline, draw_label, labelfont, true, width);
x += width + TEXT_TO_INSET_OFFSET;
}
void InsetCollapsable::draw(BufferView * bv, LyXFont const & f,
- int baseline, float & x, bool cleared) const
+ int baseline, float & x, bool cleared) const
{
if (nodraw())
return;
UpdatableInset::edit(bv, xp, yp, button);
if (collapsed_) {
+ draw_label = label;
collapsed_ = false;
if (!bv->lockInset(this))
return;
UpdatableInset::edit(bv, front);
if (collapsed_) {
+ draw_label = label;
collapsed_ = false;
if (!bv->lockInset(this))
return;
void InsetCollapsable::insetUnlock(BufferView * bv)
{
if (autocollapse) {
+ if (change_label_with_text) {
+ draw_label = get_new_label();
+ } else {
+ draw_label = label;
+ }
collapsed_ = true;
}
inset.insetUnlock(bv);
if ((x >= 0) && (x < button_length) &&
(y >= button_top_y) && (y <= button_bottom_y)) {
if (collapsed_) {
+ draw_label = label;
collapsed_ = false;
inset.insetButtonRelease(bv, 0, 0, button);
bv->updateInset(this, false);
} else {
+ if (change_label_with_text) {
+ draw_label = get_new_label();
+ } else {
+ draw_label = label;
+ }
collapsed_ = true;
bv->unlockInset(this);
bv->updateInset(this, false);
if (flag == !collapsed_)
return;
collapsed_ = !flag;
+ if (collapsed_ && change_label_with_text) {
+ draw_label = get_new_label();
+ } else {
+ draw_label = label;
+ }
bv->updateInset(this, false);
}
+
+
+void InsetCollapsable::setLabel(string const & l, bool flag)
+{
+ label = l;
+ change_label_with_text = flag;
+ if (collapsed_ && change_label_with_text) {
+ draw_label = get_new_label();
+ } else {
+ draw_label = label;
+ }
+}
+
+
+string InsetCollapsable::get_new_label() const
+{
+ string la;
+
+ int n = std::min(10, inset.paragraph()->size());
+ int i,j;
+ for(i=0,j=0; i < n && j < inset.paragraph()->size(); ++j) {
+ if (inset.paragraph()->isInset(j))
+ continue;
+ la += inset.paragraph()->getChar(j);
+ ++i;
+ }
+ if ((i > 0) && (j < inset.paragraph()->size()))
+ la += "...";
+ if (la.empty())
+ la = label;
+ return la;
+}
void setFont(BufferView *, LyXFont const &, bool toggleall = false,
bool selectall = false);
///
- void setLabel(string const & l) { label = l; }
+ void setLabel(string const & l, bool flag = false);
///
void setLabelFont(LyXFont & f) { labelfont = f; }
///
///
InsetText inset;
protected:
+ ///
+ string get_new_label() const;
+
///
mutable int button_length;
///
///
string label;
///
+ mutable string draw_label;
+ ///
bool autocollapse;
///
mutable int widthCollapsed;
mutable int topx;
mutable int topbaseline;
mutable UpdateCodes need_update;
+ ///
+ bool inlined;
+ ///
+ bool change_label_with_text;
};
#endif
InsetERT::InsetERT() : InsetCollapsable()
{
- setLabel(_("666"));
+ setLabel(_("666"), true);
//LyXFont font(LyXFont::ALL_SANE);
//font.setLatex (LyXFont::ON);
labelfont = LyXFont(LyXFont::ALL_SANE);