Open a Property Inspector by script

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Open a Property Inspector by script

Post by Dixie » Fri Oct 22, 2010 1:24 pm

Hi...

Is it possible to open the property inspector of an object by script... and have it display the geometry settings on opening ?

be well

Dixie

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Open a Property Inspector by script

Post by WaltBrown » Fri Oct 22, 2010 6:18 pm

Dixie,
I was only able to get to the main Properties screen for button "TestButton" using:

Code: Select all

on mouseUp
   choose pointer tool
   send "mouseDoubleUp" to btn "TestButton"
end mouseUp
which I am sure you got to as well. Beyond that I looked into the rev stacks to see if there was anything obvious (my own curiosity), but there wasn't an obvious way to tell it to open a Geometry card of the revPropertyPalette stack. There probably is a way, but it's going to take some digging. Plus, it reacted oddly to my digging even with "Suppress Messages" selected, so there are probably land mines as well.
Walt
Walt Brown
Omnis traductor traditor

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Open a Property Inspector by script

Post by FourthWorld » Fri Oct 22, 2010 6:20 pm

Even simpler:

edit script of this cd

In the script use:

on resizeStack x,y
-- put your resize stuff here:

end resizeStack

;)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Open a Property Inspector by script

Post by Dixie » Fri Oct 22, 2010 6:46 pm

Walt, Richard...

Thanks for your replies... Shao Sean gave me a script that works really well...

Code: Select all

on mouseUp
   # get the target of this control
   local tTargetID
   put the long id of the target into tTargetID
 
   # create the inspector linked to this control
   send "revBuildPropertyPalette tTargetID" to stack "revTemplatePalette"
 
   # get the name of the inspector linked to this control
   local tPaletteName
   put revPropertyPalettes(tTargetID) into tPaletteName
 
   # bring the inspector stack into use so we can use the scripts from it (we could do this with the value() function)
   start using stack tPaletteName
 
   # get the text for the drop down menu (the first line is the object type)
   local tTabs
   put revObjectTabs2(tTargetID) into tTabs
 
   # lock the screen so we do not see the selection handles
   lock screen
   select tTargetID
 
   # get the proper geometry card to display
   local tDefaultCard
   put revGeometryCard() into tDefaultCard
 
   # deselect the control and unlock the screen
   select EMPTY
   unlock screen
 
   # go to the correct inspector pane
   revBuildPropertyPaletteGoCard tDefaultCard, tPaletteName, tTargetID, tTabs
 
   # get the inspector to remember the pane it is displaying
   revRememberPane
 
   # no longer need the palette's scripts
   stop using stack tPaletteName
end mouseUp
I don't know enough about all this stuff that begins with 'rev'

be well

Dixie

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Open a Property Inspector by script

Post by WaltBrown » Sat Oct 23, 2010 4:47 am

I was impressed with Shao's script, in the depth of investigation done in the LC tool stacks.
Walt
Walt Brown
Omnis traductor traditor

Post Reply