how do i get a butons text from its id?

Xlobby plugin development

how do i get a butons text from its id?

Postby S Pittaway on Sun Jan 31, 2010 7:34 pm

i wand to write a plugin command that would refresh a database, wait for the importstatus text to say scan completed, then do so other stuff...

but i have to admit that i cant see how to get the text of a button if i know its ID, am i missing something?

how do i get the text from importstatus into my plugin?


cheers, Sean.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how do i get a butons text from its id?

Postby kris on Sun Jan 31, 2010 10:01 pm

you would probably have something like this :

if (xhelper.ConvertVariables("%importstatus>percent%") == "100%")
{
//do your thing
}

hope this helps, kris
kris
 
Posts: 12
Joined: Fri Dec 30, 2005 4:49 pm
Location: Belgium

Re: how do i get a butons text from its id?

Postby S Pittaway on Mon Feb 01, 2010 7:47 pm

i was trying to the Status: xxx text to tell when it was complete...

the the 100% works great (and is a lot easier)

cheers, Sean.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how do i get a butons text from its id?

Postby P3rv3rt B3ar on Wed Feb 03, 2010 6:31 pm

Pitt, if u r interest about general solution, theres a l33t h4x0r way of doing it, kinda "we dont need no API"-aproach... if i remember right theres a little caveat though, aproach doesnt work with proper buttons but only with text fields. This semantic differense obviously does not play any role as long as u can craft the skin by yourself.

XPluginSDK.Button OurTextBox=SDKhelper.getButton(ID);
//next lets use toString to make XL leak
String notFinal=OurTextBox.toString();
//little trimming required
String finalAnswer =notFinal.Substring(6,notFinal.Length-7);

// have fun ;)
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland