📄 newshape.h
字号:
//---------------------------------------------------------------------------
#ifndef NewShapeH
#define NewShapeH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
enum TNewShapeType {sstRectangle, sstSquare, sstRoundRect, sstRoundSquare,
sstEllipse, sstCircle };
//---------------------------------------------------------------------------
class PACKAGE TNewShape : public TGraphicControl
{
private:
TNewShapeType FShape;
TPen *FPen; // 保存画笔对象的数据成员
TBrush *FBrush; // 保存刷子对象的数据成员
void __fastcall SetShape(TNewShapeType Value);
void __fastcall SetBrush(TBrush *Value); //设置刷子的方法
void __fastcall SetPen(TPen *Value); //设置画笔的方法
protected:
virtual void __fastcall Paint();
public:
__fastcall TNewShape(TComponent* Owner);
__fastcall ~TNewShape();
void __fastcall StyleChanged(TObject* Owner); // 增加的析构函数申明
__published:
__property DragCursor ;
__property DragMode ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEndDrag ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property TNewShapeType Shape = {read=FShape, write=SetShape, nodefault};
__property Height;
__property Width;
__property TBrush* Brush = {read=FBrush, write=SetBrush, nodefault};//刷子属性
__property TPen* Pen = {read=FPen, write=SetPen, nodefault}; //画笔属性
};
//---------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -