QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: Qwerkey on September 02, 2018, 06:17:13 am

Title: Mastering InForm: Can Frames Receive a Click Event?
Post by: Qwerkey on September 02, 2018, 06:17:13 am
According to the Wiki, Frames can receive a Click event, and if so should react to such under the SUB __UI_Click subroutine.  I did try this for a Frame I wanted to react to at run time.  However, a Click had no effect (and the code did not pass through the CASE Framename region).  For my case, it doesn't matter as I changed it to clicking on a Label in the Frame.  That works very nicely.  Richard
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: FellippeHeitor on September 02, 2018, 10:24:19 am
Do you happen to have changed the control name since inception and could be trying to catch the event for the old name of the frame? In my tests here frames can still respond to clicks.
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: TempodiBasic on September 03, 2018, 04:46:00 pm
Hi friends
here a little demo FrameClick to show the issue of the thread
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: FellippeHeitor on September 03, 2018, 04:52:49 pm
Thanks for the sample, TempodiBasic! It's very likely that Richard is trying to use an incorrect control id.

PS: Your button doesn't get the hotkey shortcut and shows the ampersand symbol (&) because you're setting the caption directly using Caption(id) = "text" instead of SetCaption id, "text".
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: TempodiBasic on September 03, 2018, 05:48:03 pm
Hi Fellippe
Thanks for feedback, IMHO these are old bad behaviours to change for InForm.
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: FellippeHeitor on September 03, 2018, 05:55:15 pm
Bad behaviors?
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: TempodiBasic on September 03, 2018, 08:42:08 pm
Yes
Bad habits taken using old tools from RapidQ VB2008express and someone else. Now I have to focus on how InForm works
Thanks
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: Qwerkey on September 04, 2018, 05:36:32 am
It's very likely that Richard is trying to use an incorrect control id.

... It's the first thing that I checked, and as far as I could see the id name was correct.  However, I was moving the form & .bas from the root folder to my project folder.  I think that that may have confused things.  Until I have the project finished, I've moved everything back to the root folder.

By the way, am I right to assume that a Hidden control is automatically Disabled?  There is no chance that a user might accidentally cause a Click Event on a hidden (but not disabled) control?

Richard
Title: Re: Mastering InForm: Can Frames Receive a Click Event?
Post by: FellippeHeitor on September 04, 2018, 07:56:17 am
You're right.