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


    PSImport_Forms — плагин библиотеки импорта для модулей Delphi Forms.pas (TControlScrollBar, TScrollingWinControl, TScrollBox, TForm, TApplication) и Menus.pas (TPopupList, TMenuItem, TMenu, TMainMenu, TPopupMenu, TMenuItemStack).

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

Типы (список TPSPascalCompiler.FTypes):
  • TIdleEvent = ProcPtr;
  • TScrollBarKind = Enum;
  • TScrollBarInc = SmallInt;
  • TFormBorderStyle = Enum;
  • TBorderStyle = TFormBorderStyle;
  • TWindowState = Enum;
  • TFormStyle = Enum;
  • TPosition = Enum;
  • TPrintScale = Enum;
  • TCloseAction = Enum;
  • TCloseEvent = ProcPtr;
  • TCloseQueryEvent = ProcPtr;
  • TBorderIcon = Enum;
  • TBorderIcons = Set;
  • THelpContext = LongInt;
  • TControlScrollBar = Class;
  • TScrollingWinControl = Class;
  • TScrollBox = Class;
  • TForm = Class;
  • TApplication = Class;
  • HMENU = LongWord;
  • HACCEL = LongWord;
  • TMenuBreak = Enum;
  • TMenuDrawItemEvent = ProcPtr;
  • TAdvancedMenuDrawItemEvent = ProcPtr;
  • TMenuMeasureItemEvent = ProcPtr;
  • TMenuItemAutoFlag = Enum;
  • TMenuAutoFlag = TMenuItemAutoFlag;
  • TShortCut = Word;
  • TMenuItem = Class;
  • TMenuChangeEvent = ProcPtr;
  • TFindItemKind = Enum;
  • TMenu = Class;
  • TMainMenu = Class;
  • !OPENARRAYOFS32 = Array of LongInt;
  • TPopupAlignment = Enum;
  • TTrackButton = Enum;
  • TMenuAnimations = Enum;
  • TMenuAnimation = Set;
  • TPopupMenu = Class;
  • TMenuItemStack = Class;
  • TCMenuItem = TMeTScrollingWinControlnuItem;
  • !OPENARRAYOFTOBJECT = Array of TObject;

Константы (список TPSPascalCompiler.FConstants):
  • sbHorizontal: TScrollBarKind = 0;
  • sbVertical: TScrollBarKind = 1;
  • bsNone: TFormBorderStyle = 0;
  • bsSingle: TFormBorderStyle = 1;
  • bsSizeable: TFormBorderStyle = 2;
  • bsDialog: TFormBorderStyle = 3;
  • bsToolWindow: TFormBorderStyle = 4;
  • bsSizeToolWin: TFormBorderStyle = 5;
  • wsNormal: TWindowState = 0;
  • wsMinimized: TWindowState = 1;
  • wsMaximized: TWindowState = 2;
  • fsNormal: TFormStyle = 0;
  • fsMDIChild: TFormStyle = 1;
  • fsMDIForm: TFormStyle = 2;
  • fsStayOnTop: TFormStyle = 3;
  • poDesigned: TPosition = 0;
  • poDefault: TPosition = 1;
  • poDefaultPosOnly: TPosition = 2;
  • poDefaultSizeOnly: TPosition = 3;
  • poScreenCenter: TPosition = 4;
  • poDesktopCenter: TPosition = 5;
  • poMainFormCenter: TPosition = 6;
  • poOwnerFormCenter: TPosition = 7;
  • poNone: TPrintScale = 0;
  • poProportional: TPrintScale = 1;
  • poPrintToFit: TPrintScale = 2;
  • caNone: TCloseAction = 0;
  • caHide: TCloseAction = 1;
  • caFree: TCloseAction = 2;
  • caMinimize: TCloseAction = 3;
  • biSystemMenu: TBorderIcon = 0;
  • biMinimize: TBorderIcon = 1;
  • biMaximize: TBorderIcon = 2;
  • biHelp: TBorderIcon = 3;
  • mbNone: TMenuBreak = 0;
  • mbBreak: TMenuBreak = 1;
  • mbBarBreak: TMenuBreak = 2;
  • maAutomatic: TMenuItemAutoFlag = 0;
  • maManual: TMenuItemAutoFlag = 1;
  • maParent: TMenuItemAutoFlag = 2;
  • fkCommand: TFindItemKind = 0;
  • fkHandle: TFindItemKind = 1;
  • fkShortCut: TFindItemKind = 2;
  • paLeft: TPopupAlignment = 0;
  • paRight: TPopupAlignment = 1;
  • paCenter: TPopupAlignment = 2;
  • tbRightButton: TTrackButton = 0;
  • tbLeftButton: TTrackButton = 1;
  • maLeftToRight: TMenuAnimations = 0;
  • maRightToLeft: TMenuAnimations = 1;
  • maTopToBottom: TMenuAnimations = 2;
  • maBottomToTop: TMenuAnimations = 3;
  • maNone: TMenuAnimations = 4;

Процедуры и функции (список TPSPascalCompiler.FProcs):
  • function ShortCut(Key: Word; Shift: TShiftState): Word;
  • procedure ShortCutToKey(ShortCut: Word; var Key: Word; var Shift: TShiftState);
  • function ShortCutToText(ShortCut: Word): string;
  • function TextToShortCut(Text: string): Word;
  • function NewMenu(Owner: TComponent; AName: string; Items: !OPENARRAYOFTOBJECT): TMainMenu;
  • function NewPopupMenu(Owner: TComponent; AName: string; Alignment: TPopupAlignment; AutoPopup: Boolean; Items: !OPENARRAYOFTOBJECT): TPopupMenu;
  • function NewSubMenu(ACaption: string; HCTX: Word; AName: string; Items: !OPENARRAYOFTOBJECT; AEnabled: Boolean): TMenuItem;
  • function NewItem(ACaption: string; AShortCut: Word; Achecked: Boolean; AEnabled: Boolean; AOnClick: TNotifyEvent; HCTX: Word; AName: string): TMenuItem;
  • function NewLine: TMenuItem;
  • procedure DrawMenuItem(MenuItem: TMenuItem; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState);

Классы (список TPSPascalCompiler.FClasses):
  • TPopupList = class(TList)
      procedure Add(Popup: TPopupMenu);
      procedure Remove(Popup: TPopupMenu);
    end;
  • TControlScrollBar = class(TPersistent)
      property Kind: TScrollBarKind read Get;
      property ScrollPos: LongInt read Get;
      property Margin: Word read Get write Set;
      property Increment: SmallInt read Get write Set;
      property Range: LongInt read Get write Set;
      property Position: LongInt read Get write Set;
      property Tracking: Boolean read Get write Set;
      property Visible: Boolean read Get write Set;
    end;
  • TScrollingWinControl = class(TWinControl)
      property HorzScrollBar: TControlScrollBar read Get write Set;
      property VertScrollBar: TControlScrollBar read Get write Set;
    end;
  • TScrollBox = class(TScrollingWinControl)
      property BorderStyle: TFormBorderStyle read Get write Set;
      property AutoScroll: Boolean read Get write Set;
      property ParentColor: Boolean read Get write Set;
      property ParentFont: Boolean read Get write Set;
      property OnClick: TNotifyEvent read Get write Set;
      property OnDblClick: TNotifyEvent read Get write Set;
      property OnEnter: TNotifyEvent read Get write Set;
      property OnExit: TNotifyEvent read Get write Set;
      property OnResize: TNotifyEvent read Get write Set;
      property ParentShowHint: Boolean read Get write Set;
      property CTL3D: Boolean read Get write Set;
      property ParentCtl3D: Boolean read Get write Set;
    end;
  • TForm = class(TScrollingWinControl)
      constructor CreateNew(AOwner: TComponent; Dummy: LongInt): TForm;
      procedure Close;
      procedure Hide;
      procedure Show;
      function ShowModal: LongInt;
      procedure Release;
      property Active: Boolean read Get;
      property ActiveControl: TWinControl read Get write Set;
      property BorderIcons: TBorderIcons read Get write Set;
      property BorderStyle: TFormBorderStyle read Get write Set;
      property Caption: NativeString read Get write Set;
      property AutoScroll: Boolean read Get write Set;
      property FormStyle: TFormStyle read Get write Set;
      property KeyPreview: Boolean read Get write Set;
      property Position: TPosition read Get write Set;
      property OnActivate: TNotifyEvent read Get write Set;
      property OnClick: TNotifyEvent read Get write Set;
      property OnDblClick: TNotifyEvent read Get write Set;
      property OnClose: TCloseEvent read Get write Set;
      property OnCloseQuery: TCloseQueryEvent read Get write Set;
      property OnCreate: TNotifyEvent read Get write Set;
      property OnDestroy: TNotifyEvent read Get write Set;
      property OnDeactivate: TNotifyEvent read Get write Set;
      property OnHide: TNotifyEvent read Get write Set;
      property OnResize: TNotifyEvent read Get write Set;
      property OnShow: TNotifyEvent read Get write Set;
      procedure ArrangeIcons;
      procedure Print;
      property ActiveOleControl: TWinControl read Get write Set;
      property ClientHandle: LongInt read Get;
      procedure Cascade;
      function CloseQuery: Boolean;
      procedure DefocusControl(Control: TWinControl; Removing: Boolean);
      procedure FocusControl(Control: TWinControl);
      procedure Next;
      procedure Previous;
      function SetFocusedControl(Control: TWinControl): Boolean;
      procedure Tile;
      property ActiveMDIChild: TForm read Get;
      property Canvas: TCanvas read Get;
      property DropTarget: Boolean read Get write Set;
      property ModalResult: LongInt read Get write Set;
      property MDIChildCount: LongInt read Get;
      property MDIChildren(param1: LongInt): TForm read Get;
      property PixelsPerInch: LongInt read Get write Set;
      property PrintScale: TPrintScale read Get write Set;
      property Scaled: Boolean read Get write Set;
      property WindowState: TWindowState read Get write Set;
      property CTL3D: Boolean read Get write Set;
      property OnPaint: TNotifyEvent read Get write Set;
      property PopupMenu: TPopupMenu read Get write Set;
    end;
  • TApplication = class(TComponent)
      procedure BringToFront;
      function MessageBox(Text: PChar; Caption: PChar; Flags: Word): LongInt;
      procedure Minimize;
      procedure ProcessMessages;
      procedure Restore;
      procedure Terminate;
      property Active: Boolean read Get;
      property ExeName: NativeString read Get;
      property Handle: LongInt read Get write Set;
      property UpdateFormatSettings: Boolean read Get write Set;
      property Hint: NativeString read Get write Set;
      property MainForm: TForm read Get;
      property ShowHint: Boolean read Get write Set;
      property ShowMainForm: Boolean read Get write Set;
      property Terminated: Boolean read Get;
      property Title: NativeString read Get write Set;
      property OnActivate: TNotifyEvent read Get write Set;
      property OnDeactivate: TNotifyEvent read Get write Set;
      property OnIdle: TIdleEvent read Get write Set;
      property OnHint: TNotifyEvent read Get write Set;
      property OnMinimize: TNotifyEvent read Get write Set;
      property OnRestore: TNotifyEvent read Get write Set;
      procedure CancelHint;
      procedure HandleException(Sender: TObject);
      procedure HandleMessage;
      procedure HideHint;
      procedure Initialize;
      procedure NormalizeTopMosts;
      procedure RestoreTopMosts;
      procedure Run;
      function HelpCommand(Command: LongInt; Data: LongInt): Boolean;
      function HelpContext(Context: LongInt): Boolean;
      function HelpJump(JumpID: NativeString): Boolean;
      property DialogHandle: LongInt read Get write Set;
      procedure CreateHandle;
      property HelpFile: NativeString read Get write Set;
      property HintPause: LongInt read Get write Set;
      property HintShortPause: LongInt read Get write Set;
      property HintHidePause: LongInt read Get write Set;
    end;
  • TMenuItem = class(TComponent)
      constructor Create(AOwner: TComponent): TMenuItem;
      procedure InitiateAction;
      procedure Insert(Index: LongInt; Item: TMenuItem);
      procedure Delete(Index: LongInt);
      procedure Clear;
      procedure Click;
      function Find(ACaption: string): TMenuItem;
      function IndexOf(Item: TMenuItem): LongInt;
      function IsLine: Boolean;
      function GetParentComponent: TComponent;
      function HasParent: Boolean;
      function NewTopLine: LongInt;
      function NewBottomLine: LongInt;
      function InsertNewLineBefore(AItem: TMenuItem): LongInt;
      function InsertNewLineAfter(AItem: TMenuItem): LongInt;
      procedure Add(Item: TMenuItem);
      procedure Remove(Item: TMenuItem);
      function RethinkHotkeys: Boolean;
      function RethinkLines: Boolean;
      property Command: Word read Get;
      property Handle: LongWord read Get;
      property Count: LongInt read Get;
      property Items(param1: LongInt): TMenuItem read Get;
      property MenuIndex: LongInt read Get write Set;
      property Parent: TMenuItem read Get;
      property AutoHotkeys: TMenuItemAutoFlag read Get write Set;
      property AutoLineReduction: TMenuItemAutoFlag read Get write Set;
      property Caption: string read Get write Set;
      property Checked: Boolean read Get write Set;
      property Default: Boolean read Get write Set;
      property Enabled: Boolean read Get write Set;
      property GroupIndex: Byte read Get write Set;
      property HelpContext: LongInt read Get write Set;
      property Hint: string read Get write Set;
      property RadioItem: Boolean read Get write Set;
      property ShortCut: Word read Get write Set;
      property Visible: Boolean read Get write Set;
      property OnClick: TNotifyEvent read Get write Set;
      property OnDrawItem: TMenuDrawItemEvent read Get write Set;
      property OnAdvancedDrawItem: TAdvancedMenuDrawItemEvent read Get write Set;
      property OnMeasureItem: TMenuMeasureItemEvent read Get write Set;
    end;
  • TMenu = class(TComponent)
      constructor Create(AOwner: TComponent): TMenu;
      function DispatchCommand(ACommand: Word): Boolean;
      function DispatchPopup(AHandle: LongWord): Boolean;
      function FindItem(Value: LongInt; Kind: TFindItemKind): TMenuItem;
      function GetHelpContext(Value: LongInt; ByCommand: Boolean): LongInt;
      function IsRightToLeft: Boolean;
      procedure ParentBiDiModeChanged(AControl: TObject);
      property AutoHotkeys: TMenuItemAutoFlag read Get write Set;
      property AutoLineReduction: TMenuItemAutoFlag read Get write Set;
      property Handle: LongWord read Get;
      property OwnerDraw: Boolean read Get write Set;
      property ParentBiDiMode: Boolean read Get write Set;
      property Items: TMenuItem read Get;
    end;
  • TMainMenu = class(TMenu)
      procedure Merge(Menu: TMainMenu);
      procedure Unmerge(Menu: TMainMenu);
      procedure PopulateOle2Menu(SharedMenu: LongWord; Groups: !OPENARRAYOFS32; var Widths: !OPENARRAYOFS32);
      procedure GetOle2AcceleratorTable(var AccelTable: LongWord; var AccelCount: LongInt; Groups: !OPENARRAYOFS32);
      procedure SetOle2MenuHandle(Handle: LongWord);
      property AutoMerge: Boolean read Get write Set;
    end;
  • TPopupMenu = class(TMenu)
      constructor Create(AOwner: TComponent): TPopupMenu;
      procedure Popup(X: LongInt; Y: LongInt);
      property PopupComponent: TComponent read Get write Set;
      property Alignment: TPopupAlignment read Get write Set;
      property AutoPopup: Boolean read Get write Set;
      property HelpContext: LongInt read Get write Set;
      property MenuAnimation: TMenuAnimation read Get write Set;
      property TrackButton: TTrackButton read Get write Set;
      property OnPopup: TNotifyEvent read Get write Set;
    end;
  • TMenuItemStack = class(TStack)
      procedure ClearItem(AItem: TMenuItem);
    end;

Зависимости

  Плагин зависит от следующих типов и классов, которые должны быть обьявлены предварительно:
  • TIdleEvent = procedure (Sender: TObject; var Done: Boolean);
    — требует ссылки на TObject (плагин PSImport_Classes);
  • TMenuDrawItemEvent = procedure (Sender: TObject; ACanvas: TCanvas; ARect: TRect; Selected: Boolean);
    — требует ссылки на TObject, TRect (плагин PSImport_Classes) и TCanvas (плагин PSImport_Controls);
  • TAdvancedMenuDrawItemEvent = procedure (Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState);
    — требует ссылки на TObject, TRect (плагин PSImport_Classes), TCanvas (плагин PSImport_Controls) и TOwnerDrawState (плагин PSImport_StdCtrls);
  • function ShortCut(Key: Word; Shift: TShiftState): TShortCut;
    — требует ссылки на TShiftState (плагин PSImport_Controls);
  • function NewMenu(Owner: TComponent; const AName: string; Items: array of TMenuItem): TMainMenu);
    — требует ссылки на TComponent (плагин PSImport_Classes);
  • function NewItem(const ACaption: string; AShortCut: TShortCut; Achecked, AEnabled: Boolean; AOnClick: TNotifyEvent; HCTX: Word; const AName: string): TMenuItem);
    — требует ссылки на TNotifyEvent (плагин PSImport_Classes);


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

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

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