29 #ifndef PT_FORMS_MENUITEMBASE_H
30 #define PT_FORMS_MENUITEMBASE_H
32 #include <Pt/Forms/Api.h>
33 #include <Pt/Forms/Control.h>
34 #include <Pt/Forms/PixmapSurface.h>
40 class PT_FORMS_API MenuBaseItem :
public Control
49 virtual ~MenuBaseItem();
59 double iconPadding()
const;
61 void setIconPadding(
double left);
63 void setSeperator(
bool v)
68 bool hasSeperator()
const
73 bool isHighlighted()
const
75 return _isHighlighted;
82 const Pt::Gfx::Brush& background()
const;
84 void setBackground(
const Pt::Gfx::Brush& b);
94 const Pt::Gfx::Font& font()
const;
96 void setFont(
const Pt::Gfx::Font& font);
98 void setFontSize(std::size_t size);
100 void setFontWeight(Pt::Gfx::Font::Weight weight);
102 void setFontSlant(Pt::Gfx::Font::Slant slant);
105 static Pt::String shortcutText(
const Pt::Forms::Key& key);
107 virtual void onTriggered();
109 virtual void onShortcut(
const Pt::Forms::Key& key);
111 virtual void onInvalidate();
113 virtual Pt::Gfx::SizeF onMeasure(
const Pt::Forms::SizePolicy& policy);
115 virtual void onPaint(PaintSurface& surface,
const Pt::Gfx::RectF& updateRect);
117 virtual bool onMouseEvent(
const Pt::Forms::MouseEvent& ev);
119 virtual bool onTouchEvent(
const Pt::Forms::TouchEvent& ev);
121 virtual bool onEnterEvent(
const Pt::Forms::EnterEvent& ev);
123 virtual bool onLeaveEvent(
const Pt::Forms::LeaveEvent& ev);
126 Pt::Gfx::Font getFont()
const;
129 enum FontOverride :
unsigned
132 OverrideWeight = 0x02,
133 OverrideSlant = 0x04,
146 Pt::Gfx::Font _customFont;
147 unsigned _fontOverride;
150 Pt::Gfx::Brush _brush;
Rect with floating-point coordinates.
Definition: Rect.h:44
Basic image.
Definition: Api.h:81
Standard color type.
Definition: Color.h:46
Attributes for the drawing of outlines.
Definition: Pen.h:52
Size with floating-point width and height.
Definition: Size.h:44
Unicode capable basic_string.
Definition: String.h:42