Sign in Join

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

Mailing lists / lazarus / 2015-05

TBitBtn's OnClick not fired

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

I've got a form with a panel and a TBitBtn in the panel. The button is used to close the form, which is shown via ShowModal.

I've got an OnClick event handler for the BitBtn, but when I put a breakpoint in that event handler it is never reached???

The button's ModalResult = mrNone and Kind = bkClose. The Action property is also empty.

Unfortunately there is no LCL help on the TBitBtn.Kind property, but would that affect the OnClick event not being used?

http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tcustombitbtn.kind.html

Clicking the button does close the modal form though.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

K. P.
to Graeme Geldenhuys

Hi Graeme,
debugging on (I have fallen for this many times - hate that I can set BPs w/o any visual indication that debugging itself is off)? It sure does work for me. I call 2nd form like this:
procedure TForm1.BitBtn1Click(Sender: TObject);var f: Tform2;begin f := Tform2.Create(nil); try f.Showmodal; finally if Assigned(f) then f.Free; end;end; form2 has a panel with a bitbtn on it. The button's ModalResult = mrNone and Kind = bkClose. The Actionproperty is also empty. BP set on 'Self.Close' line in OnClick event and debugger stops there as expected (Laz 1.4, Windows 7) Cheers,Kai

Show quoted text 36 lines
Date: Thu, 21 May 2015 15:52:43 +0100 From: To: Subject: [Lazarus] TBitBtn's OnClick not fired Hi, I've got a form with a panel and a TBitBtn in the panel. The button is used to close the form, which is shown via ShowModal. I've got an OnClick event handler for the BitBtn, but when I put a breakpoint in that event handler it is never reached??? The button's ModalResult = mrNone and Kind = bkClose. The Action property is also empty. Unfortunately there is no LCL help on the TBitBtn.Kind property, but would that affect the OnClick event not being used? http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tcustombitbtn.kind.html Clicking the button does close the modal form though. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150521/9bc19664/attachment.html>

Reply by email