It is currently April 26th, 2024, 10:00 am

"illustro" inspired notepad?

Share and get help with Plugins and Addons
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: "illustro" inspired notepad?

Post by Chewtoy »

Right. Looks like you are pretty much getting it (unless you just copy+paste everything ;) ).
Good practice is to have the measures before the meters. The file is read from top to bottom, so to have the data before you write out the graphics is nice.

On to the parsing.
Lets say we have a .txt file that looks like this:

Code: Select all

<Title>Title - Notes</Title>

<Notes>*Notes
*and
*stuff
</Notes>
and we want that in a skin, we simply tell the Webarser measure to look for that pattern.

Code: Select all

[PNotes]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=10
Url=file://path\to\notes.txt
RegExp="(?siU)<Title>(.*)</Title>.*<Notes>(.*)</Notes>"

[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1


[MNotes]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=2
Substitute="*":"·"
As you can see in PNotes we are looking for the <pattern> and getting everything between the <tags>. If you want to know how to create real nice regexps; Here's some nice reading http://www.regular-expressions.info/tutorial.html

After PNotes you will see that we got 2 other measures. While PNotes gets us EVERYTHING we want, the other two divides our 'catches' to workable items.
In our regexp (.*) is telling us to get evertyhing it can. The first (.*) becomes StringIndex=1, the second is StringIndex=2 and so on. These we can link meter to and have the meter display it's data.

You might also notice that we got a substitute on MNotes. That substitutein is purely for aesthetics. I don't like the look of * in my notes, so I usually substitute it with · . I could write it out directly in the notes, but it's easier to write * instead of · several times.


That should help you on your way. :)
I don't think, therefore I'm not.
Rainmeterlol
Posts: 13
Joined: April 3rd, 2011, 9:04 pm

Re: "illustro" inspired notepad?

Post by Rainmeterlol »

Chewtoy wrote:Right. Looks like you are pretty much getting it (unless you just copy+paste everything ;) ).
Good practice is to have the measures before the meters. The file is read from top to bottom, so to have the data before you write out the graphics is nice.

On to the parsing.
Lets say we have a .txt file that looks like this:

Code: Select all

<Title>Title - Notes</Title>

<Notes>*Notes
*and
*stuff
</Notes>
and we want that in a skin, we simply tell the Webarser measure to look for that pattern.

Code: Select all

[PNotes]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=10
Url=file://path\to\notes.txt
RegExp="(?siU)<Title>(.*)</Title>.*<Notes>(.*)</Notes>"

[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1


[MNotes]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=2
Substitute="*":"·"
As you can see in PNotes we are looking for the <pattern> and getting everything between the <tags>. If you want to know how to create real nice regexps; Here's some nice reading http://www.regular-expressions.info/tutorial.html

After PNotes you will see that we got 2 other measures. While PNotes gets us EVERYTHING we want, the other two divides our 'catches' to workable items.
In our regexp (.*) is telling us to get evertyhing it can. The first (.*) becomes StringIndex=1, the second is StringIndex=2 and so on. These we can link meter to and have the meter display it's data.

You might also notice that we got a substitute on MNotes. That substitutein is purely for aesthetics. I don't like the look of * in my notes, so I usually substitute it with · . I could write it out directly in the notes, but it's easier to write * instead of · several times.


That should help you on your way. :)
Haha ! Copypaste <3 No but since im new i compare alot and try my way.. not like i code myself :P but im starting to get it.. even thought this is a simple skin.. But this pharsing stuff is something ill need to read up on before i will get it to work..

Cheers
//Alex


P.S!
If i get this right... im not supposed to have this
"[meterTitle]
Meter=STRING
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text="Notepad""

since i got the "<title>Notepad</title>" in the parsing file.. but im kinda stuck :/ i cant find any "simple enough" note skin that i can look at and compare.. all of them are complex whit images and shit ! ! :D

But i am supposed to write style for example the title under this
"[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1"
???? right?

hate parsing.. haha
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: "illustro" inspired notepad?

Post by Chewtoy »

Rainmeterlol wrote:Haha ! Copypaste <3 No but since im new i compare alot and try my way.. not like i code myself :P but im starting to get it.. even thought this is a simple skin.. But this pharsing stuff is something ill need to read up on before i will get it to work..

Cheers
//Alex


P.S!
If i get this right... im not supposed to have this
"[meterTitle]
Meter=STRING
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text="Notepad""

since i got the "<title>Notepad</title>" in the parsing file.. but im kinda stuck :/ i cant find any "simple enough" note skin that i can look at and compare.. all of them are complex whit images and shit ! ! :D

But i am supposed to write style for example the title under this
"[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1"
???? right?

hate parsing.. haha
The METER is what will be displayed. A MEASURE only gathers data, nothing graphical about it. You LINK meters to measures so the meter displays what ever the measure contains. :)

If you put Text="Something" then that meter will display Something. Nothing else.

What you want to do is this:

[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
MeasureName=MTitle
X=100
Y=12
W=190
H=18

This will make meterTitle diplay what ever MTitle has gathered.

ps. if you want a simple notes skin I would like to promote my own notes skin in SimpleMeter. While 2.0 might be a bit more complicated, most if it all is SIMPLE.
I don't think, therefore I'm not.
Rainmeterlol
Posts: 13
Joined: April 3rd, 2011, 9:04 pm

Re: "illustro" inspired notepad?

Post by Rainmeterlol »

Chewtoy wrote:The METER is what will be displayed. A MEASURE only gathers data, nothing graphical about it. You LINK meters to measures so the meter displays what ever the measure contains. :)

If you put Text="Something" then that meter will display Something. Nothing else.

What you want to do is this:

[MTitle]
Measure=Plugin
Plugin=WebParser.dll
URL=[PNotes]
StringIndex=1

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
MeasureName=MTitle
X=100
Y=12
W=190
H=18

This will make meterTitle diplay what ever MTitle has gathered.

ps. if you want a simple notes skin I would like to promote my own notes skin in SimpleMeter. While 2.0 might be a bit more complicated, most if it all is SIMPLE.
Ye i modified your noteskin to look like illustro's!
But i prefer having a seperate file whitout the LUA stuffs!

But i cant get the skin to open the other file.. parsing or whatever is hatiN!
but ill get it soon :D Ill live whit your note in the meanwhile :D

cheers! and thx for the help so far! even if it is beginner level :P
//Alex
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: "illustro" inspired notepad?

Post by Chewtoy »

Rainmeterlol wrote:Ye i modified your noteskin to look like illustro's!
But i prefer having a seperate file whitout the LUA stuffs!

But i cant get the skin to open the other file.. parsing or whatever is hatiN!
but ill get it soon :D Ill live whit your note in the meanwhile :D

cheers! and thx for the help so far! even if it is beginner level :P
//Alex
What? No. InputNotes is NOT SimpleNotes. Completely different skins.
http://browse.deviantart.com/?qh=&section=&global=1&q=SimpleMeter#/d30nvnz
That's SimpleMeter.
I don't think, therefore I'm not.
Rainmeterlol
Posts: 13
Joined: April 3rd, 2011, 9:04 pm

Re: "illustro" inspired notepad?

Post by Rainmeterlol »

Chewtoy wrote:What? No. InputNotes is NOT SimpleNotes. Completely different skins.
http://browse.deviantart.com/?qh=&section=&global=1&q=SimpleMeter#/d30nvnz
That's SimpleMeter.
LOL! i did it! whit alot of copypasting from your "Simple notes"-skinn! :D
Tyvm!

Took me a while to figure out that all your variables were in
"SimpleMeter2.0-styles" &
"SimpleMeter2.0-variables"
But now it works! Ty haha :D

Thinking about uploading it here somewhere if someone else would be interested ! But i dont want to take all the credit since i didnt do much of the coding :P So if u want to do me the honor :D I could zip it to ya! so could u uploade it in your name ?

or something ^^

Cheers
//Alex
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: "illustro" inspired notepad?

Post by Chewtoy »

Rainmeterlol wrote: LOL! i did it! whit alot of copypasting from your "Simple notes"-skinn! :D
Tyvm!

Took me a while to figure out that all your variables were in
"SimpleMeter2.0-styles" &
"SimpleMeter2.0-variables"
But now it works! Ty haha :D

Thinking about uploading it here somewhere if someone else would be interested ! But i dont want to take all the credit since i didnt do much of the coding :P So if u want to do me the honor :D I could zip it to ya! so could u uploade it in your name ?

or something ^^

Cheers
//Alex
Just upload it and give creds to whoever deserves them. Usually works out fine in this community. ;)
Though asking is nice, but yeah, upload it and just tell folks what you did and all that. :)
I don't think, therefore I'm not.