2006-05-30 16:23:25 +02:00
|
|
|
{ Compiletime Forms support }
|
|
|
|
unit uPSC_forms;
|
|
|
|
{$I PascalScript.inc}
|
|
|
|
|
|
|
|
interface
|
|
|
|
uses
|
|
|
|
uPSCompiler, uPSUtils;
|
|
|
|
|
|
|
|
procedure SIRegister_Forms_TypesAndConsts(Cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
|
|
|
|
procedure SIRegisterTCONTROLSCROLLBAR(Cl: TPSPascalCompiler);
|
|
|
|
procedure SIRegisterTSCROLLINGWINCONTROL(Cl: TPSPascalCompiler);
|
|
|
|
procedure SIRegisterTSCROLLBOX(Cl: TPSPascalCompiler);
|
|
|
|
procedure SIRegisterTFORM(Cl: TPSPascalCompiler);
|
|
|
|
procedure SIRegisterTAPPLICATION(Cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
procedure SIRegister_Forms(Cl: TPSPascalCompiler);
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
procedure SIRegisterTCONTROLSCROLLBAR(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
with Cl.AddClassN(cl.FindClass('TPersistent'), 'TControlScrollBar') do
|
2006-05-30 16:23:25 +02:00
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('Kind', 'TScrollBarKind', iptr);
|
|
|
|
RegisterProperty('ScrollPos', 'Integer', iptr);
|
|
|
|
RegisterProperty('Margin', 'Word', iptrw);
|
|
|
|
RegisterProperty('Increment', 'TScrollBarInc', iptrw);
|
|
|
|
RegisterProperty('Range', 'Integer', iptrw);
|
|
|
|
RegisterProperty('Position', 'Integer', iptrw);
|
|
|
|
RegisterProperty('Tracking', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('Visible', 'Boolean', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegisterTSCROLLINGWINCONTROL(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
with Cl.AddClassN(cl.FindClass('TWinControl'), 'TScrollingWinControl') do
|
2006-05-30 16:23:25 +02:00
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure ScrollInView(AControl: TControl)');
|
|
|
|
RegisterProperty('HorzScrollBar', 'TControlScrollBar', iptrw);
|
|
|
|
RegisterProperty('VertScrollBar', 'TControlScrollBar', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegisterTSCROLLBOX(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
with Cl.AddClassN(cl.FindClass('TScrollingWinControl'), 'TScrollBox') do
|
2006-05-30 16:23:25 +02:00
|
|
|
begin
|
2018-12-29 14:53:14 +01:00
|
|
|
{$IFDEF DELPHI4UP}
|
|
|
|
RegisterProperty('Anchors', 'TAnchors', iptrw);
|
2019-01-29 20:19:15 +01:00
|
|
|
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
|
2018-12-29 14:53:14 +01:00
|
|
|
{$ENDIF}
|
2021-08-25 12:31:51 +02:00
|
|
|
{$IFDEF FPC}
|
|
|
|
RegisterProperty('Anchors', 'TAnchors', iptrw);
|
|
|
|
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
|
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
|
|
|
|
RegisterProperty('Color', 'TColor', iptrw);
|
|
|
|
RegisterProperty('Font', 'TFont', iptrw);
|
|
|
|
RegisterProperty('AutoScroll', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('ParentColor', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('ParentFont', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnEnter', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnExit', 'TNotifyEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('OnResize', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('DragCursor', 'TCursor', iptrw);
|
|
|
|
RegisterProperty('DragMode', 'TDragMode', iptrw);
|
|
|
|
RegisterProperty('ParentShowHint', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('PopupMenu', 'TPopupMenu', iptrw);
|
|
|
|
RegisterProperty('CTL3D', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('ParentCtl3D', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('OnDragDrop', 'TDragDropEvent', iptrw);
|
|
|
|
RegisterProperty('OnDragOver', 'TDragOverEvent', iptrw);
|
|
|
|
RegisterProperty('OnEndDrag', 'TEndDragEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegisterTFORM(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
with Cl.AddClassN(cl.FindClass('TScrollingWinControl'), 'TForm') do
|
2006-05-30 16:23:25 +02:00
|
|
|
begin
|
|
|
|
{$IFDEF DELPHI4UP}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('constructor CreateNew(AOwner: TComponent; Dummy: Integer)');
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ELSE}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('constructor CreateNew(AOwner: TComponent)');
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure Close');
|
|
|
|
RegisterMethod('procedure Hide');
|
|
|
|
RegisterMethod('procedure Show');
|
|
|
|
RegisterMethod('function ShowModal: Integer');
|
|
|
|
RegisterMethod('procedure Release');
|
|
|
|
RegisterProperty('Active', 'Boolean', iptr);
|
|
|
|
RegisterProperty('ActiveControl', 'TWinControl', iptrw);
|
2018-12-29 14:53:14 +01:00
|
|
|
{$IFDEF DELPHI4UP}
|
|
|
|
RegisterProperty('Anchors', 'TAnchors', iptrw);
|
2019-01-29 20:19:15 +01:00
|
|
|
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
|
2018-12-29 14:53:14 +01:00
|
|
|
{$ENDIF}
|
2021-08-25 12:31:51 +02:00
|
|
|
{$IFDEF FPC}
|
|
|
|
RegisterProperty('Anchors', 'TAnchors', iptrw);
|
|
|
|
RegisterProperty('Constraints', 'TSizeConstraints', iptrw);
|
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('BorderIcons', 'TBorderIcons', iptrw);
|
|
|
|
RegisterProperty('BorderStyle', 'TFormBorderStyle', iptrw);
|
|
|
|
RegisterProperty('Caption', 'NativeString', iptrw);
|
|
|
|
RegisterProperty('AutoScroll', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('Color', 'TColor', iptrw);
|
|
|
|
RegisterProperty('Font', 'TFont', iptrw);
|
|
|
|
RegisterProperty('FormStyle', 'TFormStyle', iptrw);
|
|
|
|
RegisterProperty('KeyPreview', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('Position', 'TPosition', iptrw);
|
|
|
|
RegisterProperty('OnActivate', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnClick', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnClose', 'TCloseEvent', iptrw);
|
|
|
|
RegisterProperty('OnCloseQuery', 'TCloseQueryEvent', iptrw);
|
|
|
|
RegisterProperty('OnCreate', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnDestroy', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnDeactivate', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnHide', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnKeyDown', 'TKeyEvent', iptrw);
|
|
|
|
RegisterProperty('OnKeyPress', 'TKeyPressEvent', iptrw);
|
|
|
|
RegisterProperty('OnKeyUp', 'TKeyEvent', iptrw);
|
|
|
|
RegisterProperty('OnResize', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnShow', 'TNotifyEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
|
|
|
{$IFNDEF CLX}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure ArrangeIcons');
|
|
|
|
// RegisterMethod('function GetFormImage: TBitmap');
|
|
|
|
RegisterMethod('procedure Print');
|
|
|
|
RegisterMethod('procedure SendCancelMode(Sender: TControl)');
|
|
|
|
RegisterProperty('ActiveOleControl', 'TWinControl', iptrw);
|
|
|
|
RegisterProperty('OleFormObject', 'TOLEFormObject', iptrw);
|
|
|
|
RegisterProperty('ClientHandle', 'LongInt', iptr);
|
|
|
|
RegisterProperty('TileMode', 'TTileMode', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure Cascade');
|
|
|
|
RegisterMethod('function CloseQuery: Boolean');
|
|
|
|
RegisterMethod('procedure DefocusControl(Control: TWinControl; Removing: Boolean)');
|
|
|
|
RegisterMethod('procedure FocusControl(Control: TWinControl)');
|
|
|
|
RegisterMethod('procedure Next');
|
|
|
|
RegisterMethod('procedure Previous');
|
|
|
|
RegisterMethod('function SetFocusedControl(Control: TWinControl): Boolean');
|
|
|
|
RegisterMethod('procedure Tile');
|
|
|
|
RegisterProperty('ActiveMDIChild', 'TForm', iptr);
|
|
|
|
RegisterProperty('Canvas', 'TCanvas', iptr);
|
|
|
|
RegisterProperty('DropTarget', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('ModalResult', 'LongInt', iptrw);
|
|
|
|
RegisterProperty('MDIChildCount', 'Integer', iptr);
|
|
|
|
RegisterProperty('MDIChildren', 'TForm Integer', iptr);
|
|
|
|
RegisterProperty('Icon', 'TIcon', iptrw);
|
|
|
|
RegisterProperty('Menu', 'TMainMenu', iptrw);
|
|
|
|
RegisterProperty('ObjectMenuItem', 'TMenuItem', iptrw);
|
|
|
|
RegisterProperty('PixelsPerInch', 'Integer', iptrw);
|
|
|
|
RegisterProperty('PrintScale', 'TPrintScale', iptrw);
|
|
|
|
RegisterProperty('Scaled', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('WindowState', 'TWindowState', iptrw);
|
|
|
|
RegisterProperty('WindowMenu', 'TMenuItem', iptrw);
|
|
|
|
RegisterProperty('CTL3D', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('PopupMenu', 'TPopupMenu', iptrw);
|
|
|
|
RegisterProperty('OnDragDrop', 'TDragDropEvent', iptrw);
|
|
|
|
RegisterProperty('OnDragOver', 'TDragOverEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw);
|
|
|
|
RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw);
|
|
|
|
RegisterProperty('OnPaint', 'TNotifyEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegisterTAPPLICATION(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
with Cl.AddClassN(cl.FindClass('TComponent'), 'TApplication') do
|
2006-05-30 16:23:25 +02:00
|
|
|
begin
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure BringToFront');
|
2009-04-07 18:37:45 +02:00
|
|
|
{$IFDEF PS_PANSICHAR}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('function MessageBox(Text,Caption: PAnsiChar; Flags: Word): Integer');
|
2009-04-07 18:37:45 +02:00
|
|
|
{$ELSE}
|
2017-02-21 09:42:18 +01:00
|
|
|
{$IFDEF UNICODE}
|
|
|
|
RegisterMethod('function MessageBox(Text,Caption: string; Flags: Word): Integer');
|
|
|
|
{$ELSE}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('function MessageBox(Text,Caption: PChar; Flags: Word): Integer');
|
2017-02-21 09:42:18 +01:00
|
|
|
{$ENDIF}
|
2009-04-07 18:37:45 +02:00
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure Minimize');
|
|
|
|
RegisterMethod('procedure ProcessMessages');
|
|
|
|
RegisterMethod('procedure Restore');
|
|
|
|
RegisterMethod('procedure Terminate');
|
|
|
|
RegisterProperty('Active', 'Boolean', iptr);
|
|
|
|
RegisterProperty('ExeName', 'NativeString', iptr);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$IFNDEF CLX}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('Handle', 'LongInt', iptrw);
|
|
|
|
RegisterProperty('UpdateFormatSettings', 'Boolean', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('Hint', 'NativeString', iptrw);
|
|
|
|
RegisterProperty('MainForm', 'TForm', iptr);
|
|
|
|
RegisterProperty('ShowHint', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('ShowMainForm', 'Boolean', iptrw);
|
|
|
|
RegisterProperty('Terminated', 'Boolean', iptr);
|
|
|
|
RegisterProperty('Title', 'NativeString', iptrw);
|
|
|
|
RegisterProperty('OnActivate', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnDeactivate', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnIdle', 'TIdleEvent', iptrw);
|
|
|
|
RegisterProperty('OnHint', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnMinimize', 'TNotifyEvent', iptrw);
|
|
|
|
RegisterProperty('OnRestore', 'TNotifyEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('procedure ControlDestroyed(Control: TControl)');
|
|
|
|
RegisterMethod('procedure CancelHint');
|
|
|
|
RegisterMethod('procedure HandleException(Sender: TObject)');
|
|
|
|
RegisterMethod('procedure HandleMessage');
|
|
|
|
RegisterMethod('procedure HideHint');
|
|
|
|
// RegisterMethod('procedure HintMouseMessage(Control: TControl; var Message: TMessage)');
|
|
|
|
RegisterMethod('procedure Initialize');
|
|
|
|
RegisterMethod('procedure NormalizeTopMosts');
|
|
|
|
RegisterMethod('procedure RestoreTopMosts');
|
|
|
|
RegisterMethod('procedure Run');
|
|
|
|
// RegisterMethod('procedure ShowException(E: Exception)');
|
2006-05-30 16:23:25 +02:00
|
|
|
{$IFNDEF CLX}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterMethod('function HelpCommand(Command: Integer; Data: LongInt): Boolean');
|
|
|
|
RegisterMethod('function HelpContext(Context: THelpContext): Boolean');
|
|
|
|
RegisterMethod('function HelpJump(JumpID: NativeString): Boolean');
|
|
|
|
RegisterProperty('DialogHandle', 'LongInt', iptrw);
|
|
|
|
RegisterMethod('procedure CreateHandle');
|
|
|
|
// RegisterMethod('procedure HookMainWindow(Hook: TWindowHook)');
|
|
|
|
// RegisterMethod('procedure UnhookMainWindow(Hook: TWindowHook)');
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
2016-05-13 14:34:11 +02:00
|
|
|
RegisterProperty('HelpFile', 'NativeString', iptrw);
|
|
|
|
RegisterProperty('HintColor', 'TColor', iptrw);
|
|
|
|
RegisterProperty('HintPause', 'Integer', iptrw);
|
|
|
|
RegisterProperty('HintShortPause', 'Integer', iptrw);
|
|
|
|
RegisterProperty('HintHidePause', 'Integer', iptrw);
|
|
|
|
RegisterProperty('Icon', 'TIcon', iptrw);
|
|
|
|
RegisterProperty('OnHelp', 'THelpEvent', iptrw);
|
2006-05-30 16:23:25 +02:00
|
|
|
{$ENDIF}
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegister_Forms_TypesAndConsts(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
|
|
|
Cl.AddTypeS('TIdleEvent', 'procedure (Sender: TObject; var Done: Boolean)');
|
|
|
|
cl.AddTypeS('TScrollBarKind', '(sbHorizontal, sbVertical)');
|
|
|
|
cl.AddTypeS('TScrollBarInc', 'SmallInt');
|
|
|
|
cl.AddTypeS('TFormBorderStyle', '(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)');
|
|
|
|
cl.AddTypeS('TBorderStyle', 'TFormBorderStyle');
|
|
|
|
cl.AddTypeS('TWindowState', '(wsNormal, wsMinimized, wsMaximized)');
|
|
|
|
cl.AddTypeS('TFormStyle', '(fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop)');
|
|
|
|
cl.AddTypeS('TPosition', '(poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poDesktopCenter, poMainFormCenter, poOwnerFormCenter)');
|
|
|
|
cl.AddTypeS('TPrintScale', '(poNone, poProportional, poPrintToFit)');
|
|
|
|
cl.AddTypeS('TCloseAction', '(caNone, caHide, caFree, caMinimize)');
|
|
|
|
cl.AddTypeS('TCloseEvent' ,'procedure(Sender: TObject; var Action: TCloseAction)');
|
|
|
|
cl.AddTypeS('TCloseQueryEvent' ,'procedure(Sender: TObject; var CanClose: Boolean)');
|
|
|
|
cl.AddTypeS('TBorderIcon' ,'(biSystemMenu, biMinimize, biMaximize, biHelp)');
|
|
|
|
cl.AddTypeS('TBorderIcons', 'set of TBorderIcon');
|
2016-05-13 14:34:11 +02:00
|
|
|
cl.AddTypeS('THelpContext', 'LongInt');
|
2006-05-30 16:23:25 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure SIRegister_Forms(Cl: TPSPascalCompiler);
|
|
|
|
begin
|
|
|
|
SIRegister_Forms_TypesAndConsts(cl);
|
|
|
|
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
|
|
|
SIRegisterTCONTROLSCROLLBAR(cl);
|
|
|
|
{$ENDIF}
|
|
|
|
SIRegisterTScrollingWinControl(cl);
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
|
|
|
SIRegisterTSCROLLBOX(cl);
|
|
|
|
{$ENDIF}
|
|
|
|
SIRegisterTForm(Cl);
|
|
|
|
{$IFNDEF PS_MINIVCL}
|
|
|
|
SIRegisterTApplication(Cl);
|
|
|
|
{$ENDIF}
|
|
|
|
end;
|
|
|
|
|
|
|
|
// PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|