/* $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
*/
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")
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();