Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-02

revision 51597 attn Ondrej

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

In that revision you added RecreateWnd() for modal forms. Why ? Now in console we have warnings about it... IMO:
1.it's wrong to call RecreateWnd() if handle isn't allocated yet 2.HandleNeeded isn't really needed after RecreateWnd()

So, because of warnings, something is wrong with that revision.

zeljko

Reply by email

zeljko
to zeljko
zeljko wrote
In that revision you added RecreateWnd() for modal forms. Why ? Now in console we have warnings about it... IMO: 1.it's wrong to call RecreateWnd() if handle isn't allocated yet

There shuold be added if (popupMode = pmNone) and HandleAllocated, otherwise call just needed routines from RecreateWnd() like UpdateControlState

2.HandleNeeded isn't really needed after RecreateWnd()

Forget about this one, I was wrong here.

z

Reply by email

Ondrej Pokorny
to zeljko
zeljko wrote 8 lines
On 02/14/2016 03:01 PM, zeljko wrote: > In that revision you added RecreateWnd() for modal forms. Why ? Now in > console we have warnings about it... IMO: > 1.it's wrong to call RecreateWnd() if handle isn't allocated yet There shuold be added if (popupMode = pmNone) and HandleAllocated, otherwise call just needed routines from RecreateWnd() like UpdateControlState

Yes, you are right. Thanks for reporting!

RecreateWnd is needed because TCustomForm.GetRealPopupParent result changes for PopupMode=pmNode after change from non-modal to modal window (fsModal in FormState).

Fixed in r51631, I also tested it without HandleNeeded, it seems to work well, no problem that the handle is allocated on-demand. So I removed it. If there'll be any problems, we can remember to write HandleNeeded back.

Ondrej

Reply by email