Advanced Strategic Command
multilistbox.h
Go to the documentation of this file.
1 /***************************************************************************
2  dropdownselector
3  -------------------
4  copyright : (C) 2006 by Martin Bickel
5  email : <bickel@asc-hq.org>
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef multilistboxH
18 #define multilistboxH
19 
20 #include <pgwidget.h>
21 #include <pglistbox.h>
22 #include <pglistboxitem.h>
23 
24 template<typename T>
25 class PG_ListBoxDataItem : public PG_ListBoxItem {
26  public:
27  typedef T DataType;
28  private:
29  T my_data;
30  public:
31  PG_ListBoxDataItem( PG_Widget *parent, int height, const std::string &text, const T& data, SDL_Surface *icon=NULL ) : PG_ListBoxItem( parent, height, text, icon ), my_data(data) {};
32  T getData() { return my_data; };
33 };
34 
35 
36 
37 class MultiListBox : public PG_Widget {
38  PG_ListBox* listbox;
39  public:
40  MultiListBox (PG_Widget *parent, const PG_Rect &r );
41  PG_ListBox* getListBox() { return listbox; };
42  bool all();
43  bool none();
44 };
45 
46 
47 #endif
PG_ListBox * getListBox()
Definition: multilistbox.h:41
MultiListBox(PG_Widget *parent, const PG_Rect &r)
PG_ListBoxDataItem(PG_Widget *parent, int height, const std::string &text, const T &data, SDL_Surface *icon=NULL)
Definition: multilistbox.h:31