00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FXCOLORLIST_H
00025 #define FXCOLORLIST_H
00026
00027 #ifndef FXLIST_H
00028 #include "FXList.h"
00029 #endif
00030
00031 namespace FX {
00032
00033
00035 class FXAPI FXColorItem : public FXListItem {
00036 FXDECLARE(FXColorItem)
00037 protected:
00038 FXColor color;
00039 private:
00040 FXColorItem(const FXColorItem&);
00041 FXColorItem& operator=(const FXColorItem&);
00042 protected:
00043 FXColorItem():color(0){}
00044 virtual void draw(const FXList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h);
00045 virtual FXint hitItem(const FXList* list,FXint x,FXint y) const;
00046 public:
00048 FXColorItem(const FXString& text,FXColor clr,void* ptr=NULL):FXListItem(text,NULL,ptr),color(clr){}
00049
00051 void setColor(FXColor clr){ color=clr; }
00052
00054 FXColor getColor() const { return color; }
00055
00057 virtual FXint getWidth(const FXList* list) const;
00058
00060 virtual FXint getHeight(const FXList* list) const;
00061 };
00062
00063
00067 class FXAPI FXColorList : public FXList {
00068 FXDECLARE(FXColorList)
00069 protected:
00070 FXColorList(){}
00071 virtual FXListItem *createItem(const FXString& text,FXIcon* icon,void* ptr);
00072 private:
00073 FXColorList(const FXColorList&);
00074 FXColorList &operator=(const FXColorList&);
00075 public:
00076
00078 FXColorList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=LIST_BROWSESELECT,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00079
00081 FXint fillItems(const FXchar** strings,FXColor *colors=NULL,void* ptr=NULL,FXbool notify=FALSE);
00082
00084 FXint insertItem(FXint index,const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
00085
00087 FXint appendItem(const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
00088
00090 FXint prependItem(const FXString& text,FXColor color=0,void* ptr=NULL,FXbool notify=FALSE);
00091
00093 void setItemColor(FXint index,FXColor color);
00094
00096 FXColor getItemColor(FXint index) const;
00097 };
00098
00099 }
00100
00101 #endif