📄 jvinterpreter_dialogs.pas
字号:
{-----------------------------------------------------------------------------
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 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_Dialogs.pas,v 1.15 2005/02/17 10:20:39 marquardt Exp $
unit JvInterpreter_Dialogs;
{$I jvcl.inc}
interface
uses
{$IFDEF UNITVERSIONING}
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
JvInterpreter;
procedure RegisterJvInterpreterAdapter(JvInterpreterAdapter: TJvInterpreterAdapter);
{$IFDEF UNITVERSIONING}
const
UnitVersioning: TUnitVersionInfo = (
RCSfile: '$RCSfile: JvInterpreter_Dialogs.pas,v $';
Revision: '$Revision: 1.15 $';
Date: '$Date: 2005/02/17 10:20:39 $';
LogPath: 'JVCL\run'
);
{$ENDIF UNITVERSIONING}
implementation
uses
Classes,
{$IFDEF VCL}
JvInterpreter_Windows,
{$ENDIF VCL}
{$IFDEF VisualCLX}
Variants, Qt, JvQInterpreter_Types,
{$ENDIF VisualCLX}
Graphics, Controls, Dialogs;
{$IFDEF VisualCLX}
type
TCommonDialog = TQtDialog;
{$ENDIF VisualCLX}
{ TCommonDialog }
{ property Read Handle: HWnd }
procedure TCommonDialog_Read_Handle(var Value: Variant; Args: TJvInterpreterArgs);
begin
Value := Integer(TCommonDialog(Args.Obj).Handle);
end;
{$IFDEF 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 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 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 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 VCL}
Value := S2V(Integer(TOpenDialog(Args.Obj).Options));
{$ENDIF VCL}
{$IFDEF VisualCLX}
Value := S2V(Word(TOpenDialog(Args.Obj).Options));
{$ENDIF VisualCLX}
end;
{ property Write Options(Value: TOpenOptions) }
procedure TOpenDialog_Write_Options(const Value: Variant; Args: TJvInterpreterArgs);
begin
{$IFDEF VCL}
TOpenDialog(Args.Obj).Options := TOpenOptions(V2S(Value));
{$ENDIF VCL}
{$IFDEF VisualCLX}
TOpenDialog(Args.Obj).Options := TOpenOptions(Word(V2S(Value)));
{$ENDIF VisualCLX}
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 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 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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -