EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Any Listbox insight? (https://www.eq2interface.com/forums/showthread.php?t=9871)

Drumstix42 11-27-2007 05:02 PM

Any Listbox insight?
 
Quote:

7.4 .15 Listbox
Parent : Widget
A list of items

DataSource

OnSelect - action
OnDoubleClick - action
String

SelectedItem - value of item
String

SelectedItemIndex - index of selected item
integer

Style
ListboxStyle

RowTemplate - describes a row
Template
Currently attempting to use a sort of listbox to act as selections that will change what is showing on a page. Wondering if this is possible to begin with, and if anyone has attempted it.

gm9 11-27-2007 05:16 PM

Works pretty much like dropdowns and the like, so you can store any data you want in them and recall it via the OnSelect and OnDoubleClick events. The login/shutdown windows in my UI would be examples (selecting a row in the login window will populate text field in the window with the respective values).

Drumstix42 11-27-2007 06:51 PM

Does the OnSelect action work? I can't seem to get it to do anything.

gm9 11-27-2007 06:53 PM

Works for me, yes. Example code from the login window I mentioned (linebreaks added to make the events stand out):

Code:

<Listbox BackgroundColor="#FFFFFF" DataSource="CharacterData" Location="260,77" Margin="10,10,10,10" Name="CharacterSelect"

OnDoubleClick="Parent.AutoplayChar.Text=SelectedItem.Name
Parent.AutoplayWorld.Text=SelectedItem.Server
Parent.Username.Text=SelectedItem.Username
Parent.Password.Text=SelectedItem.Password
Parent.ConnectButton.Press=true"

OnSelect="Parent.AutoplayChar.Text=SelectedItem.Name
Parent.AutoplayWorld.Text=SelectedItem.Server
Parent.Username.Text=SelectedItem.Username
Parent.Password.Text=SelectedItem.Password"

PackSize="a,a" RowTemplate="CharacterSelect_template" Size="234,221" Style="/CommonElements.Listbox.data.listbox_style" Tooltip="Click to select, double-click to login"/>


Drumstix42 11-27-2007 07:37 PM

Apparently I was using a List and not a Listbox. :mad:

Drumstix42 11-28-2007 12:28 AM

Figured I'd share my simple findings in case anyone comes across this topic attempting to do the same thing.
I used this to be able to show different pages according to what was selected:
Code:

SELECTION=SelectedItem.Name
Parent.Parent.Parent.Text.Page1.visible=(SHOW ? True : False) SHOW=(Parent.Parent.Parent.Text.Page1.name == SELECTION)
Parent.Parent.Parent.Text.Page2.visible=(SHOW ? True : False) SHOW=(Parent.Parent.Parent.Text.Page2.name == SELECTION)

I've decided to just go another route, rather than try to come up with a new styled listbox. Plus, the listbox route was just kind of annoying me. It has it's uses however.

Another thing which I found annoying. I had to set the selectedrow to -1 (default) and have the first page set to visible. If I set the default row to the first one (zero), it would never show upon first opening. Just some extra useless info.


All times are GMT -5. The time now is 09:20 AM.

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