📄 scomboboxes.hpp
字号:
class DELPHICLASS TsCustomColorBox;
typedef void __fastcall (__closure *TGetColorsEvent)(TsCustomColorBox* Sender, Classes::TStrings* Items);
class PASCALIMPLEMENTATION TsCustomColorBox : public TsCommonComboBox
{
typedef TsCommonComboBox inherited;
private:
TsColorBoxStyle FStyle;
bool FNeedToPopulate;
bool FListSelected;
Graphics::TColor FDefaultColorColor;
Graphics::TColor FNoneColorColor;
Graphics::TColor FSelectedColor;
bool FShowColorName;
int FMargin;
TGetColorsEvent FOnGetColors;
Graphics::TColor __fastcall GetColor(int Index);
AnsiString __fastcall GetColorName(int Index);
Graphics::TColor __fastcall GetSelected(void);
void __fastcall SetSelected(const Graphics::TColor AColor);
void __fastcall ColorCallBack(const AnsiString AName);
void __fastcall SetDefaultColorColor(const Graphics::TColor Value);
void __fastcall SetNoneColorColor(const Graphics::TColor Value);
void __fastcall SetShowColorName(const bool Value);
void __fastcall SetMargin(const int Value);
protected:
DYNAMIC void __fastcall CloseUp(void);
Types::TRect __fastcall ColorRect(const Types::TRect &SourceRect, Windows::TOwnerDrawState State);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall DrawItem(int Index, const Types::TRect &Rect, Windows::TOwnerDrawState State);
virtual void __fastcall DrawSkinItem(int Index, const Types::TRect &Rect, Windows::TOwnerDrawState State);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
DYNAMIC void __fastcall KeyPress(char &Key);
virtual bool __fastcall PickCustomColor(void);
void __fastcall PopulateList(void);
DYNAMIC void __fastcall Select(void);
HIDESBASE void __fastcall SetStyle(TsColorBoxStyle AStyle);
public:
__fastcall virtual TsCustomColorBox(Classes::TComponent* AOwner);
__property AnsiString ColorNames[int Index] = {read=GetColorName};
__property Graphics::TColor Colors[int Index] = {read=GetColor};
__published:
__property TsColorBoxStyle Style = {read=FStyle, write=SetStyle, default=7};
__property int Margin = {read=FMargin, write=SetMargin, default=0};
__property Graphics::TColor Selected = {read=GetSelected, write=SetSelected, default=0};
__property bool ShowColorName = {read=FShowColorName, write=SetShowColorName, default=1};
__property Graphics::TColor DefaultColorColor = {read=FDefaultColorColor, write=SetDefaultColorColor, default=0};
__property Graphics::TColor NoneColorColor = {read=FNoneColorColor, write=SetNoneColorColor, default=0};
__property TGetColorsEvent OnGetColors = {read=FOnGetColors, write=FOnGetColors};
public:
#pragma option push -w-inl
/* TsCommonComboBox.Destroy */ inline __fastcall virtual ~TsCustomColorBox(void) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TsCustomColorBox(HWND ParentWindow) : TsCommonComboBox(ParentWindow) { }
#pragma option pop
};
class DELPHICLASS TsColorBox;
class PASCALIMPLEMENTATION TsColorBox : public TsCustomColorBox
{
typedef TsCustomColorBox inherited;
__published:
__property AutoComplete = {default=1};
__property AutoDropDown = {default=0};
__property DisabledKind = {default=1};
__property Anchors = {default=3};
__property BevelEdges = {default=15};
__property BevelInner = {index=0, default=2};
__property BevelKind = {default=0};
__property BevelOuter = {index=1, default=1};
__property BiDiMode ;
__property Color = {default=-16777211};
__property Constraints ;
__property Ctl3D ;
__property DropDownCount = {default=14};
__property Enabled = {default=1};
__property Font ;
__property ItemHeight = {default=16};
__property ParentBiDiMode = {default=1};
__property ParentColor = {default=0};
__property ParentCtl3D = {default=1};
__property ParentFont = {default=1};
__property ParentShowHint = {default=1};
__property PopupMenu ;
__property ShowHint ;
__property TabOrder = {default=-1};
__property TabStop = {default=1};
__property Visible = {default=1};
__property OnChange ;
__property OnCloseUp ;
__property OnClick ;
__property OnContextPopup ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnDropDown ;
__property OnEndDock ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseUp ;
__property OnSelect ;
__property OnStartDock ;
__property OnStartDrag ;
__property Style = {default=7};
__property Margin = {default=0};
__property Selected = {default=0};
__property ShowColorName = {default=1};
__property DefaultColorColor = {default=0};
__property NoneColorColor = {default=0};
__property SkinData ;
public:
#pragma option push -w-inl
/* TsCustomColorBox.Create */ inline __fastcall virtual TsColorBox(Classes::TComponent* AOwner) : TsCustomColorBox(AOwner) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TsCommonComboBox.Destroy */ inline __fastcall virtual ~TsColorBox(void) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TsColorBox(HWND ParentWindow) : TsCustomColorBox(ParentWindow) { }
#pragma option pop
};
class DELPHICLASS TsComboItems;
class DELPHICLASS TsCustomComboBoxEx;
class DELPHICLASS TsComboItem;
class PASCALIMPLEMENTATION TsCustomComboBoxEx : public TsCommonComboBox
{
typedef TsCommonComboBox inherited;
private:
Imglist::TChangeLink* FImageChangeLink;
Imglist::TCustomImageList* FImages;
TsComboItems* FItemsEx;
bool NeedToUpdate;
void __fastcall ImageListChange(System::TObject* Sender);
void __fastcall SetImages(const Imglist::TCustomImageList* Value);
void __fastcall SetItemsEx(const TsComboItems* Value);
TsComboItem* __fastcall GetSelectedItem(void);
protected:
virtual void __fastcall DrawItem(int Index, const Types::TRect &Rect, Windows::TOwnerDrawState State);
virtual void __fastcall DrawSkinItem(int Index, const Types::TRect &Rect, Windows::TOwnerDrawState State);
Types::TRect __fastcall ImgRect(TsComboItem* Item, Windows::TOwnerDrawState State);
int __fastcall CurrentImage(TsComboItem* Item, Windows::TOwnerDrawState State);
public:
virtual void __fastcall Clear(void);
void __fastcall UpdateList(void);
__fastcall virtual TsCustomComboBoxEx(Classes::TComponent* AOwner);
__fastcall virtual ~TsCustomComboBoxEx(void);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
virtual void __fastcall UpdateMargins(void);
__property Imglist::TCustomImageList* Images = {read=FImages, write=SetImages};
__property TsComboItems* ItemsEx = {read=FItemsEx, write=SetItemsEx};
__property TsComboItem* SelectedItem = {read=GetSelectedItem};
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TsCustomComboBoxEx(HWND ParentWindow) : TsCommonComboBox(ParentWindow) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TsComboItems : public Classes::TCollection
{
typedef Classes::TCollection inherited;
public:
TsComboItem* operator[](int Index) { return Items[Index]; }
private:
TsCustomComboBoxEx* FOwner;
HIDESBASE TsComboItem* __fastcall GetItem(int Index);
HIDESBASE void __fastcall SetItem(int Index, TsComboItem* Value);
protected:
DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
virtual void __fastcall Update(Classes::TCollectionItem* Item);
public:
HIDESBASE TsComboItem* __fastcall Add(void);
TsComboItem* __fastcall AddItem(const AnsiString Caption, const int ImageIndex, const int SelectedImageIndex, const int OverlayImageIndex, const int Indent, void * Data);
__fastcall TsComboItems(TsCustomComboBoxEx* AOwner);
__fastcall virtual ~TsComboItems(void);
__property TsComboItem* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
};
class PASCALIMPLEMENTATION TsComboItem : public Classes::TCollectionItem
{
typedef Classes::TCollectionItem inherited;
private:
AnsiString FCaption;
Imglist::TImageIndex FSelectedImageIndex;
Imglist::TImageIndex FImageIndex;
Imglist::TImageIndex FOverlayImageIndex;
int FIndend;
void *FData;
void __fastcall SetCaption(const AnsiString Value);
void __fastcall SetData(const void * Value);
public:
__property void * Data = {read=FData, write=SetData};
__fastcall virtual TsComboItem(Classes::TCollection* Collection);
__fastcall virtual ~TsComboItem(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
virtual AnsiString __fastcall GetDisplayName();
__published:
__property AnsiString Caption = {read=FCaption, write=SetCaption};
__property Imglist::TImageIndex ImageIndex = {read=FImageIndex, write=FImageIndex, default=-1};
__property int Indend = {read=FIndend, write=FIndend, default=-1};
__property Imglist::TImageIndex OverlayImageIndex = {read=FOverlayImageIndex, write=FOverlayImageIndex, default=-1};
__property Imglist::TImageIndex SelectedImageIndex = {read=FSelectedImageIndex, write=FSelectedImageIndex, default=-1};
};
class DELPHICLASS TsComboBoxEx;
class PASCALIMPLEMENTATION TsComboBoxEx : public TsCustomComboBoxEx
{
typedef TsCustomComboBoxEx inherited;
public:
__property SelectedItem ;
__published:
__property Action ;
__property Anchors = {default=3};
__property BiDiMode ;
__property Color = {default=-16777211};
__property Constraints ;
__property Ctl3D ;
__property DisabledKind = {default=1};
__property DragCursor = {default=-12};
__property DragKind = {default=0};
__property DragMode = {default=0};
__property Enabled = {default=1};
__property Font ;
__property ImeMode = {default=3};
__property ImeName ;
__property ItemHeight = {default=16};
__property ParentBiDiMode = {default=1};
__property ParentColor = {default=0};
__property ParentCtl3D = {default=1};
__property ParentFont = {default=1};
__property ParentShowHint = {default=1};
__property PopupMenu ;
__property ShowHint ;
__property TabOrder = {default=-1};
__property TabStop = {default=1};
__property Visible = {default=1};
__property BevelEdges = {default=15};
__property BevelInner = {index=0, default=2};
__property BevelKind = {default=0};
__property BevelOuter = {index=1, default=1};
__property DropDownCount = {default=14};
__property OnChange ;
__property OnCloseUp ;
__property OnClick ;
__property OnContextPopup ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnDrawItem ;
__property OnDropDown ;
__property OnEndDock ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnSelect ;
__property OnStartDock ;
__property OnStartDrag ;
__property MaxLength = {default=0};
__property Images ;
__property ItemsEx ;
__property SkinData ;
__property Text ;
public:
#pragma option push -w-inl
/* TsCustomComboBoxEx.Create */ inline __fastcall virtual TsComboBoxEx(Classes::TComponent* AOwner) : TsCustomComboBoxEx(AOwner) { }
#pragma option pop
#pragma option push -w-inl
/* TsCustomComboBoxEx.Destroy */ inline __fastcall virtual ~TsComboBoxEx(void) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TsComboBoxEx(HWND ParentWindow) : TsCustomComboBoxEx(ParentWindow) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Dialogs::TColorDialog* ColDlg;
} /* namespace Scomboboxes */
using namespace Scomboboxes;
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Scomboboxes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -