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

📄 simplegraph.hpp

📁 矢量绘图组件(开源版)
💻 HPP
📖 第 1 页 / 共 5 页
字号:
	void __fastcall SetStyle(Forms::TScrollBarStyle Value);
	void __fastcall SetThumbSize(int Value);
	void __fastcall SetVisible(bool Value);
	bool __fastcall IsIncrementStored(void);
	
protected:
	__fastcall TGraphScrollBar(TSimpleGraph* AOwner, Forms::TScrollBarKind AKind);
	int __fastcall ControlSize(bool ControlSB, bool AssumeSB);
	void __fastcall CalcAutoRange(void);
	void __fastcall Update(bool ControlSB, bool AssumeSB);
	bool __fastcall NeedsScrollBarVisible(void);
	void __fastcall ScrollMessage(Messages::TWMScroll &Msg);
	
public:
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	void __fastcall ChangeBiDiPosition(void);
	__property Forms::TScrollBarKind Kind = {read=fKind, nodefault};
	bool __fastcall IsScrollBarVisible(void);
	__property int ScrollPos = {read=GetScrollPos, nodefault};
	__property int Range = {read=fRange, nodefault};
	__property TSimpleGraph* Owner = {read=fOwner};
	
__published:
	__property int ButtonSize = {read=fButtonSize, write=SetButtonSize, default=0};
	__property Graphics::TColor Color = {read=fColor, write=SetColor, default=-2147483628};
	__property Forms::TScrollBarInc Increment = {read=fIncrement, write=fIncrement, stored=IsIncrementStored, default=8};
	__property Word Margin = {read=fMargin, write=fMargin, default=0};
	__property bool ParentColor = {read=fParentColor, write=SetParentColor, default=1};
	__property int Position = {read=fPosition, write=SetPosition, default=0};
	__property bool Smooth = {read=fSmooth, write=fSmooth, default=0};
	__property int Size = {read=fSize, write=SetSize, default=0};
	__property Forms::TScrollBarStyle Style = {read=fStyle, write=SetStyle, default=0};
	__property int ThumbSize = {read=fThumbSize, write=SetThumbSize, default=0};
	__property bool Tracking = {read=fTracking, write=fTracking, default=0};
	__property bool Visible = {read=fVisible, write=SetVisible, default=1};
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TGraphScrollBar(void) { }
	#pragma option pop
	
};


class DELPHICLASS TGraphStreamableObject;
class PASCALIMPLEMENTATION TGraphStreamableObject : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	unsigned fID;
	TGraphObject* fG;
	int fDummy;
	
__published:
	__property unsigned ID = {read=fID, write=fID, nodefault};
	__property TGraphObject* G = {read=fG, write=fG, stored=true};
	__property int Left = {read=fDummy, write=fDummy, stored=false, nodefault};
	__property int Top = {read=fDummy, write=fDummy, stored=false, nodefault};
	__property Tag  = {stored=false, default=0};
	__property Name  = {stored=false};
public:
	#pragma option push -w-inl
	/* TComponent.Create */ inline __fastcall virtual TGraphStreamableObject(Classes::TComponent* AOwner) : Classes::TComponent(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TGraphStreamableObject(void) { }
	#pragma option pop
	
};


class DELPHICLASS TMemoryHandleStream;
class PASCALIMPLEMENTATION TMemoryHandleStream : public Classes::TMemoryStream 
{
	typedef Classes::TMemoryStream inherited;
	
private:
	unsigned fHandle;
	bool fReleaseHandle;
	
protected:
	virtual void * __fastcall Realloc(int &NewCapacity);
	
public:
	__fastcall virtual TMemoryHandleStream(unsigned MemHandle);
	__fastcall virtual ~TMemoryHandleStream(void);
	__property unsigned Handle = {read=fHandle, nodefault};
	__property bool ReleaseHandle = {read=fReleaseHandle, write=fReleaseHandle, nodefault};
};


class DELPHICLASS TCompatibleCanvas;
class PASCALIMPLEMENTATION TCompatibleCanvas : public Graphics::TCanvas 
{
	typedef Graphics::TCanvas inherited;
	
public:
	__fastcall TCompatibleCanvas(void);
	__fastcall virtual ~TCompatibleCanvas(void);
};


#pragma option push -b-
enum TGraphObjectState { osCreating, osDestroying, osLoading, osReading, osWriting, osUpdating, osDragging, osDragDisabled, osConverting };
#pragma option pop

typedef Set<TGraphObjectState, osCreating, osConverting>  TGraphObjectStates;

#pragma option push -b-
enum TGraphDependencyChangeFlag { gdcChanged, gdcRemoved };
#pragma option pop

#pragma option push -b-
enum TGraphObjectOption { goLinkable, goSelectable, goShowCaption };
#pragma option pop

typedef Set<TGraphObjectOption, goLinkable, goShowCaption>  TGraphObjectOptions;

class PASCALIMPLEMENTATION TGraphObject : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	unsigned fID;
	TSimpleGraph* fOwner;
	Graphics::TBrush* fBrush;
	Graphics::TPen* fPen;
	AnsiString fText;
	AnsiString fHint;
	Graphics::TFont* fFont;
	bool fParentFont;
	TGraphObjectOptions fOptions;
	bool fVisible;
	bool fSelected;
	TGraphObjectStates fStates;
	TGraphObjectList* fDependentList;
	TGraphObjectList* fLinkInputList;
	TGraphObjectList* fLinkOutputList;
	AnsiString fTextToShow;
	int fTag;
	void *fData;
	bool fHasCustomData;
	#pragma pack(push, 1)
	Types::TRect fVisualRect;
	#pragma pack(pop)
	
	TGraphChangeFlags fVisualRectFlags;
	int UpdateCount;
	TGraphChangeFlags PendingChanges;
	int DragDisableCount;
	void __fastcall SetBrush(Graphics::TBrush* Value);
	void __fastcall SetPen(Graphics::TPen* Value);
	void __fastcall SetText(const AnsiString Value);
	void __fastcall SetHint(const AnsiString Value);
	void __fastcall SetFont(Graphics::TFont* Value);
	void __fastcall SetParentFont(bool Value);
	void __fastcall SetVisible(bool Value);
	void __fastcall SetSelected(bool Value);
	int __fastcall GetZOrder(void);
	void __fastcall SetZOrder(int Value);
	void __fastcall SetOptions(TGraphObjectOptions Value);
	void __fastcall SetHasCustomData(bool Value);
	bool __fastcall GetShowing(void);
	bool __fastcall GetDragging(void);
	TGraphObject* __fastcall GetDependents(int Index);
	int __fastcall GetDependentCount(void);
	TGraphLink* __fastcall GetLinkInputs(int Index);
	int __fastcall GetLinkInputCount(void);
	TGraphLink* __fastcall GetLinkOutputs(int Index);
	int __fastcall GetLinkOutputCount(void);
	bool __fastcall IsFontStored(void);
	void __fastcall StyleChanged(System::TObject* Sender);
	void __fastcall ListChanged(System::TObject* Sender, TGraphObject* GraphObject, TGraphObjectListAction Action);
	void __fastcall ReadCustomData(Classes::TStream* Stream);
	void __fastcall WriteCustomData(Classes::TStream* Stream);
	
protected:
	__fastcall virtual TGraphObject(TGraphObject* AGraphObject);
	__fastcall virtual TGraphObject(TSimpleGraph* AOwner, Classes::TStream* AStream);
	DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
	virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
	virtual void __fastcall Initialize(void);
	virtual void __fastcall Loaded(void);
	virtual void __fastcall ReplaceID(unsigned OldID, unsigned NewID);
	virtual void __fastcall ReplaceObject(TGraphObject* OldObject, TGraphObject* NewObject);
	virtual void __fastcall NotifyDependents(TGraphDependencyChangeFlag Flag);
	virtual void __fastcall LookupDependencies(void);
	virtual void __fastcall UpdateDependencies(void);
	virtual void __fastcall UpdateDependencyTo(TGraphObject* GraphObject, TGraphDependencyChangeFlag Flag);
	virtual bool __fastcall UpdateTextPlacement(bool Recalc, int dX, int dY);
	virtual void __fastcall Changed(TGraphChangeFlags Flags);
	virtual void __fastcall BoundsChanged(int dX, int dY, int dCX, int dCY);
	virtual void __fastcall DependentChanged(TGraphObject* GraphObject, TGraphObjectListAction Action);
	virtual void __fastcall LinkInputChanged(TGraphObject* GraphObject, TGraphObjectListAction Action);
	virtual void __fastcall LinkOutputChanged(TGraphObject* GraphObject, TGraphObjectListAction Action);
	virtual void __fastcall ParentFontChanged(void);
	virtual bool __fastcall IsUpdateLocked(void);
	virtual int __fastcall NeighborhoodRadius(void);
	virtual Types::TPoint __fastcall FixHookAnchor(void) = 0 ;
	virtual Types::TPoint __fastcall RelativeHookAnchor(const Types::TPoint &RefPt) = 0 ;
	virtual void __fastcall DrawControlPoint(Graphics::TCanvas* Canvas, const Types::TPoint &Pt, bool Enabled);
	virtual void __fastcall DrawControlPoints(Graphics::TCanvas* Canvas) = 0 ;
	virtual void __fastcall DrawHighlight(Graphics::TCanvas* Canvas) = 0 ;
	virtual void __fastcall DrawText(Graphics::TCanvas* Canvas) = 0 ;
	virtual void __fastcall DrawBody(Graphics::TCanvas* Canvas) = 0 ;
	virtual void __fastcall Draw(Graphics::TCanvas* Canvas);
	virtual void __fastcall DrawState(Graphics::TCanvas* Canvas);
	virtual bool __fastcall IsVisibleOn(Graphics::TCanvas* Canvas);
	virtual void __fastcall QueryVisualRect(/* out */ Types::TRect &Rect) = 0 ;
	virtual unsigned __fastcall QueryHitTest(const Types::TPoint &Pt);
	virtual Controls::TCursor __fastcall QueryCursor(unsigned HT);
	virtual TObjectSides __fastcall QueryMobility(unsigned HT);
	virtual bool __fastcall OffsetHitTest(unsigned HT, int dX, int dY);
	virtual void __fastcall SnapHitTestOffset(unsigned HT, int &dX, int &dY);
	virtual bool __fastcall BeginFollowDrag(unsigned HT);
	virtual bool __fastcall EndFollowDrag(void);
	virtual void __fastcall DisableDrag(void);
	virtual void __fastcall EnableDrag(void);
	virtual void __fastcall MoveBy(int dX, int dY) = 0 ;
	virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, const Types::TPoint &Pt);
	virtual void __fastcall MouseMove(Classes::TShiftState Shift, const Types::TPoint &Pt);
	virtual void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, const Types::TPoint &Pt);
	virtual bool __fastcall KeyPress(Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall SetBoundsRect(const Types::TRect &Rect) = 0 ;
	virtual Types::TRect __fastcall GetBoundsRect(void) = 0 ;
	virtual Types::TRect __fastcall GetSelectedVisualRect();
	__property AnsiString TextToShow = {read=fTextToShow, write=fTextToShow};
	__property TGraphObjectList* DependentList = {read=fDependentList};
	__property TGraphObjectList* LinkInputList = {read=fLinkInputList};
	__property TGraphObjectList* LinkOutputList = {read=fLinkOutputList};
	__property TGraphChangeFlags VisualRectFlags = {read=fVisualRectFlags, write=fVisualRectFlags, nodefault};
	
public:
	__fastcall virtual TGraphObject(TSimpleGraph* AOwner);
	__fastcall virtual ~TGraphObject(void);
	virtual void __fastcall AfterConstruction(void);
	virtual void __fastcall BeforeDestruction(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
	virtual TGraphObject* __fastcall ConvertTo(TMetaClass* AnotherClass);
	virtual void __fastcall LoadFromStream(Classes::TStream* Stream);
	virtual void __fastcall SaveToStream(Classes::TStream* Stream);
	virtual void __fastcall BeginUpdate(void);
	virtual void __fastcall EndUpdate(void);
	virtual void __fastcall Invalidate(void);
	virtual void __fastcall BringToFront(void);
	virtual void __fastcall SendToBack(void);
	/* virtual class method */ virtual bool __fastcall IsLink(TMetaClass* vmt);
	/* virtual class method */ virtual bool __fastcall IsNode(TMetaClass* vmt);
	virtual bool __fastcall IsLocked(void);
	virtual bool __fastcall Delete(void);
	virtual bool __fastcall CanDelete(void);
	virtual unsigned __fastcall HitTest(const Types::TPoint &Pt);
	virtual bool __fastcall ContainsPoint(int X, int Y);
	virtual bool __fastcall ContainsRect(const Types::TRect &Rect);
	virtual bool __fastcall BeginDrag(const Types::TPoint &Pt, unsigned HT = (unsigned)(0xffffffff));
	virtual bool __fastcall DragTo(const Types::TPoint &Pt, bool SnapToGrid);
	virtual bool __fastcall DragBy(int dX, int dY, bool SnapToGrid);
	virtual bool __fastcall EndDrag(bool Accept);
	__property TGraphObjectStates States = {read=fStates, nodefault};
	__property bool Dragging = {read=GetDragging, nodefault};
	__property bool Showing = {read=GetShowing, nodefault};
	__property TSimpleGraph* Owner = {read=fOwner};
	__property int ZOrder = {read=GetZOrder, write=SetZOrder, nodefault};
	__property bool Selected = {read=fSelected, write=SetSelected, nodefault};

⌨️ 快捷键说明

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