Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Docking    [ Add a report in this area ]  
Report #:  28871   Status: Open
dock preview different to actual dock location
Project:  Delphi Build #:  10.0.2288.4245
Version:    10.0 Submitted By:   grant allan
Report Type:  Minor failure / Design problem Date Reported:  5/8/2006 7:43:43 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   240261
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
4.50 out of 5
Total Votes: 6
Description
in the IDE, the preview rectangle for incoming windows shows a different location from the rectangle that the dock client actually ends up at.

same with the VCL docking.
Steps to Reproduce:
float an IDE dockable window, and dock a second one inside it.  resize them so the left client (A) is twice the width of the right client (B).
  AAAABB

now drag a new dock client over the right-hand half of client B.  the preview rectangle shows this:
  AAAABC

release the dock client, and the result is quite different:
  AABBCC

same problem with VCL docking (eg. docking demo project).  it is more serious with VCL because we don't want our work to look sloppy to our users.
Workarounds
at the bottom of TDockTree.InsertSibling, i replaced:

     // Set up zone limits for all siblings
    SiblingZone.FParentZone.ResetChildren;
    SiblingZone.FParentZone.ResetZoneLimits;

with:

  if SiblingZone.ZoneLimit = 0 then            
    begin
    // Limits are not set up for this zone yet, so...
    // Set up zone limits for all siblings
    SiblingZone.FParentZone.ResetChildren;
    SiblingZone.FParentZone.ResetZoneLimits;
    end
  else if InsertLast then
    DivideIntoHalves(SiblingZone, SiblingZone)  
  else
    DivideIntoHalves(SiblingZone, NewZone);    


where the procedure DivideIntoHalves is defined as:

  procedure TDockTree.DivideIntoHalves(const originalZone, firstZoneAfterDividing: TDockZone);
    var
        fullLimit: integer;
        halfLimit: integer;

    begin
    fullLimit := originalZone.ZoneLimit;
    halfLimit := (firstZoneAfterDividing.LimitBegin + fullLimit) div 2;

    firstZoneAfterDividing.ZoneLimit := halfLimit;
    firstZoneAfterDividing.Update;
    firstZoneAfterDividing.FNextSibling.ZoneLimit := fullLimit;
    firstZoneAfterDividing.FNextSibling.Update;
    end;
Attachment
None
Comments

Roddy Pratt at 5/9/2006 1:53:56 AM -
Reproducible.

When you dock N windows in a row either horizontally or vertically, each window gets resized to occupy 1/Nth of the space, so all windows have equal size - 1/3rd, 1/3rd, 1/3rd, in your example.

Docking the Nth pane should reduce the size of the window you're docking into by 50%, and leave other pane sizes - and positions - untouched.

However, I suspect it's "as designed"...

grant allan at 5/9/2006 5:51:17 PM -
yes, maybe the 1/N, 1/N, 1/N arrangement after docking is intentional.

it's nonetheless a bug that the preview advertises something else.
the problem is that the preview rectangle says to the user "it will look like this", but then it doesn't.



Server Response from: ETNACODE01