*/
class InsetText : public UpdatableInset {
public:
- ///
- enum { TEXT_TO_INSET_OFFSET = 2 };
///
enum UpdateCodes {
NONE = 0,
FULL,
CURSOR_PAR,
CURSOR,
- SELECTION
+ SELECTION,
+ DRAW_FRAME,
+ CLEAR_FRAME
+ };
+ ///
+ enum DrawFrame {
+ NEVER = 0,
+ LOCKED,
+ ALWAYS
};
///
explicit
///
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
///
+ int getMaxWidth(Painter &, UpdatableInset const *) const;
+ ///
void init(InsetText const * ins = 0);
///
+ void WriteParagraphData(Buffer const *, std::ostream &) const;
+ ///
void SetParagraphData(LyXParagraph *);
///
void SetAutoBreakRows(bool);
///
- void SetDrawLockedFrame(bool);
+ void SetDrawFrame(BufferView *, DrawFrame);
///
- void SetFrameColor(LColor::color);
+ void SetFrameColor(BufferView *, LColor::color);
///
- LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const;
+// LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const;
///
LyXText * getLyXText(BufferView *) const;
void deleteLyXText(BufferView *);
LyXParagraph * par;
+ ///
+ mutable UpdateCodes need_update;
protected:
///
void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty);
- ///
- void WriteParagraphData(Buffer const *, std::ostream &) const;
- ///
- virtual int getMaxTextWidth(Painter &, UpdatableInset const *) const;
mutable int drawTextXOffset;
mutable int drawTextYOffset;
///
bool autoBreakRows;
- bool drawLockedFrame;
+ DrawFrame drawFrame;
///
LColor::color frame_color;
- ///
- mutable UpdateCodes need_update;
private:
///
///
string getText(int);
///
+ bool checkAndActivateInset(BufferView * bv, bool behind);
bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
int button = 0);
///
mutable int last_height;
mutable int top_y;
///
+ LyXParagraph * inset_par;
+ ///
int inset_pos;
///
mutable int inset_x;