It is currently November 25th, 2020, 1:41 pm

"$UserInput$", Remnants, Ctrl + Enter: All new lines are cleared when [!Refresh]. How to prevent cleared text?

Help with creating, editing & fixing problems with skins
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

"$UserInput$", Remnants, Ctrl + Enter: All new lines are cleared when [!Refresh]. How to prevent cleared text?

Post by strawberryshortcake »

Problem: "$UserInput$" Ctrl + Enter creates new lines, however, anytime the skin undergoes [!Refresh], all new lines created by Ctrl+Enter are no longer visible in the text box. That's the main problem. Is there a solution?

Side Note:
1. The use of Ctrl + Enter keeps all remnants of new lines within the notepad.inc / notepad.txt file. They are not deleted even though the $UserInput$" textbox no longer shows any Ctrl+Enter text when [!Refresh] happens.

2. Yes, it's on the user to simply use a visible separator to separate 'bullet points' such as APPLE / ORANGE / GRAPE / PEACH FRUIT COBBLER / to mimic new bullet points if the user wants to avoid using Ctrl+Enter. By typing / to separate out bullet points, everything type in the textbox will remain visible when the [!Refresh] is applied to the skin. But this doesn't really solved the problem.

3. Using the commandplugin allows me to completely erase all traces of Ctrl+Enter new line bullet points from the notepad.inc / notepad.txt file, but unfortunately (a third side note that doesn't affect this particular problem) is that the commandplugin feature output file types only in ANSI, UTF8, UTF16 but not USC-2 LE BOM.

Hopefully the video better describes the situation.

Shows Color markers
Forgot to include color markers

The following is the text document in the video.

1. NEW line are not saved when !Refresh refreshes the skin. Only the first line remains unaffected. Ctrl + Enter creates new line. However, hitting refresh button removes any visible new line entrys on the calendar (user textinput box). BUT these new line entries remain embeded in the notepad file after the skin is [!Refresh].
2. The biggest issue I have are new lines being cleared when the !Refresh happens, especially if a second feature uses the !Refresh button to 'set' permanent colors.
3. The only way to preserve visible 'new lines' is to write everything AS ONE LINE.
4. All text can be cleared from the notepad using the CommandPlugin code. The issue with the CommandPlugin code is that it outputs ANSI, UTF8 and UTF16 file formats, which is why I don't use it to erase those little red corner box notes. Those specific notes require the file to be in USC2 LE BOM format. These little files I would simply clear all the text manually one by one. There's is no ALL CLEAR for these red boxes.


Don't really need to dive too deep into the code, but the main concern is how to 'fix' (if possible) or to prevent Ctrl +Enter text from disappearing after the user uses [!Refresh] on the skin itself.

Code: Select all

[Rainmeter]
Update=1000

[Variables]

;	This variable is important because this is the file that holds ALL (30 plus days) 
;	of text typed into the calendar box. However, the problem is that Userinput text
; 	does funny things when the user using the "Ctrl Enter" key to create new lines of text.
;	All text using the Ctrl Enter feature remains loaded onto the file (#@#Notes.inc) even 
; 	when it's clearly not visible on the calendar skin.
;	However, that's not even the biggest concern. That can be taken care of using commandplugin
; 	But the biggest issue is all Ctrl+Enter new text lines are no longer visible when [!Refresh] happens.

@include1=#@#Notes.inc



;----------------- Measure Plugin

; 	This section is important because it allows for userinput.
;	The problem with this is that when hitting !Refresh on Ctrl + enter 
;		to create separate lines, !Refresh will only preserve the 
;		very first line, but will completely erase all new lines 
;		that uses Ctrl+Enter.

	

[MeasureInputNote1a]
Measure			=Plugin
Plugin			=InputText
X				=((#Column_1x#)*(#Scale#))
Y				=( (#Row_1y#)*(#Scale#))
W			=((#widthbox#)*#Scale#)
H			=((#heightbox#)*#Scale#)
FontSize		=((#TEXTSize#)*#Scale#)
FontColor		=#TEXTfontcolor_Measure#
SolidColor		=#TEXTboxcolor_Measure#
DefaultValue		=#NOTE1a#
FocusDimiss		=1
DynamicVariables	=1
Command1		=[!WriteKeyValue Variables Note1a " $UserInput$" "#@#Notes.inc"][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1a #COLORIZE_TEXT#]
Command2		=[!SetVariable Note1a [MeasureInputNote1a]][!SetVariable DEFAULT_CLEARTEXT_meter_1a #COLORIZE_TEXT#]
Command3		=[!UpdateMeter "MeterNote1a"]
UpdateDivider=-1



;----------------- Meter IMAGE
;	This section is another cosmetic issue. Not important.
;	Beacause the calendar uses a yellow bar indicatr to highlight TODAY's DATE.
;		i needed something [MeterNote1a_TOP] to hide/show to make sure the 
;		calendar day's background remains the same color when the 
;		yellow bar is no longer highlighting that specific day.

[MeterNote1a_TOP]
Meter			=IMAGE
X			=((#Column_1x#)*(#Scale#))
Y			=((#Row_1y#)*(#Scale#))
W			=((#totalwidth#/#totalcolumn#)*(#Scale#))
H			=(((#totalheight#/#totalrow#)/5.25)*(#Scale#))
SolidColor		=#TEXTboxcolor#
UpdateDivider=-1




;----------------- Meter STRING
;	This section is required to display the actual text in the calendar 
;	box after you press the enter key. When the calendar is completely fresh 
;	and cleared of any user input text, normally #NOTE1a# would be visible
; 	in the calendar day box in the color white. Thus, I decided to 
;	add a #Default_CLEARTEXT_meter_1a# fontcolor variable so it's the same fontcolor 
;	as the calendar background solidcolor.
;	
;	In other words, #NOTE1a# is still present, but its (fontcolor) disguised and blends in
; 	with the default calendar background (solidcolor)
;	

[MeterNote1a]
Meter			=STRING
X			=((#Column_1x#)*(#Scale#))
Y			=((#Row_1y#+24)*(#Scale#))
W			=((#totalwidth#/#totalcolumn#)*(#Scale#))
H			=((#totalheight#/#totalrow#)/1.21)*(#Scale#)
FontSize		=((#TEXTSize#)*#Scale#)
FontColor		=#DEFAULT_CLEARTEXT_meter_1a#
SolidColor		=#TEXTboxcolor#
FontWeight		=#TEXTfontweight#
ClipString		=1
Text			=#NOTE1a#
LeftMouseUpAction	=[!CommandMeasure "MeasureInputNote1a" "ExecuteBatch 1-2"]
MouseOverAction		=[!ShowMeter AddOver1a][!Redraw]
MouseLeaveAction	=[!HideMeter AddOver1a][!Redraw]
DynamicVariables	=1
AntiAlias		=1


;----------------- Meter IMAGE

; 	This section is sort of useless. It's simply a cosmetic feature;
;	hover over calendar day and it lights up.
;	I used a very faint color so its not a real big distraction.
; 	it's very subtle.

[AddOver1a]
Meter			=IMAGE
X			=((#Column_1x#)*(#Scale#))
Y			=((#Row_1y#)*(#Scale#))
W			=((#widthbox#)*#Scale#)
H			=((#heightbox#)*#Scale#)
Solidcolor		=0,0,0,20
AntiAlias		=1
Hidden			=1
UpdateDivider=-1
 


;----------------- Meter IMAGE
;	This section is for setting the color marker of each 
;	calendar day if desired. It does requires a separate
;	[!Refresh] in order to permanently set the color.
; 	I purposely removed it directly from each 
; 	mousescroll action because I didn't want the skin to 
; 	refresh (and cause a rainmeter hiccup) everytime I set
;	a day's color. 

[ColorBox1a]
Meter=Image
X			=((#Column_1x#)*(#Scale#))
Y			=((#Row_1y#)*(#Scale#))
W			=((#widthbox#)*#Scale#)
H			=((#heightbox#)*#Scale#)
SolidColor		=#TEXTboxcolor1a#
MouseScrollUpAction	=[!WriteKeyValue Variables TEXTboxcolor1a #ScrollUpColor_Permanent#][!SetVariable TEXTboxcolor1a #ScrollUpColor_Transparent#][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollRightAction	=[!WriteKeyValue Variables TEXTboxcolor1a #ScrollRightColor_Permanent#][!SetVariable TEXTboxcolor1a #ScrollRightColor_Transparent#][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollLeftAction	=[!WriteKeyValue Variables TEXTboxcolor1a #ScrollLeftColor_Permanent#][!SetVariable TEXTboxcolor1a #ScrollLeftColor_Transparent#][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollDownAction	=[!WriteKeyValue Variables TEXTboxcolor1a #ScrollDownColor_Permanent#][!SetVariable TEXTboxcolor1a #ScrollDownColor_Transparent#][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
DynamicVariables	=1
UpdateDivider		=-1




;--------------------- Measure Plugin (RunCommand)


;	This section is important because it removes ALL traces of text enter. 
;	It even removes all traces the Ctrl Enter text from the notepad file.
;	However, I do have to run it twice (click LeftMouseUpAction) because the first 
;	click removes all visible text from the meter box, the second click removes 
; 	the text in the measure box.

;	The secondary problem that doesn't affect this current problem 
;	is that it only output's file type ANSI, UTF8 (for some reason, I can't output
;	file typ UTF16. And file type UCS-2 LE BOM unfortunately isn't outputed
;		otherwise I would use it to possibly clear out all the red 
;		corner dot in the calendar (using the QUoteplugin).


[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=break > "#MyFile#"
State=Hide
;OutputType=UCS-2 LE BOM
;OutputType=ANSI
OutputType=UTF16
UpdateDivider=-1


[CLEAR_TEXT]
Meter			=IMAGE
X			=(#Column_6x#)*(#Scale#)
Y			=#Row_0y#
W			=(((#totalwidth#)/(#totalcolumn#/4))/4)*(#Scale#)
H			=(#totalheight#/#totalrow#)*(#Scale#)
SolidColor		=0,0,255,200

X=(#Column_7x#)*(#Scale#)
W=(((#totalwidth#)/(#totalcolumn#/4))/4)*(#Scale#)
H=((#totalheight#)/(#totalrow#))*(#Scale#)

SolidColor=255,0,0,200

LeftMouseUpAction=[!CommandMeasure "MeasureRun" "Run"]
LeftMouseDownAction=[!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_1g #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_2g #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_3g #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_4g #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_5g #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6a #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6b #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6c #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6d #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6e #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6f #INVISIBLE_TEXT#][!WriteKeyValue Variables DEFAULT_CLEARTEXT_meter_6g #INVISIBLE_TEXT#][!Refresh]

MouseOverAction		=[!HideMeter CalendarMonthHeader][!ShowMeter AddOver_CLEAR_TEXT][!ShowMeter CLEAR_TEXT_CENTER_AREA_TEXT][!Redraw]
MouseLeaveAction	=[!ShowMeter CalendarMonthHeader][!HideMeter AddOver_CLEAR_TEXT][!HideMeter CLEAR_TEXT_CENTER_AREA_TEXT][!Redraw]