Action 相关组件

来源:转载


TAction //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTActionList //<- 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 <- TComponentTEditAction //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTEditAction -> TEditCut、TEditCopy、TEditPaste、TEditSelectAll、TEditUndo、TEditDelete、TEditSelectAll、TEditSelectAllTWindowAction //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTWindowAction -> TWindowClose、TWindowCascade、TWindowTileHorizontal、TWindowTileVertical、TWindowMinimizeAll、TWindowArrangeTHelpAction //<- TAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTHelpAction -> THelpContents、THelpTopicSearch、THelpOnHelp、THelpContextActionTFileAction //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTFileAction -> TFileOpenWith、TFileSaveAs、TFilePrintSetup、TFilePageSetup、TFileExitTSearchFind //<- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTSearchReplace //<- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTSearchFindFirst //<- TSearchFind <- TSearchAction <- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTSearchFindNext //<- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTFontEdit //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTColorSelect //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTPrintDlg //<- TCommonDialogAction <- TCustomAction <- TContainedAction <- TBasicAction <- TComponentTBrowseForFolder //<- 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;interfaceuses 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 := 'http://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.


分享给朋友:
您可能感兴趣的文章:
随机阅读: