Page 1 of 1
Control List
Posted: Fri Mar 07, 2008 2:26 pm
by ChristopherBodell
Does anyone know of a way to get a complete list of all the controls on a card or stack, including buttuns, fields, scrollbars, ect.
thanks,
Christopher
Posted: Fri Mar 07, 2008 2:37 pm
by Mark
Dear Cristopher,
You can find two simple handlers here:
http://runrev.info/Objects%20list.htm
You can use them like this:
put the objects of this card into myList
put the objectIDs of group 1 into myList
All the best,
Mark
Cant get it to work
Posted: Fri Mar 07, 2008 3:07 pm
by ChristopherBodell
i tried using the "getProps objects" example and it returns empty
What am i forgetting?
Thanks,
Christopher
Posted: Fri Mar 07, 2008 3:32 pm
by Mark
Dear Chrstopher,
Without seeing your actual script, it is difficult to see what the problem might be. Perhaps you put the objects handler in a place where your script can't get to it. Make sure that the objects handler is somewhere up the message hierarchy, for example in the stack script of your mainstack or in a library that is in use or in a backscript.
Of course, there also need to be a few objects available on the card or in the group you are requesting the objects from, but I'm sure you got that right already.
If the above doesn't help, would you mind posting your own script?
Best,
Mark
Ok... Here's what i've got
Posted: Fri Mar 07, 2008 3:55 pm
by ChristopherBodell
I just tested the script through a button......
-------------------------------------------------------------------
on mouseUp
put the objects of this card into myList
answer myList
end mouseUp
getProp objects
repeat with x = 1 to number of controls of the target
put the name of control x of this card & return after myList
end repeat
sort myList
return myList
end objects
-------------------------------------------------------------------
ok, nevermind, see, i didn't even think about that, i figured i would just put the "getProp object" handler into the buttons script along with the handler(mouseUp) to call it, but i have never tried putting handlers like that into the buttons script so i never knew it wouldn't work. I ended up put the script of the object handler on the card and called for that cards objects. Thanks Mark, thats exactly what i've been looking for.
Many Thanks,
Christopher
Another Problem[Errors handling]...
Posted: Fri Mar 07, 2008 4:01 pm
by ChristopherBodell
I know you probably don't have time to be sitting here answering all these questions but this one i do have problems with and it's not just one of those common sesed things that i just overlooked, To intercept Errors, how do i go about that. I mean i've tried everything i could things of, and i know it's not a bug or anything, i have tried the scriptParsingError handler, the errorDialoque handler, scriptError handler, maybe i'm just using it wrong again or put it in the wrong spot agian, but i can't seem to make it work, is this related to the lockErrorDialogues Command?
Many Thanks,
Christopher
Oh....
Posted: Fri Mar 07, 2008 4:05 pm
by ChristopherBodell
I also jsut put the "getProp objects" handler before the "mouseUp" handler was to call it.... That works too.....
Christopher
Posted: Fri Mar 07, 2008 5:07 pm
by Mark
Dear Christopher,
I'm glad to know that it works now.
Regarding error handling, it is a long time ago that I looked into it. On the top of my head, I believe you need to set the lockErrorDialogs to true by script and, if you're working in the IDE, turn off Script Debug Mode in the Development menu. You also need an errorDialog handler and a script to interprete the error. I believe there was more information about that in the use list archives, but I can't find it that quickly. You might want to give it a try yourself at
http://dir.gmane.org/gmane.comp.ide.revolution.user
There is a shareware library available on my homepage, which parses errors, but it seems to me that you want to write your own script.
The easiest way to deal with errors probably is to use the standard error dialog in the Rev IDE and to turn on the error reporting feature in the standalone builder. So, frankly, there isn't much of reason to write a script or use a library, unless you want something very specific.
Finally, I need to mention the fact that properties usually don't return an error if they don't exist. I don't know whether this is the reason for you asking your question about errors, but if you query an arbitrary property, such as "the cThisIsANonexistentProperty of field 1", you won't get an error, the property simply returns empty if it does't exist.
Best,
Mark
Perfect
Posted: Fri Mar 07, 2008 5:46 pm
by ChristopherBodell
Perfect.....I'll look into the user list, and for the error dialog in standalone builder i tried that but it didn't do everything i wanted it to do and it wasn't exactly what i was looking for anyways, i want something that is more specific about errors, that tells everything you need to know and has options to revert back to previously logged attempts or changes or whatever, so yeah, but i mean it doesn't have everything i want but maybe thats why its not working, i have to turn off the Error Dialogue in Revolution. Great!!!!
Many Thanks,
Christopher
Perfect
Posted: Fri Mar 07, 2008 5:47 pm
by ChristopherBodell
Perfect.....I'll look into the user list, and for the error dialog in standalone builder i tried that but it didn't do everything i wanted it to do and it wasn't exactly what i was looking for anyways, i want something that is more specific about errors, that tells everything you need to know and has options to revert back to previously logged attempts or changes or whatever, so yeah, but i mean it doesn't have everything i want but maybe thats why its not working, i have to turn off the Error Dialogue in Revolution. Great!!!!
Many Thanks,
Christopher