00001
00015 #ifndef CUI_COMBOBOX_H
00016 #define CUI_COMBOBOX_H
00017
00018 #include "UI_Lib.h"
00019 #include "UI_types.h"
00020 #include "CUI_Button.h"
00021 #include "CUI_ListBox.h"
00022
00023
00025
00036 class GLGUI_ENTRY CUI_ComboBox : public CUI_Control
00037 {
00038 public:
00040 CUI_ComboBox(
00041 CUI_UI *ui = NULL, float x = 0, float y = 0, float x2 = 1, float y2 = 1,
00042 CUI_Frame *parent = NULL, IUI_Shader *shader = NULL,
00043 IUI_Shader *cursor = NULL, CUI_CoordSys *coordsys = NULL,
00044
00045
00046 IUI_Shader *dropIcon = NULL
00047 );
00048
00050 virtual ~CUI_ComboBox();
00051
00053 virtual bool SetUI( CUI_UI *ui );
00054
00056 virtual int GetSelectedID( )
00057 { return m_selectedID;}
00058
00060 virtual bool Select( CUI_Frame *frame );
00061
00063 virtual bool Select( unsigned int id );
00064
00066
00069 virtual bool SetFlag( unsigned long flag, bool set );
00070
00072 virtual bool AddItem( char *text = NULL, unsigned int itemID = 0, IUI_Shader *icon = NULL,
00073 unsigned short flags = UI_ITEM_BUTTON );
00074
00076 virtual bool AddItem( CUI_ListItem *item )
00077 { return m_listBox->AddItem( item ); }
00078
00080 virtual bool RemoveItem( unsigned int itemID );
00081
00083 virtual bool EnableItem( unsigned int itemID, bool enable = true );
00084
00086 virtual bool ProcessKey( unsigned long key )
00087 { return m_listBox->ProcessKey( key ); }
00088
00090
00093 bool CallbackFunc( int id, int numparam, void *param );
00094
00096 virtual bool SetDropIconShader( IUI_Shader *dropIcon )
00097 { return m_dropIcon->SetShader( dropIcon ); }
00098
00100 virtual bool SetItemSize( float size )
00101 { return m_listBox->SetItemSize(size); }
00102
00104 virtual bool SetItemFlag( unsigned int itemID, unsigned short flag, bool enable = true );
00105
00107 virtual bool SetItemIcon( unsigned int itemID, IUI_Shader *icon );
00108
00110 virtual bool SetHoverShader( IUI_Shader *shader );
00111
00113 virtual bool SetSelectedShader( IUI_Shader *shader )
00114 { return m_listBox->SetSelectedShader(shader); }
00115
00117 virtual bool SetItemShader( IUI_Shader *shader );
00118
00120 virtual bool SetItemBorder( IUI_Border *border );
00121
00122
00123 protected:
00124
00125
00126 virtual bool OpenListBox();
00127
00128
00129 virtual bool CloseListBox();
00130
00132 CUI_ListBox *m_listBox;
00133
00135 CUI_Button *m_button;
00136
00138
00141 CUI_Widget *m_widget;
00142
00144 CUI_Frame *m_icon;
00145
00147 CUI_Frame *m_dropIcon;
00148
00150 int m_selectedID;
00151
00153 bool m_listBoxOpen;
00154
00155 };
00156
00157 #endif