///
static int const TEXT_TO_BOTTOM_OFFSET = 2;
///
- enum CollapseStatus {
- Collapsed,
- Inlined,
- Open
- };
- ///
InsetCollapsable(BufferParams const &, CollapseStatus status = Open);
///
void read(Buffer const &, LyXLex &);
///
void draw(PainterInfo & pi, int x, int y) const;
///
- bool hitButton(FuncRequest &) const;
+ void drawSelection(PainterInfo & pi, int x, int y) const;
+ /// return x,y of given position relative to the inset's baseline
+ void cursorPos(CursorSlice const & sl, bool boundary, int & x, int & y) const;
+ ///
+ bool hitButton(FuncRequest const &) const;
///
std::string const getNewLabel(std::string const & l) const;
///
void setLabel(std::string const & l);
///
virtual void setButtonLabel() {}
- ///
- void setLabelFont(LyXFont & f);
///
- int scroll(bool recursive = true) const;
- ///
- void scroll(BufferView & bv, float sx) const;
- ///
- void scroll(BufferView & bv, int offset) const;
+ void setLabelFont(LyXFont & f);
///
bool isOpen() const { return status_ == Open || status_ == Inlined; }
///
bool inlined() const { return status_ == Inlined; }
///
- CollapseStatus status() const { return status_; }
+ CollapseStatus status() const;
///
- void open();
+ bool allowSpellCheck() const { return true; }
///
- void close();
+ bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
///
- bool allowSpellCheck() const { return true; }
+ void setStatus(LCursor & cur, CollapseStatus st);
protected:
///
- void setStatus(CollapseStatus st);
- ///
- void priv_dispatch(LCursor & cur, FuncRequest & cmd);
+ virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
///
- void dimension_collapsed(Dimension &) const;
- ///
- void draw_collapsed(PainterInfo & pi, int x, int y) const;
- ///
- int getMaxTextWidth(Painter & pain, UpdatableInset const *) const;
+ Dimension dimensionCollapsed() const;
///
Box const & buttonDim() const;
///
void edit(LCursor & cur, bool left);
///
InsetBase * editXY(LCursor & cur, int x, int y);
+ ///
+ void setInlined() { status_ = Inlined; }
protected:
///
mutable CollapseStatus status_;
/// a substatus of the Open status, determined automatically in metrics
mutable bool openinlined_;
+ /// the inset will automatically open when the cursor is inside
+ mutable bool autoOpen_;
///
mutable Dimension textdim_;
};
// A helper function that pushes the cursor out of the inset.
-void getOutOfInset(LCursor & cur, InsetBase const & in);
+void leaveInset(LCursor & cur, InsetBase const & in);
#endif