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

📄 oleregister7.pas

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

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

{$I OLE.INC}

unit OleRegister7;

interface

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

  OleConsts, OleHelpers;

type
  TOleInsertForm = class(TForm)
    PageControl: TPageControl;
    StandardTabSheet: TTabSheet;
    GroupBox2: TGroupBox;
    Label4: TLabel;
    Label5: TLabel;
    CaptionEdit: TEdit;
    CentreCheckBox: TCheckBox;
    ResourceEdit: TEdit;
    GroupBox3: TGroupBox;
    CheckLinkCheckBox: TCheckBox;
    DisableLinkCheckBox: TCheckBox;
    HideChangeIconCheckBox: TCheckBox;
    HelpCheckBox: TCheckBox;
    VerifyCheckBox: TCheckBox;
    ShowInsertCheckBox: TCheckBox;
    AsIconCheckBox: TCheckBox;
    FormatsTabSheet: TTabSheet;
    LinkTypesTabSheet: TTabSheet;
    ExcludeTabSheet: TTabSheet;
    GroupBox4: TGroupBox;
    CLSIDListView: TListView;
    TestBtn: TBitBtn;
    DelBtn: TBitBtn;
    AddBtn: TBitBtn;
    EditExcludeBitBtn: TBitBtn;
    BrowseCLSIDBitBtn: TBitBtn;
    OKBtn: TBitBtn;
    CancelBtn: TBitBtn;
    ShowCreateCheckBox: TCheckBox;
    CreateNewCheckBox: TCheckBox;
    CreateFileCheckBox: TCheckBox;
    CreateLinkCheckBox: TCheckBox;
    OptionsRG: TRadioGroup;
    Label1: TLabel;
    FormatComboBox: TComboBox;
    AspectRadioGroup: TRadioGroup;
    GroupBox1: TGroupBox;
    GlobalCheckBox: TCheckBox;
    FileCheckBox: TCheckBox;
    StreamCheckBox: TCheckBox;
    StorageCheckBox: TCheckBox;
    GDICheckBox: TCheckBox;
    WMFCheckBox: TCheckBox;
    EMFCheckBox: TCheckBox;
    RenderComboBox: TComboBox;
    Label2: TLabel;
    Label3: TLabel;
    IIDEdit: TEdit;
    procedure AddBtnClick(Sender: TObject);
    procedure BrowseCLSIDBitBtnClick(Sender: TObject);
    procedure DelBtnClick(Sender: TObject);
    procedure EditExcludeBitBtnClick(Sender: TObject);
    procedure TestBtnClick(Sender: TObject);
  private
    FComponent : TComponent;
  public
    property Dialog : TComponent read FComponent write FComponent;
    procedure Initialise;
    procedure Finalise;
  end;

var
  OleInsertForm: TOleInsertForm;

implementation

{$R *.DFM}

uses
  OleRegister8;

procedure TOleInsertForm.Initialise;
var
  Loop : integer;
begin
  with FComponent as TOleInsertObjectDialog do
  begin
// Standard tab
    CentreCheckBox.Checked := AutoCentre;
    CaptionEdit.Text := Caption;
    HelpCheckBox.Checked := ShowHelp;
    ResourceEdit.Text := Resource;
    CheckLinkCheckBox.Checked := CheckLink;
    AsIconCheckBox.Checked := CheckDisplayAsIcon;
    CreateNewCheckBox.Checked := CreateNewObject;
    CreateFileCheckBox.Checked := CreateFileObject;
    CreateLinkCheckBox.Checked := CreateLinkObject;
    HideChangeIconCheckBox.Checked := HideChangeIcon;
    VerifyCheckBox.Checked := VerifyServersExist;
    ShowInsertCheckBox.Checked := ShowInsertControl;
    ShowCreateCheckBox.Checked := SelectCreateControl;
    if SelectCreateNew then
      OptionsRG.ItemIndex := 0
    else
      if SelectCreateFromFile then
        OptionsRG.ItemIndex := 1
      else
        OptionsRG.ItemIndex := -1;
// Format & Render tab
    FormatComboBox.Items.AddStrings (KnownClipboardFormats);
    FormatComboBox.Text := FormatEtc.Name;
    AspectRadioGroup.ItemIndex := ord (FormatEtc.Aspect) - 1;
    GlobalCheckbox.Checked := cmGlobal in FormatEtc.Medium;
    FileCheckbox.Checked := cmFile in FormatEtc.Medium;
    StreamCheckbox.Checked := cmStream in FormatEtc.Medium;
    StorageCheckbox.Checked := cmStorage in FormatEtc.Medium;
    GDICheckbox.Checked := cmGDI in FormatEtc.Medium;
    WMFCheckbox.Checked := cmMFPict in FormatEtc.Medium;
    EMFCheckbox.Checked := cmEnhMF in FormatEtc.Medium;
    RenderComboBox.ItemIndex := ord (Render);
// Exclude tab
    for Loop := 0 to Exclude.Count - 1 do
      with CLSIDListView.Items.Add do
        Caption := Exclude[Loop];
// IID tab
    IIDEdit.Text := IID
  end
end;

procedure TOleInsertForm.Finalise;
var
  Loop : integer;
begin
  with FComponent as TOleInsertObjectDialog do
  begin
// Standard tab
    AutoCentre := CentreCheckBox.Checked;
    Caption := CaptionEdit.Text;
    ShowHelp := HelpCheckBox.Checked;
    Resource := ResourceEdit.Text;
    CheckLink := CheckLinkCheckBox.Checked;
    CheckDisplayAsIcon := AsIconCheckBox.Checked;
    CreateNewObject := CreateNewCheckBox.Checked;
    CreateFileObject := CreateFileCheckBox.Checked;
    CreateLinkObject := CreateLinkCheckBox.Checked;
    HideChangeIcon := HideChangeIconCheckBox.Checked;
    VerifyServersExist := VerifyCheckBox.Checked;
    ShowInsertControl := ShowInsertCheckBox.Checked;
    SelectCreateControl := ShowCreateCheckBox.Checked;
    SelectCreateNew := false;
    SelectCreateFromFile := false;
    case OptionsRG.ItemIndex of
      0 : SelectCreateNew := true;
      1 : SelectCreateFromFile := true
    end;
// Format & Render tab
    FormatEtc.Name := FormatComboBox.Text;
    FormatEtc.Aspect := TClipAspect (AspectRadioGroup.ItemIndex);
    FormatEtc.Medium := [];
    if GlobalCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmGlobal];
    if FileCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmFile];
    if StreamCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmStream];
    if StorageCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmStorage];
    if GDICheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmGDI];
    if WMFCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmMFPict];
    if EMFCheckbox.Checked then
      FormatEtc.Medium := FormatEtc.Medium + [cmEnhMF];
    Render := TOleRender (RenderComboBox.ItemIndex);
// Exclude tab
    Exclude.Clear;
    for Loop := 0 to CLSIDListView.Items.Count - 1 do
      Exclude.Add (CLSIDListView.Items[Loop].Caption);
// IID tab
    IID := IIDEdit.Text
  end
end;



//--- Exclude Page -------------------------------------------------------------

// Add a new CLSID - offer a null CLSID to edit
procedure TOleInsertForm.AddBtnClick(Sender: TObject);
begin
  with CLSIDListView.Items.Add do
  begin
    Caption := '{00000000-0000-0000-0000-000000000000}';
    EditCaption
  end
end;

//--- Delete the selected CLSID
procedure TOleInsertForm.DelBtnClick(Sender: TObject);
begin
  with CLSIDListView do
    if Assigned (Selected) then
      Selected.Delete
end;

//--- Put the listview into edit mode
procedure TOleInsertForm.EditExcludeBitBtnClick(Sender: TObject);
begin
  with CLSIDListView do
    if Assigned (Selected) then
      Selected.EditCaption
end;

//--- Test each CLSID for the correct format (doesn't mean they right,
// just in the format like '{69857C20-AA5A-11D2-9803-C65433F0DB60}'
procedure TOleInsertForm.TestBtnClick(Sender: TObject);
var
  Loop : integer;
  CLSID : TCLSID;
  Bad : boolean;
begin
  Bad := false;
  with CLSIDListView do
    for Loop := 0 to Items.Count - 1 do
      if CLSIDFromString (PWideChar(WideString(Items[Loop].Caption)), CLSID) <> NOERROR then
      begin
        ShowMessage (Items[Loop].Caption + ' is invalid');
        Bad := true
      end;

  if not Bad then
    ShowMessage ('All CLSIDs are valid')
end;

//--- read the registry to pick a CLSID
procedure TOleInsertForm.BrowseCLSIDBitBtnClick(Sender: TObject);
begin
  with TBrowseCLSIDForm2.Create (Application) do
  try
    InsertMode;
    if Assigned (CLSIDListView.Selected) then
      SelectedCLSID := CLSIDListView.Selected.Caption;
    if ShowModal = mrOk then
      if Assigned (CLSIDListView.Selected) then
        CLSIDListView.Selected.Caption := SelectedCLSID
      else
        CLSIDListView.Items.Add.Caption := SelectedCLSID
  finally
    Free
  end
end;




end.

⌨️ 快捷键说明

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