advtabset.hpp

来自「TMSPack基本上涵盖了Delphi所有的基础控件」· HPP 代码 · 共 757 行 · 第 1/3 页

HPP
757
字号
	Graphics::TBitmap* FTabBackGroundSelected;
	TGradientDirection FGradientDirection;
	TGradientDirection FHoverGradientDirection;
	Graphics::TColor FTabHoverColor;
	Graphics::TColor FTabHoverColorTo;
	Graphics::TColor FTabHoverBorder;
	Imglist::TCustomImageList* FImages;
	TTabMargin* FTabMargin;
	TTabOverlapSize FTabOverlap;
	bool FShowFocus;
	TTabCloseEvent FOnTabClose;
	TCanCloseEvent FOnCanClose;
	TDrawTabSetBackgroundEvent FOnDrawTabSetBackground;
	TAdvTabStyle FAdvTabStyle;
	TTabMovedEvent FOnTabMoved;
	TAdvTabPosition FTabPosition;
	TCloseButtonPos FCloseButtonAt;
	bool FTabRearrange;
	TShowScroller FShowScroller;
	int FLowerSelected;
	bool FHoverClosedButton;
	Classes::TStringList* FDuplicateTabs;
	int FHoverTab;
	bool FCloseButtonDown;
	Controls::TImageList* ImageList;
	Graphics::TBitmap* MemBitmap;
	Graphics::TBitmap* BrushBitmap;
	Classes::TList* TabPositions;
	int FTabHeight;
	TScroller* FScroller;
	bool FDoFix;
	bool FSoftTop;
	Graphics::TFont* FActiveFont;
	Graphics::TBitmap* FCloseGlyph;
	Graphics::TBitmap* FDisableCloseGlyph;
	bool FFreeOnClose;
	TClosePosition FClosePosition;
	void __fastcall SetSelectedColor(Graphics::TColor Value);
	void __fastcall SetUnselectedColor(Graphics::TColor Value);
	void __fastcall SetBackgroundColor(Graphics::TColor Value);
	void __fastcall SetDitherBackground(bool Value);
	void __fastcall SetAutoScroll(bool Value);
	void __fastcall SetStartMargin(int Value);
	void __fastcall SetEndMargin(int Value);
	void __fastcall SetTabIndex(int Value);
	void __fastcall SetFirstIndex(int Value);
	void __fastcall SetTabList(Classes::TStrings* Value);
	void __fastcall SetTabStyle(TTabStyle Value);
	void __fastcall SetTabHeight(int Value);
	void __fastcall SetSelectedColorTo(Graphics::TColor Value);
	void __fastcall SetUnSelectedColorTo(Graphics::TColor Value);
	void __fastcall SetTextColor(Graphics::TColor Value);
	void __fastcall SetTabBorderColor(Graphics::TColor Value);
	void __fastcall SetTabBackGround(const Graphics::TBitmap* Value);
	void __fastcall SetTabBackGroundSelected(const Graphics::TBitmap* Value);
	void __fastcall SetGradientDirection(TGradientDirection Value);
	void __fastcall SetHoverGradientDirection(TGradientDirection value);
	void __fastcall SetTabMargin(TTabMargin* Value);
	void __fastcall SetTabOverlap(TTabOverlapSize Value);
	void __fastcall SetImages(Imglist::TCustomImageList* value);
	void __fastcall SetAdvTabStyle(TAdvTabStyle Value);
	void __fastcall SetTabPosition(TAdvTabPosition Value);
	void __fastcall SetCloseButtonAt(TCloseButtonPos Value);
	void __fastcall SetLowerSelected(int Value);
	void __fastcall SetShowScroller(TShowScroller Value);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	HIDESBASE MESSAGE void __fastcall CMSysColorChange(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
	void __fastcall CreateBrushPattern(Graphics::TBitmap* Bitmap);
	int __fastcall CalcTabPositions(int Start, int Stop, Graphics::TCanvas* Canvas, int First);
	void __fastcall CreateScroller(void);
	void __fastcall InitBitmaps(void);
	void __fastcall DoneBitmaps(void);
	void __fastcall CreateEdgeParts(void);
	void __fastcall FixTabPos(void);
	MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
	HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
	void __fastcall ScrollClick(System::TObject* Sender);
	void __fastcall ReadIntData(Classes::TReader* Reader);
	void __fastcall ReadBoolData(Classes::TReader* Reader);
	void __fastcall SetSoftTop(const bool Value);
	void __fastcall DrawCloseGlyph(Graphics::TCanvas* Canvas, const Types::TPoint &P, bool IsEnable);
	void __fastcall DrawCloseButton(Graphics::TCanvas* Canvas, const Types::TRect &Rect, bool Active);
	void __fastcall DrawHoverCloseButton(const Types::TRect &Rect);
	void __fastcall DrawDownCloseButton(const Types::TRect &Rect);
	bool __fastcall IsOnButton(int TabIndex, int X, int Y)/* overload */;
	bool __fastcall IsOnButton(int TabIndex, int X, int Y, Types::TRect &aRect)/* overload */;
	void __fastcall TabMarginChange(TMarginSize NewValue, TMarginSize OldValue, int Index);
	void __fastcall SetOriginalTabWidth(void);
	void __fastcall IncTabWidth(int w);
	void __fastcall DrawCrossAtTabSet(bool IsEnable);
	void __fastcall DrawCloseButtonAtTabSet(bool IsEnable);
	void __fastcall DrawDownCloseButtonAtTabSet(void);
	bool __fastcall IsOnCloseButtonAtTabSet(int X, int Y);
	void __fastcall CloseButtonClick(void);
	void __fastcall SetActiveFont(const Graphics::TFont* Value);
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	int __fastcall GetVersionNr(void);
	void __fastcall CloseGlyphOnChange(System::TObject* Sender);
	void __fastcall SetCloseGlyph(const Graphics::TBitmap* Value);
	void __fastcall SetClosePosition(const TClosePosition Value);
	
protected:
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	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);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	DYNAMIC void __fastcall DragOver(System::TObject* Source, int X, int Y, Controls::TDragState State, bool &Accept);
	virtual void __fastcall Paint(void);
	virtual void __fastcall DrawTab(Graphics::TCanvas* TabCanvas, const Types::TRect &R, int Index, bool Selected);
	bool __fastcall CanChange(int NewIndex);
	virtual void __fastcall MeasureTab(int Index, int &TabWidth);
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	void __fastcall AdjustTabWidth(void);
	__property Classes::TStringList* DuplicateTabs = {read=FDuplicateTabs};
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
	virtual void __fastcall Loaded(void);
	__property TScroller* Scroller = {read=FScroller};
	__property Classes::TStrings* Tabs = {read=FTabs, write=SetTabList};
	__property TTabStyle Style = {read=FStyle, write=SetTabStyle, default=1};
	__property bool DitherBackground = {read=FDitherBackground, write=SetDitherBackground, default=0};
	void __fastcall UpdateScroller(void);
	virtual void __fastcall ChangeActiveTab(int Value);
	virtual void __fastcall BeforeCloseTab(TTabCollectionItem* Tab, Forms::TCloseAction &CloseAction);
	virtual bool __fastcall CanCloseTab(int TabIdx, Forms::TCloseAction &CloseAction);
	__property bool AutoScroll = {read=FAutoScroll, write=SetAutoScroll, default=1};
	__property Graphics::TFont* ActiveFont = {read=FActiveFont, write=SetActiveFont};
	__property Graphics::TColor BackgroundColor = {read=FBackgroundColor, write=SetBackgroundColor, default=-16777201};
	__property Graphics::TBitmap* CloseGlyph = {read=FCloseGlyph, write=SetCloseGlyph};
	__property int EndMargin = {read=FEndMargin, write=SetEndMargin, default=5};
	__property int StartMargin = {read=FStartMargin, write=SetStartMargin, default=5};
	__property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, default=-16777201};
	__property bool SoftTop = {read=FSoftTop, write=SetSoftTop, default=0};
	__property TTabCollection* AdvTabs = {read=FAdvTabs, write=FAdvTabs};
	__property TClosePosition ClosePosition = {read=FClosePosition, write=SetClosePosition, default=0};
	__property bool FreeOnClose = {read=FFreeOnClose, write=FFreeOnClose, nodefault};
	__property Graphics::TColor SelectedColorTo = {read=FSelectedColorTo, write=SetSelectedColorTo, default=536870911};
	__property Graphics::TColor UnSelectedColorTo = {read=FUnSelectedColorTo, write=SetUnSelectedColorTo, default=536870911};
	__property Graphics::TColor TextColor = {read=FTextColor, write=SetTextColor, default=0};
	__property Graphics::TColor TabBorderColor = {read=FTabBorderColor, write=SetTabBorderColor, default=8421504};
	__property Graphics::TBitmap* TabBackGround = {read=FTabBackGround, write=SetTabBackGround};
	__property Graphics::TBitmap* TabBackGroundSelected = {read=FTabBackGroundSelected, write=SetTabBackGroundSelected};
	__property TGradientDirection GradientDirection = {read=FGradientDirection, write=SetGradientDirection, nodefault};
	__property TGradientDirection HoverGradientDirection = {read=FHoverGradientDirection, write=SetHoverGradientDirection, default=0};
	__property Graphics::TColor TabHoverColor = {read=FTabHoverColor, write=FTabHoverColor, default=536870911};
	__property Graphics::TColor TabHoverColorTo = {read=FTabHoverColorTo, write=FTabHoverColorTo, default=536870911};
	__property Graphics::TColor TabHoverBorder = {read=FTabHoverBorder, write=FTabHoverBorder, default=536870911};
	__property TTabMargin* TabMargin = {read=FTabMargin, write=SetTabMargin};
	__property TTabOverlapSize TabOverlap = {read=FTabOverlap, write=SetTabOverlap, nodefault};
	__property bool ShowFocus = {read=FShowFocus, write=FShowFocus, default=0};
	__property Imglist::TCustomImageList* Images = {read=FImages, write=SetImages};
	__property TAdvTabStyle TabStyle = {read=FAdvTabStyle, write=SetAdvTabStyle, default=0};
	__property TAdvTabPosition TabPosition = {read=FTabPosition, write=SetTabPosition, default=2};
	__property TCloseButtonPos CloseButtonAt = {read=FCloseButtonAt, write=SetCloseButtonAt, default=0};
	__property bool TabRearrange = {read=FTabRearrange, write=FTabRearrange, default=0};
	__property TShowScroller ShowScroller = {read=FShowScroller, write=SetShowScroller, default=1};
	__property int LowerSelected = {read=FLowerSelected, write=SetLowerSelected, default=2};
	__property int TabHeight = {read=FOwnerDrawHeight, write=SetTabHeight, default=20};
	__property int TabIndex = {read=FTabIndex, write=SetTabIndex, default=-1};
	__property Graphics::TColor UnselectedColor = {read=FUnselectedColor, write=SetUnselectedColor, default=-16777211};
	__property int VisibleTabs = {read=FVisibleTabs, nodefault};
	__property TTabMovedEvent OnTabMoved = {read=FOnTabMoved, write=FOnTabMoved};
	__property TTabCloseEvent OnTabClose = {read=FOnTabClose, write=FOnTabClose};
	__property TCanCloseEvent OnCanClose = {read=FOnCanClose, write=FOnCanClose};
	__property TTabChangeEvent OnChange = {read=FOnChange, write=FOnChange};
	__property TTabChangedEvent OnChanged = {read=FOnChanged, write=FOnChanged};
	__property TMeasureTabEvent OnMeasureTab = {read=FOnMeasureTab, write=FOnMeasureTab};
	__property TDrawTabSetBackgroundEvent OnDrawTabSetBackground = {read=FOnDrawTabSetBackground, write=FOnDrawTabSetBackground};
	
public:
	DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
	__fastcall virtual TAdvCustomTabSet(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvCustomTabSet(void);
	int __fastcall ItemAtPos(const Types::TPoint &Pos);
	Types::TRect __fastcall ItemRect(int Item);
	int __fastcall ItemIndex(int Pos);
	int __fastcall ItemWidth(int Index);
	Types::TRect __fastcall MinClientRect()/* overload */;
	Types::TRect __fastcall MinClientRect(bool IncludeScroller)/* overload */;
	Types::TRect __fastcall MinClientRect(int TabCount, bool IncludeScroller = false)/* overload */;
	HIDESBASE void __fastcall SelectNext(bool Direction);
	int __fastcall DisplToRealTabIndex(int tab);
	int __fastcall RealToDisplTabIndex(int tab);
	DYNAMIC void __fastcall DragDrop(System::TObject* Source, int X, int Y);
	__property Canvas ;
	__property int FirstIndex = {read=FFirstIndex, write=SetFirstIndex, default=0};
	__property int VersionNr = {read=GetVersionNr, nodefault};
	
__published:
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvCustomTabSet(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TTabList : public Classes::TStringList 
{
	typedef Classes::TStringList inherited;
	
private:
	TAdvCustomTabSet* Tabs;
	
public:
	virtual void __fastcall Insert(int Index, const AnsiString S);
	virtual void __fastcall Delete(int Index);
	virtual int __fastcall Add(const AnsiString S);
	virtual void __fastcall Put(int Index, const AnsiString S);
	virtual void __fastcall Clear(void);
	virtual void __fastcall AddStrings(Classes::TStrings* Strings);
public:
	#pragma option push -w-inl
	/* TStringList.Destroy */ inline __fastcall virtual ~TTabList(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TTabList(void) : Classes::TStringList() { }
	#pragma option pop
	
};


#pragma option push -b-
enum TEdgePart { epSelectedLeft, epUnselectedLeft, epSelectedRight, epUnselectedRight };
#pragma option pop

#pragma option push -b-
enum TEdgeType { etNone, etFirstIsSel, etFirstNotSel, etLastIsSel, etLastNotSel, etNotSelToSel, etSelToNotSel, etNotSelToNotSel };
#pragma option pop

class PASCALIMPLEMENTATION TTabCollectionItem : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	AnsiString FCaption;
	bool FVisible;
	bool FShowClose;
	int FTag;
	System::TObject* FObject;
	Graphics::TColor FTextColor;
	Graphics::TColor FTabColor;
	Graphics::TColor FTabColorTo;
	TGradientDirection FTabGradientDirection;
	TGradientDirection FHoverGradientDirection;
	int FImageIndex;
	int FIndexInAdvTabSet;
	bool FEnable;

⌨️ 快捷键说明

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