62 Button(
X x,
Y y,
X w,
Y h,
const std::string& str,
const boost::shared_ptr<Font>& font,
Clr color,
78 virtual void Render();
80 virtual void SetColor(
Clr c);
85 void SetUnpressedGraphic(
const SubTexture& st);
101 virtual void MouseLeave();
103 virtual void RenderUnpressed();
104 virtual void RenderPressed();
105 virtual void RenderRollover();
109 void RenderDefault();
154 virtual Pt MinUsableSize()
const;
156 bool Checked()
const;
157 Clr InteriorColor()
const;
166 virtual void Render();
167 virtual void SizeMove(
const Pt& ul,
const Pt& lr);
170 void SetCheck(
bool b =
true);
171 void SetButtonPosition(
const Pt& ul,
const Pt& lr);
172 void SetDefaultButtonPosition();
173 virtual void SetColor(
Clr c);
174 void SetInteriorColor(
Clr c);
186 Pt ButtonUpperLeft()
const;
187 Pt ButtonLowerRight()
const;
188 Pt TextUpperLeft()
const;
194 void RepositionButton();
228 virtual Pt MinUsableSize()
const;
237 std::size_t NumButtons()
const;
241 std::size_t CheckedButton()
const;
247 bool ExpandButtons()
const;
253 bool ExpandButtonsProportionally()
const;
257 bool RenderOutline()
const;
263 virtual void Render();
268 void SetCheck(std::size_t index);
274 void DisableButton(std::size_t index,
bool b =
true);
281 void AddButton(
const std::string& text,
const boost::shared_ptr<Font>& font,
Flags<TextFormat> format,
282 Clr color,
Clr text_color = CLR_BLACK,
Clr interior = CLR_ZERO,
287 void InsertButton(std::size_t index,
StateButton* bn);
292 void InsertButton(std::size_t index,
const std::string& text,
const boost::shared_ptr<Font>& font,
Flags<TextFormat> format,
293 Clr color,
Clr text_color = CLR_BLACK,
Clr interior = CLR_ZERO,
308 void ExpandButtons(
bool expand);
314 void ExpandButtonsProportionally(
bool proportional);
318 void RenderOutline(
bool render_outline);
322 void RaiseCheckedButton();
337 boost::signals::connection connection;
345 const std::vector<ButtonSlot>& ButtonSlots()
const;
349 class ButtonClickedFunctor
353 void operator()(
bool checked);
360 void ConnectSignals();
361 void SetCheckImpl(std::size_t index,
bool signal);
365 std::vector<ButtonSlot> m_button_slots;
366 std::size_t m_checked_button;
367 bool m_expand_buttons;
368 bool m_expand_buttons_proportionally;
369 bool m_render_outline;
371 friend class ButtonClickedFunctor;