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

📄 oleregister.pas

📁 是一个delphi的流程制作软件
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    begin
      BusyForm.Finalise;
      Designer.Modified
    end
  finally
    BusyForm.Free
  end
end;

procedure TOleBusyDialogEditor.Test;
begin
  with TOleBusyDialog(Component) do
    Execute
end;

//=== OleChangeIconDialogEditor ======================================================
// See OleRegister4

procedure TOleChangeIconDialogEditor.Edit;
var
  Form : TOleIconForm;
begin
  Form := TOleIconForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

procedure TOleChangeIconDialogEditor.Test;
begin
  with TOleChangeIconDialog (Component) do
    Execute
end;

//=== OleInsertObjectDialogEditor ======================================================

procedure TOleInsertObjectDialogEditor.Edit;
var
  Form : TOleInsertForm;
begin
  Form := TOleInsertForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

procedure TOleInsertObjectDialogEditor.Test;
begin
  with TOleChangeIconDialog(Component) do
  try
    Execute  // generates exceptions if Ok pressed
  except
  end
end;

//=== OleInsertObjectDialogEditor ======================================================

procedure TOlePropsDialogEditor.Edit;
var
  Form : TOlePropsForm;
begin
  Form := TOlePropsForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

//=== OleInsertObjectDialogEditor ======================================================

procedure TOleEditLinksDialogEditor.Edit;
var
  Form : TOleEditLinksForm;
begin
  Form := TOleEditLinksForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

//=== OleConvertDialogEditor ======================================================

procedure TOleConvertDialogEditor.Edit;
var
  Form : TOleConvertForm;
begin
  Form := TOleConvertForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

procedure TOleConvertDialogEditor.Test;
begin
  with TOleConvertDialog(Component) do
    Execute
end;

//=== OleChangeSourceDialogEditor ==============================================

procedure TOleChangeSourceDialogEditor.Edit;
var
  Form : TOleChangeSourceForm;
begin
  Form := TOleChangeSourceForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

//=== OlePromptUserDialogEditor ======================================================
// OleRegister6

function TOlePromptUserDialogEditor.GetVerbCount: Integer;
begin
  Result := 2
end;

procedure TOlePromptUserDialogEditor.Edit;
var
  Form : TOleUserForm;
begin
  Form := TOleUserForm.Create (Application);
  try
    Form.Dialog := Component;
    Form.Initialise;
    if Form.ShowModal = mrOk then
    begin
      Form.Finalise;
      Designer.Modified
    end
  finally
    Form.Free
  end
end;

procedure TOlePromptUserDialogEditor.Test;
begin
  with TOlePromptUserDialog(Component) do
    Execute
end;

//=== Clipboard format name property editor ====================================

type
  TClipPropertyEditor = class (TStringProperty)
    function GetAttributes : TPropertyAttributes; override;
    procedure GetValues (Proc: TGetStrProc); override;
  end;

function TClipPropertyEditor.GetAttributes;
begin
  Result := [paValueList, paSortList]
end;

procedure TClipPropertyEditor.GetValues (Proc: TGetStrProc);
var
  Loop : integer;
begin
  for Loop := 0 to KnownClipboardFormats.Count - 1 do
    Proc (KnownClipboardFormats [Loop])
end;

//=== CLSID Helpers ============================================================

type
  TCLSIDProperty = class(TStringProperty)
  public
    procedure Edit; override;
    function GetAttributes : TPropertyAttributes; override;
    function GetEditLimit: Integer; override;
//    function GetValue: string; override;
//    procedure SetValue(const Value: string); override;
  end;

function TCLSIDProperty.GetAttributes;
begin
  Result := [paDialog]
end;

//00000000011111111112222222222333333333
//12345678901234567890123456789012345678
//{0312DB00-33DE-11D3-A27A-999366A95F71}

function TCLSIDProperty.GetEditLimit: Integer;
begin
  Result := 38
end;

(*
function TCLSIDProperty.GetValue: string;
begin
  Result :=
end;

procedure TCLSIDProperty.SetValue(const Value: string);
begin
end; *)

procedure TCLSIDProperty.Edit;
begin
  with TCLSIDSelectForm.Create (Application) do
  try
    CLSID := GetValue;
    if ShowModal = mrOk then
      SetValue (CLSID)
  finally
    Free
  end
end;


//=== Register Component =======================================================

procedure Register;
begin
// COMPONENTS:
// -----------
// ole based dnd
  RegisterComponents ('OLE', [TDelphiDropTarget, TFormDropTarget, TControlDropTarget,
   TPictureDataSource, TStringDataSource, TComponentDataSource, TDelphiObjectDataSource,
   TURLDataSource, TControlDataSource,
   TStdDragSource, TControlDragSource, TOleRE]);
//non-ole based dnd
  RegisterComponents ('OLE', [TDnDRun, TDnDForm, TDnDControl]);
// automation client and server message filters
  RegisterComponents ('OLE', [TServerMsgFilter, TClientMsgFilter, TMsgFilter]);
// Container
  RegisterComponents ('OLE', [TOle2Container, TOle2ContainerDataSource]);

// ole ui dialog wrappers
  RegisterComponents ('OLE UI', [TOleBusyDialog, TOleBusyDialogEx, TOlePasteSpecialDialog,
    TOlePasteSpecialDialogEx, TOlePromptUserDialog, TOleChangeIconDialog,
    TOleInsertObjectDialog, TOleObjectPropsDialog, TOleEditLinksDialog,
    TOleUpdateLinksDialog, TOleConvertDialog, TOleChangeSourceDialog]);

// PROPERTY EDITORS:
// -----------------
// clipboard format names
  RegisterPropertyEditor (TypeInfo (TClipName), nil, '', TClipPropertyEditor);
  RegisterPropertyEditor (TypeInfo (TCLSIDStr), nil, '', TCLSIDProperty);

// COMPONENT EDITORS
//------------------
  RegisterComponentEditor (TOle2Container, TOleContainerEditor);

// OLE UI Dialogs
  RegisterComponentEditor (TOleBusyDialog, TOleBusyDialogEditor);
  RegisterComponentEditor (TOlePasteSpecialDialog, TOlePasteSpecialDialogEditor);
  RegisterComponentEditor (TOleChangeIconDialog, TOleChangeIconDialogEditor);
  RegisterComponentEditor (TOlePromptUserDialog, TOlePromptUserDialogEditor);
  RegisterComponentEditor (TOleInsertObjectDialog, TOleInsertObjectDialogEditor);
  RegisterComponentEditor (TOleObjectPropsDialog, TOlePropsDialogEditor);
  RegisterComponentEditor (TOleEditLinksDialog, TOleEditLinksDialogEditor);
  RegisterComponentEditor (TOleConvertDialog, TOleConvertDialogEditor);
  RegisterComponentEditor (TOleChangeSourceDialog, TOleChangeSourceDialogEditor)

// No component editor for:
//  TOleUpdateLinksDialog - trivial only has a caption property published
end;

end.

⌨️ 快捷键说明

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