Thread: Context Menus
-
October 25th, 2018, 23:55 #11
Shot in the dark, the second click on wounds may be resetting the focus to wounds. Try switching focus to woundsEdit on a single click and see what happens.
-
October 26th, 2018, 00:19 #12
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
So onClickDown() does the same thing as onDoubleClick(). onClickRelease does properly pass the focus to the other control, but this would never allow me to select the original control and edit its contents. I did try catching an onChat() and typing in a special character which I captured in an if statement and passing Focus, and that worked. So it feels like it's something with the click events themselves.
I've also looked at the hierarchy of classes that make the basic number up windowcontrol -> numberfield -> number -> basicnumber and their scripts, and none of them appear to have an override for the method.Last edited by Tielc; October 26th, 2018 at 00:24.
-
October 26th, 2018, 00:27 #13
I didn't mean for it to be a permanent solution, just trying to determine if the second click was return focus to the wounds control. I'm not sure from your post if that was the case, or not.
-
October 26th, 2018, 00:41 #14
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
I didn't mean to come across that way; onClickRelease() works, and onClickDown() gives me the same challenge I had before. It looks like maybe onHover() could internally setFocus maybe?
Edit: No, that's not doing it either.
-
October 26th, 2018, 00:50 #15
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Are you returning "true" in onClickDown to prevent FG from performing the default behavior?
Regards,
JPG
-
October 26th, 2018, 00:58 #16
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
I have tried returning true in both onClickDown and onDoubleClick, both give the same results. I can watch the focus change to the specified control for about a split second and then it returns.
-
October 26th, 2018, 01:28 #17
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
This is a private video where I'm hopefully trying to explain this a little better what I'm trying to accomplish. I am sorry for my dog chewing on the hardest toy he could find in the background.
-
October 26th, 2018, 02:56 #18
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Do you have a copy of the current code extension which has the issue, and steps to recreate? That's the easiest way for me to investigate.
Regards,
JPG
-
October 26th, 2018, 13:05 #19
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
This is the extension as I would prefer it to work. One thing I noticed this morning. If I double click, before I release the cursor on the second double click; I move the cursor away from the initial control, the focus changes as expected. So it has to be something with the fact that the cursor is still over the control.
-
October 26th, 2018, 15:08 #20
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
You can actually see this issue happening without my extension. If you open the record_char_main.xml file from common in the 5e Ruleset and add a doubleclick event to say the wounds field like so
function onDoubleClick(x,y)
window.hp.setFocus();
return true;
end
Then when you run FG and double click on wounds, you can see the focus switch to the hp field and then immediately return to the wounds field.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks