rm_jvinterpreter_controls.pas

来自「胜天进销存源码,国产优秀的进销存」· PAS 代码 · 共 1,943 行 · 第 1/5 页

PAS
1,943
字号
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: JvInterpreter_Controls.PAS, released on 2002-07-04.

The Initial Developers of the Original Code are: Andrei Prygounkov <a.prygounkov@gmx.de>
Copyright (c) 1999, 2002 Andrei Prygounkov
All Rights Reserved.

Contributor(s):

Last Modified: 2002-07-04

You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net

Description : adapter unit - converts JvInterpreter calls to delphi calls

Known Issues:
-----------------------------------------------------------------------------}

{$I rm_JVCL.INC}

unit rm_JvInterpreter_Controls;

interface

uses
  rm_JvInterpreter;

procedure RegisterJvInterpreterAdapter(JvInterpreterAdapter: TJvInterpreterAdapter);

implementation

uses
  {$IFDEF COMPLIB_VCL}
  Graphics, Controls, Menus,
  {$IFDEF COMPILER4_UP}
  ImgList,
  {$ENDIF COMPILER4_UP}
  rm_JvInterpreter_Windows,
  {$ENDIF COMPLIB_VCL}
  {$IFDEF COMPLIB_CLX}
  Qt, QGraphics, QControls, QMenus, QImgList, rm_JvInterpreter_Types,
  {$ENDIF COMPLIB_CLX}
  Classes;

{ TControl }

{ constructor Create(AOwner: TComponent) }

procedure TControl_Create(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TControl.Create(V2O(Args.Values[0]) as TComponent));
end;

{ procedure BeginDrag(Immediate: Boolean); }

procedure TControl_BeginDrag(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).BeginDrag(Args.Values[0]);
end;

{ procedure BringToFront; }

procedure TControl_BringToFront(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).BringToFront;
end;

{ function ClientToScreen(const Point: TPoint): TPoint; }

procedure TControl_ClientToScreen(var Value: Variant; Args: TJvInterpreterArgs);
begin
  JvInterpreterVarCopy(Value, Point2Var(TControl(Args.Obj).ClientToScreen(Var2Point(Args.Values[0]))));
end;

{ function Dragging: Boolean; }

procedure TControl_Dragging(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Dragging;
end;

{ procedure DragDrop(Source: TObject; X, Y: Integer); }

procedure TControl_DragDrop(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).DragDrop(V2O(Args.Values[0]), Args.Values[1], Args.Values[2]);
end;

{ procedure EndDrag(Drop: Boolean); }

procedure TControl_EndDrag(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).EndDrag(Args.Values[0]);
end;

{$IFDEF COMPLIB_VCL}

{ function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer; }

procedure TControl_GetTextBuf(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).GetTextBuf(PChar(string(Args.Values[0])), Args.Values[1]);
end;

{ function GetTextLen: Integer; }

procedure TControl_GetTextLen(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).GetTextLen;
end;

{$ENDIF COMPLIB_VCL}

{ procedure Hide; }

procedure TControl_Hide(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Hide;
end;

{ procedure Invalidate; }

procedure TControl_Invalidate(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Invalidate;
end;

{ function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint; }

{$IFDEF COMPLIB_VCL}
procedure TControl_Perform(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Perform(Args.Values[0], Args.Values[1], Args.Values[2]);
end;
{$ENDIF COMPLIB_VCL}

{ procedure Refresh; }

procedure TControl_Refresh(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Refresh;
end;

{ procedure Repaint; }

procedure TControl_Repaint(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Repaint;
end;

{ function ScreenToClient(const Point: TPoint): TPoint; }

procedure TControl_ScreenToClient(var Value: Variant; Args: TJvInterpreterArgs);
begin
  JvInterpreterVarCopy(Value, Point2Var(TControl(Args.Obj).ScreenToClient(Var2Point(Args.Values[0]))));
end;

{ procedure SendToBack; }

procedure TControl_SendToBack(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).SendToBack;
end;

{ procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); }

procedure TControl_SetBounds(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).SetBounds(Args.Values[0], Args.Values[1], Args.Values[2], Args.Values[3]);
end;

{ procedure SetTextBuf(Buffer: PChar); }

{$IFDEF COMPLIB_VCL}
procedure TControl_SetTextBuf(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).SetTextBuf(PChar(string(Args.Values[0])));
end;
{$ENDIF COMPLIB_VCL}

{ procedure Show; }

procedure TControl_Show(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Show;
end;

{ procedure Update; }

procedure TControl_Update(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Update;
end;

{ property Read Align: TAlign }

procedure TControl_Read_Align(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Align;
end;

{ property Write Align(Value: TAlign) }

procedure TControl_Write_Align(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Align := Value;
end;

{ property Read BoundsRect: TRect }

procedure TControl_Read_BoundsRect(var Value: Variant; Args: TJvInterpreterArgs);
begin
  JvInterpreterVarCopy(Value, Rect2Var(TControl(Args.Obj).BoundsRect));
end;

{ property Write BoundsRect(Value: TRect) }

procedure TControl_Write_BoundsRect(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).BoundsRect := Var2Rect(Value);
end;

{ property Read ClientHeight: Integer }

procedure TControl_Read_ClientHeight(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).ClientHeight;
end;

{ property Write ClientHeight(Value: Integer) }

procedure TControl_Write_ClientHeight(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).ClientHeight := Value;
end;

{ property Read ClientOrigin: TPoint }

procedure TControl_Read_ClientOrigin(var Value: Variant; Args: TJvInterpreterArgs);
begin
  JvInterpreterVarCopy(Value, Point2Var(TControl(Args.Obj).ClientOrigin));
end;

{ property Read ClientRect: TRect }

procedure TControl_Read_ClientRect(var Value: Variant; Args: TJvInterpreterArgs);
begin
//  Value := TControl(Args.Obj).ClientRect;
  NotImplemented('TControl.ClientRect');
end;

{ property Read ClientWidth: Integer }

procedure TControl_Read_ClientWidth(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).ClientWidth;
end;

{ property Write ClientWidth(Value: Integer) }

procedure TControl_Write_ClientWidth(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).ClientWidth := Value;
end;

{ property Read ControlState: TControlState }

procedure TControl_Read_ControlState(var Value: Variant; Args: TJvInterpreterArgs);
begin
//  Value := TControl(Args.Obj).ControlState;
  NotImplemented('TControl.ControlState');
end;

{ property Write ControlState(Value: TControlState) }

procedure TControl_Write_ControlState(const Value: Variant; Args: TJvInterpreterArgs);
begin
//  TControl(Args.Obj).ControlState := Value;
  NotImplemented('TControl.ControlState');
end;

{ property Read ControlStyle: TControlStyle }

procedure TControl_Read_ControlStyle(var Value: Variant; Args: TJvInterpreterArgs);
begin
//  Value := TControl(Args.Obj).ControlStyle;
  NotImplemented('TControl.ControlState');
end;

{ property Write ControlStyle(Value: TControlStyle) }

procedure TControl_Write_ControlStyle(const Value: Variant; Args: TJvInterpreterArgs);
begin
//  TControl(Args.Obj).ControlStyle := Value;
  NotImplemented('TControl.ControlStyle');
end;

{ property Read Parent: TWinControl }

procedure TControl_Read_Parent(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TControl(Args.Obj).Parent);
end;

{ property Write Parent(Value: TWinControl) }

procedure TControl_Write_Parent(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Parent := V2O(Value) as TWinControl;
end;

{ property Read ShowHint: Boolean }

procedure TControl_Read_ShowHint(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).ShowHint;
end;

{ property Write ShowHint(Value: Boolean) }

procedure TControl_Write_ShowHint(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).ShowHint := Value;
end;

{ property Read Visible: Boolean }

procedure TControl_Read_Visible(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Visible;
end;

{ property Write Visible(Value: Boolean) }

procedure TControl_Write_Visible(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Visible := Value;
end;

{ property Read Enabled: Boolean }

procedure TControl_Read_Enabled(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Enabled;
end;

{ property Write Enabled(Value: Boolean) }

procedure TControl_Write_Enabled(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TControl(Args.Obj).Enabled := Value;
end;

{ property Read WindowProc: TWndMethod }

procedure TControl_Read_WindowProc(var Value: Variant; Args: TJvInterpreterArgs);
begin
//  Value := TControl(Args.Obj).WindowProc;
  NotImplemented('TControl.WindowProc');
end;

{ property Write WindowProc(Value: TWndMethod) }

procedure TControl_Write_WindowProc(const Value: Variant; Args: TJvInterpreterArgs);
begin
//  TControl(Args.Obj).WindowProc := Value;
  NotImplemented('TControl.WindowProc');
end;

{ property Read Left: Integer }

procedure TControl_Read_Left(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TControl(Args.Obj).Left;
end;

{ property Write Left(Value: Integer) }

procedure TControl_Write_Left(const Value: Variant; Args: TJvInterpreterArgs);

⌨️ 快捷键说明

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