Re: line breaks with InputText.dll
Posted: April 28th, 2017, 1:25 pm
Ok, please post here the code of the incriminated skin.glow8 wrote:Okay so the balala code isn't working. At least here. Maybe the bug is only in this skin
Ok, please post here the code of the incriminated skin.glow8 wrote:Okay so the balala code isn't working. At least here. Maybe the bug is only in this skin
balala wrote:Ok, please post here the code of the incriminated skin.
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Quick Notes
Author=rasvob.deviantart.com
Version=1.0
;End of added Metadata
@include2=#@#Notes/Note1.txt
@include3=#@#Vars.inc
[Background]
Meter=Image
ImageName=#@#images\Notes\white_bg.png
W=280
H=275
Y=5
[MeterTopImg]
Meter=Image
ImageName=#top_slim#
W=280
[TextNotes]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color4#
X=0
Y=8
Text=Notas
[MeterSettings]
Meter=Button
X=260
Y=20
ButtonImage=#top_slim_btn#
ButtonCommand=[!ShowMeterGroup Cfg][!ShowMeter MeterSettings_off][!HideMeter MeterSettings][!Redraw]
[MeterSettings_off]
Meter=Button
X=260
Y=20
Hidden=1
ButtonImage=#top_slim_btn#
ButtonCommand=[!HideMeterGroup Cfg][!ShowMeter MeterSettings][!HideMeter MeterSettings_off][!Redraw]
[NoteText]
Meter=STRING
FontFace=RobotoLightNote
FontSize=9
FontColor=#color2#
AntiAlias=1
X=5
Y=44
W=270
H=230
Clipstring=1
Text=#Text#
LeftMouseUpAction=!RainmeterPluginBang "MeasureInput ExecuteBatch 1"
[MeasureSearchInput]
Measure=Plugin
Plugin=InputText
X=4
Y=3
W=188
H=44
SolidColor=200,200,200,255
FontColor=47,47,47,255
FontSize=11
AntiAlias=1
FocusDismiss=1
UpdateDivider=-1
RegExpSubstitute=1
Substitute="\r\n":"#*CRLF*#"
Command1=[!SetVariable Text "$UserInput$"][!UpdateMeasure "MeasureText"]
Command2=[!WriteKeyValue Variables TestString "[MeasureSearchInput]" "#CURRENTPATH#Test1.ini"]
[MeasureText]
Measure=String
String=#Text#
RegExpSubstitute=1
Substitute="\r\n":"#*CRLF*#"
OnChangeAction=[!WriteKeyValue Variables Text "[MeasureText]" "#@#Notes/Note1.txt"][!Refresh]
DynamicVariables=1
UpdateDivider=-1
[Over]
Meter=Image
W=270
H=215
X=5
Y=44
SolidColor=0,0,0,210
Hidden=1
Group=Cfg
[TextColorScheme]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color1#
X=70
Y=50
Text="Color theme"
[Box1]
Meter=Image
W=60
H=60
X=80
Y=100
SolidColor=#color_orange#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #orange_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #orange_slim_btn# "#@#Vars.inc"][!Refresh]
[Box2]
Meter=Image
W=60
H=60
X=160
Y=100
SolidColor=#color_red#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #red_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #red_slim_btn# "#@#Vars.inc"][!Refresh]
[Box3]
Meter=Image
W=60
H=60
X=80
Y=180
SolidColor=#color_blue#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #blue_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #blue_slim_btn# "#@#Vars.inc"][!Refresh]
[Box4]
Meter=Image
W=60
H=60
X=160
Y=180
SolidColor=#color_green#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #green_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #green_slim_btn# "#@#Vars.inc"][!Refresh]
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Quick Notes
Author=rasvob.deviantart.com
Version=1.0
;End of added Metadata
@include2=#@#Notes\Note1.txt
@include3=#@#Vars.inc
[Background]
Meter=Image
ImageName=#@#images\Notes\white_bg.png
W=280
H=275
Y=5
[MeterTopImg]
Meter=Image
ImageName=#top_slim#
W=280
[TextNotes]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color4#
X=0
Y=8
Text=Notas
[MeterSettings]
Meter=Button
X=260
Y=20
ButtonImage=#top_slim_btn#
ButtonCommand=[!ShowMeterGroup Cfg][!ShowMeter MeterSettings_off][!HideMeter MeterSettings][!Redraw]
[MeterSettings_off]
Meter=Button
X=260
Y=20
Hidden=1
ButtonImage=#top_slim_btn#
ButtonCommand=[!HideMeterGroup Cfg][!ShowMeter MeterSettings][!HideMeter MeterSettings_off][!Redraw]
[NoteText]
Meter=STRING
FontFace=RobotoLightNote
FontSize=9
FontColor=#color2#
AntiAlias=1
X=5
Y=44
W=270
H=230
Clipstring=1
Text=#Text#
LeftMouseUpAction=[!CommandMeasure "MeasureInput" "ExecuteBatch 1"]
[MeasureInput]
Measure=Plugin
Plugin=InputText
X=5
Y=44
W=270
H=230
SolidColor=200,200,200,255
FontColor=47,47,47,255
FontSize=9
AntiAlias=1
FocusDismiss=1
DefaultValue=#Text#
Command1=[!SetVariable Text "$UserInput$"][!UpdateMeasure "MeasureText"]
[MeasureText]
Measure=String
String=#Text#
RegExpSubstitute=1
Substitute="\r\n":"#*CRLF*#"
OnChangeAction=[!WriteKeyValue Variables Text "[MeasureText]" "#@#Notes\Note1.txt"][!Refresh]
DynamicVariables=1
UpdateDivider=-1
[Over]
Meter=Image
W=270
H=215
X=5
Y=44
SolidColor=0,0,0,210
Hidden=1
Group=Cfg
[TextColorScheme]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color1#
X=70
Y=50
Text="Color theme"
[Box1]
Meter=Image
W=60
H=60
X=80
Y=100
SolidColor=#color_orange#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #orange_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #orange_slim_btn# "#@#Vars.inc"][!Refresh]
[Box2]
Meter=Image
W=60
H=60
X=160
Y=100
SolidColor=#color_red#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #red_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #red_slim_btn# "#@#Vars.inc"][!Refresh]
[Box3]
Meter=Image
W=60
H=60
X=80
Y=180
SolidColor=#color_blue#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #blue_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #blue_slim_btn# "#@#Vars.inc"][!Refresh]
[Box4]
Meter=Image
W=60
H=60
X=160
Y=180
SolidColor=#color_green#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #green_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #green_slim_btn# "#@#Vars.inc"][!Refresh]
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Quick Notes
Author=rasvob.deviantart.com
Version=1.0
;End of added Metadata
@include2=#@#Notes\Note1.txt
@include3=#@#Vars.inc
[Background]
Meter=Image
ImageName=#@#images\Notes\white_bg.png
W=280
H=275
Y=5
[MeterTopImg]
Meter=Image
ImageName=#top_slim#
W=280
[TextNotes]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color4#
X=0
Y=8
Text=Notas
[MeterSettings]
Meter=Button
X=260
Y=20
ButtonImage=#top_slim_btn#
ButtonCommand=[!ShowMeterGroup Cfg][!ShowMeter MeterSettings_off][!HideMeter MeterSettings][!Redraw]
[MeterSettings_off]
Meter=Button
X=260
Y=20
Hidden=1
ButtonImage=#top_slim_btn#
ButtonCommand=[!HideMeterGroup Cfg][!ShowMeter MeterSettings][!HideMeter MeterSettings_off][!Redraw]
[NoteText]
Meter=STRING
FontFace=RobotoLightNote
FontSize=9
FontColor=#color2#
AntiAlias=1
X=5
Y=44
W=270
H=230
Clipstring=1
Text=#Text#
LeftMouseUpAction=[!CommandMeasure "MeasureInput" "ExecuteBatch 1-2"]
[MeasureInput]
Measure=Plugin
Plugin=InputText
X=5
Y=44
W=270
H=230
SolidColor=200,200,200,255
FontColor=47,47,47,255
FontSize=9
AntiAlias=1
FocusDismiss=1
DefaultValue=#Text#
RegExpSubstitute=1
Substitute="\r\n":"#*CRLF*#"
Command1=$UserInput$
Command2=[!WriteKeyValue Variables Text "[MeasureInput]" "#@#Notes\Note1.txt"][!Refresh]
[Over]
Meter=Image
W=270
H=215
X=5
Y=44
SolidColor=0,0,0,210
Hidden=1
Group=Cfg
[TextColorScheme]
Meter=STRING
MeterStyle=RobotoLight
FontSize=20
FontColor=#color1#
X=70
Y=50
Text="Color theme"
[Box1]
Meter=Image
W=60
H=60
X=80
Y=100
SolidColor=#color_orange#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #orange_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #orange_slim_btn# "#@#Vars.inc"][!Refresh]
[Box2]
Meter=Image
W=60
H=60
X=160
Y=100
SolidColor=#color_red#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #red_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #red_slim_btn# "#@#Vars.inc"][!Refresh]
[Box3]
Meter=Image
W=60
H=60
X=80
Y=180
SolidColor=#color_blue#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #blue_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #blue_slim_btn# "#@#Vars.inc"][!Refresh]
[Box4]
Meter=Image
W=60
H=60
X=160
Y=180
SolidColor=#color_green#
Hidden=1
Group=Cfg
LeftMouseUpAction=[!WriteKeyValue Variables top_slim #green_slim# "#@#Vars.inc"][!WriteKeyValue Variables top_slim_btn #green_slim_btn# "#@#Vars.inc"][!Refresh]
Code: Select all
[MeasureTextEdit]
Measure=String
String=#Text#
RegExpSubstitute=1
Substitute="#CRLF#":"\r\n"
Unfortunately, the InputText plugin is not aware of the #CRLF# special variable in Rainmeter.ariefcfa wrote:one question, the [MeasureInput] InputText DefaultValue=#Text# which is contain literal #CRLF#. But the #CRLF# is not displayed as new line break in input tex box when we edit it.
i try to add a new measure to substitute #CRLF# become "\r\n" and make DefaultValue=[MeasureTextedit]
assume Text=January#CRLF#FebruaryCode: Select all
[MeasureTextEdit] Measure=String String=#Text# RegExpSubstitute=1 Substitute="#CRLF#":"\r\n"
The input text will display it as January\r\nFebruary which is interpret literal \r\n not as line break.
Is there a way to anticipate this?
Code: Select all
RegExpSubstitute=1
Substitute="\r\n":"#*CRLF*#"
Right. While that doesn't solve his particular problem, you can use \r\n as control characters in a regular expression Substitute.fonpaolo wrote:You can use the opposite, if you use Ctrl + Enter in your ImputText and then add this substitution in your measure:...it works.Code: Select all
RegExpSubstitute=1 Substitute="\r\n":"#*CRLF*#"