[Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
On Mon, Nov 16, 2020 at 11:43 AM Bo Berglund via lazarus
<[hidden email]> 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.

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
On Mon, 16 Nov 2020 13:04:04 +0100, Bart via lazarus
<[hidden email]> wrote:

>On Mon, Nov 16, 2020 at 11:43 AM Bo Berglund via lazarus
><[hidden email]> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
On Mon, Nov 16, 2020 at 3:06 PM Bo Berglund via lazarus
<[hidden email]> wrote:
> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Mon, Nov 16, 2020 at 1:04 PM Bart <[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
On Mon, Nov 16, 2020 at 6:21 PM Bart <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button... - TestTransparency.zip (0/1)

Free Pascal - Lazarus mailing list
On Mon, 16 Nov 2020 18:31:13 +0100, Bart via lazarus
<[hidden email]> wrote:

>On Mon, Nov 16, 2020 at 6:21 PM Bart <[hidden email]> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button... - TestTransparency.zip (1/1)

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

begin 644 TestTransparency.zip
M4$L#!!0``@`(`/::<%&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,7YX5MY]@`"%.79)QKFH"W.W$A%MY!'3$3&.F2J"$;O)\K$4C"3^W7<
MPP4SO$!8@#8+185.J,(2]Z[C/*(<UH6G2L$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96YC>2YL<&D*`"````````$`&`"0QZ.=1;S6`9#'HYU%O-8!D&Q^\?Z[
MU@%02P$"%``4``(`"`!*5W!1Y,#'_@@!``"H`0``%``D```````!`"````#-
M`@``5&5S=%1R86YS<&%R96YC>2YL<'(*`"````````$`&`!P!X0"_[O6`7`'
MA`+_N]8!<(&L\?Z[U@%02P$"%``4``(`"`#VFG!1KG?LW6,!```.`P``#``D
M```````!`"`````'!```9F]R;6UA:6XN;&9M"@`@```````!`!@`8*6JG46\
MU@%@I:J=1;S6`;#,2_G^N]8!4$L!`A0`%``"``@`]IIP43[^S1OC`P``5@D`
M``P`)````````0`@````E`4``&9O<FUM86EN+G!A<PH`(````````0`8`*!?
LIIU%O-8!H%^FG46\U@'0*"#Y_KO6`5!+!08`````!``$`(@!``"A"0````!?
`
end

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
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 <[hidden email]>
Sent: Monday, 16 November 2020 18:31
To: [hidden email]; Lazarus mailing list <[hidden email]>
Subject: Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

On Mon, Nov 16, 2020 at 6:21 PM Bart <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

TestTransparency.zip (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

Free Pascal - Lazarus mailing list

On Mon, Nov 16, 2020 at 8:30 PM Bo Berglund via lazarus <[hidden email]> 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 <[hidden email]>
Sent: Monday, 16 November 2020 18:31
To: [hidden email]; Lazarus mailing list <[hidden email]>
Subject: Re: [Lazarus] Cannot close Windows 10 application with a bkClose TBitBtn button...

On Mon, Nov 16, 2020 at 6:21 PM Bart <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus