00001 #ifndef _VGUI_LISTBOX_H 00002 #define _VGUI_LISTBOX_H 00003 00004 /* listbox.h */ 00005 #include <vector> 00006 #include <string> 00007 #include "gui.h" 00008 using namespace VGUI; 00009 00010 class ListBox : public Widget 00011 { 00012 public: 00013 ListBox( Widget w ); 00014 ~ListBox(); 00015 00016 ListItem GetSelected() { return items[cur]; } 00017 00018 private: 00019 vector<ListItem> items; 00020 int cur; 00021 }; 00022 00023 00024 class ListItem 00025 { 00026 public: 00027 ListItem(); 00028 ~ListItem(); 00029 ListItem(string val, string txt) { value = val; text = txt; } 00030 00031 string GetValue() { return value; } 00032 string GetText() { return text; } 00033 void SetValue(string new_value) { value = new_value; } 00034 void SetText(string new_text) { text = new_text; } 00035 00036 private: 00037 string value; 00038 string text; 00039 }; 00040 00041 00042 #endif // _VGUI_LISTBOX_H
1.4.6