00001 #if !defined( __ARSDROPDOWN_H__ ) 00002 #define __ARSDROPDOWN_H__ 00003 00004 namespace Ars 00005 { 00006 class XDropDown : public XEditBox { 00007 private: 00008 00009 XListBox *listBox; 00010 XButtonImage *dropButton; 00011 00012 public: 00015 XDropDown( void ); 00016 00018 virtual ~XDropDown(void) { } 00019 00020 00025 virtual void Init( icstring &aStr ); 00026 00027 virtual const bool SetupWindow( const Message &msg ); 00028 00029 // Items 00034 const int AddItem( XListItem ListItem ) { return listBox->AddItem( ListItem ); } 00035 const int AddItem( const std::string &aText ){ return listBox->AddItem( aText ); } 00036 00040 XListItem &GetItem( const int iItemIndex ) { return listBox->GetItem( iItemIndex ); } 00041 00044 void RemoveItem( const int iItemIndex ) { listBox->RemoveItem( iItemIndex ); } 00045 00047 void ClearItems(void) { listBox->ClearItems(); } 00048 00049 // Height of items 00052 unsigned int GetItemHeight(void) { return listBox->GetItemHeight(); } 00053 00055 void SetItemHeight( const unsigned int iItemHeight ) { listBox->SetItemHeight( iItemHeight ); } 00056 00057 00059 const int Size(void) { return listBox->Size(); } 00060 00063 const bool IsSelected( const int iItemIndex ) { return listBox->IsSelected(iItemIndex); } 00064 00068 void SetSelection( const int iItemIndex, const bool bSelected) { listBox->SetSelection(iItemIndex, bSelected); } 00069 00072 void SetAllSelections( const bool bSelected) { listBox->SetAllSelections(bSelected); } 00073 00074 protected: 00076 void ShowListBox(void); 00077 00079 void HideListBox(void); 00080 00081 virtual const bool evValueChange( const CtrlMessage &msg ); 00082 virtual const bool evMouseLClick( const CtrlMessage &msg ); 00083 virtual const bool wmLostFocus( const CtrlMessage &msg ); 00084 }; 00085 00086 } 00087 00088 #endif