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