Sample Application: urltest.dpr

Project source
Form source (Pascal)
Form source (DFM)

Design-time form image
Project source: urltest.dpr

program urltest;

{Main program file for test application for the UnitOOPS OLE
 Drag and Drop Components}
uses
  Forms,
  fmLinkList in 'fmLinkList.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
Back to top
Form source: fmLinkList.pas

unit fmLinkList;

{ UnitOOPS OLE Drag and Drop Components - Example
 form for URL link demonstration, demonstrating how to accept URLs
 dropped from a browser.

 Last modified:  08/26/98}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  uoole, ComCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    ListView1: TListView;
    UOTextTarget1: TUOTextTarget;
    procedure UOTextTarget1Drop(Sender: TObject; Acceptor: TWinControl;
      const dropText: String; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.UOTextTarget1Drop(Sender: TObject; Acceptor: TWinControl;
  const dropText: String; X, Y: Integer);
begin
  with ListView1.Items.Add do
  begin
    Caption := (Sender as TUOTextTarget).URLTitle;
    SubItems.Add(dropText);
  end;    // with
end;

end.
Back to top
Form source: fmLinkList.dfm

object Form1: TForm1
  Left = 192
  Top = 103
  Width = 468
  Height = 269
  Caption = 'Drag a link from Netscape or Internet Explorer onto this window'
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 460
    Height = 242
    Align = alClient
    BevelOuter = bvNone
    BorderWidth = 3
    Caption = 'Panel1'
    TabOrder = 0
    object ListView1: TListView
      Left = 3
      Top = 3
      Width = 454
      Height = 236
      Align = alClient
      ColumnClick = False
      Columns = <
        item
          Caption = 'URL Title'
          Width = 200
        end
        item
          Caption = 'URL'
          Width = 250
        end>
      TabOrder = 0
      ViewStyle = vsReport
    end
  end
  object UOTextTarget1: TUOTextTarget
    AcceptorControl = ListView1
    AcceptTextFormats = [dtfURL]
    OnDrop = UOTextTarget1Drop
    Left = 72
    Top = 104
  end
end
Back to top

Back to the examples page