]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.cpp
Rearrange members
[libs/gltk.git] / source / list.cpp
index 672cf4911bbf028e4e3850579959794e9c4f11f2..ac8b48cb77432dfb5069bf038c1a705510cd2684 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgltk
-Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2011  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -114,24 +114,6 @@ const string &List::get_selected() const
        return items[sel_index];
 }
 
-void List::button_press(int x, int y, unsigned btn)
-{
-       Container::button_press(x, y, btn);
-       if(!click_focus && btn==1)
-       {
-               if(items_part)
-                       y += items_part->get_margin().top;
-
-               unsigned i = (geom.h-1-y)/row_height;
-               if(i<n_visible && first+i<items.size())
-               {
-                       sel_index = first+i;
-
-                       signal_item_selected.emit(sel_index, items[sel_index]);
-               }
-       }
-}
-
 void List::render_special(const Part &part) const
 {
        if(part.get_name()=="items")
@@ -175,6 +157,24 @@ void List::render_special(const Part &part) const
                slider.render();
 }
 
+void List::button_press(int x, int y, unsigned btn)
+{
+       Container::button_press(x, y, btn);
+       if(!click_focus && btn==1)
+       {
+               if(items_part)
+                       y += items_part->get_margin().top;
+
+               unsigned i = (geom.h-1-y)/row_height;
+               if(i<n_visible && first+i<items.size())
+               {
+                       sel_index = first+i;
+
+                       signal_item_selected.emit(sel_index, items[sel_index]);
+               }
+       }
+}
+
 void List::on_geometry_change()
 {
        reposition_slider();