Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

combobox_generic.h

Go to the documentation of this file.
00001 /*
00002         ClanGUI, copyrights by various people. Have a look in the CREDITS file.
00003         
00004         This sourcecode is distributed using the Library GNU Public Licence,
00005         version 2 or (at your option) any later version. Please read LICENSE
00006         for details.
00007 */
00008 
00009 #ifndef header_combobox_generic
00010 #define header_combobox_generic
00011 
00012 #include "API/GUI/combobox.h"
00013 
00014 class CL_Button;
00015 
00016 class CL_ComboBox_Generic
00017 {
00018 public:
00019         static CL_ComponentOptions create_options(
00020                 const CL_Rect &pos);
00021 
00022         CL_ComboBox_Generic(CL_ComboBox *self, const CL_ComponentOptions &options, CL_StyleManager *style);
00023         ~CL_ComboBox_Generic();
00024 
00025 public:
00026         int get_count() const;
00027 
00028         std::list<std::string> &get_items();
00029         std::string get_current_text() const;
00030         std::string get_text(int index) const;
00031         int get_current_item() const;
00032         bool is_selected(int index) const;
00033 
00034 public:
00035         int insert_item(const std::string &text, int index);
00036         void remove_item(int index);
00037         void change_item(const std::string &text, int index);
00038 
00039         void set_current_item(int index);
00040         void clear_selection();
00041 
00042         void sort(bool ascending);
00043 
00044         void clear();
00045 
00046 public:
00047         CL_Signal_v1<int> sig_activated;
00048         CL_Signal_v1<int> sig_highlighted;
00049 
00050 protected:
00051         void set_select_button(CL_Button *select_button);
00052         void select_clicked();
00053 
00054         CL_Slot slot_clicked, slot_pressed;
00055 
00056         bool activated;
00057         bool skip_next_activation;
00058 
00059         int highlighted_item;
00060 
00061         CL_ComboBox *combobox;
00062         CL_Button *select_button;
00063 
00064         std::list<std::string> items;
00065 };  
00066 
00067 #endif

Generated at Wed Apr 4 19:53:59 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001