Thread Tools Display Modes
06-01-06, 12:30 PM   #1
abenadi
A Defias Bandit
Join Date: Jun 2006
Posts: 2
slider problems

I'm having some problems with the apparent default behavior of sliders.

First of all, the text strings on either side are "Low" and "High". I would like these text strings instead to display the min/max values. There does not appear to be a slider property for them. If I directly edit the xml using another application (is it possible to edit the xml text in WoW UID?) then those changes will be overwritten the next time I save a change in WoW UID.

Secondly, I would like to call a function when the slider position changes. I believe the correct event is OnValueChanged, however I think adding a function to the event property adds it to the slider frame instead of the slider itself causing nothing to happen when the slider is moved.

I'm a bit new to all of this so if I'm doing something wrong or missing something please say so. Thank you.

edit: Poking around on these boards helped me to realize I can set additional properties by expanding the frame object tree... as I said I'm new to this, however I would still appreciate some help getting a function to fire when the slider changes. Any help is appreciated and once again forgive my neanderthal ways.

edit2: OK back to square1... even though I can make the slider textstring property change with UID now, it changes back to Low/High instead of 0/3000 (my min and max values for this slider) the second I save.

Last edited by abenadi : 06-01-06 at 12:39 PM.
  Reply With Quote
06-01-06, 05:36 PM   #2
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
Lightbulb

Ok, there are two ways to get what you want.

The first is to use the Slider from the Basic tree in the Toolbox. This is just a base slider frame and you can place your min/max labels yourself by putting down Label components where you want and putting in whatever text you want. Whatever you put in the OnValueChanged event will fire when the slider changes.

The second is to use the existing slider component from the Default tree in the Toolbox and write a bit of code in the OnLoad event handler to change the text in the WoW UI itself (but you wouldn't see the change in the editor).
Code:
local minLabel = getglobal("FormName".."SliderName".."Low");
local maxLabel = getglobal("FormName".."SliderName".."High");
minLabel:SetText("0");
maxLabel:SetText("3000");
You can also use the script editor (select the OnValueChanged event, and press the ... button that appears to the right of the property) and select the $parentSlider item in the Sub Frame selector box at the top, any code entered here will execute with the change of the slider itself.

Hope that works for you,
Nulk
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote
06-02-06, 09:12 AM   #3
abenadi
A Defias Bandit
Join Date: Jun 2006
Posts: 2
That points me in the right direction. Thanks for your help and thanks for this awesome tool.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » slider problems

Thread Tools
Display Modes

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