29 #ifndef Pt_Forms_ComboBox_H
30 #define Pt_Forms_ComboBox_H
32 #include <Pt/Forms/Control.h>
33 #include <Pt/Forms/Popup.h>
34 #include <Pt/Forms/ListBox.h>
35 #include <Pt/Forms/LineEditor.h>
36 #include <Pt/SmartPtr.h>
37 #include <Pt/String.h>
43 class PT_FORMS_API ComboBox :
public Control
52 void addItem(ListBoxItem& item);
54 void removeItem(ListBoxItem& item);
56 bool isEditable()
const;
58 void setEditable(
bool e);
60 bool isAccepted()
const;
62 void setAccepted(
bool a);
68 Adjustment textAdjustment()
const;
70 void setTextAdjustment(Adjustment a);
72 void setScrollBars(
bool hasScrollBars);
74 void setMaxHeight(
double height);
80 bool isHighlighted()
const;
97 const Gfx::Brush& background()
const;
99 void setBackground(
const Gfx::Brush& b);
101 const Gfx::Brush& foreground()
const;
103 void setForeground(
const Gfx::Brush& b);
105 const Gfx::Pen& contour()
const;
107 void setContour(
const Gfx::Pen& p);
109 const Gfx::Color& textColor()
const;
111 void setTextColor(
const Gfx::Color& color);
113 const Gfx::Font& font()
const;
115 void setFont(
const Gfx::Font& font);
117 void setFontSize(std::size_t size);
119 void setFontWeight(Gfx::Font::Weight weight);
121 void setFontSlant(Gfx::Font::Slant slant);
123 void setRenderer(ComboBoxRenderer* renderer);
126 virtual Gfx::SizeF onMeasure(
const SizePolicy& policy);
128 virtual void onInvalidate();
130 virtual void onPaint(PaintSurface& surface,
const Gfx::RectF& updateRect);
133 virtual void onProcessMouseEvent(
const MouseEvent& ev);
136 virtual void onResizeEvent(
const ResizeEvent& ev);
138 virtual bool onKeyEvent(
const KeyEvent& ev);
140 virtual bool onMouseEvent(
const MouseEvent& ev);
142 virtual bool onTouchEvent(
const TouchEvent& ev);
144 virtual bool onEnterEvent(
const EnterEvent& ev);
146 virtual bool onLeaveEvent(
const LeaveEvent& ev);
148 virtual void onFocusEvent(
const FocusEvent& ev);
151 void onItemSelected(ListBoxItem& item);
153 void processKeyEvent(
const KeyEvent& ev);
155 Gfx::Font getFont()
const;
158 enum FontOverride :
unsigned
161 OverrideWeight = 0x02,
162 OverrideSlant = 0x04,
174 Gfx::SizeF _buttonSize;
182 AutoPtr<Gfx::Brush> _background;
183 AutoPtr<Gfx::Brush> _foreground;
184 AutoPtr<Gfx::Pen> _contour;
185 AutoPtr<Gfx::Color> _textColor;
186 Gfx::Font _customFont;
187 unsigned _fontOverride;
189 FacetPtr<ComboBoxRenderer> _renderer;
192 Gfx::Brush _backgroundBrush;
193 Gfx::Brush _foregroundBrush;
Multicast Signal to call multiple slots.
Definition: Signal.h:109
Unicode capable basic_string.
Definition: String.h:42