It is currently February 27th, 2021, 10:35 pm

illustro Notes ~ Patch

Quote of the Day, To-Do List and other text-based skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4226
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

illustro Notes ~ Patch

Post by eclectic-tech »

I came across killall-q's Lua script for a generic notes skin from a few years ago, and really loved how simple, yet useful, it is! :great:

So, being the illustro fan that I am, I created a Notes skin in the illustro style using killall-q's LUA code; modified the original code to allow a custom prompt and strike-through options. :D
illustroNotes1.png
:: Features ::
  • illustro style
  • in-the-skin editing of up to 16 notes
  • double-click to edit note
  • ability to move notes up/down in the list
  • strike-through the current note (right-click to restore)
  • delete the current note
  • middle-click to copy highlighted note to the clipboard
  • enlarged edit buttons for better touch screen functions
  • removed position shift when deleting a note
PATCH Info
I packaged the skin as a patch to illustro, so if you already have illustro installed, it will add a Notes folder to your current illustro installation and not make any changes to other existing illustro skins.

If illustro is not installed, it will install in a new illustro/Notes folder in your skins folder.

:: Credits ::
killall-q for LUA code
Webdings font (@Resources\Fonts)
Rainmeter Team for illustro style

Version 1.2018.03.08 Initial release
Version 1.2018.03.10 touch screen improvements
Version 1.2018.03.11 added strike-through option and positioning

Latest version: DA Download Link
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4226
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: illustro Notes ~ Patch

Post by eclectic-tech »

"Tinker... tinker" :D

Version 1.2018.03.11
Added an option to strike notes versus just deleting; left-click icon to strike, right-click to restore
Removed re-positioning from the delete action

Edit: Here is the modified LUA code with the changes for strike-through. I added State# variables to the Notes.ini skin, and change them via the script, to track strike-through when adding, deleting, or moving notes.

Feel free to use it in a notes skin of your own. Note: Skin must be named 'Notes.ini' and the notes text file must be named 'Notes.txt'. All 3 files must be in the same folder, or you will need to edit the 'Notes.lua' code for alternate locations.

Notes.lua

Code: Select all

function Initialize()
	if SKIN:GetVariable('Item16') ~= "" then
		SKIN:Bang('!SetOption', 'Input', 'MouseOverAction', '[!SetOption Input Text "You List is Full!"][!SetOption Input SolidColor "160,0,0"][!UpdateMeter Input][!Redraw]')
		SKIN:Bang('!SetOption', 'Input', 'MouseLeaveAction', '[!SetOption Input Text "#*Prompt*#"][!SetOption Input SolidColor "#BGColor#"][!UpdateMeter Input][!Redraw]')
		SKIN:Bang('!SetOption Input LeftMouseUpAction ""')
	end
end

function AddItem()
	local input, crlf = SKIN:GetVariable('Input'):gsub("\r\n", "#*CRLF*#")
	if input ~= "" then
		for i = 1, 15 do
			SKIN:Bang('!WriteKeyValue Variables Item'..(i+1)..' """'..SKIN:GetVariable('Item'..i):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
			SKIN:Bang('[!WriteKeyValue Variables State'..(i+1)..' [#State'..i..'] "#CURRENTPATH#Notes.ini"]')
		end
		SKIN:Bang('!WriteKeyValue Variables Item1 """'..input..'""" "#CURRENTPATH#Notes.txt"')
		SKIN:Bang('[!WriteKeyValue Variables State1 None "#CURRENTPATH#Notes.ini"][!Refresh]')
	end
end

function EditItemA(n)
	SKIN:Bang('!SetVariable ItemOrig """'..SKIN:GetVariable('Item'..n):gsub("\n", "\r\n")..'"""')
	SKIN:Bang('!CommandMeasure mInput "ExecuteBatch 2"')
end

function EditItemB(n)
	local input = SKIN:GetVariable('Input'):gsub("\r\n", "#*CRLF*#")
	if input ~= "" then
		SKIN:Bang('[!WriteKeyValue Variables Item'..n..' """'..input..'""" "#CURRENTPATH#Notes.txt"][!Refresh]')
	else
		DeleteItem(n)
	end
end

function ClipItem(n)
	SKIN:Bang('!SetClip "'..SKIN:GetVariable('Item'..n):gsub("\n", "\r\n")..'"')
end

function StrikeItem(n)
	SKIN:Bang('[!WriteKeyValue Variables State'..n..' Strikethrough "#CURRENTPATH#Notes.ini"][!Refresh]')
end

function UnStrikeItem(n)
	SKIN:Bang('[!WriteKeyValue Variables State'..n..' None "#CURRENTPATH#Notes.ini"][!Refresh]')
end

function DeleteItem(n)
	for i = n, 15 do
		SKIN:Bang('!WriteKeyValue Variables Item'..i..' """'..SKIN:GetVariable('Item'..(i+1)):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
		SKIN:Bang('[!WriteKeyValue Variables State'..i..' [#State'..(i+1)..'] "#CURRENTPATH#Notes.ini"]')
	end
	SKIN:Bang('[!WriteKeyValue Variables Item16 "" "#CURRENTPATH#Notes.txt"][!Refresh]')
end

function SwapItemUp(n)
	if n ~= "1" then
		SKIN:Bang('!WriteKeyValue Variables Item'..n..' """'..SKIN:GetVariable('Item'..(n-1)):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
		SKIN:Bang('[!WriteKeyValue Variables State'..n..' [#State'..(n-1)..'] "#CURRENTPATH#Notes.ini"]')
		SKIN:Bang('[!WriteKeyValue Variables State'..(n-1)..' [#State'..n..'] "#CURRENTPATH#Notes.ini"]')
		SKIN:Bang('[!WriteKeyValue Variables Item'..(n-1)..' """'..SKIN:GetVariable('Item'..n):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"][!Refresh]')
	end
end

function SwapItemDown(n)
	if n ~= "16" and SKIN:GetVariable('Item'..(n+1)) ~= "" then
		SKIN:Bang('!WriteKeyValue Variables Item'..n..' """'..SKIN:GetVariable('Item'..(n+1)):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"')
		SKIN:Bang('[!WriteKeyValue Variables State'..n..' [#State'..(n+1)..'] "#CURRENTPATH#Notes.ini"]')
		SKIN:Bang('[!WriteKeyValue Variables State'..(n+1)..' [#State'..n..'] "#CURRENTPATH#Notes.ini"]')
		SKIN:Bang('[!WriteKeyValue Variables Item'..(n+1)..' """'..SKIN:GetVariable('Item'..n):gsub("\n", "#*CRLF*#")..'""" "#CURRENTPATH#Notes.txt"][!Refresh]')
	end
end