X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsettabular.h;h=2cb39167ee47836390876e6f2d50b79dd1d8b69e;hb=729f944d8805e888af25c703a4fd6e4322c47764;hp=7c5b1340da07b7815e76077bf9eb87f3cfcd2104;hpb=60a085fb1ca08f534ba02143606d8393ade58b25;p=lyx.git diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 7c5b1340da..2cb39167ee 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -61,6 +61,15 @@ class Buffer; class InsetTabular : public UpdatableInset { public: + /// + enum UpdateCodes { + NONE = 0, + INIT, + FULL, + CELL, + CURSOR, + SELECTION + }; /// InsetTabular(Buffer *, int rows=1, int columns=1); /// @@ -80,17 +89,19 @@ public: /// int width(Painter &, LyXFont const & f) const; /// - void draw(Painter & pain, const LyXFont &, int , float &) const; + void draw(BufferView *, const LyXFont &, int , float &, bool) const; /// - void update(BufferView *, LyXFont const &) const; + void update(BufferView *, LyXFont const &, bool =false); /// const char * EditMessage() const; /// void Edit(BufferView *, int x, int y, unsigned int); /// + bool doClearArea() const { return !locked; }; + /// void InsetUnlock(BufferView *); /// - void UpdateLocal(BufferView *, bool what, bool mark_dirty); + void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty); /// bool LockInsetInInset(BufferView *, UpdatableInset *); /// @@ -130,7 +141,7 @@ public: /// Inset::Code LyxCode() const { return Inset::TABULAR_CODE; } /// - void GetCursorPos(int & x, int & y) const; + void GetCursorPos(BufferView *, int & x, int & y) const; /// void ToggleInsetCursor(BufferView *); /// @@ -150,7 +161,7 @@ public: LyXTabular * tabular; private: - void calculate_width_of_cells(Painter &, LyXFont const &) const; + bool calculate_dimensions_of_cells(BufferView *, LyXFont const &, bool =false) const; /// void DrawCellLines(Painter &, int x, int baseline, int row, int cell) const; @@ -164,8 +175,6 @@ private: /// void setPos(Painter &, int x, int y) const; /// - bool SetCellDimensions(Painter & pain, int cell, int row); - /// UpdatableInset::RESULT moveRight(BufferView *, bool lock=true); UpdatableInset::RESULT moveLeft(BufferView *, bool lock=true); UpdatableInset::RESULT moveUp(BufferView *); @@ -212,10 +221,8 @@ private: oldcell, actcol, actrow; - bool - locked, - no_selection; - mutable bool - init_inset; + bool no_selection; + mutable bool locked; + mutable UpdateCodes need_update; }; #endif