[Lazarus] TSplitter

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Aug 21 14:31:29 CEST 2010


On Sat, 21 Aug 2010 13:29:02 +0200
Bernd Kreuss <prof7bit at googlemail.com> wrote:

> On 21.08.2010 04:00, Paul Ishenin wrote:
> > 1. set Align := alLeft for the first control,
> > 2. set Align := alLeft for the splitter and move it after the first control
> > 3. set Align := alClient for the second control
> 
> 
> Two questions:
> 
> a) How can I then make the splitter always be in a fixed relative
> position to the window width? If I have dragged it to say 2/3 of the
> size from the left and then resize the window I want it to stay at 2/3
> of the new size and not at the same fixed pixel distance from the left
> that it had before resizing?

There is no such option. You have to do that yourself. See
anchordocking for an example.

 
> b) Why does the following work and are there any objections against
> making the following the recommended procedure:
> 
>   1. Set Align of the splitter to alNone (should be default)
>   2. Anchor the splitter only on top and bottom and move it freely
>   2. Anchor the two controls at the splitter

TSplitter can also work with anchors. Delphi's VCL does not have this
feature.

 
> I have never used Delphi and I find steps b.2 and b.3 a hundred times
> more intuitive, the only problem is step b.1 which is not obvious.

Several controls set the Align property by default. For example
TStatusBar, TSplitter, TButtonPanel, TPage.
TSplitter uses alLeft by default for Delphi compatibility.

 
> Intuitively[1] the user tries to position the Splitter like any other
> control and use the anchor editor like with any other control. The funny
> thing is that it even seems to be able to work exactly the way I
> intuitively tried to do it (after finding out how to unblock the anchor
> editor). Is this only a coincidence? I tested on GTK and Windows and it
> works like a charm.

Maybe you just didn't know the Align property.

 
> IMHO the default should be alNone so the Splitter can be immediately
> used like described above or the anchor editor should *tell* the user
> why it refuses to change the anchoring, either a message box should pop
> up telling the user exactly why a certain anchor side is blocked when he
> tries to uncheck the check box or it should be grayed out and a hint or
> a label should tell the reason.

Many people find Align more intuitive than Anchors. Especially those
coming from Delphi or other frameworks.


> ______
> [1] I am writing this from the perspective of somebody who's intuition
> is not contaminated by decades of Delphi usage. As long as I have not
> become too used to some of the few counterintuitive oddities to complain
> about them I will complain. You could utilize me as a living detector
> for these hidden pitfalls. The form editor is already really great and
> intuitive and almost works like one would expect it, the above problem
> is one of the few exceptions where usability suddenly drops to zero (or
> even below) and the user has a really bad experience.


Mattias




More information about the Lazarus mailing list