ROPS (Rem Object Pascal Script) - встраиваемый интерпретатор языка Pascal. Плагин PSImport_Controls


    PSImport_Controls — плагин библиотеки импорта для модулей Delphi Controls.pas (TDragObject, TSizeConstraints, TControl, TGraphicControl, TWinControl, TCustomControl) и Graphics.pas (TCanvas, TGraphicsObject, TGraphic, TFont, TPen, TBrush, TBitmap, TPicture).

Плагин добавляет в среду интерпретатора следующие данные:

Типы (список TPSPascalCompiler.FTypes):
  • TFontStyle = Enum;
  • TFontStyles = Set;
  • TFontPitch = Enum;
  • TPenStyle = Enum;
  • TPenMode = Enum;
  • TBrushStyle = Enum;
  • TColor = LongInt;
  • HBITMAP = LongInt;
  • HPALETTE = LongInt;
  • TGraphicsObject = Class;
  • TGraphic = Class;
  • TFont = Class;
  • TPen = Class;
  • TBrush = Class;
  • TBitmap = Class;
  • TPicture = Class;
  • TEShiftState = Enum;
  • TShiftState = Set;
  • TMouseButton = Enum;
  • TDragMode = Enum;
  • TDragState = Enum;
  • TDragKind = Enum;
  • TMouseEvent = ProcPtr;
  • TMouseMoveEvent = ProcPtr;
  • TKeyEvent = ProcPtr;
  • TKeyPressEvent = ProcPtr;
  • TDragOverEvent = ProcPtr;
  • TDragDropEvent = ProcPtr;
  • HWND = LongInt;
  • TEndDragEvent = ProcPtr;
  • TAlign = Enum;
  • TAnchorKind = Enum;
  • TAnchors = Set;
  • TModalResult = LongInt;
  • TCursor = LongInt;
  • TPoint = record
      X: LongInt;
      Y: LongInt;
    end;
  • TDragObject = Class;
  • TStartDragEvent = ProcPtr;
  • TConstraintSize = LongInt;
  • TSizeConstraints = Class;
  • TControl = Class;
  • TGraphicControl = Class;
  • TCustomControl = Class;

Константы (список TPSPascalCompiler.FConstants):
  • clScrollBar: LongInt = -16777216 (0xFF000000);
  • clBackground: LongInt = -16777215 (0xFF000001);
  • clActiveCaption: LongInt = -16777214 (0xFF000002);
  • clInactiveCaption: LongInt = -16777213 (0xFF000003);
  • clMenu: LongInt = -16777212 (0xFF000004);
  • clWindow: LongInt = -16777211 (0xFF000005);
  • clWindowFrame: LongInt = -16777210 (0xFF000006);
  • clMenuText: LongInt = -16777209 (0xFF000007);
  • clWindowText: LongInt = -16777208 (0xFF000008);
  • clCaptionText: LongInt = -16777207 (0xFF000009);
  • clActiveBorder: LongInt = -16777206 (0xFF00000A);
  • clInactiveBorder: LongInt = -16777213 (0xFF000003);
  • clAppWorkSpace: LongInt = -16777204 (0xFF00000C);
  • clHighlight: LongInt = -16777203 (0xFF00000D);
  • clHighlightText: LongInt = -16777202 (0xFF00000E);
  • clBtnFace: LongInt = -16777201 (0xFF00000F);
  • clBtnShadow: LongInt = -16777200 (0xFF000010);
  • clGrayText: LongInt = -16777199 (0xFF000011);
  • clBtnText: LongInt = -16777198 (0xFF000012);
  • clInactiveCaptionText: LongInt = -16777197 (0xFF000013);
  • clBtnHighlight: LongInt = -16777196 (0xFF000014);
  • cl3DDkShadow: LongInt = -16777195 (0xFF000015);
  • cl3DLight: LongInt = -16777194 (0xFF000016);
  • clInfoText: LongInt = -16777193 (0xFF000017);
  • clInfoBk: LongInt = -16777192 (0xFF000018);
  • clBlack: LongInt = 0 (0x0);
  • clMaroon: LongInt = 128 (0x80);
  • clGreen: LongInt = 32768 (0x8000);
  • clOlive: LongInt = 32896 (0x8080);
  • clNavy: LongInt = 8388608 (0x800000);
  • clPurple: LongInt = 8388736 (0x800080);
  • clTeal: LongInt = 8421376 (0x808000);
  • clGray: LongInt = 8421504 (0x808080);
  • clSilver: LongInt = 12632256 (0xC0C0C0);
  • clRed: LongInt = 255 (0xFF);
  • clLime: LongInt = 65280 (0xFF00);
  • clYellow: LongInt = 65535 (0xFFFF);
  • clBlue: LongInt = 16711680 (0xFF0000);
  • clFuchsia: LongInt = 16711935 (0xFF00FF);
  • clAqua: LongInt = 16776960 (0xFFFF00);
  • clLtGray: LongInt = 12632256 (0xC0C0C0);
  • clDkGray: LongInt = 8421504 (0x808080);
  • clWhite: LongInt = 16777215 (0xFFFFFF);
  • clNone: LongInt = 536870911 (0x1FFFFFFF);
  • clDefault: LongInt = 536870912 (0x20000000);
  • fsBold: TFontStyle = 0;
  • fsItalic: TFontStyle = 1;
  • fsUnderline: TFontStyle = 2;
  • fsStrikeOut: TFontStyle = 3;
  • fpDefault: TFontPitch = 0;
  • fpVariable: TFontPitch = 1;
  • fpFixed: TFontPitch = 2;
  • psSolid: TPenStyle = 0;
  • psDash: TPenStyle = 1;
  • psDot: TPenStyle = 2;
  • psDashDot: TPenStyle = 3;
  • psDashDotDot: TPenStyle = 4;
  • psClear: TPenStyle = 5;
  • psInsideFrame: TPenStyle = 6;
  • pmBlack: TPenMode = 0;
  • pmWhite: TPenMode = 1;
  • pmNop: TPenMode = 2;
  • pmNot: TPenMode = 3;
  • pmCopy: TPenMode = 4;
  • pmNotCopy: TPenMode = 5;
  • pmMergePenNot: TPenMode = 6;
  • pmMaskPenNot: TPenMode = 7;
  • pmMergeNotPen: TPenMode = 8;
  • pmMaskNotPen: TPenMode = 9;
  • pmMerge: TPenMode = 10;
  • pmNotMerge: TPenMode = 11;
  • pmMask: TPenMode = 12;
  • pmNotMask: TPenMode = 13;
  • pmXor: TPenMode = 14;
  • pmNotXor: TPenMode = 15;
  • bsSolid: TBrushStyle = 0;
  • bsClear: TBrushStyle = 1;
  • bsHorizontal: TBrushStyle = 2;
  • bsVertical: TBrushStyle = 3;
  • bsFDiagonal: TBrushStyle = 4;
  • bsBDiagonal: TBrushStyle = 5;
  • bsCross: TBrushStyle = 6;
  • bsDiagCross: TBrushStyle = 7;
  • ssShift: TEShiftState = 0;
  • ssAlt: TEShiftState = 1;
  • ssCtrl: TEShiftState = 2;
  • ssLeft: TEShiftState = 3;
  • ssRight: TEShiftState = 4;
  • ssMiddle: TEShiftState = 5;
  • ssDouble: TEShiftState = 6;
  • mbLeft: TMouseButton = 0;
  • mbRight: TMouseButton = 1;
  • mbMiddle: TMouseButton = 2;
  • dmManual: TDragMode = 0;
  • dmAutomatic: TDragMode = 1;
  • dsDragEnter: TDragState = 0;
  • dsDragLeave: TDragState = 1;
  • dsDragMove: TDragState = 2;
  • dkDrag: TDragKind = 0;
  • dkDock: TDragKind = 1;
  • alNone: TAlign = 0;
  • alTop: TAlign = 1;
  • alBottom: TAlign = 2;
  • alLeft: TAlign = 3;
  • alRight: TAlign = 4;
  • alClient: TAlign = 5;
  • akLeft: TAnchorKind = 0;
  • akTop: TAnchorKind = 1;
  • akRight: TAnchorKind = 2;
  • akBottom: TAnchorKind = 3;
  • mrNone: LongInt = 0 (0x0);
  • mrOk: LongInt = 1 (0x1);
  • mrCancel: LongInt = 2 (0x2);
  • mrAbort: LongInt = 3 (0x3);
  • mrRetry: LongInt = 4 (0x4);
  • mrIgnore: LongInt = 5 (0x5);
  • mrYes: LongInt = 6 (0x6);
  • mrNo: LongInt = 7 (0x7);
  • mrAll: LongInt = 8 (0x8);
  • mrNoToAll: LongInt = 9 (0x9);
  • mrYesToAll: LongInt = 10 (0xA);
  • crDefault: LongInt = 0 (0x0);
  • crNone: LongInt = -1 (0xFFFFFFFF);
  • crArrow: LongInt = -2 (0xFFFFFFFE);
  • crCross: LongInt = -3 (0xFFFFFFFD);
  • crIBeam: LongInt = -4 (0xFFFFFFFC);
  • crSizeNESW: LongInt = -6 (0xFFFFFFFA);
  • crSizeNS: LongInt = -7 (0xFFFFFFF9);
  • crSizeNWSE: LongInt = -8 (0xFFFFFFF8);
  • crSizeWE: LongInt = -9 (0xFFFFFFF7);
  • crUpArrow: LongInt = -10 (0xFFFFFFF6);
  • crHourGlass: LongInt = -11 (0xFFFFFFF5);
  • crDrag: LongInt = -12 (0xFFFFFFF4);
  • crNoDrop: LongInt = -13 (0xFFFFFFF3);
  • crHSplit: LongInt = -14 (0xFFFFFFF2);
  • crVSplit: LongInt = -15 (0xFFFFFFF1);
  • crMultiDrag: LongInt = -16 (0xFFFFFFF0);
  • crSQLWait: LongInt = -17 (0xFFFFFFEF);
  • crNo: LongInt = -18 (0xFFFFFFEE);
  • crAppStart: LongInt = -19 (0xFFFFFFED);
  • crHelp: LongInt = -20 (0xFFFFFFEC);
  • crHandPoint: LongInt = -21 (0xFFFFFFEB);
  • crSizeAll: LongInt = -22 (0xFFFFFFEA);
Константы начинающиеся на 'cl' относятся к цвету, начинающиеся на 'mr' к результату 'ModalResult' диалогового окна, начинающиеся на 'cr' к типу курсора.

Классы PSImport_Controls (список TPSPascalCompiler.FClasses):
  • TWinControl = class(TControl)
      property Handle: LongInt read Get;
      property Showing: Boolean read Get;
      property TabOrder: LongInt read Get write Set;
      property TabStop: Boolean read Get write Set;
      function CanFocus: Boolean;
      function Focused: Boolean;
      property Controls(param1: LongInt): TControl read Get;
      property ControlCount: LongInt read Get;
      function HandleAllocated: Boolean;
      procedure HandleNeeded;
      procedure EnableAlign;
      procedure RemoveControl(AControl: TControl);
      procedure InsertControl(AControl: TControl);
      procedure Realign;
      procedure ScaleBy(M: LongInt; D: LongInt);
      procedure ScrollBy(DeltaX: LongInt; DeltaY: LongInt);
      procedure SetFocus;
      procedure PaintTo(DC: LongInt; X: LongInt; Y: LongInt);
      function ContainsControl(Control: TControl): Boolean;
      procedure DisableAlign;
      procedure UpdateControlState;
      property Brush: TBrush read Get;
      property HelpContext: LongInt read Get write Set;
    end;
  • TCanvas = class(TPersistent)
      procedure Arc(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt; X3: LongInt; Y3: LongInt; X4: LongInt; Y4: LongInt);
      procedure Chord(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt; X3: LongInt; Y3: LongInt; X4: LongInt; Y4: LongInt);
      procedure Draw(X: LongInt; Y: LongInt; Graphic: TGraphic);
      procedure Ellipse(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt);
      procedure FillRect(Rect: TRect);
      procedure FloodFill(X: LongInt; Y: LongInt; Color: LongInt; FillStyle: Byte);
      procedure LineTo(X: LongInt; Y: LongInt);
      procedure MoveTo(X: LongInt; Y: LongInt);
      procedure Pie(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt; X3: LongInt; Y3: LongInt; X4: LongInt; Y4: LongInt);
      procedure Rectangle(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt);
      procedure Refresh;
      procedure RoundRect(X1: LongInt; Y1: LongInt; X2: LongInt; Y2: LongInt; X3: LongInt; Y3: LongInt);
      function TextHeight(Text: string): LongInt;
      procedure TextOut(X: LongInt; Y: LongInt; Text: string);
      function TextWidth(Text: string): LongInt;
      property Handle: LongInt read Get write Set;
      property Pixels(param1: LongInt; param2: LongInt): LongInt read Get write Set;
      property Brush: TBrush read Get;
      property CopyMode: Byte read Get write Set;
      property Font: TFont read Get;
      property Pen: TPen read Get;
    end;
  • TGraphicsObject = class(TPersistent)
      property OnChange: TNotifyEvent read Get write Set;
    end;
  • TGraphic = class(TPersistent)
      constructor Create: TGraphic;
      procedure LoadFromFile(FileName: string);
      procedure SaveToFile(FileName: string);
      property Empty: Boolean read Get;
      property Height: LongInt read Get write Set;
      property Modified: Boolean read Get write Set;
      property Width: LongInt read Get write Set;
      property OnChange: TNotifyEvent read Get write Set;
    end;
  • TFont = class(TGraphicsObject)
      constructor Create: TFont;
      property Handle: LongInt read Get write Set;
      property Color: LongInt read Get write Set;
      property Height: LongInt read Get write Set;
      property Name: string read Get write Set;
      property Pitch: Byte read Get write Set;
      property Size: LongInt read Get write Set;
      property PixelsPerInch: LongInt read Get write Set;
      property Style: TFontStyles read Get write Set;
    end;
  • TPen = class(TGraphicsObject)
      constructor Create: TPen;
      property Color: LongInt read Get write Set;
      property Mode: TPenMode read Get write Set;
      property Style: TPenStyle read Get write Set;
      property Width: LongInt read Get write Set;
    end;
  • TBrush = class(TGraphicsObject)
      constructor Create: TBrush;
      property Color: LongInt read Get write Set;
      property Style: TBrushStyle read Get write Set;
    end;
  • TBitmap = class(TGraphic)
      property Canvas: TCanvas read Get;
      property Handle: LongInt read Get write Set;
      procedure Dormant;
      procedure FreeImage;
      function ReleaseHandle: LongInt;
      function ReleasePalette: LongInt;
      property Monochrome: Boolean read Get write Set;
      property Palette: LongInt read Get write Set;
      property IgnorePalette: Boolean read Get write Set;
      property TransparentColor: LongInt read Get;
    end;
  • TPicture = class(TPersistent)
      property Bitmap: TBitmap read Get write Set;
    end;
  • TDragObject = class(TObject)
      procedure Assign(Source: TDragObject);
      function GetName: string;
      function Instance: LongInt;
      procedure HideDragImage;
      procedure ShowDragImage;
      property Cancelling: Boolean read Get write Set;
      property DragHandle: LongInt read Get write Set;
      property DragPos: TPoint read Get write Set;
      property DragTargetPos: TPoint read Get write Set;
      property MouseDeltaX: Double read Get;
      property MouseDeltaY: Double read Get;
    end;
  • TSizeConstraints = class(TPersistent)
      property MaxHeight: LongInt read Get write Set;
      property MaxWidth: LongInt read Get write Set;
      property MinHeight: LongInt read Get write Set;
      property MinWidth: LongInt read Get write Set;
    end;
  • TControl = class(TComponent)
      constructor Create(AOwner: TComponent): TControl;
      procedure BringToFront;
      procedure Hide;
      procedure Invalidate;
      procedure Refresh;
      procedure Repaint;
      procedure SendToBack;
      procedure Show;
      procedure Update;
      procedure SetBounds(X: LongInt; Y: LongInt; w: LongInt; h: LongInt);
      property Left: LongInt read Get write Set;
      property Top: LongInt read Get write Set;
      property Width: LongInt read Get write Set;
      property Height: LongInt read Get write Set;
      property Hint: string read Get write Set;
      property Align: TAlign read Get write Set;
      property ClientHeight: LongInt read Get write Set;
      property ClientWidth: LongInt read Get write Set;
      property ShowHint: Boolean read Get write Set;
      property Visible: Boolean read Get write Set;
      property Enabled: Boolean read Get write Set;
      property Cursor: LongInt read Get write Set;
      function Dragging: Boolean;
      function HasParent: Boolean;
      procedure BeginDrag(Immediate: Boolean);
      function ClientToScreen(Point: TPoint): TPoint;
      procedure EndDrag(Drop: Boolean);
      function GetTextBuf(Buffer: PChar; BufSize: LongInt): LongInt;
      function GetTextLen: LongInt;
      procedure SetTextBuf(Buffer: PChar);
      function Perform(Msg: LongWord; WPARAM: LongInt; LPARAM: LongInt): LongInt;
      function ScreenToClient(Point: TPoint): TPoint;
      property Parent: TWinControl read Get write Set;
    end;
  • TGraphicControl = class(TControl)
    end;
  • TCustomControl = class(TWinControl)
    end;

Зависимости

  Плагин зависит от следующих типов и классов, которые должны быть обьявлены предварительно:
  • TMouseEvent = procedure (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    — требует ссылки на TObject (плагин PSImport_Classes);

  • +3
  • 07 октября 2022, 21:09
  • anakost

Комментарии (0)

RSS свернуть / развернуть
Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.