[Lazarus] TForm BorderIcons

Roberto P. padovani.r at gmail.com
Fri Sep 7 12:09:08 CEST 2012

2012/9/6 Martin <lazarus at mfriebe.de>

>  On 06/09/2012 20:21, Roberto P. wrote:
> 2012/9/6 Mattias Gaertner <nc-gaertnma at netcologne.de>
>>  On Thu, 6 Sep 2012 16:15:03 +0200
>> "Roberto P." <padovani.r at gmail.com> wrote:
>> > I can see the option biHelp among the other TForm.BorderIcons
>> properties.
>> > What shall I do to have the form display the "?" button? It seems that
>> > setting the property to true is not enough.
>>  AFAIK only MS Windows supports that.
>  Well, I am working on Win XP.
> Fresh install of Lazarus 1.0 prepackaged installer + some extra components
> from the CCR.
> Tested on Vista
> It seems exlusive to the min/max buttons. If both of them are off, then
> the "?" will show
> biSystemMenu must be set, or nothing will show
I made a little test application (see attachment) to try the various
combinations of border icons and border style.
After confirming that the context help icon is exclusive with the max/min
ones, and all of them require the system one, I checked the reason why it
is so: in Win32WSForms.pp, starting from the line 463, the handler
explicitely masks that combination.

Why is it so? The reason might be that this is the way the MSDN describe
the usage of the extended window styles:
which by design makes the context help mutually exclusive with the max/min.

I tried to force it, violating that rule above and calling with all the
flags, but it is probably masked inside the Win32 window manager as well.
I think we can't change that...

BUT, I discovered something strange: if you change programmatically the
border icons the title bar is not update graphically.
If you disable the minimized button, it is still displayed as active, but
it's actually disabled.
If you force a refresh (Form.Minimize; Form.Maximize) than it gets update.

On the other side, if you change the borer style, the window is update
Maybe the difference is that in:

      class procedure TWin32WSCustomForm.SetBorderIcons(..);

the function Windows.RedrawWindow(...) is called, while in

      class procedure TWin32WSCustomForm.SetFormBorderStyle(...);

the function RecreateWnd(AForm) is called.
I think that also the border icons should deserve a true update.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120907/624b8d7d/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bordericonstest.zip
Type: application/zip
Size: 2695 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120907/624b8d7d/attachment-0003.zip>

More information about the Lazarus mailing list