- TeX mode has been superseded by the 666 (aka ERT) inset, which is
foldable
-- new graphics inset superseding the older figure inset [will that be
- OK in 1.2.0?]
+- new graphics inset with support for hassle-free inclusion of various
+ image formats (GIF, JPEG, PNG and EPS by default).
- new minipage inset
Bienvenue dans l'univers de LyX !
\begin_inset Info
Informations de révision :
-Traduction : Mise à jour, Date: 2001/02/16
+Traduction : Mise à jour, Date: 2001/06/10
Original : Révision: 1.5, Date: 2000/12/28
\end_inset
Le Top N des choses à connaître pour utiliser LyX
\layout Enumerate
-LyX est fourni avec une excellente documentation -- servez-vous-en s'il
- vous plaît ! Vous pouvez commencer par
+LyX est fourni avec une excellente documentation -- servez-vous-en donc
+ ! Vous pouvez commencer par
\family sans
\bar under
A
\bar default
ide\SpecialChar \menuseparator
Manuel\SpecialChar ~
-d'Apprentissage.
-
+d'Apprentissage
\family default
-Seul le titre des autres documents est traduit en français pour le moment.
+.
\layout Enumerate
LyX est ce qu'on appelle un
Par sa conception, il se distingue des traitements de texte ordinaires
-- en ce sens qu'il facilite l'écriture des documents.
Mais la distinction est minime, ne vous inquiétez pas.
- La documentation est là pour faire toute la lumière la-dessus
+ La documentation est là pour faire toute la lumière là-dessus
\begin_float footnote
\layout Standard
.
\layout Enumerate
-Les résultats de mise en page de LyX sont très esthétiques ! Sélectionnez
-
+Les résultats de mise en page de LyX sont très esthétiques ! Faites
\family sans
\bar under
V
\layout Enumerate
LyX possède de nombreuses fonctionnalités pour ceux qui lisent ou écrivent
- d'autres langages que l'anglais.
- De plus, le clavier, la barre d'outils et beaucoup d'autres caractéristiques
+ dans d'autres langues que l'anglais.
+ En outre, le clavier, la barre d'outils et beaucoup d'autres caractéristiques
sont pleinement configurables (pour la plupart en éditant votre fichier
\family typewriter
lyxrc
\family default
).
- Voir le fichier
+ Voir
\family sans
\bar under
A
+2001-07-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * lyxtext.h: remove unused (and unimplemented) methods
+
+2001-07-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * text.C (getVisibleRow): honor background color
+
+ * PainterBase.h:
+ * Painter.h: remove default color argument for fillRectangle
+
+ * text.C (backgroundColor): new method
+
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
* text.C (getVisibleRow): adjust
/// Fill a rectangle
PainterBase & fillRectangle(int x, int y, int w, int h,
- LColor::color = LColor::background);
+ LColor::color);
/// For the graphics inset.
PainterBase & image(int x, int y, int w, int h, LyXImage const * image);
/// Fill a rectangle
virtual PainterBase & fillRectangle(
int x, int y, int w, int h,
- LColor::color = LColor::background) = 0;
+ LColor::color) = 0;
/// A filled rectangle with the shape of a 3D button
virtual PainterBase & button(int x, int y, int w, int h);
+2001-07-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * insetminipage.C (InsetMinipage): set background color to red :)
+
+2001-07-23 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * insettext.C (insetUnlock): only set update to CLEAR_FRAME if
+ draw frame mode is LOCKED.
+
+ * insetcollapsable.C (edit):
+ (insetButtonRelease): set update status to full when
+ opening inset.
+
+ * insettext.C (clearInset):
+ * insettabular.C (draw):
+ * insetlatexaccent.C (draw): honor background color.
+
+ * inset.h: new member background_color_, initialized to
+ LColor::inherit.
+
+ * inset.C (backgroundColor): new method.
+ (setBackgroundColor): new method.
+
+ * insetert.C (init): new method, called by the ctors.
+ (InsetERT): when inserting contents, make sure the font is
+ ALL_INHERIT.
+
+ * insetnote.C (InsetNote): when inserting content, remove trailing
+ newline
+ (init): set background color to LColor::note
+
2001-07-24 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insetcollapsable.C: adjust
}
+void Inset::setBackgroundColor(LColor::color color)
+{
+ background_color_ = color;
+}
+
+
+LColor::color Inset::backgroundColor() const
+{
+ if (background_color_ == LColor::inherit) {
+ if (owner())
+ return owner()->backgroundColor();
+ else
+ return LColor::background;
+ } else
+ return background_color_;
+}
+
+
int Inset::id() const
{
return id_;
#include "LString.h"
#include <X11/Xlib.h>
#include "commandtags.h"
+#include "LColor.h"
class LyXFont;
class BufferView;
};
///
- Inset() : top_x(0), top_baseline(0), scx(0), id_(inset_id++), owner_(0) {}
+ Inset() : top_x(0), top_baseline(0), scx(0), id_(inset_id++), owner_(0), background_color_(LColor::inherit) {}
/// Virtual base destructor
virtual ~Inset() {}
///
///
Inset * owner() const { return owner_; }
///
+ void setBackgroundColor(LColor::color);
+ ///
+ LColor::color backgroundColor() const;
+ ///
int x() const { return top_x; }
///
int y() const { return top_baseline; }
Inset * owner_;
///
string name;
+ ///
+ LColor::color background_color_;
};
collapsed_ = false;
if (!bv->lockInset(this))
return;
+ inset.setUpdateStatus(bv, InsetText::FULL);
bv->updateInset(this, false);
inset.edit(bv, front);
} else {
draw_label = label;
collapsed_ = false;
inset.insetButtonRelease(bv, 0, 0, button);
+ inset.setUpdateStatus(bv, InsetText::FULL);
bv->updateInset(this, false);
} else {
if (change_label_with_text) {
string InsetCollapsable::get_new_label() const
{
string la;
+ Paragraph::size_type const max_length = 10;
- int n = std::min(10, inset.paragraph()->size());
+ int n = std::min(max_length, inset.paragraph()->size());
int i,j;
for(i=0,j=0; i < n && j < inset.paragraph()->size(); ++j) {
if (inset.paragraph()->isInset(j))
using std::ostream;
-InsetERT::InsetERT() : InsetCollapsable()
+void InsetERT::init()
{
setLabel(_("666"), true);
- //LyXFont font(LyXFont::ALL_SANE);
- //font.setLatex (LyXFont::ON);
labelfont = LyXFont(LyXFont::ALL_SANE);
labelfont.decSize();
labelfont.decSize();
+#ifndef NO_LATEX
+ labelfont.setLatex(LyXFont::ON);
+#else
labelfont.setColor(LColor::latex);
+#endif
setAutoCollapse(false);
setInsetName("ERT");
}
+InsetERT::InsetERT() : InsetCollapsable()
+{
+ init();
+}
+
InsetERT::InsetERT(string const & contents, bool collapsed)
: InsetCollapsable(collapsed)
{
- setLabel(_("666"));
- LyXFont font(LyXFont::ALL_SANE);
-#ifndef NO_LATEX
- font.setLatex(LyXFont::ON);
-#else
- font.setColor(LColor::latex);
-#endif
- labelfont = LyXFont(LyXFont::ALL_SANE);
- labelfont.decSize();
- labelfont.decSize();
- labelfont.setColor(LColor::latex);
- setAutoCollapse(false);
- setInsetName("ERT");
+ init();
+ LyXFont const font(LyXFont::ALL_INHERIT);
string::const_iterator cit = contents.begin();
string::const_iterator end = contents.end();
Paragraph::size_type pos = 0;
virtual int linuxdoc(Buffer const *, std::ostream &) const;
///
virtual int docBook(Buffer const *, std::ostream &) const;
+private:
+ ///
+ void init();
};
#endif
pain.fillRectangle(int(x + tmpx), tmpvar, wid,
lyxfont::ascent('i', font) -
lyxfont::ascent('x', font) - 1,
- LColor::background);
+ backgroundColor());
// the five lines below is a simple hack to
// make the display of accent 'i' and 'j'
// better. It makes the accent be written
baseline - ascent(bv, font) + 1,
width(bv, font) - 2,
ascent(bv, font)
- + descent(bv, font) - 2);
+ + descent(bv, font) - 2,
+ backgroundColor());
pain.rectangle(int(x + 1), baseline - ascent(bv, font) + 1,
width(bv, font) - 2,
ascent(bv, font) + descent(bv, font) - 2);
font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
+ // just for experimentation :)
+ setBackgroundColor(LColor::red);
setInsetName("Minipage");
width_ = "100%"; // set default to 100% of column_width
}
#include "lyxtext.h"
#include "insets/insettext.h"
#include "support/LOstream.h"
+#include "support/lstrings.h"
#include "debug.h"
using std::ostream;
font.decSize();
font.setColor(LColor::note);
setLabelFont(font);
+
setAutoCollapse(false);
+ setBackgroundColor(LColor::note);
setLabel(_("note"));
setInsetName("Note");
}
+
InsetNote::InsetNote()
: InsetCollapsable()
{
init();
}
+
InsetNote::InsetNote(Buffer const * buf, string const & contents,
bool collapsed)
: InsetCollapsable(collapsed)
Paragraph * par = inset.paragraph();
Paragraph::size_type pos = 0;
- buf->insertStringAsLines(par, pos, labelfont, contents);
+ buf->insertStringAsLines(par, pos, LyXFont(LyXFont::ALL_INHERIT),
+ strip(contents, '\n'));
}
+
Inset * InsetNote::clone(Buffer const &, bool same_id) const
{
InsetNote * result = new InsetNote;
h = pain.paperHeight();
if ((top_x + w) > pain.paperWidth())
w = pain.paperWidth();
- pain.fillRectangle(tx, ty, w, h);
+ pain.fillRectangle(tx, ty, w, h, backgroundColor());
need_update = FULL;
cleared = true;
}
baseline - tabular->GetAscentOfRow(i) + 1,
int(cx - nx - 1),
tabular->GetAscentOfRow(i) +
- tabular->GetDescentOfRow(i) - 1);
+ tabular->GetDescentOfRow(i) - 1,
+ backgroundColor());
// clear behind the inset
pain.fillRectangle(
int(cx + the_locking_inset->width(bv,font) + 1),
the_locking_inset->width(bv,font) -
tabular->GetAdditionalWidth(cell) - 1,
tabular->GetAscentOfRow(i) +
- tabular->GetDescentOfRow(i) - 1);
+ tabular->GetDescentOfRow(i) - 1,
+ backgroundColor());
}
}
x -= ADD_TO_TABULAR_WIDTH;
if (!cleared) {
pain.rectangle(top_x + 1, top_baseline - insetAscent + 1,
insetWidth - 1, insetAscent + insetDescent - 1,
- LColor::background);
+ backgroundColor());
}
frame_is_visible = false;
}
hideInsetCursor(bv);
no_selection = false;
locked = false;
- int code = CURSOR|CLEAR_FRAME;
+ int code;
+ if (drawFrame_ == LOCKED)
+ code = CURSOR|CLEAR_FRAME;
+ else
+ code = CURSOR;
bool clear = false;
if (!lt) {
lt = getLyXText(bv);
h = pain.paperHeight();
if ((top_x + drawTextXOffset + w) > pain.paperWidth())
w = pain.paperWidth();
- pain.fillRectangle(top_x+drawTextXOffset, ty, w, h);
+ pain.fillRectangle(top_x+drawTextXOffset, ty, w, h,
+ backgroundColor());
cleared = true;
need_update = FULL;
}
UpdatableInset::RESULT moveDown(BufferView *);
///
void setCharFont(Buffer const *, int pos, LyXFont const & font);
+#if 0
+ ///What's that ??? Not used, not implemented!
///
string const getText(int);
+#endif
///
bool checkAndActivateInset(BufferView * bv, bool behind);
///
#include "layout.h"
#include "lyxrow.h"
#include "vspace.h"
+#include "LColor.h"
class Buffer;
class BufferParams;
void copyEnvironmentType();
///
void pasteEnvironmentType(BufferView *);
- ///
- void insertFootnote();
- ///
- void insertMarginpar();
- ///
- void insertFigure();
- ///
- void insertTabular();
/** the DTP switches for paragraphs. LyX will store the top settings
always in the first physical paragraph, the bottom settings in the
*/
bool hfillExpansion(Buffer const *, Row const * row_ptr,
Paragraph::size_type pos) const;
+ ///
+ LColor::color backgroundColor();
///
}
+LColor::color LyXText::backgroundColor()
+{
+ if (inset_owner)
+ return inset_owner->backgroundColor();
+ else
+ return LColor::background;
+}
+
void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const
{
/* get the maximum ascent and the maximum descent */
int const w = inset_owner ?
inset_owner->width(bview, font) - 2 : ww;
int const x = x_offset;
- pain.fillRectangle(x, y, w, h);
+ pain.fillRectangle(x, y, w, h, backgroundColor());
} else if (inset != 0) {
int h = row_ptr->baseline() - inset->ascent(bview, font);
if (h > 0) {
int const w = (inset_owner ?
inset_owner->width(bview, font) : ww);
- pain.fillRectangle(x_offset, y_offset, w, h);
+ pain.fillRectangle(x_offset, y_offset, w, h,
+ backgroundColor());
}
h += inset->ascent(bview, font) + inset->descent(bview, font);
if ((row_ptr->height() - h) > 0) {
int const w = (inset_owner ?
inset_owner->width(bview, font) : ww);
pain.fillRectangle(x_offset, y_offset + h,
- w, row_ptr->height() - h);
+ w, row_ptr->height() - h,
+ backgroundColor());
}
if (!inset_owner && !inset->display() && !inset->needFullRow())
{
int const w = inset->width(bview, font) + int(x);
- pain.fillRectangle(w, y_offset, ww - w, row_ptr->height());
+ pain.fillRectangle(w, y_offset,
+ ww - w, row_ptr->height(),
+ backgroundColor());
}
}
0,
_("Page Break (top)"),
pb_font,
- LColor::background,
- LColor::background, false, w, a, d);
+ backgroundColor(),
+ backgroundColor(), false, w, a, d);
#else
;
lyxfont::rectText(_("Page Break (top)"), pb_font,
y_offset + y_top + 2 * defaultHeight() + d,
_("Page Break (top)"),
pb_font,
- LColor::background,
- LColor::background);
+ backgroundColor(),
+ backgroundColor());
y_top += 3 * defaultHeight();
}
.rectText(0, 0,
_("Page Break (bottom)"),
pb_font,
- LColor::background,
- LColor::background, false, w, a, d);
+ backgroundColor(),
+ backgroundColor(), false, w, a, d);
#else
;
lyxfont::rectText(_("Page Break (bottom)"), pb_font,
pain.rectText((ww - w) / 2, y_place + d,
_("Page Break (bottom)"),
pb_font,
- LColor::background,
- LColor::background);
+ backgroundColor(),
+ backgroundColor());
y_bottom -= 3 * defaultHeight();
}