Is it possible to select a specific entry in a dialog list?
#1
Is it possible to use the ActivateWindow() command to reference a specific item in a list.

ie. i'm using a list based off the favourites menu which contains, say, 5 entries.
I've a custom button to activate said list but would like to be able to have the button open the list to item 3 on the list.

The wiki entry container item layout seems to indicate you can reference specific rows, columns and positions in a list for animation means.

Does ActivateWindow() support similar? Is there a command that would allow me to activate the favourites window and move to item 3 on the list?
Reply
#2
You could try using

PHP Code:
Control.Move(id,offset

This action would need to be triggered after activating the window though.

So try adding

PHP Code:
<defaultcontrol always="true">n</defaultcontrol

to the dialog window, where n is the ID of an invisible "trigger" button:

PHP Code:
<control type="button" id="n">
    <
onfocus>Control.Move(id,2)</onfocus>
    <
texturenofocus>-</texturenofocus>
    <
texturefocus>-</texturefocus>
</
control

and the onfocus action of the trigger button tells the list (fill in ID) to move 3 places (0=counted as the first)

I have not tested this so I'm not sure if it will work but worth the try I think.
Reply
#3
Great! Thanks! Works almost a treat and is a method I would not have thought to try.

Following your steps, I can get the invisible trigger to work to move the list focus 2 items down.

However, two issues are occuring.

1) When using the invisible trigger button, the <onfocus>Control.Move(id,2)</onfocus> works to set the item in the list 2 places down, but focus isn't returned to the list itself. So no entry is actually highlighted on the list. This isn't a deal breaker, as the first cursor movement does highlight the list entry, but would be nice to fix.

2) the list remembers last position, so exiting and entering the window will cause an increment of 2 from the last position, rather than from the first entry. This results in the position moving down thru the entire list if you exit/enter repeatedly.

I know there is a flag to turn off remember last position, but can't find it. Any idea what this is?


Here's the code snippets i've added in for this into the custom.xml file, in case i've missed something.

<window type="dialog" id="1">
<defaultcontrol always="true">10</defaultcontrol>

<control type="button" id="10">
<onfocus>Control.Move(11,2)</onfocus>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<onleft>11</onleft>
<onright>11</onright>
<onup>11</onup>
<ondown>11</ondown>
</control>

note: the list is question is id=11
Reply
#4
Ok, using the same method for the most part but instead of using Control.Move(id,position) you could try using Control.SetFocus(id,position)
I think that would take care of both issues. Although I'm not completely sure about the second one.
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to select a specific entry in a dialog list?0