]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.h
Add Container class
[libs/gltk.git] / source / list.h
index 770cc2f4517366a0b777d3e33df26f7f86b1a31f..dee57ed55c98587182976bf5b338a5683b79f93c 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -9,18 +9,17 @@ Distributed under the LGPL
 #define MSP_GLTK_LIST_H_
 
 #include <sigc++/signal.h>
-#include "widget.h"
+#include "container.h"
+#include "vslider.h"
 
 namespace Msp {
 namespace GLtk {
 
-class VSlider;
-
 /**
 Shows a list of items, allowing the user to select one.  A slider is included
 to allow scrolling through a long list.
 */
-class List: public Widget
+class List: virtual public Widget, private Container
 {
 public:
        class Loader: public Widget::Loader
@@ -40,14 +39,12 @@ private:
 
        const Part *items_part;
 
-       VSlider *slider;
-       bool slider_active;
+       VSlider slider;
 
 public:
        sigc::signal<void, unsigned, const std::string &> signal_item_selected;
 
        List(const Resources &);
-       ~List();
 
        void append(const std::string &);
        void insert(unsigned, const std::string &);
@@ -60,8 +57,6 @@ public:
        int get_selected_index() const { return sel_index; }
 
        virtual void button_press(int, int, unsigned);
-       virtual void button_release(int, int, unsigned);
-       virtual void pointer_motion(int, int);
 
 private:
        virtual const char *get_class() const { return "list"; }