Changeset 355 for Docking/CoolDocking/UCDManager.pas
- Timestamp:
- Apr 27, 2012, 8:34:10 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Docking/CoolDocking/UCDManager.pas
r354 r355 68 68 private 69 69 FControl: TWinControl; 70 function GetHideType: TCDHideType;71 70 procedure ResizeExecute(Sender: TObject); 72 procedure SetHideType(const AValue: TCDHideType);73 71 public 74 72 Manager: TCDManager; … … 81 79 constructor Create; virtual; 82 80 destructor Destroy; override; 83 property HideType: TCDHideType read GetHideType write SetHideType;84 81 property Control: TWinControl read FControl write SetControl; 85 82 end; … … 90 87 protected 91 88 FUpdateCount: Integer; 89 FDockStyle: TCDStyleType; 92 90 private 93 91 FDockSite: TWinControl; 92 FDockSiteVisible: Boolean; 94 93 FHeaderPos: THeaderPos; 95 94 FHeaderVisible: Boolean; 95 FOnDockSiteHide: TNotifyEvent; 96 FOnDockSiteShow: TNotifyEvent; 96 97 function GetDockSite: TWinControl; 97 98 function GetMoveDuration: Integer; 99 procedure SetDockSiteVisible(AValue: Boolean); virtual; 98 100 procedure SetDockStyle(const AValue: TCDStyleType); 99 101 procedure SetHeaderVisible(const AValue: Boolean); 100 102 procedure SetMoveDuration(const AValue: Integer); 103 procedure CloseHandler(Sender: TObject; var CloseAction: TCloseAction); 101 104 public 102 105 Locked: Boolean; 103 106 PopupMenu: TCDPopupMenu; 104 FDockStyle: TCDStyleType;105 107 FreeParentIfEmpty: Boolean; // Free or not parent conjoin forms 106 108 procedure SetVisible(const AValue: Boolean); virtual; … … 146 148 property HeaderVisible: Boolean read FHeaderVisible write SetHeaderVisible; 147 149 property Visible: Boolean write SetVisible; 150 property DockSiteVisible: Boolean read FDockSiteVisible write SetDockSiteVisible; 151 property OnDockSiteHide: TNotifyEvent read FOnDockSiteHide write FOnDockSiteHide; 152 property OnDockSiteShow: TNotifyEvent read FOnDockSiteShow write FOnDockSiteShow; 148 153 end; 149 154 … … 273 278 end; 274 279 275 function TCDManagerItem.GetHideType: TCDHideType;276 begin277 Result := TCDHideType(Control.Tag);278 end;279 280 280 procedure TCDManagerItem.ResizeExecute(Sender: TObject); 281 281 begin … … 296 296 end; 297 297 298 procedure TCDManagerItem.SetHideType(const AValue: TCDHideType);299 begin300 Control.Tag := Integer(AValue);301 end;302 303 298 procedure TCDManagerItem.DockPanelMouseDown(Sender: TObject; 304 299 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); … … 357 352 end; 358 353 354 procedure TCDManager.SetDockSiteVisible(AValue: Boolean); 355 begin 356 if FDockSiteVisible = AValue then Exit; 357 FDockSiteVisible := AValue; 358 SetVisible(FDockSiteVisible); 359 if Assigned(FOnDockSiteHide) and not AValue then 360 FOnDockSiteHide(Self); 361 if Assigned(FOnDockSiteShow) and AValue then 362 FOnDockSiteShow(Self); 363 end; 364 359 365 constructor TCDManager.Create(ADockSite: TWinControl); 360 366 var … … 372 378 PopupMenu := TCDPopupMenu.Create(Self); 373 379 PopupMenu.Parent := ADockSite; 380 if ADockSite is TForm then 381 TForm(ADockSite).AddHandlerClose(CloseHandler); 374 382 end; 375 383 376 384 destructor TCDManager.Destroy; 377 385 begin 386 if FDockSite is TForm then 387 TForm(FDockSite).RemoveHandlerClose(CloseHandler); 378 388 PopupMenu.Free; 379 389 inherited Destroy; … … 594 604 procedure TCDManager.SetMoveDuration(const AValue: Integer); 595 605 begin 606 end; 607 608 procedure TCDManager.CloseHandler(Sender: TObject; var CloseAction: TCloseAction 609 ); 610 begin 611 //DockSite.Visible := False; 612 //SetVisible(FDockSite.Visible); 596 613 end; 597 614
Note:
See TracChangeset
for help on using the changeset viewer.