3 * \file render_button.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
12 #ifndef RENDER_BUTTON_H
13 #define RENDER_BUTTON_H
15 #include "render_base.h"
17 #include "support/docstring.h"
23 class RenderButton : public RenderBase
28 std::auto_ptr<RenderBase> clone(InsetBase const *) const;
30 /// compute the size of the object returned in dim
31 virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
32 /// draw inset and update (xo, yo)-cache
33 virtual void draw(PainterInfo & pi, int x, int y) const;
35 /// Provide the text for the button
36 void update(docstring const &, bool editable);
38 /// The "sensitive area" box, i.e., the button area
39 Box box() const { return button_box_; }
41 void setBox(Box b) { button_box_ = b; }
43 /// equivalent to dynamic_cast
44 virtual RenderButton * asButton() { return this; }
56 #endif // NOT RENDER_BUTTON_H