Sign in Join

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

Mailing lists / lazarus / 2020-11

Cannot close Windows 10 application with a bkClose TBitBtn button...

10 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

Lazarus 2.0.10 FPC 3.2.0 on Windows 10

I create a new application and place a TBitBtn on a panel at the bottom of the main form. I set the Kind property to bkClose.

Now I expect the application to close when I click this button, like it does on Delphi for the same type of button.

But when I run this test application it does not react to the click on this button at all!
The only way to close the program is to click the X at the upper right corner of the application window.

I even tried adding this to the OnClick event:

Close; //Does not work.
frmMain.Close;  //Does not work either

If I put a breakpoint at the OnClick event it does not even get there when debugging...

What have I missed?

I am testing methods to use transparent (see-through) forms and this test is done using code from this webpage:
http://lazplanet.blogspot.com/2013/04/make-your-forms-transparent.html

My form is made transparent via the background color but on it there is a non-transparent panel at the bottom (it does not inherit the parent color) and this is where the button is placed. Does the form's transparency block mouse clicks from non-transparent components placed on the form?

Bo Berglund Developer in Sweden

Reply by email

Bart
to Bo Berglund
AM Bo Berglund wrote 5 lines
I create a new application and place a TBitBtn on a panel at the bottom of the main form. I set the Kind property to bkClose. Now I expect the application to close when I click this button, like it does on Delphi for the same type of button.

IIRC then having a button with a ModalResult on the application's main form in Delphi does not close that form.
In Lazarus it did in the past, but this was changed (long time ago), to be consistent with Delphi behaviour.

Bart

Reply by email

Bo Berglund
to Bart
Bart wrote 14 lines
On Mon, Nov 16, 2020 at 11:43 AM Bo Berglund via lazarus wrote: > I create a new application and place a TBitBtn on a panel at the > bottom of the main form. I set the Kind property to bkClose. > > Now I expect the application to close when I click this button, like > it does on Delphi for the same type of button. IIRC then having a button with a ModalResult on the application's main form in Delphi does not close that form. In Lazarus it did in the past, but this was changed (long time ago), to be consistent with Delphi behaviour.

But...
If I place for instance a ShowMessage() call in the OnClick event of the button it DOES NOT show up!
And if I place a breakpoint there it too does not break.

So somehow this business of setting the form transparent robs it of any mouse event too...
Even if the control clicked on is in fact not transparent.

Bo Berglund Developer in Sweden

Reply by email

Bart
to Bo Berglund
PM Bo Berglund wrote 8 lines
But... If I place for instance a ShowMessage() call in the OnClick event of the button it DOES NOT show up! And if I place a breakpoint there it too does not break. So somehow this business of setting the form transparent robs it of any mouse event too... Even if the control clicked on is in fact not transparent.

Sorry, can't help you with that.

Bart

Reply by email

Bart
to Bart: On Mon, Nov 16, 2020 at 11:43 AM Bo Berglund via lazarus IIRC then having a button with a…
PM Bart wrote
IIRC then having a button with a ModalResult on the application's main form in Delphi does not close that form.

I just tested (Delphi and Lazarus): a TBitButton with Lind = bkClose on the MainForm indeed closes the application.
Furthermore, the OnClick event handler is NOT executed in this case. This is Delphi compatible (at least compatible with Delphi 7)

Bart

Reply by email

Bart
to Bart

On Mon, Nov 16, 2020 at 6:21 PM Bart wrote:

Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of the form.
Without actual code (also the lfm) it's hard to test.

Bart

Reply by email

Bo Berglund
to Bart
Bart wrote 6 lines
On Mon, Nov 16, 2020 at 6:21 PM Bart wrote: Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of the form. Without actual code (also the lfm) it's hard to test.

Attaching a zip with the test code.

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bart: Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of…

begin 644 TestTransparency.zip
(`/::<%&H)6P2FP(``!P(```4````5&5S=%1R86YS<&%R96YC
M>2YL<&FM54UOVD`0O5?J?["L',(AF(]+#YM&Q$"$E`04(.TAE\4,L,UZU]U= MM^'?=Q;\L3:82E4/ENS9F?=FWLRLR=U'S+U?H#23XM;OMCN^!R*2:R:VM_YR M,;[YXM]]_?R)A-/G\>0!WSR/S)3\`9&9)@:#],&&UM<CB/=*>0H(U?6#_&A& MS6X(G,"%.79)QKFH"W.W$A%MY!'3$3&.F2J"$;O)\K$4C"3^W7< ,(2]Z[C/*(<UH6G2L$]?0$M4Q7!8I\4:`JTZ[+4\'WV
M1`7;($L33NE1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$1GO<
MMQ.8W>U(X;T61ISB-E9[./W)">DEUW)NVD
M:V_,6#)+J+')+9&*12CY at C"4V3H["'V$+V4Y6R2EV$9"4S:VD"MCC]0+XX`G M/8"#![NE5:+>@#L"WSDW-MPT%I8\^LU(YG-33@>7^GK_73&:EQ.80?`/K8>[ M[2LNT:/E<#^Z_0ZT)L#GR`C6;5NM<8&C<'`Y5E4X(=0,V:<?B\CNF6,M-# M`WM at G1E9,[7"P.Z]I<"`EI^%U#<F8YZ>ET)*.MIV()<K\$7$PI`S`V(&,\GF M=E,`*:;G.F1)G8+43:Q)<TII3TK7-JQL0`ZG?]ORC%_^9`K3MFXWLK<ZUMPU M(6Z6K<7:N;;U(#RVJWWG-EIH!LJ'_LP1=N7#E'FO<Z-C'T2"S73UXQ>_-P`7 M=CE6:]UN,WW><F0Q/R*FO06!R?W^RH9!EW:?AD[3?=NV7H+I;NR.U^OR% M;PHRHGUTSZ.(S7GALL^EU##11OIG&Y at HE\N7N_[H7[;_?P!02P$"%``4``(` M"`#VFG!1J"5L$IL"```<"```%``D```````!`"``````````5&5S=%1R86YS M<&%R96YC>2YL<&D*`"````````$`&`"0QZ.=1;S6`9#'HYU%O-8!D&Q^\?Z[ "%``4``(`"`!*5W!1Y,#'_@@!``"H`0``%``D```````!`"````#- <&%R96YC>2YL<'(*`"````````$`&`!P!X0"_[O6`7`'
MA`+_N]8!<("%``4``(`"`#VFG!1KG?LW6,!```.`P``#``D
M```````!`"`````'!```9F]R;6UA:6XN;&9M"@@`8*6JG46\
@I:J=1;S6`;#,2_G^N]8!4$L!`A0`%``" at D`
M``P`)<FUM86EN+G!A<PH`(````````0`8`*!?
LIIU%O-8!H%^FG46\U@'0*"#Y_KO6`5!+!08`````!``$`(@!``"A"0````!? `
end

Reply by email

Bo Berglund
to Bart: Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of…

For some reason my news reader would not transfer the zipped archive with the sources. So here goes another attempt using my email instead. Attached is the zipped project.

/Bo B

Earlier message 22 lines
-----Original Message----- From: Bart Sent: Monday, 16 November 2020 18:31 To: ; Lazarus mailing list Subject: Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button... On Mon, Nov 16, 2020 at 6:21 PM Bart wrote: Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of the form. Without actual code (also the lfm) it's hard to test. -- Bart -------------- next part -------------- A non-text attachment was scrubbed... Name: TestTransparency.zip Type: application/x-zip-compressed Size: 2879 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201116/4c81c57b/attachment-0001.bin>

Reply by email

Balázs Székely
to Bo Berglund

Hi Bo,

Please check the following forum post:
https://forum.lazarus.freepascal.org/index.php/topic,52155.msg383939.html#msg383939

On Mon, Nov 16, 2020 at 8:30 PM Bo Berglund via lazarus <

Show quoted text 32 lines
wrote: For some reason my news reader would not transfer the zipped archive with the sources. So here goes another attempt using my email instead. Attached is the zipped project. /Bo B -----Original Message----- From: Bart Sent: Monday, 16 November 2020 18:31 To: ; Lazarus mailing list < > Subject: Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button... On Mon, Nov 16, 2020 at 6:21 PM Bart wrote: Can you upload a basic example (1 form, 1 bitbutton) where you set the transparency of the form. Without actual code (also the lfm) it's hard to test. -- Bart -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201116/3c6452b5/attachment.html>

Reply by email