[fpc-devel] [PATCH][LCL] Fix BitBtn Kind property with ShowModal

Tarnyko tarnyko at tarnyko.net
Sun Nov 12 06:53:02 CET 2017

Hi folks, 

Please find attached a patch which fixes the following issue : 

When we position the Kind property of a BitBtn, to "bkYes" e.g., and its 
parent Form is in a modal state ; clicking the button is normally supposed 
to close the Form and return the modal result value ("mrYes" e.g.). 

Here, it does not work because the ModalResult property is never positioned 
at design time by the SetKind() function. This patch fixes this by 
reorganizing function calls. 

To reproduce the issue, you can download the following test case [1]. 

Just extract it and compile it ; if you are on Windows, you can directly run 
"compile-delphi.bat" or "compile-lazarus.bat" (you may want edit this last 
script to change the %LAZPATH% variable). 

Notice that with Delphi, clicking on buttons gives feedback, whereas it does 
not with Lazarus until you apply the patch. 


[1] : http://www.tarnyko.net/repo/BitBtnKind_bug.zip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitbtn.inc-KindBug.patch
Type: text/x-diff
Size: 1742 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20171112/6ba7ab40/attachment.patch>

More information about the fpc-devel mailing list