📄 fccolorcombo.hpp
字号:
bool InAutoDropDown;
Classes::TAlignment FColorAlignment;
Dialogs::TColorDialog* FColorDialog;
bool FShowMatchText;
Classes::TStringList* FCustomColors;
TfcColorList* FListbox;
Graphics::TColor FSelectedColor;
int FDropDownWidth;
TfcColorListOptions* FColorListOptions;
Stdctrls::TDrawItemEvent FOnDrawItem;
TfcColorDialogEvent FOnInitColorDialog;
TfcCloseColorDialogEvent FOnCloseColorDialog;
TfcColorDialogOptions FColorDialogOptions;
int FItemIndex;
bool SkipDataChange;
bool SkipTextChange;
bool SkipDropDown;
bool FCloseOnUp;
int FOriginalIndex;
Graphics::TColor FOriginalSelectedColor;
int FSelectedItemIndex;
TfcAddNewColorEvent FOnAddNewColor;
TfcOnFilterColorEvent FOnFilterColor;
bool SetModifiedInChangeEvent;
void __fastcall SetAlignment(Classes::TLeftRight Value);
void __fastcall SetColorAlignment(Classes::TLeftRight Value);
void __fastcall SetCustomColors(Classes::TStringList* Value);
void __fastcall SetItemIndex(int Value);
void __fastcall SetSelectedColor(Graphics::TColor Value);
void __fastcall CustomColorsChangeEvent(System::TObject* Sender);
void __fastcall ListMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState
Shift, int X, int Y);
void __fastcall ListMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState
Shift, int X, int Y);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
HIDESBASE MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CNCommand(Messages::TWMCommand &Message);
HIDESBASE MESSAGE void __fastcall CNKeyDown(Messages::TWMKey &Message);
HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
HIDESBASE MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
AnsiString __fastcall GetSelectedColorString(void);
void __fastcall SetSelectedColorString(AnsiString Value);
void __fastcall UpdateSelectedColor(void);
Classes::TLeftRight __fastcall GetEffectiveAlignment(void);
protected:
DYNAMIC void __fastcall Change(void);
virtual void __fastcall AddNewColorEvent(System::TObject* Sender, Graphics::TColor AColor, AnsiString
&AColorName, bool &Accept);
virtual void __fastcall OnFilterColorEvent(System::TObject* Sender, Graphics::TColor AColor, AnsiString
AColorName, bool &Accept);
virtual Graphics::TColor __fastcall GetComboColor(int Index);
virtual TfcColorComboDataType __fastcall GetComboDataType(void);
virtual AnsiString __fastcall GetComboDisplayText(int Value);
virtual Windows::TRect __fastcall GetTextRect(const Windows::TRect &ARect, bool Highlight);
virtual void __fastcall ListBoxNeeded(void);
virtual void __fastcall PaintToCanvas(Graphics::TCanvas* ACanvas, const Windows::TRect &Rect, bool
Highlight, bool GridPaint, AnsiString Text);
virtual void __fastcall Paint(void);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall DataChange(System::TObject* Sender);
virtual bool __fastcall Editable(void);
virtual bool __fastcall EditCanModify(void);
virtual Controls::TWinControl* __fastcall GetDropDownControl(void);
virtual Controls::TWinControl* __fastcall GetDropDownContainer(void);
virtual int __fastcall GetItemCount(void);
virtual tagSIZE __fastcall GetItemSize(void);
virtual void __fastcall HideCaret(void);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
DYNAMIC void __fastcall KeyPress(char &Key);
DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
virtual int __fastcall GetIndentLeft(const Windows::TRect &Rect);
virtual int __fastcall GetRightIndent(const Windows::TRect &Rect);
virtual int __fastcall GetTopIndent(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
virtual void __fastcall DrawColorRect(Graphics::TCanvas* ACanvas, const Windows::TRect &Rect, Graphics::TColor
CurColor, bool Highlight);
virtual void __fastcall SetComboText(AnsiString Value);
virtual void __fastcall SetEditRect(void);
virtual void __fastcall ShowCaret(void);
virtual void __fastcall UpdateData(System::TObject* Sender);
virtual void __fastcall WndProc(Messages::TMessage &Message);
__property Stdctrls::TDrawItemEvent OnDrawItem = {read=FOnDrawItem, write=FOnDrawItem};
public:
__fastcall virtual TfcCustomColorCombo(Classes::TComponent* AOwner);
__fastcall virtual ~TfcCustomColorCombo(void);
virtual void __fastcall SelectAll(void);
virtual void __fastcall CloseUp(bool Accept);
AnsiString __fastcall ColorString(AnsiString s);
bool __fastcall IsCustomColor(AnsiString s);
virtual bool __fastcall IsDroppedDown(void);
virtual void __fastcall DrawInGridCell(Graphics::TCanvas* ACanvas, const Windows::TRect &Rect, Grids::TGridDrawState
State);
virtual void __fastcall DropDown(void);
virtual bool __fastcall ExecuteColorDialog(void);
bool __fastcall GetColorFromRGBString(AnsiString RGBString, Graphics::TColor &AColor);
void __fastcall GetColorRectInfo(const Windows::TRect &Rect, int &AWidth, int &AHeight);
virtual void __fastcall RefreshList(void);
__property TfcColorList* ListBox = {read=FListbox};
__property bool DroppedDown = {read=IsDroppedDown, nodefault};
__property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, nodefault
};
__property Classes::TLeftRight UnboundAlignment = {read=GetEffectiveAlignment, write=SetAlignment,
default=0};
__property bool AutoDropDown = {read=FAutoDropDown, write=FAutoDropDown, default=0};
__property ButtonStyle ;
__property Classes::TLeftRight ColorAlignment = {read=FColorAlignment, write=SetColorAlignment, default=0
};
__property Dialogs::TColorDialog* ColorDialog = {read=FColorDialog, write=FColorDialog};
__property TfcColorDialogOptions ColorDialogOptions = {read=FColorDialogOptions, write=FColorDialogOptions
, default=2};
__property TfcColorListOptions* ColorListOptions = {read=FColorListOptions, write=FColorListOptions
};
__property Classes::TStringList* CustomColors = {read=FCustomColors, write=SetCustomColors};
__property AnsiString SelectedColorString = {read=GetSelectedColorString, write=SetSelectedColorString
};
__property int DropDownWidth = {read=FDropDownWidth, write=FDropDownWidth, default=0};
__property int ItemIndex = {read=FItemIndex, write=SetItemIndex, nodefault};
__property bool ShowMatchText = {read=FShowMatchText, write=FShowMatchText, default=1};
__property TfcAddNewColorEvent OnAddNewColor = {read=FOnAddNewColor, write=FOnAddNewColor};
__property TfcOnFilterColorEvent OnFilterColor = {read=FOnFilterColor, write=FOnFilterColor};
__property TfcColorDialogEvent OnInitColorDialog = {read=FOnInitColorDialog, write=FOnInitColorDialog
};
__property TfcCloseColorDialogEvent OnCloseColorDialog = {read=FOnCloseColorDialog, write=FOnCloseColorDialog
};
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TfcCustomColorCombo(HWND ParentWindow) : Fccombo::TfcCustomCombo(
ParentWindow) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TfcColorListOptions : public Classes::TPersistent
{
typedef Classes::TPersistent inherited;
private:
TfcCustomColorCombo* FCombo;
Graphics::TColor FColor;
int FColorWidth;
Graphics::TFont* FFont;
int FGreyScaleIncrement;
bool FIntegralHeight;
int FItemHeight;
TfcColorListBoxOptions FOptions;
TfcSortByOption FSortByOption;
AnsiString FNoneString;
void __fastcall SetColor(Graphics::TColor Value);
void __fastcall SetColorWidth(int Value);
void __fastcall SetFont(Graphics::TFont* Value);
void __fastcall SetGreyScaleIncrement(int Value);
void __fastcall SetIntegralHeight(bool Value);
void __fastcall SetItemHeight(int Value);
void __fastcall SetNoneString(AnsiString Value);
void __fastcall SetSortBy(TfcSortByOption Value);
bool __fastcall StoreNoneString(void);
protected:
void __fastcall SetOptions(TfcColorListBoxOptions Value);
__published:
__fastcall TfcColorListOptions(TfcCustomColorCombo* AOwner);
__fastcall virtual ~TfcColorListOptions(void);
__property Graphics::TColor Color = {read=FColor, write=SetColor, default=-2147483643};
__property int ColorWidth = {read=FColorWidth, write=SetColorWidth, default=0};
__property Graphics::TFont* Font = {read=FFont, write=SetFont};
__property int GreyScaleIncrement = {read=FGreyScaleIncrement, write=SetGreyScaleIncrement, default=10
};
__property bool IntegralHeight = {read=FIntegralHeight, write=SetIntegralHeight, default=1};
__property int ItemHeight = {read=FItemHeight, write=SetItemHeight, default=16};
__property AnsiString NoneString = {read=FNoneString, write=SetNoneString, stored=StoreNoneString};
__property TfcColorListBoxOptions Options = {read=FOptions, write=SetOptions, default=24};
__property TfcSortByOption SortBy = {read=FSortByOption, write=SetSortBy, default=0};
};
class DELPHICLASS TfcColorCombo;
class PASCALIMPLEMENTATION TfcColorCombo : public TfcCustomColorCombo
{
typedef TfcCustomColorCombo inherited;
__published:
__property Controller ;
__property DisableThemes ;
__property Anchors ;
__property BiDiMode ;
__property Constraints ;
__property ParentBiDiMode ;
__property DataField ;
__property DataSource ;
__property InfoPower ;
__property UnboundAlignment ;
__property AlignmentVertical ;
__property AllowClearKey ;
__property AutoDropDown ;
__property AutoSelect ;
__property AutoSize ;
__property ShowButton ;
__property BorderStyle ;
__property ButtonStyle ;
__property ButtonEffects ;
__property ButtonGlyph ;
__property ButtonWidth ;
__property CharCase ;
__property Color ;
__property ColorAlignment ;
__property ColorDialog ;
__property ColorDialogOptions ;
__property ColorListOptions ;
__property CustomColors ;
__property Ctl3D ;
__property DragMode ;
__property DragCursor ;
__property DropDownCount ;
__property DropDownWidth ;
__property Enabled ;
__property Frame ;
__property Font ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ReadOnly ;
__property ShowHint ;
__property ShowMatchText ;
__property SelectedColor ;
__property Style ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property OnAddNewColor ;
__property OnFilterColor ;
__property OnChange ;
__property OnClick ;
__property OnContextPopup ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnDropDown ;
__property OnCloseUp ;
__property OnInitColorDialog ;
__property OnCloseColorDialog ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseEnter ;
__property OnMouseLeave ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDrag ;
public:
#pragma option push -w-inl
/* TfcCustomColorCombo.Create */ inline __fastcall virtual TfcColorCombo(Classes::TComponent* AOwner
) : TfcCustomColorCombo(AOwner) { }
#pragma option pop
#pragma option push -w-inl
/* TfcCustomColorCombo.Destroy */ inline __fastcall virtual ~TfcColorCombo(void) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TfcColorCombo(HWND ParentWindow) : TfcCustomColorCombo(
ParentWindow) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint ColorRectMargin = 0x2;
} /* namespace Fccolorcombo */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Fccolorcombo;
#endif
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // fcColorCombo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -