EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Does a Checkbox care how long you press it? (https://www.eq2interface.com/forums/showthread.php?t=8246)

Othesus 04-21-2007 11:47 AM

Does a Checkbox care how long you press it?
 
1 Attachment(s)
Or am I seeing something else here?

I've been working on some more features for a browser window. Any window with a dropdown menu always has problems with keyboard focus. Anytime the window has focus the space bar causes the dropdown menu to open, which is not normally what you want. To work around this I've been putting set_focus Parent...Parent.Player.Fullpath commands in every button in the window to switch the focus to the player window. This has worked for every button, it seems, except for the minimize Checkbox:

<Checkbox BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnSet="OldSize=Parent.Parent.Parent.Parent.Size
Parent.Parent.Parent.Parent.MinimumSize=325,27
Parent.Parent.Parent.Parent.Size=325,27
Parent.Parent.Parent.Parent.UserResizable=false
set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath
LocalTooltip=Restore" OnUnset="Parent.Parent.Parent.Parent.MinimumSize=600,150
Parent.Parent.Parent.Parent.Size=OldSize
Parent.Parent.Parent.Parent.UserResizable=true
set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath
LocalTooltip=Minimize" ScrollExtent="13,9" Size="13,9" Style="ShowControl.Style"></Checkbox>

The line set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath is supposed to switch focus to the player window but a normal click doesn't work. After a lot of trial and error I found out that if I click down on the button for longer than a couple tenths of a second it does switch focus but a normal quick click doesn't.

Has anyone run into this problem or something similar? Here's the xml file if you want to try it.

Talyns 04-21-2007 12:04 PM

I haven't played in a while but the way I recall it:

1st. the OnActivate is called instantly everytime when you click on a button/checkbox

2nd. The OnPress or OnSet doesn't get called until you let go of the mouse button.
In other words, if you move the mouse off of the button before letting go of the button, you can cancel the click.

3rd. The OnDeactivate gets called everytime

I don't think that helps but it does help explain the buttons.. I'm not sure what goes on if you hold the button down on a checkbox.

You can try putting the set_focus in the OnDeactivate and see what happens.

Edit:
I'm not 100% sure a checkbox works like a button though.

I used to use 2 buttons for minimize/restore with the same size and location

The minimize button would hide itself and show the restore button (OnSet event)
The restore button would hide itself and show the minimize button (OnUnset event)

Othesus 04-21-2007 10:46 PM

I tried putting the set_focus command into OnPress and it still does the same thing.

<Checkbox BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnPress="set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath" OnSet="OldSize=Parent.Parent.Parent.Parent.Size
Parent.Parent.Parent.Parent.MinimumSize=325,27
Parent.Parent.Parent.Parent.Size=325,27
Parent.Parent.Parent.Parent.UserResizable=false
LocalTooltip=Restore" OnUnset="Parent.Parent.Parent.Parent.MinimumSize=600,150
Parent.Parent.Parent.Parent.Size=OldSize
Parent.Parent.Parent.Parent.UserResizable=true
LocalTooltip=Minimize" ScrollExtent="13,9" Size="13,9" Style="ShowControl.Style"></Checkbox>

Stripping the scripts of everything else:

<Checkbox BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnSet="set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath" OnUnset="set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath" ScrollExtent="13,9" Size="13,9" Style="ShowControl.Style"></Checkbox>

Using "=" style commands:

<Checkbox BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnSet="set_focus=Parent.Parent.Parent.Parent.Parent.Player.Fullpath
set_focus=Parent.Parent.Parent.Parent.Parent.Player.Fullpath" OnUnset="set_focus=Parent.Parent.Parent.Parent.Parent.Player.Fullpath
set_focus=Parent.Parent.Parent.Parent.Parent.Player.Fullpath" ScrollExtent="13,9" Size="13,9" Style="ShowControl.Style"></Checkbox>

Pressing a button at the first level of the window:

<Checkbox BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnSet="Parent.Parent.Parent.Parent.SetFocusToPlayerWindow.Press=true" OnUnset="Parent.Parent.Parent.Parent.SetFocusToPlayerWindow.Press=true" ScrollExtent="13,9" Size="13,9" Style="ShowControl.Style"></Checkbox>
...
<Button Name="SetFocusToPlayerWindow" OnPress="set_focus Parent.Parent.Player.Fullpath" Size="0,0" Visible="false"/>

Othesus 04-21-2007 11:59 PM

VICTORY!

Changing to two toggling Buttons:

<Button BackgroundOpacity="1.000" LocalTooltip="Mimimize" Name="Minimize" OnPress="Visible=false
Parent.Restore.Visible=true
set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath" ScrollExtent="13,9" Size="13,9" Style="ShowControl.ButtonDefault"/>
<Button BackgroundOpacity="1.000" LocalTooltip="Restore" Name="Restore" OnPress="Visible=false
Parent.Minimize.Visible=true
set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath" ScrollExtent="13,9" Size="13,9" Style="ShowControl.ButtonActivated" Visible="false"/>

I have no idea why a Checkbox requires you to press it for a couple tenths of a second and a Button doesn't. What kind of code would cause that? I wish the documentation wasn't so shoddy so I wouldn't have to waste 5 hours trying to figure out each little bug.

Zonx 04-22-2007 10:50 AM

Another option is to give the checkbox control...
onHoverout="set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath"

Othesus 04-22-2007 04:13 PM

It seems like the reason a dropdown menu always grabs the spacebar input is that you can use spacebar - arrow keys - enter key to use the dropdown menu without the mouse, but I really doubt many players use that unless some kind of physical disability prevents them from using a mouse at all.

Landiin 04-22-2007 06:09 PM

I had the same issue with the way I did show head armor. I just simply enabled and !enabled the dropdown with the OnHoverIn & OnHOverOut event of said window.

Othesus 04-22-2007 09:40 PM

Quote:

Originally Posted by Landiin (Post 58333)
I had the same issue with the way I did show head armor. I just simply enabled and !enabled the dropdown with the OnHoverIn & OnHOverOut event of said window.

On the first level of that window? I did try that a long time ago. When your mouse moves over the Browser object it triggers the OnHoverOut script though so the dropdown would close on you.

Landiin 04-22-2007 10:01 PM

If by first level you mean the root node of that window then yes. Hmm if the browser object is causeing the OnHoverOut to fire then yea that way wouldn't work. But I kind of think that is a bug because OnHoverOut shouldn't fire until the mouse left that node.


All times are GMT -5. The time now is 05:30 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI