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

📄 jvdialogactns.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: JvStdActions.PAS, released on 2002-10-06.

The Initial Developer of the Original Code is Peter Th鰎nqvist.
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

Known Issues:

-----------------------------------------------------------------------------}
// $Id: JvDialogActns.pas,v 1.18 2005/02/17 10:20:23 marquardt Exp $

unit JvDialogActns;

{$I jvcl.inc}
{$I vclonly.inc}

interface

uses
  {$IFDEF UNITVERSIONING}
  JclUnitVersioning,
  {$ENDIF UNITVERSIONING}
  SysUtils, Classes, ActnList, StdActns,
  {$IFDEF COMPILER5}
  Dialogs,
  {$ENDIF COMPILER5}
  JvBaseDlg, JvBrowseFolder, JvSelectDirectory, JvConnectNetwork,
  JvWinDialogs, JvDialogs, JvPageSetupTitled, JvPageSetup;

type
  {$IFDEF COMPILER5}
  {$IFDEF BCB5}
  // For some weird reason, directly using TCommonDialog in the declaration
  // of TCommonDialogClass will trigger a link error (bad index) with
  // BCB5. However, the fix below allows the compilation to work and the
  // linker doesn't complain anymore.
  TBCB5TCommonDialogFix = TCommonDialog;
  TCommonDialogClass = class of TBCB5TCommonDialogFix;
  {$ELSE}
  TCommonDialogClass = class of TCommonDialog;
  {$ENDIF BCB5}
  {$ENDIF COMPILER5}
  TJvCommonDialogClass = class of TJvCommonDialog;
  TJvCommonDialogPClass = class of TJvCommonDialogP;
  TJvCommonDialogFClass = class of TJvCommonDialogF;

  {$IFDEF COMPILER5}
  TCommonDialogAction = class(TCustomAction)
  private
    FOnAccept: TNotifyEvent;
    FOnCancel: TNotifyEvent;
    FBeforeExecute: TNotifyEvent;
  protected
    FDialog: TCommonDialog;
    function GetDialogClass: TCommonDialogClass; virtual;
    property OnAccept: TNotifyEvent read FOnAccept write FOnAccept;
    property OnCancel: TNotifyEvent read FOnCancel write FOnCancel;
  public
    constructor Create(AOwner: TComponent); override;
    function HandlesTarget(Target: TObject): Boolean; override;
    property BeforeExecute: TNotifyEvent read FBeforeExecute write FBeforeExecute;
  published
    property Caption;
    property Enabled;
    property HelpContext;
    property Hint;
    property ImageIndex;
    property ShortCut;
    property Visible;
  end;
  {$ENDIF COMPILER5}

  TJvCommonDialogAction = class(TCustomAction)
  private
    {$IFDEF COMPILER6_UP}
    FExecuteResult: Boolean;
    {$ENDIF COMPILER6_UP}
    FOnAccept: TNotifyEvent;
    FOnCancel: TNotifyEvent;
    FBeforeExecute: TNotifyEvent;
  protected
    FDialog: TJvCommonDialog;
    function GetDialogClass: TJvCommonDialogClass; virtual;
    property OnAccept: TNotifyEvent read FOnAccept write FOnAccept;
    property OnCancel: TNotifyEvent read FOnCancel write FOnCancel;
  public
    constructor Create(AOwner: TComponent); override;
    function HandlesTarget(Target: TObject): Boolean; override;
    {$IFDEF COMPILER6_UP}
    procedure ExecuteTarget(Target: TObject); override;
    property ExecuteResult: Boolean read FExecuteResult;
    {$ENDIF COMPILER6_UP}
    property BeforeExecute: TNotifyEvent read FBeforeExecute write FBeforeExecute;
  published
    property Caption;
    property Enabled;
    property HelpContext;
    property Hint;
    property ImageIndex;
    property ShortCut;
    {$IFDEF COMPILER6_UP}
    property SecondaryShortCuts;
    {$ENDIF COMPILER6_UP}
    property Visible;
  end;

  TJvCommonDialogPAction = class(TCustomAction)
  private
    FBeforeExecute: TNotifyEvent;
    FAfterExecute: TNotifyEvent;
  protected
    FDialog: TJvCommonDialogP;
    function GetDialogClass: TJvCommonDialogPClass; virtual;
  public
    constructor Create(AOwner: TComponent); override;
    function HandlesTarget(Target: TObject): Boolean; override;
    procedure ExecuteTarget(Target: TObject); override;
  published
    property Caption;
    property Enabled;
    property HelpContext;
    property Hint;
    property ImageIndex;
    property ShortCut;
    {$IFDEF COMPILER6_UP}
    property SecondaryShortCuts;
    {$ENDIF COMPILER6_UP}
    property Visible;
    property BeforeExecute: TNotifyEvent read FBeforeExecute write FBeforeExecute;
    property AfterExecute: TNotifyEvent read FAfterExecute write FAfterExecute;
  end;

  TJvCommonDialogFAction = class(TJvCommonDialogAction)
  private
    FBeforeExecute: TNotifyEvent;
    FAfterExecute: TNotifyEvent;
  protected
    FDialog: TJvCommonDialogF;
    function GetDialogClass: TJvCommonDialogFClass; reintroduce; virtual;
  public
    constructor Create(AOwner: TComponent); override;
    function HandlesTarget(Target: TObject): Boolean; override;
    procedure ExecuteTarget(Target: TObject); override;
  published
    property Caption;
    property Enabled;
    property HelpContext;
    property Hint;
    property ImageIndex;
    property ShortCut;
    {$IFDEF COMPILER6_UP}
    property SecondaryShortCuts;
    {$ENDIF COMPILER6_UP}
    property Visible;
    property BeforeExecute: TNotifyEvent read FBeforeExecute write FBeforeExecute;
    property AfterExecute: TNotifyEvent read FAfterExecute write FAfterExecute;
  end;

  // (rom) renamed to match renamed TJvBrowseForFolder
  TJvBrowseForFolderAction = class(TJvCommonDialogFAction)
  private
    function GetDialog: TJvBrowseForFolderDialog;
  protected
    function GetDialogClass: TJvCommonDialogFClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvBrowseForFolderDialog read GetDialog;
  end;

  TJvSelectDirectoryAction = class(TJvCommonDialogAction)
  private
    function GetDialog: TJvSelectDirectory;
  protected
    function GetDialogClass: TJvCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP} 
    property Dialog: TJvSelectDirectory read GetDialog;
  end;

  TJvConnectNetworkAction = class(TJvCommonDialogAction)
  private
    function GetDialog: TJvNetworkConnect;
  protected
    function GetDialogClass: TJvCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvNetworkConnect read GetDialog;
  end;

  TJvFloppyFormatAction = class(TJvCommonDialogFAction)
  private
    function GetDialog: TJvFormatDriveDialog;
  protected
    function GetDialogClass: TJvCommonDialogFClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvFormatDriveDialog read GetDialog;
  end;

  TJvOrganizeFavoritesAction = class(TJvCommonDialogAction)
  private
    function GetDialog: TJvOrganizeFavoritesDialog;
  protected
    function GetDialogClass: TJvCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvOrganizeFavoritesDialog read GetDialog;
  end;

  TJvControlPanelAction = class(TJvCommonDialogFAction)
  private
    function GetDialog: TJvAppletDialog;
  protected
    function GetDialogClass: TJvCommonDialogFClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvAppletDialog read GetDialog;
  end;

  TJvOpenFileAction = class(TCommonDialogAction)
  private
    function GetDialog: TJvOpenDialog;
  protected
    function GetDialogClass: TCommonDialogClass; override;
  published
    property Caption;
    property Enabled;
    property HelpContext;
    property Hint;
    property ImageIndex;
    property ShortCut;
    property Visible;
    {$IFDEF COMPILER6_UP}
    property SecondaryShortCuts;
    {$ENDIF COMPILER6_UP}
    property OnAccept;
    property OnCancel;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvOpenDialog read GetDialog;
  end;

  TJvSaveFileAction = class(TJvOpenFileAction)
  private
    function GetDialog: TJvSaveDialog;
  protected
    function GetDialogClass: TCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvSaveDialog read GetDialog;
  end;

  TJvPageSetupAction = class(TJvCommonDialogAction)
  private
    function GetDialog: TJvPageSetupDialog;
  protected
    function GetDialogClass: TJvCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}
    property Dialog: TJvPageSetupDialog read GetDialog;
  end;

  TJvPageSetupTitledAction = class(TJvCommonDialogAction)
  private
    function GetDialog: TJvPageSetupTitledDialog;
  protected
    function GetDialogClass: TJvCommonDialogClass; override;
  {$IFDEF COMPILER6_UP}
  published
  {$ELSE}
  public
  {$ENDIF COMPILER6_UP}

⌨️ 快捷键说明

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