2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 *======================================================
13 #ifndef INSETCOLLAPSABLE_H
14 #define INSETCOLLAPSABLE_H
20 #include "insettext.h"
27 /** A colapsable text inset
30 class InsetCollapsable : public InsetText {
33 static int const TEXT_TO_TOP_OFFSET = 2;
35 static int const TEXT_TO_BOTTOM_OFFSET = 2;
37 InsetCollapsable(Buffer *);
39 ~InsetCollapsable() {}
41 Inset * Clone() const;
43 int ascent(Painter &, LyXFont const &) const;
45 int descent(Painter &, LyXFont const &) const;
47 int width(Painter &, LyXFont const & f) const;
49 void draw(Painter & pain, const LyXFont &, int , float &) const;
51 void Edit(BufferView *, int, int, unsigned int);
53 EDITABLE Editable() const;
55 void InsetUnlock(BufferView *);
57 bool display() const { return (!collapsed); }
59 void InsetButtonRelease(BufferView *, int, int, int);
61 void InsetButtonPress(BufferView *, int, int, int);
63 void InsetMotionNotify(BufferView *, int, int, int);
65 void setLabel(string const & l) { label = l; }
67 void setLabelFont(LyXFont & f) { labelfont = f; }
69 void setAutoCollapse(bool f) { autocolapse = f; }
73 int ascent_collapsed(Painter &, LyXFont const &) const;
75 int descent_collapsed(Painter &, LyXFont const &) const;
77 int width_collapsed(Painter &, LyXFont const & f) const;
79 void draw_collapsed(Painter & pain, const LyXFont &, int , float &) const;
81 void UpdateLocal(BufferView *, bool);
86 LColor::color framecolor;
98 button_x, button_top_y, button_bottom_y;