Changeset 57 for Docking/CoolDocking/UCoolDockWindowList.pas
- Timestamp:
- Sep 22, 2010, 9:21:42 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDockWindowList.pas
r56 r57 7 7 uses 8 8 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 9 ComCtrls, StdCtrls ;9 ComCtrls, StdCtrls, Menus; 10 10 11 11 type … … 27 27 public 28 28 procedure LoadList; 29 procedure LoadToMenuItem(MenuItem: TMenuItem); 29 30 end; 30 31 … … 75 76 Form: TForm; 76 77 DockState: string; 78 IconBitmap: TBitmap; 79 Mask: TBitmap; 77 80 begin 78 81 with ListView1, Items do begin … … 81 84 ImageList1.Clear; 82 85 for I := 0 to Application.ComponentCount - 1 do begin 83 if Application.Components[I] is TFormthen begin86 if (Application.Components[I] is TForm) then begin 84 87 Form := (Application.Components[I] as TForm); 85 NewItem := Add; 86 NewItem.Caption := Form.Caption; 87 NewItem.Data := Form; 88 if Assigned(Form.HostDockSite) then DockState := SStateDocked 89 else DockState := SStateFloating; 90 NewItem.SubItems.Add(DockState); 91 if Form.Visible then DockState := SStateVisible 92 else DockState := SStateHidden; 93 NewItem.SubItems.Add(DockState); 94 ImageList1.AddIcon(Form.Icon); 88 if Form.DragKind = dkDock then begin 89 NewItem := Add; 90 NewItem.Caption := Form.Caption; 91 NewItem.Data := Form; 92 if Assigned(Form.HostDockSite) then DockState := SStateDocked 93 else DockState := SStateFloating; 94 NewItem.SubItems.Add(DockState); 95 if Form.Visible then DockState := SStateVisible 96 else DockState := SStateHidden; 97 NewItem.SubItems.Add(DockState); 98 99 try 100 Mask := TBitmap.Create; 101 IconBitmap := TBitmap.Create; 102 //IconBitmap.SetSize(Form.Icon.Width, Form.Icon.Height); 103 //ShowMessage(IntToStr(Integer(Form.Icon.TransparentColor))); 104 IconBitmap.Assign(Form.Icon); 105 //IconBitmap.Canvas.Draw(0, 0, Form.Icon); 106 107 Mask.Assign(Form.Icon); 108 Mask.Canvas.Brush.Color := Form.Icon.TransparentColor; 109 Mask.Monochrome := True; 110 ImageList1.BkColor := clBlack; 111 ImageList1.Add(IconBitmap, Mask); 112 finally 113 Mask.Free; 114 IconBitmap.Free; 115 end; 116 117 NewItem.ImageIndex := ImageList1.Count - 1; 118 end; 95 119 end; 96 120 end; 97 121 EndUpdate; 122 end; 123 end; 124 125 procedure TCoolDockWindowListForm.LoadToMenuItem(MenuItem: TMenuItem); 126 var 127 NewMenuItem: TMenuItem; 128 I: Integer; 129 Form: TForm; 130 begin 131 with MenuItem do begin 132 Clear; 133 for I := 0 to Application.ComponentCount - 1 do begin 134 if Application.Components[I] is TForm then begin 135 Form := (Application.Components[I] as TForm); 136 NewMenuItem := TMenuItem.Create(MenuItem); 137 NewMenuItem.Caption := Form.Caption; 138 MenuItem.Add(NewMenuItem); 139 end; 140 end; 98 141 end; 99 142 end;
Note:
See TracChangeset
for help on using the changeset viewer.