/* $Id$
This file is part of libmspgltk
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
exclude_siblings();
}
+void Toggle::exclude_siblings()
+{
+ const list<Widget *> &siblings = parent->get_children();
+ for(list<Widget *>::const_iterator i=siblings.begin(); i!=siblings.end(); ++i)
+ if(Toggle *tgl = dynamic_cast<Toggle *>(*i))
+ if(tgl!=this && tgl->get_exclusive() && tgl->get_value())
+ tgl->set_value(false);
+}
+
void Toggle::set_value(bool v)
{
value = v;
state &= ~ACTIVE;
}
+void Toggle::render_special(const Part &part) const
+{
+ if(part.get_name()=="text")
+ text.render(part, geom);
+}
+
void Toggle::button_press(int, int, unsigned btn)
{
if(btn==1)
}
}
-void Toggle::render_special(const Part &part) const
-{
- if(part.get_name()=="text")
- text.render(part, geom);
-}
-
-void Toggle::exclude_siblings()
-{
- const list<Widget *> &siblings = parent->get_children();
- for(list<Widget *>::const_iterator i=siblings.begin(); i!=siblings.end(); ++i)
- if(Toggle *tgl = dynamic_cast<Toggle *>(*i))
- if(tgl!=this && tgl->get_exclusive() && tgl->get_value())
- tgl->set_value(false);
-}
-
void Toggle::on_style_change()
{
text.set_style(style);