dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [patch #3714] Fix layouting bug in Control.cs


From: Marc Haisenko
Subject: [Pnet-developers] [patch #3714] Fix layouting bug in Control.cs
Date: Wed, 2 Feb 2005 12:53:38 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko)

URL:
  <http://savannah.gnu.org/patch/?func=detailitem&item_id=3714>

                 Summary: Fix layouting bug in Control.cs
                 Project: DotGNU Portable.NET
            Submitted by: darkdust
            Submitted on: Wed 02/02/2005 at 12:53
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________

Details:

The layouting (namely the anchor layouting) code in Control.cs needs to know
the last size of the parent when layouting the children.

This information was stored in the children in prevParentWidth and
prevParentHeight. This could cause a bug in which the anchoring layouting was
done wrong and the child got a wrong size. Unfortunately I haven't been able
to write a sample application that demonstrates this bug, but it appeared in
the Trumpf prototype.

The following patch fixes this issue by doing the bookkeeping in the parent,
not the children (this means the old size is stored only once, in the parent,
instead of several times, in the children). The prevParentWidth and
prevParentHeight members are deleted, instead prev{Left,Top,Width,Height} are
introduced which are updated by the UpdateBounds method.

This is similar to the way Mono does it.

Furthermore this patch also does a little refactoring/optimization of the
PerformActualLayout method: currently it iterates over all children two
times, the first time to do the dock layouting and a second time to do the
anchor layouting. This is unneccessary, the patch changes this so only one
iteration takes place.

The patch also moves the anchor layouting code in a separate method
PerformAnchorLayout, which should improve maintainability.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 02/02/2005 at 12:53  Name: Control.cs.patch  Size: 7.54KB   By:
darkdust
Fixes layouting bug and does minor refactoring
<http://savannah.gnu.org/patch/download.php?item_id=3714&item_file_id=4134>

    _______________________________________________________

This item URL is:

  <http://savannah.gnu.org/patch/?func=detailitem&item_id=3714>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]