Ignore:
Timestamp:
Sep 16, 2010, 2:15:02 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Částečná implementace umělého ukotvovacího okna.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DockManager/Lazarus/Demo/UMainForm.pas

    r43 r44  
    1919    procedure FormCreate(Sender: TObject);
    2020    procedure FormShow(Sender: TObject);
    21     procedure ListView1EndDrag(Sender, Target: TObject; X, Y: Integer);
    22     procedure ListView1StartDrag(Sender: TObject; var DragObject: TDragObject);
    23     procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
    24       Shift: TShiftState; X, Y: Integer);
    2521  private
    2622    { private declarations }
     
    2824    FormIndex: Integer;
    2925    LastDockForm: TDockForm;
     26    function NewDockForm: TDockForm;
    3027  end;
    3128
     
    4946  DockForm3: TDockForm;
    5047begin
    51   Button1Click(Self);
    52   DockForm1 := LastDockForm;
     48  DockForm1 := NewDockForm;
    5349  DockForm1.ManualDock(Panel1);
    5450
    55   Button1Click(Self);
    56   DockForm2 := LastDockForm;
     51  DockForm2 := NewDockForm;
    5752  DockForm2.ManualDock(Panel1);
    5853
    59   Button1Click(Self);
    60   DockForm3 := LastDockForm;
     54  DockForm3 := NewDockForm;
    6155  DockForm3.ManualDock(DockForm2);
    6256end;
    6357
    64 procedure TMainForm.ListView1EndDrag(Sender, Target: TObject; X, Y: Integer);
     58function TMainForm.NewDockForm: TDockForm;
    6559begin
    66 
    67 end;
    68 
    69 procedure TMainForm.ListView1StartDrag(Sender: TObject;
    70   var DragObject: TDragObject);
    71 begin
    72 
    73 end;
    74 
    75 procedure TMainForm.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
    76   Shift: TShiftState; X, Y: Integer);
    77 begin
    78 
     60  Result := TDockForm.Create(Self);
     61  Result.Name := 'Form' + IntToStr(FormIndex);
     62  Result.Memo1.Text := Result.Name;
     63  Result.DragKind := dkDock;
     64  Result.DragMode := dmAutomatic;
     65  Result.DockSite := True;
     66  Result.UseDockManager := True;
     67  Inc(FormIndex);
     68  Result.Show;
    7969end;
    8070
    8171procedure TMainForm.Button1Click(Sender: TObject);
    82 var
    83   NewForm: TDockForm;
    8472begin
    85   NewForm := TDockForm.Create(Self);
    86   NewForm.Name := 'Form' + IntToStr(FormIndex);
    87   NewForm.Memo1.Text := NewForm.Name;
    88   NewForm.DragKind := dkDock;
    89   NewForm.DragMode := dmAutomatic;
    90   NewForm.DockSite := True;
    91   NewForm.UseDockManager := True;
    92   Inc(FormIndex);
    93   NewForm.Show;
    94   LastDockForm := NewForm;
     73  NewDockForm;
    9574end;
    9675
Note: See TracChangeset for help on using the changeset viewer.