Thread: Context Menus
-
October 26th, 2018, 15:27 #21
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
I just checked this on the inventory tab to make sure this wasn't an isolated incident. I added a double click to set focus to all of the coin fields to advance to the next one. The same thing happens. It for a split-second highlights the next coin field and then immediately returns. So this appears to be something fundamental with either the cursor hovering an element, or the numberfield itself capturing its own focus.
-
October 26th, 2018, 16:03 #22
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
GOT IT! It's something in the base level onClickRelease() event. I did an overwrite on numberboxes and it fixed the issue as shown below. So, there's something in the base class' onClickRelease event that's reclaiming Focus. I don't see it in the rulesets, so I'm guessing this is base level.
function onClickRelease(button,x,y)
return true;
end
-
October 26th, 2018, 16:04 #23
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,558
I haven’t had a chance to load the files yet; but are you also capturing the onClickRelease event and returning true. Without having looked at the specific code yet; the FG client code could be setting focus on click release as well.
Regards,
JPG
-
October 26th, 2018, 16:27 #24
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
This is causing new issues now where onclick apparently doesn't capture focus. Working on a workaround for this now.
-
October 26th, 2018, 16:56 #25
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,558
Whenever I capture an onClickDown event, I always add an onClickRelease event as well. This allows me full control over what happens when someone clicks on a field, including whether to setFocus or not.
JPG
-
October 26th, 2018, 17:10 #26
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
That's what I've done. I've removed the set focus from the OnClickRelease and added to the onClickDown. Seems to be working now as expected. Now going to template this for the 4 places I want to use it.
Just different from how I'm used to WinForms and XAML working with controls.
-
October 28th, 2018, 00:11 #27
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
Just wanted to drop in and say thanks for all the help. I got this extension working how I wanted. You can see the changed in the video in this post. I'm quite proud of the edit fields capability I added to the character sheet and combat trackers.
https://www.fantasygrounds.com/forum...l=1#post392243
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks