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

📄 oleregister1.pas

📁 是一个delphi的流程制作软件
💻 PAS
字号:

//========================= OLE UI UTILITIES ===================================
//
// This is s component editor for the OleBusyDislog component
//
// Grahame Marsh
// Freeware for UNDU - you get it for free I make no promises
// gsmarsh@aol.com
//------------------------------------------------------------------------------

{$I OLE.INC}

unit OleRegister1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls, Buttons, OleDlgs, ExtCtrls, ExtDlgs;

type
  TOleBusyForm = class(TForm)
    PageControl: TPageControl;
    StandardTabSheet: TTabSheet;
    OKBtn: TBitBtn;
    CancelBtn: TBitBtn;
    ExtensionTabSheet: TTabSheet;
    GroupBox1: TGroupBox;
    CancelCheckBox: TCheckBox;
    RetryCheckBox: TCheckBox;
    NotRespondingCheckBox: TCheckBox;
    GroupBox2: TGroupBox;
    CaptionEdit: TEdit;
    CentreCheckBox: TCheckBox;
    GroupBox3: TGroupBox;
    InitialUpDown: TUpDown;
    InitialEdit: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    RetryEdit: TEdit;
    RetryUpDown: TUpDown;
    Label3: TLabel;
    RepeatEdit: TEdit;
    RepeatUpDown: TUpDown;
    GroupBox4: TGroupBox;
    CancelBtnEdit: TEdit;
    RetryBtnEdit: TEdit;
    TextMemo: TMemo;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    GroupBox5: TGroupBox;
    IconImage: TImage;
    ClearButton: TButton;
    LoadButton: TButton;
    Bevel1: TBevel;
    OpenPictureDialog: TOpenPictureDialog;
    procedure ClearButtonClick(Sender: TObject);
    procedure LoadButtonClick(Sender: TObject);
  private
    FBusyEx : boolean;
    FComponent : TComponent;
    procedure SetBusyEx (Value : boolean);
  public
    property BusyEx : boolean read FBusyEx write SetBusyEx;
    property Dialog : TComponent read FComponent write FComponent;
    procedure Initialise;
    procedure Finalise;
  end;

implementation

{$R *.DFM}

procedure TOleBusyForm.SetBusyEx (Value : boolean);
begin
  FBusyEx := Value;
  ExtensionTabSheet.TabVisible := Value;
  if Value then
    Caption := 'OleUIBusyEx Dialog Editor'
  else
    Caption := 'OleUIBusy Dialog Editor';
  PageControl.ActivePage := StandardTabSheet
end;

procedure TOleBusyForm.Initialise;
begin
  with FComponent as TOleBusyDialog do
  begin
    CentreCheckBox.Checked := AutoCentre;
    CaptionEdit.Text := Caption;
    InitialUpDown.Position := InitialDelay;
    RetryUpDown.Position := RetryDelay;
    RepeatUpDown.Position := RepeatDelay;
    CancelCheckBox.Checked := oboDisableCancel in Options;
    RetryCheckBox.Checked := oboDisableRetry in Options;
    NotRespondingCheckBox.Checked := oboNotResponding in Options;
  end;

  if FBusyEx then
    with FComponent as TOleBusyDialogEx do
    begin
      CancelBtnEdit.Text := Cancel;
      RetryBtnEdit.Text := Retry;
      TextMemo.Text := Text;
      IconImage.Picture.Graphic := Icon
    end
end;

procedure TOleBusyForm.Finalise;
begin
  with FComponent as TOleBusyDialog do
  begin
    AutoCentre := CentreCheckBox.Checked;
    Caption := CaptionEdit.Text;
    InitialDelay := InitialUpDown.Position;
    RetryDelay := RetryUpDown.Position;
    RepeatDelay := RepeatUpDown.Position;
    Options := [];
    if CancelCheckBox.Checked then
      Options := Options  + [oboDisableCancel];
    if RetryCheckBox.Checked then
      Options := Options  + [oboDisableRetry];
    if NotRespondingCheckBox.Checked then
      Options := Options  + [oboNotResponding]
  end;
  if FBusyEx then
    with FComponent as TOleBusyDialogEx do
    begin
      Cancel := CancelBtnEdit.Text;
      Retry := RetryBtnEdit.Text;
      Text := TextMemo.Text;
      Icon := IconImage.Picture.Icon
    end
end;

procedure TOleBusyForm.ClearButtonClick(Sender: TObject);
begin
  IconImage.Picture := nil
end;

procedure TOleBusyForm.LoadButtonClick(Sender: TObject);
var
  Icon : TIcon;
begin
  if OpenPictureDialog.Execute then
  begin
    Icon := TIcon.Create;
    try
      Icon.LoadFromFile (OpenPictureDialog.Filename);
      IconImage.Picture.Graphic := Icon;
    finally
      Icon.Free
    end
  end
end;

end.

⌨️ 快捷键说明

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