How open directly inspector when the optionKey is down ?

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
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

How open directly inspector when the optionKey is down ?

Post by jmburnod » Sun Jan 04, 2015 10:07 am

Hi All,

I want open directly the inspector of control when the user click a control with browse tool and optionKey down ?
Is there a way to do that ?
I remember HC "doMenu" but it is not available in LC
Best regards
Jean-Marc
https://alternatic.ch

Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Re: How open directly inspector when the optionKey is down ?

Post by Martin Koob » Sun Jan 04, 2015 4:06 pm

I don't think you can open property inspector with browse tool.

You can open the script editor with the 'option' and 'command' key down while using the browse tool.

With the edit tool you click the control with the 'Control' key down. That will show a popup menu with items: Edit Script, Property Inspector, and some other items.

Martin

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

Re: How open directly inspector when the optionKey is down ?

Post by WaltBrown » Sun Jan 04, 2015 4:14 pm

I was looking at this but found no solution. Note that in LC 7.0 rc1, the "doMenu" function did work on a few menu items (it worked on New Card but not the Property Inspectors), but only without the "of menuName" parameter, which caused a failure out to the Script Editor.
Walt
Walt Brown
Omnis traductor traditor

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by jmburnod » Sun Jan 04, 2015 6:39 pm

Thanks,
Inspector palette is a stack, then that should be possible to call it.
I thought find it into Toolset folder of the app package but I didn't find.
I hoped use it instead make my own.
As said Klaus "lazy moi" 8)
Jean-Marc
https://alternatic.ch

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

Re: How open directly inspector when the optionKey is down ?

Post by WaltBrown » Mon Jan 05, 2015 5:14 am

I tried calling it - it's name is "revPropertyPalette 1". I tried opening it and could do so, but then the IDE thinks it is a user stack (it puts it's name in the stacksInUse property), not part of the IDE - it asks if you want to save or discard changes when you try to close it, so I don't know if that will have an effect on the IDE. Making the actual menu selection in the IDE appears to do more than just open the stack.
Walt Brown
Omnis traductor traditor

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by jmburnod » Mon Jan 05, 2015 11:19 am

Thanks Walt,
I searched it but I can't found it in the package
The style of the stack "revPropertyPalette 1" is open in a standard style instead palette.
I will test if set its style is possible without problem with IDE
Jean-Marc
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by jmburnod » Mon Jan 05, 2015 9:37 pm

Hi,
it asks if you want to save or discard changes when you try to close it
Same problem here
I tried:

Code: Select all

on doOpenInspector
   select control "myControl"
   open stack "revPropertyPalette 1"
   palette stack "revPropertyPalette 1"
end doOpenInspector
I think I have to create my own inspector.
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How open directly inspector when the optionKey is down ?

Post by bn » Mon Jan 05, 2015 10:29 pm

Hi Jean-Marc,

try this

Code: Select all

on doOpenInspector
   select control "myControl"
   send "revBuildPropertyPalette" to stack "revTemplatePalette"
end doOpenInspector
I took this from the script of button "object properties" from card id 1002 of stack "revMenuBar"

That is the button you click when in the IDE and want to choose the Properties Inspector.

Kind regards
Bernd

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by Klaus » Mon Jan 05, 2015 10:32 pm

Hi friends,

I'm afraid this is a tad more complex than you hope! 8)

This is the "mousedoubleup" handler from the "revFrontScript", which usually opens the Inspector if in POINTER mode.
That should give you a clue where to dig deeper, note the first line:

Code: Select all

on mouseDoubleUp pButtonNo, pTarget
  if revCheckEdit(pTarget) then send "revBuildPropertyPalette" to stack "revTemplatePalette"
  else if not gREVSuppressMessages or (gREVSuppressMessages and revOKTarget()) then pass mouseDoubleUp
end mouseDoubleUp
Hope that helps, good luck! :D


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by jmburnod » Tue Jan 06, 2015 2:07 pm

Salut les amis,
Wow! The german livecode staff is coming with a very good solution
Thanks a lot, it works fine for my goals
I'm afraid this is a tad more complex than you hope!
I mean a simplified inspector

I changed my scenario:
Instead a click on object I use a list of all controls in a list field of a palette stack

The list field script:

Code: Select all

on mouseup
   put line (the hilitedlines of fld "fImagesRef") of fld "fImagesRef" into tnameC
   doOpenInspector tnameC,stCrerStory -- stCrerStory = name of the mainstack
end mouseup

on doOpenInspector pControl,pStack
    select control pControl of stack pStack
    send "revBuildPropertyPalette" to stack "revTemplatePalette"
end doOpenInspector
Best regards
Jean-Marc
https://alternatic.ch

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How open directly inspector when the optionKey is down ?

Post by Klaus » Tue Jan 06, 2015 2:37 pm

Bonjour Jean-Marc,

glad I could help, but I am not part of the Livecode staff, I am just a user of LC!


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How open directly inspector when the optionKey is down ?

Post by bn » Tue Jan 06, 2015 2:53 pm

Klaus wrote:
but I am not part of the Livecode staff, I am just a user of LC!
So why do you get calls from Edinburgh every night when they get stuck?
They even register with ridiculous user names in the forum to get help from you.

What does that make you? The Last Resort?

:) :) :)

They never call me, so I am out of the "staff" business...

But seriously, thanks Klaus for all your help.

Kind regards
Bernd

Post Reply