⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvinterpreter_jveditor.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{-----------------------------------------------------------------------------
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_JvEditor.PAS, released on 2002-07-04.

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

Contributor(s):

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:
-----------------------------------------------------------------------------}
// $Id: JvInterpreter_JvEditor.pas,v 1.14 2005/02/17 10:20:39 marquardt Exp $

unit JvInterpreter_JvEditor;

{$I jvcl.inc}

interface

uses
  {$IFDEF UNITVERSIONING}
  JclUnitVersioning,
  {$ENDIF UNITVERSIONING}
  JvInterpreter;

procedure RegisterJvInterpreterAdapter(JvInterpreterAdapter: TJvInterpreterAdapter);

{$IFDEF UNITVERSIONING}
const
  UnitVersioning: TUnitVersionInfo = (
    RCSfile: '$RCSfile: JvInterpreter_JvEditor.pas,v $';
    Revision: '$Revision: 1.14 $';
    Date: '$Date: 2005/02/17 10:20:39 $';
    LogPath: 'JVCL\run'
  );
{$ENDIF UNITVERSIONING}

implementation

uses
  Classes,
  JvEditor, JvEditorCommon, JvHLEditor, JvInterpreter_Windows;

{ TJvKeyboard }

{ constructor Create }

procedure TKeyboard_Create(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TJvKeyboard.Create);
end;

{ procedure Add(const ACommand: TEditCommand; const AKey1: word; const AShift1: TShiftState); }

procedure TKeyboard_Add(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvKeyboard(Args.Obj).Add(Args.Values[0], Args.Values[1], TShiftState(Byte(V2S(Args.Values[2]))));
end;

{ procedure Add2(const ACommand: TEditCommand; const AKey1: word; const AShift1: TShiftState; const AKey2: word; const AShift2: TShiftState); }

procedure TKeyboard_Add2(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvKeyboard(Args.Obj).Add2(Args.Values[0], Args.Values[1], TShiftState(Byte(V2S(Args.Values[2]))), Args.Values[3],
    TShiftState(Byte(V2S(Args.Values[4]))));
end;

{ procedure Clear; }

procedure TKeyboard_Clear(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvKeyboard(Args.Obj).Clear;
end;

{ procedure SetDefLayout; }

procedure TKeyboard_SetDefLayout(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvKeyboard(Args.Obj).SetDefLayout;
end;

{ EJvEditorError  }

{ TJvCustomEditor }

{ constructor Create(AOwner: TComponent) }

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

{ procedure SetLeftTop(ALeftCol, ATopRow: Integer); }

procedure TRACustomEditor_SetLeftTop(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).SetLeftTop(Args.Values[0], Args.Values[1]);
end;

{ procedure ClipBoardCopy; }

procedure TRACustomEditor_ClipBoardCopy(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).ClipBoardCopy;
end;

{ procedure ClipBoardPaste; }

procedure TRACustomEditor_ClipBoardPaste(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).ClipBoardPaste;
end;

{ procedure ClipBoardCut; }

procedure TRACustomEditor_ClipBoardCut(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).ClipBoardCut;
end;

{ procedure DeleteSelected; }

procedure TRACustomEditor_DeleteSelected(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).DeleteSelected;
end;

{ function CalcCellRect(const X, Y: Integer): TRect; }

procedure TRACustomEditor_CalcCellRect(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Rect2Var(TJvCustomEditor(Args.Obj).CalcCellRect(Args.Values[0], Args.Values[1]));
end;

{ procedure SetCaret(X, Y: Integer); }

procedure TRACustomEditor_SetCaret(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).SetCaret(Args.Values[0], Args.Values[1]);
end;

{ procedure CaretFromPos(const Pos: Integer; var X, Y: Integer); }

procedure TRACustomEditor_CaretFromPos(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).CaretFromPos(Args.Values[0], TVarData(Args.Values[1]).vInteger,
    TVarData(Args.Values[2]).vInteger);
end;

{ function PosFromCaret(const X, Y: Integer): Integer; }

procedure TRACustomEditor_PosFromCaret(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).PosFromCaret(Args.Values[0], Args.Values[1]);
end;

{ procedure PaintCaret(const bShow: Boolean); }

procedure TRACustomEditor_PaintCaret(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).PaintCaret(Args.Values[0]);
end;

{ function GetTextLen: Integer; }

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

{ function GetSelText: string; }

procedure TRACustomEditor_GetSelText(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).GetSelText;
end;

{ procedure SetSelText(const AValue: string); }

procedure TRACustomEditor_SetSelText(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).SetSelText(Args.Values[0]);
end;

{ function GetWordOnCaret: string; }

procedure TRACustomEditor_GetWordOnCaret(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).GetWordOnCaret;
end;

{ procedure BeginUpdate; }

procedure TRACustomEditor_BeginUpdate(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).BeginUpdate;
end;

{ procedure EndUpdate; }

procedure TRACustomEditor_EndUpdate(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).EndUpdate;
end;

{ procedure MakeRowVisible(ARow: Integer); }

procedure TRACustomEditor_MakeRowVisible(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).MakeRowVisible(Args.Values[0]);
end;

{ procedure Command(ACommand: TEditCommand); }

procedure TRACustomEditor_Command(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).Command(Args.Values[0]);
end;

{ procedure PostCommand(ACommand: TEditCommand); }

procedure TRACustomEditor_PostCommand(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).PostCommand(Args.Values[0]);
end;

{ procedure InsertText(const Text: string); }

procedure TRACustomEditor_InsertText(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).InsertText(Args.Values[0]);
end;

{ procedure ReplaceWord(const NewString: string); }

procedure TRACustomEditor_ReplaceWord(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).ReplaceWord(Args.Values[0]);
end;

{ procedure ReplaceWord2(const NewString: string); }

procedure TRACustomEditor_ReplaceWord2(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).ReplaceWord2(Args.Values[0]);
end;

{ procedure BeginCompound; }

procedure TRACustomEditor_BeginCompound(var Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).BeginCompound;
end;

{ procedure EndCompound; }

procedure TRACustomEditor_EndCompound(var Value: Variant; Args: TJvInterpreterArgs);
begin                                               
  TJvCustomEditor(Args.Obj).EndCompound;
end;

{ property Read LeftCol: Integer }

procedure TRACustomEditor_Read_LeftCol(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).LeftCol;
end;

{ property Read TopRow: Integer }

procedure TRACustomEditor_Read_TopRow(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).TopRow;
end;

{ property Read VisibleColCount: Integer }

procedure TRACustomEditor_Read_VisibleColCount(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).VisibleColCount;
end;

{ property Read VisibleRowCount: Integer }

procedure TRACustomEditor_Read_VisibleRowCount(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).VisibleRowCount;
end;

{ property Read LastVisibleCol: Integer }

procedure TRACustomEditor_Read_LastVisibleCol(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).LastVisibleCol;
end;

{ property Read LastVisibleRow: Integer }

procedure TRACustomEditor_Read_LastVisibleRow(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).LastVisibleRow;
end;

{ property Read Cols: Integer }

procedure TRACustomEditor_Read_Cols(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).Cols;
end;

{ property Write Cols(Value: Integer) }

procedure TRACustomEditor_Write_Cols(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TJvCustomEditor(Args.Obj).Cols := Value;
end;

{ property Read Rows: Integer }

procedure TRACustomEditor_Read_Rows(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TJvCustomEditor(Args.Obj).Rows;
end;

{ property Write Rows(Value: Integer) }

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

⌨️ 快捷键说明

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