Double Click to See Code

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Double Click to See Code

Post by townsend » Mon Jun 18, 2012 6:52 pm

Double clicking on an object currently opens up the object inspector.

How about the option to double click on an object to open up the code for that object.

Maybe on the Tools Pallet, the Run and Edit buttons could be combined,
and then have another on/off button for Inspector/Code on a double click.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Double Click to See Code

Post by dunbarx » Mon Jun 18, 2012 6:57 pm

Hi.

You know that cmd-opt-click opens the script editor, right?

Craig Newman

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Double Click to See Code

Post by townsend » Mon Jun 18, 2012 7:34 pm

I didn't know that. Thanks. I'll use that.

I have the Inspector open all the time,
so that double click to open seemed useless.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Double Click to See Code

Post by townsend » Mon Jun 18, 2012 9:15 pm

Actually-- that "opt" is important.
I checked the User Guide under shortcuts and found that Ctl-E does it.
890 shortcut.JPG
890 shortcut.JPG (8.64 KiB) Viewed 3337 times
Better than nothing-- but the double click option is still on my wish list.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Double Click to See Code

Post by sturgis » Mon Jun 18, 2012 9:49 pm

ctrl-alt-click works. Not sure if thats easier than ctrl-e or not. :)

If you want to override the double click entirely you can use a simple plugin to do so. (very very simple, not sure if there are other things to worry about when doing it this way)


make a stack with 1 button. for its card script put the following

Code: Select all

on opencard 
insert the script of button 1 into front
end opencard

on closecard
remove the script of button 1 from front
end closecard
For the script of the button the following should work.

Code: Select all

on mousedoubleup pBtn
if pBtn is 1 and the selectedobject is not empty then
   edit the script of the selobj
else
   pass mousedoubleup
end if
end mousedoubleup
At this point you can save it to your plugins folder, restart lc, then adjust the setting of the plugin so that it opens on lc startup invisible. Or you could modify it so that it opens as a palette so that you can toggle the functionality on and off. Also, if you want the property inspector to always open for the object you're working on you can put "pass mousedoubleup" at the end of the handler outside the if block.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Double Click to See Code

Post by townsend » Mon Jun 18, 2012 11:20 pm

Oh yeah-- The Ctl-Alt Click works. I'll use that.

As for overriding the IDE default, it good to know that's possible.
And thanks for that code.

Post Reply