revTinyIDE fix for resizing code peek window

Are you developing an External using the LiveCode Externals SDK?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adxsoft
Posts: 26
Joined: Wed Apr 11, 2018 12:25 pm

revTinyIDE fix for resizing code peek window

Post by adxsoft » Sun Aug 11, 2019 10:12 am

I have recently found revTinyIDE (https://github.com/AndyPiddock/TinyIDE) and tested on MacOS for LC8.1.8,9.04 and 9.5.0 and its a very handy plugin which reduces the screen clutter as promised .. its also developed solely in LC so its customisable too!.. so a big shout out to Andy Piddock for his excellent work.

I only found one issue when resizing the 'code peek' window .. I have provided a fix for this in the 'Issues' area of Andy's github site.

I thought I would post the fix here for LC Developers who are using revTinyIDE

Cheers
Allan

=======================================================================

CODE PEEK WINDOW CRASH WHEN RESIZING

This is fixed by opening file 'stack_revTinyIDE_35305.livecodescript' in the folder 'TinyIDE-Behaviours (in the plugins folder) in a text editor and replace all the code with the following code
then save the file. The problem was there were references to cards in the resizeStack handler that were not qualified correctly e.g. a reference to crdMain should have been made to crdMain of stack gStackName.

Note I have only tested this fix on MacOS but I think it will work without any problems on Windows and Linux.

BTW Its a very nice solution and as promised I get heaps more screen real estate plus as its in Livecode I was able to modify revTinyIDE for myself by
- adding Inspector and Code buttons to my copy of revTinyIDE.
- having Sublime Text come up when editor icon is chosen


Very happy camper!!

Code: Select all

-- TinyIDE for LiveCode
-- Author - Andy Piddock
-- Web - 2108.co.uk
-- Add to your Plugins folder and set to auto-start with LiveCode.
-- Credits:
-- Icons - Gentalface Free Wireframe Toolbar Icons for GUI designers
-- http://gentleface.com/free_icon_set.html

global gStackYPos --for recording and reseting top postion

global gStackName --used to set the stack name during debug and editlocal tTooltPath

global gTooltPath --location of TinyIDETools folder
global gToolsFiles --files in the TinyIDETools folder

-- Add delay to allow slower startup times of LC V9
on preOpenStack
wait 2 seconds with messages
end preOpenStack

on openStack
put "revTinyIDE" into gStackName --live
--put "TinyIDE" into gStackName --dev

--set time default
put "0.0" into fld "timer" of card "CrdMain" of stack gStackName

--set revTinyIDE defaults
put empty into fld "FldStatus" of card "CrdMain" of stack gStackName

--

--is mon1 offset set
set the label of button "Monitor1TOffset" of card "CrdInfo" of stack gStackName to the cpTopOffsetMon1 of stack gStackName

--is mon2 offset set
set the label of button "Monitor2TOffset" of card "CrdInfo" of stack gStackName to the cpTopOffsetMon2 of stack gStackName

--is docked offset set
set the label of button "MonitorDTOffset" of card "CrdInfo" of stack gStackName to the cpTopOffsetDocked of stack gStackName

--determine TinyIDE path
GetStackPath
--load Web and App lists
LoadWebApps

lock screen
--set the width of me to item 3 of the screenRect -20
set the visible of stack "revTools" to false
set the effective top of stack "revMenuBar" to item 2 of the working screenRect
set the effective left of stack "revMenuBar" to 0
local tMenuBarVisible
put the visible of stack "revMenuBar" into tMenuBarVisible
set the visible of stack "revMenuBar" to true
set the width of this stack to the width of stack "revMenuBar"
set the left of this stack to the left of stack "revMenuBar"
set the effective top of this stack to the effective bottom of 
stack "revMenuBar" + the cpTopOffsetDocked of stack gStackName
if not tMenuBarVisible then
send "mouseUp" to button "BtnLCIDE" of group "Layout" of card "CrdMain"
end if
unlock screen

insert the script of button "BtnFSHoverInfo" of card "CrdInfo" of stack gStackName into back
ideSubscribe "ideToolChanged"

--initializeIcons
--send "initializeIcons" to stack gStackName in 0 ms
end openStack

on initializeIcons
send "SetUpBar" to card "CrdMain" of stack gStackName
send "resizeStack" to stack gStackName
end initializeIcons

on LoadWebApps
local tCount
local tNameList
filter fld "FldLaunchList" of card "CrdInfo" of stack gStackName without empty
set the text of button "BtnLinks" of card "CrdMain" of stack gStackName to empty
put empty into tNameList
repeat with tCount = 1 to the number of lines of fld "FldLaunchList" of card "CrdInfo" of stack gStackName
put item 1 of line tCount of fld "FldLaunchList" of card "CrdInfo" of stack gStackName & return after tNameList
end repeat

LoadTinyIDETools
put "-" & return & gToolsFiles after tNameList

set the text of button "BtnLinks" of card "CrdMain" of stack gStackName to tNameList
end LoadWebApps

on LoadTinyIDETools
put the defaultfolder & "/TinyIDETools/" into gTooltPath
put files(gTooltPath) into tToolsFiles
filter tToolsFiles without ".DS_Store"
if tToolsFiles is not empty then
put tToolsFiles into gToolsFiles
end if
end LoadTinyIDETools

on GetStackPath
local tPath
put the effective filename of me into tPath
set the itemDel to "/"
delete last item of tPath
set the defaultFolder to tPath
end GetStackPath

on resizeStack
local tULeft
local tURight

lock screen
--main
set the right of button "BtnExit" of card "CrdMain" of stack gStackName to the right of card "CrdMain" of stack gStackName -2
set the right of button "BtnInfo" of card "CrdMain" of stack gStackName to the left of button "BtnExit" of card "CrdMain" of stack gStackName -2
set the right of grp "Timer" of card "CrdMain" of stack gStackName to the left of button "BtnInfo" of card "CrdMain" of stack gStackName -2
put the left of grp "Timer" of card "CrdMain" of stack gStackName -2 into tURight
put the right of grp "EditTools" of card "CrdMain" of stack gStackName +2 into tULeft
set the width of grp "UBarTools" of card "CrdMain" of stack gStackName to tURight-tULeft
set the left of grp "UBarTools" of card "CrdMain" of stack gStackName to the right of grp "EditTools" of card "CrdMain" of stack gStackName +2
set the height of grp "UBarTools" of card "CrdMain" of stack gStackName to 42
set the top of grp "UBarTools" of card "CrdMain" of stack gStackName to -1
set the right of fld "LblVersion" of card "CrdMain" of stack gStackName to the right of card "CrdMain" of stack gStackName -2

--settings/info
set the right of button "BtnSaveStack" of card "CrdInfo" of stack gStackName to the right of card "CrdInfo" of stack gStackName -20
set the right of button "Btn2108Web" of card "CrdInfo" of stack gStackName to the left of button "BtnSaveStack" of card "CrdInfo" of stack gStackName -4
set the right of button "BtnCloseInfo" of card "CrdInfo" of stack gStackName to the left of button "Btn2108Web" of card "CrdInfo" of stack gStackName -4

set the width of fld "FldStatus" of card "CrdMain" of stack gStackName to item 3 of line 1 of the working screenRects -20
set the left of fld "FldStatus" of card "CrdMain" of stack gStackName to the left of card "CrdMain" of stack gStackName
unlock screen
end resizeStack

on ideToolChanged
send "updateTool" to button "BtnRun-Edit" of card "CrdMain" of stack gStackName
end ideToolChanged

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: revTinyIDE fix for resizing code peek window

Post by AndyP » Sun Aug 11, 2019 4:11 pm

Hi Allan, Many thanks for noticing this and the solution.
This has now been updated on GitHub.

I have not made any updates to TinyIDE for a while so if you have any suggestions please post them to Issues.

Again, many thanks.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: revTinyIDE fix for resizing code peek window

Post by bogs » Sun Aug 11, 2019 4:16 pm

adxsoft wrote:
Sun Aug 11, 2019 10:12 am
...a big shout out to Andy Piddock for his excellent work.
I agree wholeheartedly with that, Andy did an awesome job with that.
AndyP wrote:
Sun Aug 11, 2019 4:11 pm
Many thanks for noticing this and the solution.
Although I never noticed the problem myself, great job!
Image

Post Reply

Return to “Building Externals”