dotgnu-pnet
[Top][All Lists]
Advanced

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

[Pnet-developers] [patch #3630] Fix some problems in TextBox


From: Marc Haisenko
Subject: [Pnet-developers] [patch #3630] Fix some problems in TextBox
Date: Mon, 10 Jan 2005 15:00:37 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko)

This is an automated notification sent by Savannah.
It relates to:
                patch #3630, project DotGNU Portable.NET

==============================================================================
 OVERVIEW of patch #3630:
==============================================================================

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

                 Summary: Fix some problems in TextBox
                 Project: DotGNU Portable.NET
            Submitted by: darkdust
            Submitted on: Mon 01/10/2005 at 15:00
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________


This patch fixes three problems with TextBox.cs: it fixes bug #11553 (TextBox
doesn't correctly handle scrollbars), it fixes relayouting on resize and fixes
the size calculation in LayoutFromText (discussed below).



I'll discuss every method of TextBox.cs that this patch touches and explain
what I changed and why.



=====

On the class-level itself, two private variables bool showVScrollBar and
showHScrollBar have been added. They are used to work around the problem that
ScrollBar.Visible is reporting false although it has been set to true when the
parent is not visible (see report for bug #11553).



=====

SetupScrollBars:



The return value has been changed from void to bool. This method now returns
whether the caller should call SetScrollBarPositions as well. This is
necessary to fix the size calculation in LayoutFromText (see discussion of
that method).



The calls to SetScrollBarPositions have been removed because it's unnecessary
to call that method twice (happened when both scrollbars where enabled) and
SetScrollBarPositions calls MaxTextDimensions which will often not be able to
return the correct size at this point. Instead a variable "callPositions" gets
set which is the value for this method to return, which means "call
SetScrollBarPositions when we know the values will be correct"



Before returning we call "SetScrollBarVisibility", a new method that has been
split off of SetScrollBarPositions. It sets the show{H,V}ScrollBar variables
and {h,v}ScrollBar.Visible properties.



=====

SetScrollBarPositions:



This method has been split into two parts: the code that has set the
visibility of the scrollbars has been refactored and is now in
SetScrollBarVisibility.



The scrollbar size calculations has been refactored, it has been optimized
(and I think it's way more readable now).



=====

SetScrollBarVisibility:



New method, sets whether the scrollbars are visible (sets show{H,V}ScrollBar
variables and {h,v}ScrollBar.Visible properties).



=====

MaxTextDimensions:



Now uses show{H,V}ScrollBar variables instead of {h,v}ScrollBar.Visible
properties. The reason was already explained, the properties where reporting
wrong values when the TextBox parent wasn't visible (well, wrong is not
correct here; "unexpected" would be more accurate).



=====

LayoutFromText:



A new bool variable "callSetScrollBarPositions" has been introduced to
remember the return value of SetupScrollBars and call SetScrollBarPositions
at the end of LayoutFromText if needed.



SetupScrollBars is now called very early so that TextDrawArea works
correctly. It has been called at the end of the method but TextDrawArea
depends on the correct informations about the scrollbar visibilities !



=====

SetBoundsCore:



If the size has changed we need to set "layout = null" so that LayoutFromText
really does a re-layouting. This fixes the bug that no relayouting occurred on
a size change.



=====

TextDrawArea:



Replaced {h,v}ScrollBar.Visible with show{h,v}ScrollBar.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 01/10/2005 at 15:00  Name: TextBox.cs.patch  Size: 6.25KB   By:
darkdust
Fix for bug #11553 and two other problems with TextBox.cs
<http://savannah.gnu.org/patch/download.php?item_id=3630&item_file_id=4020>

==============================================================================

This item URL is:
  <http://savannah.gnu.org/patch/?func=detailitem&item_id=3630>

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



reply via email to

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