⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 advofficeselectors.hpp

📁 一个非常棒的控件.做商业软件特别适用.里面的控件涉及面非常的广,有兴趣的话可以下来用用就知道了.
💻 HPP
📖 第 1 页 / 共 5 页
字号:
	
private:
	TColorCubeCell FCubeCells[127];
	#pragma pack(push,1)
	Types::TPoint FCubeSize;
	#pragma pack(pop)
	Graphics::TColor FSelectedColor;
	int FSelectedIndex;
	int FHotIndex;
	Classes::TNotifyEvent FOnSelect;
	bool FShowRGBHint;
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	void __fastcall DrawColorCube(int Index);
	void __fastcall DrawAllColorCube(void);
	void __fastcall DrawSelectedBorder(void);
	void __fastcall DrawHotBorder(void);
	void __fastcall SetSelectedColor(const Graphics::TColor Value);
	void __fastcall SetSelectedIndexAndColor(Graphics::TColor clr, int index = 0xffffffff);
	void __fastcall SetShowRGBHint(const bool Value);
	
protected:
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	bool __fastcall PtInCell(int Index, const Types::TPoint &P);
	int __fastcall IndexOfCellAt(int X, int Y);
	void __fastcall DrawHexagon(Graphics::TCanvas* aCanvas, const Types::TPoint &P, int X, int Y);
	HIDESBASE void __fastcall Initialize(void);
	void __fastcall SetItemsPosition(void);
	void __fastcall SetPanelSize(void);
	
public:
	__fastcall virtual TAdvColorCubePanel(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvColorCubePanel(void);
	
__published:
	__property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, nodefault};
	__property bool ShowRGBHint = {read=FShowRGBHint, write=SetShowRGBHint, nodefault};
	__property Classes::TNotifyEvent OnSelect = {read=FOnSelect, write=FOnSelect};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvColorCubePanel(HWND ParentWindow) : TAdvCustomSelectorPanel(ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TAdvColorSpectrumPanel;
class PASCALIMPLEMENTATION TAdvColorSpectrumPanel : public TAdvCustomSelectorPanel 
{
	typedef TAdvCustomSelectorPanel inherited;
	
private:
	Extctrls::TImage* FSpectrumImage;
	Graphics::TColor FHotColor;
	Graphics::TColor FSelectedColor;
	#pragma pack(push,1)
	Types::TRect FHotRect;
	#pragma pack(pop)
	#pragma pack(push,1)
	Types::TRect FSelectedRect;
	#pragma pack(pop)
	Classes::TNotifyEvent FOnSelect;
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	void __fastcall SpectrumImageMouseMove(System::TObject* Sender, Classes::TShiftState Shift, int X, int Y);
	void __fastcall SpectrumImageMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	void __fastcall SpectrumImageMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	void __fastcall DrawHotRect(void);
	void __fastcall DrawSelectedRect(void);
	void __fastcall DrawFocusPoint(void);
	void __fastcall SetSelectedColor(const Graphics::TColor Value);
	
protected:
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	void __fastcall SetItemsPosition(void);
	void __fastcall SetPanelSize(void);
	
public:
	__fastcall virtual TAdvColorSpectrumPanel(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvColorSpectrumPanel(void);
	
__published:
	__property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, nodefault};
	__property Classes::TNotifyEvent OnSelect = {read=FOnSelect, write=FOnSelect};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvColorSpectrumPanel(HWND ParentWindow) : TAdvCustomSelectorPanel(ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TAdvTableSelectorPanel;
class PASCALIMPLEMENTATION TAdvTableSelectorPanel : public TAdvCustomSelectorPanel 
{
	typedef TAdvCustomSelectorPanel inherited;
	
private:
	Classes::TNotifyEvent FOnSelect;
	int FSelectedCols;
	int FSelectedRows;
	int FColCount;
	int FRowCount;
	int FCellSize;
	int FLeftMargin;
	int FTopMargin;
	int FCellSpace;
	int FLabelHeight;
	Graphics::TColor FSelectionColor;
	AnsiString FTextTable;
	AnsiString FTextCancel;
	void __fastcall SetColCount(const int Value);
	void __fastcall SetRowCount(const int Value);
	void __fastcall SetSelectedCols(const int Value);
	void __fastcall SetSelectedRows(const int Value);
	void __fastcall SetCellSize(const int Value);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	void __fastcall DrawAllCells(void);
	void __fastcall DrawLabel(void);
	void __fastcall InvalidateSelection(int OldSelectedCols, int OldSelectedRows);
	
protected:
	virtual void __fastcall Paint(void);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	void __fastcall SetItemsPosition(void);
	void __fastcall SetPanelSize(void);
	
public:
	__fastcall virtual TAdvTableSelectorPanel(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvTableSelectorPanel(void);
	
__published:
	__property int ColCount = {read=FColCount, write=SetColCount, default=5};
	__property int RowCount = {read=FRowCount, write=SetRowCount, default=4};
	__property int SelectedCols = {read=FSelectedCols, write=SetSelectedCols, default=0};
	__property int SelectedRows = {read=FSelectedRows, write=SetSelectedRows, default=0};
	__property int CellSize = {read=FCellSize, write=SetCellSize, default=16};
	__property Graphics::TColor SelectionColor = {read=FSelectionColor, write=FSelectionColor, default=8388608};
	__property AnsiString TextTable = {read=FTextTable, write=FTextTable};
	__property AnsiString TextCancel = {read=FTextCancel, write=FTextCancel};
	__property Classes::TNotifyEvent OnSelect = {read=FOnSelect, write=FOnSelect};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvTableSelectorPanel(HWND ParentWindow) : TAdvCustomSelectorPanel(ParentWindow) { }
	#pragma option pop
	
};


typedef void __fastcall (__closure *TDrawToolEvent)(System::TObject* Sender, Graphics::TCanvas* Canvas, int ItemIndex, const Types::TRect &R);

class DELPHICLASS TAdvCustomOfficeSelector;
class PASCALIMPLEMENTATION TAdvCustomOfficeSelector : public Advglowbutton::TAdvCustomGlowButton 
{
	typedef Advglowbutton::TAdvCustomGlowButton inherited;
	
private:
	TSelectorDropDownWindow* FDropDownWindow;
	TAdvSelectorPanel* FSelectorPanel;
	bool FMouseInControl;
	bool FMouseDown;
	int FDropDownBtnWidth;
	bool FFlat;
	TAdvSelectorStyle FStyle;
	Imglist::TCustomImageList* FToolImages;
	Classes::TNotifyEvent FOnDropDown;
	Graphics::TColor FColorDropDownTo;
	Graphics::TColor FColorDropDown;
	Graphics::TColor FBorderDropDownColor;
	int FDropDownCount;
	TGradientDirection FGradientDirection;
	int FSelectedIndex;
	TAdvSelectorItems* FTools;
	TNoOfButtons FButtonsPerRow;
	THotToolEvent FOnHotTool;
	Classes::TNotifyEvent FOnClick;
	TSelectEvent FOnSelect;
	TDrawToolEvent FOnDrawTool;
	int FDupSelectedIndex;
	bool FTwoColorImages;
	Graphics::TColor FBackGroundImageColor;
	Graphics::TColor FForeGroundImageColor;
	Graphics::TColor FOldForeGroundImgColor;
	Graphics::TColor FOldBkGroundImgColor;
	bool FStretchImageDraw;
	TSelectionAppearance* FSelectionAppearance;
	bool FAllowFloating;
	TVistaBackgroundHot* FDragGripAppearance;
	bool FCloseOnSelect;
	TGripPosition FGripPosition;
	TGradientCaption* FCaptionAppearance;
	Graphics::TColor FColorDropDownFloatingTo;
	Graphics::TColor FColorDropDownFloating;
	Classes::TNotifyEvent FOnDropDownFloat;
	Classes::TNotifyEvent FOnDropDownClose;
	HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	void __fastcall OnDropDownWindowHide(System::TObject* Sender);
	void __fastcall OnDropDownPanelShouldHide(System::TObject* Sender);
	void __fastcall OnDropDownPanelSelect(System::TObject* Sender);
	void __fastcall OnDropDownPanelHotTool(System::TObject* Sender, int HotItemIndex);
	void __fastcall OnDropDownPanelDrawTool(System::TObject* Sender, int ItemIndex, const Types::TRect &R);
	void __fastcall OnDropDownPanelFloating(System::TObject* Sender);
	void __fastcall OnDropDownPanelClose(System::TObject* Sender);
	void __fastcall OnSelectionAppearanceChanged(System::TObject* Sender);
	HIDESBASE void __fastcall PopupBtnDown(void);
	void __fastcall ButtonDown(void);
	HIDESBASE void __fastcall DoDropDown(void);
	void __fastcall SetFlat(const bool Value);
	void __fastcall SetToolImages(const Imglist::TCustomImageList* Value);
	HIDESBASE void __fastcall SetStyle(const TAdvSelectorStyle Value);
	void __fastcall SetColorDropDown(const Graphics::TColor Value);
	void __fastcall SetColorDropDownTo(const Graphics::TColor Value);
	void __fastcall SetDropDownCount(const int Value);
	void __fastcall SetTGradientDirection(const TGradientDirection Value);
	void __fastcall SetSelectedIndex(const int Value);
	void __fastcall SetTools(const TAdvSelectorItems* Value);
	int __fastcall GetSelectedIndex(void);
	void __fastcall SetButtonsPerRow(const TNoOfButtons Value);
	HIDESBASE AnsiString __fastcall GetVersion();
	HIDESBASE void __fastcall SetVersion(const AnsiString Value);
	void __fastcall SetTwoColorImages(const bool Value);
	void __fastcall SetForeGroundImageColor(const Graphics::TColor Value);
	void __fastcall SetStretchImageDraw(const bool Value);
	void __fastcall SetSelectionAppearance(const TSelectionAppearance* Value);
	void __fastcall SetDragGripAppearance(const TVistaBackgroundHot* Value);
	void __fastcall SetCaptionAppearance(const TGradientCaption* Value);
	
protected:
	virtual void __fastcall OnToolSelect(void);
	virtual void __fastcall GetToolImage(Graphics::TBitmap* bmp);
	void __fastcall CopyPicture(Gdipicture::TGDIPPicture* Pic, Graphics::TBitmap* bmp);
	int __fastcall DrawGlyph(Graphics::TBitmap* aGlyph, const Types::TRect &aRect);
	virtual void __fastcall DrawGlyphAndCaption(Gdipicture::TGDIPPicture* Pic, const Types::TRect &R);
	void __fastcall DrawComboButton(void);
	Types::TRect __fastcall GetBtnRect();
	void __fastcall SetSelectorPanelItems(void);
	virtual void __fastcall SetSelectorPanel(void);
	virtual void __fastcall Loaded(void);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall DoSelect(int Index, TAdvSelectorItem* Item);
	virtual void __fastcall DropDownWindowClose(System::TObject* Sender, Forms::TCloseAction &Action);
	virtual void __fastcall Paint(void);
	__property bool MouseInControl = {read=FMouseInControl, nodefault};
	virtual void __fastcall WndProc(Messages::TMessage &Message);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
	void __fastcall ThemeAdapt(void);
	virtual int __fastcall GetVersionNr(void);
	void __fastcall ChangeImagesColor(Graphics::TColor ForeGColor, Graphics::TColor BkGColor);
	__property bool TwoColorImages = {read=FTwoColorImages, write=SetTwoColorImages, nodefault};
	__property Graphics::TColor OldForeGroundImgColor = {read=FOldForeGroundImgColor, nodefault};
	__property Graphics::TColor OldBkGroundImgColor = {read=FOldBkGroundImgColor, nodefault};
	__property Graphics::TColor ForeGroundImageColor = {read=FForeGroundImageColor, write=SetForeGroundImageColor, nodefault};
	__property Graphics::TColor BackGroundImageColor = {read=FBackGroundImageColor, write=FBackGroundImageColor, nodefault};
	__property bool StretchImageDraw = {read=FStretchImageDraw, write=SetStretchImageDraw, default=1};
	__property TNoOfButtons ButtonsPerRow = {read=FButtonsPerRow, write=SetButtonsPerRow, default=1};
	__property Graphics::TColor BorderDropDownColor = {read=FBorderDropDownColor, write=FBorderDropDownColor, default=8421504};
	__property Graphics::TColor ColorDropDown = {read=FColorDropDown, write=SetColorDropDown, nodefault};
	__property Graphics::TColor ColorDropDownTo = {read=FColorDropDownTo, write=SetColorDropDownTo, default=536870911};
	__property Graphics::TColor ColorDropDownFloating = {read=FColorDropDownFloating, write=FColorDropDownFloating, nodefault};
	__property Graphics::TColor ColorDropDownFloatingTo = {read=FColorDropDownFloatingTo, write=FColorDropDownFloatingTo, default=536870911};
	__property TSelectionAppearance* SelectionAppearance = {read=FSelectionAppearance, write=SetSelectionAppearance};
	__property TVistaBackgroundHot* DragGripAppearance = {read=FDragGripAppearance, write=SetDragGripAppearance};
	__property TGradientCaption* CaptionAppearance = {read=FCaptionAppearance, write=SetCaptionAppearance};
	__property int DropDownCount = {read=FDropDownCount, write=SetDropDownCount, nodefault};
	__property bool Flat = {read=FFlat, write=SetFlat, default=1};
	__property TGradientDirection GradientDirection = {read=FGradientDirection, write=SetTGradientDirection, nodefault};
	__property Imglist::TCustomImageList* ToolImages = {read=FToolImages, write=SetToolImages};
	__property TAdvSelectorStyle Style = {read=FStyle, write=SetStyle, nodefault};
	__property TAdvSelectorItems* Tools = {read=FTools, write=SetTools};
	__property int SelectedIndex = {read=GetSelectedIndex, write=SetSelectedIndex, nodefault};
	__property bool AllowFloating = {read=FAllowFloating, write=FAllowFloating, nodefault};
	__property bool CloseOnSelect = {read=FCloseOnSelect, write=FCloseOnSelect, nodefault};
	__property TGripPosition DragGripPosition = {read=FGripPosition, write=FGripPosition, nodefault};
	__property Classes::TNotifyEvent OnDropDown = {read=FOnDropDown, write=FOnDropDown};
	__property Classes::TNotifyEvent OnDropDownFloat = {read=FOnDropDownFloat, write=FOnDropDownFloat};
	__property Classes::TNotifyEvent OnDropDownClose = {read=FOnDropDownClose, write=FOnDropDownClose};
	__property TSelectEvent OnSelect = {read=FOnSelect, write=FOnSelect};
	__property THotToolEvent OnHotTool = {read=FOnHotTool, write=FOnHotTool};
	__property TDrawToolEvent OnDrawTool = {read=FOnDrawTool, write=FOnDrawTool};
	__property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
	
public:
	__fastcall virtual TAdvCustomOfficeSelector(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvCustomOfficeSelector(void);
	DYNAMIC void __fastcall Click(void);
	void __fastcall ShowDropDown(void);
	void __fastcall HideDropDown(void);
	HIDESBASE void __fastcall SetComponentStyle(Advstyleif::TTMSStyle AStyle);
	
__published:
	__property Action ;
	__property TabOrder  = {default=-1};
	__property TabStop  = {default=0};
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
	__property Visible  = {default=1};
	__property ShowCaption  = {default=0};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvCustomOfficeSelector(HWND ParentWindow) : Advglowbutton::TAdvCustomGlowButton(ParentWindow) { }
	#pragma option pop
	
private:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -