EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 04-21-2007, 11:47 AM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default Does a Checkbox care how long you press it?

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.
Attached Files
File Type: xml eq2ui_mainhud_browser.xml (10.5 KB, 318 views)
Reply With Quote
  #2  
Unread 04-21-2007, 12:04 PM
Talyns's Avatar
Talyns Talyns is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Jul 2004
Server: Everfrost
Posts: 604
Default

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)
__________________
Talyns

Last edited by Talyns : 04-21-2007 at 12:20 PM.
Reply With Quote
  #3  
Unread 04-21-2007, 10:46 PM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default

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"/>

Last edited by Othesus : 04-21-2007 at 11:39 PM.
Reply With Quote
  #4  
Unread 04-21-2007, 11:59 PM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default

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.
Reply With Quote
  #5  
Unread 04-22-2007, 10:50 AM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Another option is to give the checkbox control...
onHoverout="set_focus Parent.Parent.Parent.Parent.Parent.Player.Fullpath"
Reply With Quote
  #6  
Unread 04-22-2007, 04:13 PM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default

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.
Reply With Quote
  #7  
Unread 04-22-2007, 06:09 PM
Landiin Landiin is offline
Slayer of clock cycles
This person is a EQ2Map developer.
Featured
 
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
Default

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.
__________________
Landiin's EQ2MAP Updater Discussion Download
Reply With Quote
  #8  
Unread 04-22-2007, 09:40 PM
Othesus's Avatar
Othesus Othesus is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Lucan DLere
Posts: 847
Default

Quote:
Originally Posted by Landiin View Post
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.
Reply With Quote
  #9  
Unread 04-22-2007, 10:01 PM
Landiin Landiin is offline
Slayer of clock cycles
This person is a EQ2Map developer.
Featured
 
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
Default

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.
__________________
Landiin's EQ2MAP Updater Discussion Download
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:52 PM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI