zoukankan      html  css  js  c++  java
  • Action 相关组件


    TAction //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    
    TActionList //<- TCustomActionList <- TComponent
    //其父类 TCustomActionList 包含一个 TContainedAction 类型的动作列表(Actions[])
    
    TActionManager //<- TCustomActionManager <- TCustomActionList <- TComponent)
    //其父父类 TCustomActionList 包含一个 TContainedAction 类型的动作列表(Actions[])
    
    TCustomizeDlg //<- TComponent
    //它拥有 ActionManager: TCustomActionManager 属性
    
    TActionToolBar //<- TCustomActionToolBar <- TCustomActionDockBar <- TCustomActionBar <- TToolWindow <<<- TComponent
    //其父父父类 TCustomActionBar 拥有 ActionManager: TCustomActionManager 属性.
    
    TActionMainMenuBar //<- TCustomActionMainMenuBar <- TCustomActionMenuBar <- TCustomActionDockBar <- TCustomActionBar <- TToolWindow <<<- TComponent
    //其父父父父类 TCustomActionBar 拥有 ActionManager: TCustomActionManager 属性.
    
    TMenuItem //<- TComponent
    //它拥有 Action: TBasicAction 属性
    
    TPopupActionBar //<- TPopupMenu <- TMenu <- TComponent
    //它内部拥有 FActionManager: TCustomActionManager 成员
    
    
    { StdActns 单元一些更具体的类: }
    
    THintAction   //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    
    TEditAction   //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TEditAction -> TEditCut、TEditCopy、TEditPaste、TEditSelectAll、TEditUndo、TEditDelete、TEditSelectAll、TEditSelectAll
    
    TWindowAction //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TWindowAction -> TWindowClose、TWindowCascade、TWindowTileHorizontal、TWindowTileVertical、TWindowMinimizeAll、TWindowArrange
    
    THelpAction   //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    THelpAction -> THelpContents、THelpTopicSearch、THelpOnHelp、THelpContextAction
    
    TFileAction   //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TFileAction -> TFileOpenWith、TFileSaveAs、TFilePrintSetup、TFilePageSetup、TFileExit
    
    TSearchFind      //<- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TSearchReplace   //<- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TSearchFindFirst //<- TSearchFind <- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TSearchFindNext  //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    
    TFontEdit        //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TColorSelect     //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TPrintDlg        //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    TBrowseForFolder //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponent
    
    
    { 另有 ExtActns 单元下的: }
    TFileRun、TRichEditAction、TRichEditBold、TRichEditItalic、TRichEditUnderline、TRichEditStrikeOut、TRichEditStrikeOut、
    TRichEditBullets、TRichEditAlignLeft、TRichEditAlignRight、TRichEditAlignCenter、TTabAction、TPreviousTab、TNextTab、
    TOpenPicture、TSavePicture、TURLAction、TBrowseURL、TDownLoadURL、TSendMail
    
    { DBActns 单元下的: }
    TDataSetAction、TDataSetFirst、TDataSetPrior、TDataSetNext、TDataSetLast、TDataSetInsert、
    TDataSetDelete、TDataSetEdit、TDataSetPost、TDataSetCancel、TDataSetRefresh
    
    { ActnRes 单元下的: }
    TStandardActions
    
    //它们一般用在窗体设计时
    


    使用 TBrowseURL 打开网页:

    uses ExtActns;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      with TBrowseURL.Create(nil) do
      begin
        URL := 'http://del.cnblogs.com';
        Execute;
        Free;
      end;
    end;
    


    关联 TBrowseURL 到 TSpeedButton:

    uses ExtActns, Buttons;
    
    var
      bUrl: TBrowseURL;
      sBtn: TSpeedButton;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      bUrl := TBrowseURL.Create(Self);
      bUrl.URL := 'http://del.cnblogs.com';
      bUrl.Caption := 'Open URL';
    
      sBtn := TSpeedButton.Create(Self);
      sBtn.Parent := Self;
      sBtn.Width := 100;
      sBtn.Action := bUrl;
    end;
    


    使用 TDownLoadURL 下载文件:

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtActns, ComCtrls;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        ProgressBar1: TProgressBar;
        procedure Button1Click(Sender: TObject);
      private
        procedure DownProgress(Sender: TDownLoadURL; Progress, ProgressMax: Cardinal;
          StatusCode: TURLDownloadStatus; StatusText: String; var Cancel: Boolean);
      public
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Button1.Enabled := False;
      with TDownLoadURL.Create(nil) do
      begin
        URL := 'https://files.cnblogs.com/del/PMark_1.rar';
        Filename := 'c:\temp\PMark_1.rar';
        OnDownloadProgress := DownProgress; //下载进度
        ExecuteTarget(nil);
        Free;
      end;
      Button1.Enabled := True;
    end;
    
    procedure TForm1.DownProgress(Sender: TDownLoadURL; Progress, ProgressMax: Cardinal;
      StatusCode: TURLDownloadStatus; StatusText: String; var Cancel: Boolean);
    begin
      ProgressBar1.Max := ProgressMax;
      ProgressBar1.Position := Progress;
      Application.ProcessMessages;
    end;
    
    end.
    

  • 相关阅读:
    如何降低微服务测试成本?我的经验之谈
    Serverless 在 SaaS 领域的最佳实践
    技术干货 | “选图预览并上传”的场景如何解?全网最全方案汇总来了
    SRE技术保障平台-盯屏中心TAC: 混合云一站式告警运维平台
    DTCC 2020 | 阿里云王涛:阿里巴巴电商数据库上云实践
    中值滤波算法 C
    python logger.debug_python中的logger模块讲解
    唯一值
    接触jeecgBoot低代码开发
    php数字操作
  • 原文地址:https://www.cnblogs.com/del/p/2041290.html
Copyright © 2011-2022 走看看