Changeset 57 for Docking/CoolDocking/UCoolDocking.pas
- Timestamp:
- Sep 22, 2010, 9:21:42 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCoolDocking.pas
r56 r57 37 37 CloseButton: TSpeedButton; 38 38 Title: TLabel; 39 Icon: TI con;39 Icon: TImage; 40 40 ParentClientPanel: TCoolDockClientPanel; 41 41 Shape: TShape; … … 157 157 procedure SaveLayoutToFile(FileName: string); 158 158 procedure LoadLayoutFromFile(FileName: string); 159 destructor Destroy; override; 159 160 published 160 161 property TabsEnabled: Boolean read FTabsEnabled write SetTabsEnabled; … … 169 170 TCoolDockCustomize = class(TComponent) 170 171 private 171 FManager: TCoolDockMaster; 172 procedure SetManager(const AValue: TCoolDockMaster); 172 FMaster: TCoolDockMaster; 173 Form: TCoolDockCustomizeForm; 174 procedure SetMaster(const AValue: TCoolDockMaster); 173 175 public 174 Form: TCoolDockCustomizeForm;175 176 function Execute: Boolean; 176 177 constructor Create(AOwner: TComponent); override; 178 destructor Destroy; override; 177 179 published 178 property Ma nager: TCoolDockMaster read FManager write SetManager;180 property Master: TCoolDockMaster read FMaster write SetMaster; 179 181 end; 180 182 … … 183 185 TCoolDockWindowList = class(TComponent) 184 186 private 187 Form: TCoolDockWindowListForm; 185 188 public 186 Form: TCoolDockWindowListForm;187 189 function Execute: Boolean; 188 190 constructor Create(AOwner: TComponent); override; … … 469 471 Header.PopupMenu := PopupMenuHeader; 470 472 end; 473 if (Control is TForm) and Assigned((Control as TForm).Icon) then 474 NewPanel.Header.Icon.Picture.Assign((Control as TForm).Icon); 471 475 472 476 if DockStyle = dsTabs then begin … … 708 712 for I := 0 to FDockPanels.Count - 1 do begin 709 713 TCoolDockClientPanel(FDockPanels[I]).Height := FDockSite.Height div 710 FDockSite. VisibleDockClientCount;714 FDockSite.DockClientCount; 711 715 TCoolDockClientPanel(FDockPanels[I]).Width := FDockSite.Width div 712 FDockSite. VisibleDockClientCount;716 FDockSite.DockClientCount; 713 717 //TCoolDockClientPanel(FDockPanels[I]).DockPanelPaint(Self); 718 TCoolDockClientPanel(FDockPanels[I]).DockPanelPaint(Self); 714 719 end; 715 720 end else … … 841 846 procedure TCoolDockClientPanel.VisibleChange(Sender: TObject); 842 847 begin 843 //OwnerDockManager.FDockPanels.Remove(Self); 844 ClientAreaPanel.Visible := Control.Visible; 845 Splitter.Visible := Control.Visible; 846 OwnerDockManager.UpdateClientSize; 848 (* if Assigned(Control) then begin 849 //OwnerDockManager.FDockPanels.Remove(Self); 850 if Assigned(ClientAreaPanel) then 851 ClientAreaPanel.Visible := Control.Visible; 852 if Assigned(Splitter) then 853 Splitter.Visible := Control.Visible; 854 OwnerDockManager.UpdateClientSize; 855 end;*) 847 856 end; 848 857 … … 968 977 procedure TCoolDockMaster.SetCustomize(const AValue: TCoolDockCustomize 969 978 ); 970 begin 971 if FCoolDockCustomize=AValue then exit; 972 FCoolDockCustomize:=AValue; 973 if Assigned(AValue) then 974 if not Assigned(AValue.Manager) then 975 AValue.Manager := Self; 979 var 980 OldCustomize: TCoolDockCustomize; 981 begin 982 if FCoolDockCustomize = AValue then Exit; 983 OldCustomize := FCoolDockCustomize; 984 FCoolDockCustomize := AValue; 985 if Assigned(AValue) then begin 986 FCoolDockCustomize.Master := Self; 987 end else begin 988 OldCustomize.Master := nil; 989 end; 976 990 end; 977 991 … … 1077 1091 Free; 1078 1092 end; 1093 end; 1094 1095 destructor TCoolDockMaster.Destroy; 1096 begin 1097 Customize := nil; 1098 inherited Destroy; 1079 1099 end; 1080 1100 … … 1116 1136 BevelOuter := bvNone; 1117 1137 end; 1138 Icon := TImage.Create(Self); 1139 with Icon do begin 1140 Parent := Self; 1141 Left := 4; 1142 Top := 3; 1143 Visible := True; 1144 end; 1118 1145 end; 1119 1146 … … 1134 1161 else Title.Font.Style := Font.Style - [fsBold]; 1135 1162 Rectangle(1, 1, AControl.Width - 1, GrabberSize - 1); 1163 if Icon.Picture.Width > 0 then Title.Left := 8 + Icon.Picture.Width 1164 else Title.Left := 6; 1136 1165 Title.Caption := AControl.Caption; 1137 1166 end; … … 1145 1174 { TCoolDockCustomize } 1146 1175 1147 procedure TCoolDockCustomize.SetManager(const AValue: TCoolDockMaster); 1148 begin 1149 if FManager = AValue then exit; 1150 FManager := AValue; 1151 if Assigned(AValue) then 1152 if not Assigned(AValue.Customize) then 1153 AValue.Customize := Self; 1176 procedure TCoolDockCustomize.SetMaster(const AValue: TCoolDockMaster); 1177 var 1178 OldMaster: TCoolDockMaster; 1179 begin 1180 if FMaster = AValue then Exit; 1181 OldMaster := FMaster; 1182 FMaster := AValue; 1183 if Assigned(AValue) then begin 1184 FMaster.Customize := Self; 1185 end else begin 1186 OldMaster.Customize := nil; 1187 end; 1154 1188 end; 1155 1189 1156 1190 function TCoolDockCustomize.Execute: Boolean; 1157 1191 begin 1192 Form := TCoolDockCustomizeForm.Create(Self); 1158 1193 Form.ShowModal; 1194 Form.Free; 1159 1195 Result := True; 1160 1196 end; … … 1163 1199 begin 1164 1200 inherited Create(AOwner); 1165 Form := TCoolDockCustomizeForm.Create(Self); 1201 end; 1202 1203 destructor TCoolDockCustomize.Destroy; 1204 begin 1205 Master := nil; 1206 inherited Destroy; 1166 1207 end; 1167 1208 … … 1171 1212 function TCoolDockWindowList.Execute: Boolean; 1172 1213 begin 1214 Form := TCoolDockWindowListForm.Create(Self); 1173 1215 Form.ShowModal; 1216 Form.Free; 1174 1217 Result := True; 1175 1218 end; … … 1178 1221 begin 1179 1222 inherited Create(AOwner); 1180 Form := TCoolDockWindowListForm.Create(Self);1181 1223 end; 1182 1224
Note:
See TracChangeset
for help on using the changeset viewer.