rm_jvinterpreter_dialogs.pas

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

PAS
1,106
字号
{-----------------------------------------------------------------------------
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_Dialogs.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_Dialogs;

interface

uses
  rm_JvInterpreter;

procedure RegisterJvInterpreterAdapter(JvInterpreterAdapter: TJvInterpreterAdapter);

implementation

uses
  Classes,
  {$IFDEF COMPLIB_VCL}
  Graphics, Controls, Dialogs,
  rm_JvInterpreter_Windows;
  {$ENDIF COMPLIB_VCL}
  {$IFDEF COMPLIB_CLX}
  Variants, Qt, QGraphics, QControls, QDialogs,
  rm_JvInterpreter_Types;
  {$ENDIF COMPLIB_CLX}

{$IFDEF COMPLIB_CLX}
type
  TCommonDialog = TQtDialog;
{$ENDIF COMPLIB_CLX}

{ TCommonDialog }

{ property Read Handle: HWnd }

{$IFDEF COMPILER3_UP}
procedure TCommonDialog_Read_Handle(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := Integer(TCommonDialog(Args.Obj).Handle);
end;
{$ENDIF COMPILER3_UP}

{$IFDEF COMPLIB_VCL}

{ property Read Ctl3D: Boolean }

procedure TCommonDialog_Read_Ctl3D(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TCommonDialog(Args.Obj).Ctl3D;
end;

{ property Write Ctl3D(Value: Boolean) }

procedure TCommonDialog_Write_Ctl3D(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TCommonDialog(Args.Obj).Ctl3D := Value;
end;

{$ENDIF COMPLIB_VCL}

{ property Read HelpContext: THelpContext }

procedure TCommonDialog_Read_HelpContext(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TCommonDialog(Args.Obj).HelpContext;
end;

{ property Write HelpContext(Value: THelpContext) }

procedure TCommonDialog_Write_HelpContext(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TCommonDialog(Args.Obj).HelpContext := Value;
end;

{ TOpenDialog }

{ constructor Create(AOwner: TComponent) }

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

{ function Execute: Boolean; }

procedure TOpenDialog_Execute(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).Execute;
end;

{$IFDEF COMPLIB_VCL}

{ property Read FileEditStyle: TFileEditStyle }

procedure TOpenDialog_Read_FileEditStyle(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).FileEditStyle;
end;

{ property Write FileEditStyle(Value: TFileEditStyle) }

procedure TOpenDialog_Write_FileEditStyle(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).FileEditStyle := Value;
end;

{$ENDIF COMPLIB_VCL}

{ property Read Files: TStrings }

procedure TOpenDialog_Read_Files(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TOpenDialog(Args.Obj).Files);
end;

{ property Read HistoryList: TStrings }

procedure TOpenDialog_Read_HistoryList(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TOpenDialog(Args.Obj).HistoryList);
end;

{ property Write HistoryList(Value: TStrings) }

procedure TOpenDialog_Write_HistoryList(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).HistoryList := V2O(Value) as TStrings;
end;

{ property Read DefaultExt: string }

procedure TOpenDialog_Read_DefaultExt(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).DefaultExt;
end;

{ property Write DefaultExt(Value: string) }

procedure TOpenDialog_Write_DefaultExt(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).DefaultExt := Value;
end;

{ property Read FileName: TFileName }

procedure TOpenDialog_Read_FileName(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).FileName;
end;

{ property Write FileName(Value: TFileName) }

procedure TOpenDialog_Write_FileName(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).FileName := Value;
end;

{ property Read Filter: string }

procedure TOpenDialog_Read_Filter(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).Filter;
end;

{ property Write Filter(Value: string) }

procedure TOpenDialog_Write_Filter(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).Filter := Value;
end;

{ property Read FilterIndex: Integer }

procedure TOpenDialog_Read_FilterIndex(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).FilterIndex;
end;

{ property Write FilterIndex(Value: Integer) }

procedure TOpenDialog_Write_FilterIndex(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).FilterIndex := Value;
end;

{ property Read InitialDir: string }

procedure TOpenDialog_Read_InitialDir(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).InitialDir;
end;

{ property Write InitialDir(Value: string) }

procedure TOpenDialog_Write_InitialDir(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).InitialDir := Value;
end;

{ property Read Options: TOpenOptions }

procedure TOpenDialog_Read_Options(var Value: Variant; Args: TJvInterpreterArgs);
begin
  {$IFDEF COMPLIB_VCL}
  Value := S2V(Integer(TOpenDialog(Args.Obj).Options));
  {$ENDIF COMPLIB_VCL}
  {$IFDEF COMPLIB_CLX}
  Value := S2V(Word(TOpenDialog(Args.Obj).Options));
  {$ENDIF COMPLIB_CLX}
end;

{ property Write Options(Value: TOpenOptions) }

procedure TOpenDialog_Write_Options(const Value: Variant; Args: TJvInterpreterArgs);
begin
  {$IFDEF COMPLIB_VCL}
  TOpenDialog(Args.Obj).Options := TOpenOptions(V2S(Value));
  {$ENDIF COMPLIB_VCL}
  {$IFDEF COMPLIB_CLX}
  TOpenDialog(Args.Obj).Options := TOpenOptions(Word(V2S(Value)));
  {$ENDIF COMPLIB_CLX}
end;

{ property Read Title: string }

procedure TOpenDialog_Read_Title(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TOpenDialog(Args.Obj).Title;
end;

{ property Write Title(Value: string) }

procedure TOpenDialog_Write_Title(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TOpenDialog(Args.Obj).Title := Value;
end;

{ TSaveDialog }

{ constructor Create(AOwner: TComponent) }

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

{ function Execute: Boolean; }

procedure TSaveDialog_Execute(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TSaveDialog(Args.Obj).Execute;
end;

{ TColorDialog }

{ constructor Create(AOwner: TComponent) }

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

{ function Execute: Boolean; }

procedure TColorDialog_Execute(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TColorDialog(Args.Obj).Execute;
end;

{ property Read Color: TColor }

procedure TColorDialog_Read_Color(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TColorDialog(Args.Obj).Color;
end;

{ property Write Color(Value: TColor) }

procedure TColorDialog_Write_Color(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TColorDialog(Args.Obj).Color := Value;
end;

{ property Read CustomColors: TStrings }

procedure TColorDialog_Read_CustomColors(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TColorDialog(Args.Obj).CustomColors);
end;

{ property Write CustomColors(Value: TStrings) }

procedure TColorDialog_Write_CustomColors(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TColorDialog(Args.Obj).CustomColors := V2O(Value) as TStrings;
end;

{$IFDEF COMPLIB_VCL}

{ property Read Options: TColorDialogOptions }

procedure TColorDialog_Read_Options(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := S2V(Byte(TColorDialog(Args.Obj).Options));
end;

{ property Write Options(Value: TColorDialogOptions) }

procedure TColorDialog_Write_Options(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TColorDialog(Args.Obj).Options := TColorDialogOptions(Byte(V2S(Value)));
end;

{$ENDIF COMPLIB_VCL}

{ TFontDialog }

{ constructor Create(AOwner: TComponent) }

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

{ function Execute: Boolean; }

procedure TFontDialog_Execute(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := TFontDialog(Args.Obj).Execute;
end;

{ property Read Font: TFont }

procedure TFontDialog_Read_Font(var Value: Variant; Args: TJvInterpreterArgs);
begin
  Value := O2V(TFontDialog(Args.Obj).Font);
end;

{ property Write Font(Value: TFont) }

procedure TFontDialog_Write_Font(const Value: Variant; Args: TJvInterpreterArgs);
begin
  TFontDialog(Args.Obj).Font := V2O(Value) as TFont;

⌨️ 快捷键说明

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