]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/toggle.cpp
Rearrange members
[libs/gltk.git] / source / toggle.cpp
index a950b971307aae231b91783624a234155aee8ae3..7edbbb08823c5018aac2a6e4b217309b66fbf8d9 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2011  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -35,6 +35,15 @@ void Toggle::set_exclusive(bool e)
                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;
@@ -48,6 +57,12 @@ void Toggle::set_value(bool 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)
@@ -68,21 +83,6 @@ void Toggle::button_release(int x, int y, unsigned btn)
        }
 }
 
-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);