]> git.tdb.fi Git - libs/gltk.git/blob - examples/widgetdemo/demoselector.h
Add another example application to demonstrate various widgets
[libs/gltk.git] / examples / widgetdemo / demoselector.h
1 #ifndef DEMOSELECTOR_H_
2 #define DEMOSELECTOR_H_
3
4 #include <msp/gltk/list.h>
5 #include <msp/gltk/panel.h>
6
7 class DemoSelector: public Msp::GLtk::Panel
8 {
9 private:
10         struct Demo
11         {
12                 std::string title;
13                 Msp::GLtk::Panel *panel;
14         };
15
16         Msp::GLtk::List list;
17         Msp::GLtk::FunctionListData<Demo> demos;
18         const Demo *current_demo;
19
20 public:
21         DemoSelector();
22
23         void add_demo(const std::string &, Msp::GLtk::Panel *);
24 private:
25         void item_selected(unsigned);
26
27         static std::string get_demo_title(const Demo &);
28 };
29
30 #endif