Skinning 101
Posted: Mon Jul 31, 2006 4:16 pm
--------------
Skinning 101
--------------
Here is a step-by-step tutorial on how to create a notifier for POP Peeper.
by: blind_phantom
--------------
Requirements
--------------
POP Peeper v3.x [update to be sure]
Notification Skin Plugin v3.0.0.1
--------------
Images
--------------
Right-click and save these images, you will need them to create your skin.




--------------
Step 1: Creating the folder
Create a folder in C:\Program Files\POP Peeper\Plugins\Skins (or where ever you have you POP Peeper setup) titled "Tutorial". This will be your working folder. Put all the above images in that folder.
Step 2: Creating the .ini
Create a file titled "tutorial.ini" by right clicking and selecting New>Text Document; rename the document to "tutorial.ini". This is where we will put the code to bring together all the image files so POP Peeper can read them. Open tutorial.ini and copy and paste the following code:
Skin_Name is needed for every skin, in this case it is Tutorial. Everything else you can input for yourself. The skin_dim is 329 x 98, or the size of the overall skin (not needed).
Step 3: Constants
Under INFO, you will need to paste this code:
This is for POP Peeper, we come back to this later.
Step 4: Main
Copy the following code again into tutorial.ini:
Bitmap probably one of the most important values. This is what will be used as your "background" or base image to what you will put all your other controls on-top of. Our base image is titled "form.gif". GIF, JPG, and BMP are accepted file formats. I recommend to use GIF or JPG to keep the file size down, but if you are using transparencies, go with GIF first, BMP second. To make a background transparent, fill your background a solid color (I find 0 255 0, or green, works best), and then set your BmpTrans to that color. More on this later.
This is also where you used to adjust the slider (what makes the notifier "pop-up"), but since you can control that yourself in the plugin, its really not needed to know what this stuff does. But here is an explanation of what everything means anyway:
Slider_Enabled = 1 enables slider, 0 disables
Slider_Speed = pixels-per-timer (see below)
Slider_Timer = how fast to move the window in milliseconds
Slider_Delay = pause in milliseconds for window
FontName, FontColor, and FontSize are all the default font settings that will be used. Tahoma is the default pre-Windows XP font, so it will do nicely. FontColor is a RGB number, just go into MS Paint and find the color you want with the color picker. 255 255 255 is white.
Step 5: Controls and Bitmap
Now for the meat of the code. Copy and paste this header:
By the way, if you are really nit-picky about organizing your code, anything after # is commented out (not used). It's actually good idea usually, but this is really simple coding and it is not really needed to comment everything.
The first control we will code will be the POP Peeper logo.
The [popIcon] is very important. Every control needs a unique name or you will have problems. Type is also important, since this is an image, it is _TYPE_Static. For other controls, different Types will be used. Pos is position from the upper-left hand corner of the base image (X Y coordinates) in pixels. Bitmap is the image (in our case icon.gif) and BmpTrans is just like before. Since the background is 0 255 0 in icon.gif, BmpTrans will now make it transparent. Sometimes you will have a "halo" around your image of the left over color. Just go into MS Paint and go over the edges and make sure everything is one color. BmpTrans is not needed if you do not need a transparency. GIF, JPG, and BMP are supported.
Step 6: Text
This control will now just place text onto the base image. Here is the following code:
Again, Type is _TYPE_Static, and position is X Y coordinates. Size is kinda funny, It's needed, but just make it a large number; too small will cut off words, too large, well, does nothing right now. Label is what you want your text to say, in this case "POP Peeper - New Message"
Step 7: Variables
Here is where we will code the variables that tell you from who the message is from, what account, and what the subject is.
Size is now important. The text box is only 145 pixels long, so we don’t want the text exceeding that amount. Label here is what will be displayed. The % is from the Variables (another important variable is %NumNewMsg%, which is total new messages). Here we wanted the font to be not white, but black. So we used the FontColor command (0 0 0 is black).
Step 8: Buttons
The final step, add the buttons. Buttons can also use BmpTrans, but we are not going to. The first button we are going to add is the close button.
Type now is _TYPE_Button, since we are making a button. Command depends on what you want the button to do. We got the command from Constants up above. Bitmap is what image you want to use for the button. POP Peeper has a nifty "button-depressor" that is on automatically. In other words, if you use an image for a button, POP Peeper will make it "button-like" when you click it, depressing the image. But since that doesn't look very good for this image, we use a second bitmap, Bitmap2, so that when you click the button, it uses the second image. Comment out Bitmap2 sometime to see what I mean (#bitmap2). Almost done, we just need to add buttons to open your email client, and to open POP Peeper.
If bitmap is not used, then POP Peeper draws a simple button for you. Usually, its pretty ugly, but it feels right at home here. Type is still _TYPE_Button, but this time, Size is the dimensions of the button (X Y). Label is what the button says. The Command changes this now, OPENPP and CLIENT.
Final Code
Test
Now just go into settings and test out your new skin. Everything should be working perfectly. Enjoy.

Skinning 101
--------------
Here is a step-by-step tutorial on how to create a notifier for POP Peeper.
by: blind_phantom
--------------
Requirements
--------------
POP Peeper v3.x [update to be sure]
Notification Skin Plugin v3.0.0.1
--------------
Images
--------------
Right-click and save these images, you will need them to create your skin.




--------------
Step 1: Creating the folder
Create a folder in C:\Program Files\POP Peeper\Plugins\Skins (or where ever you have you POP Peeper setup) titled "Tutorial". This will be your working folder. Put all the above images in that folder.
Step 2: Creating the .ini
Create a file titled "tutorial.ini" by right clicking and selecting New>Text Document; rename the document to "tutorial.ini". This is where we will put the code to bring together all the image files so POP Peeper can read them. Open tutorial.ini and copy and paste the following code:
Code: Select all
############################################
[INFO]
############################################
Skin_Name = Tutorial
Skin_Info =
Skin_Author =
Skin_Mail =
Skin_Web =
Skin_Dim = 329 x 98
Step 3: Constants
Under INFO, you will need to paste this code:
Code: Select all
############################################
[CONSTANTS]
############################################
# Control Types
_TYPE_Window = 0
_TYPE_Button = 1
_TYPE_Editbox = 2
_TYPE_Static = 3
# System Button Commands
_IDOK = 1
_IDCANCEL = 2
# App-defined Constants
_CMD_OPENPP = 10
_CMD_CLIENT = 11
_CMD_DISMISS = 12
_CMD_RELOADSKIN = 25
############################################
[VARIABLES]
############################################
%NumNewMsg% = number of new messages
%Account1% = Account Name for first account with new messages
%NumNewAct1% = Number of New Messages for first account
%Account2% = Account Name for second account with new messages
%NumNewAct2% = Number of New Messages for second account
# etc.
Step 4: Main
Copy the following code again into tutorial.ini:
Code: Select all
############################################
[MAIN]
############################################
Bitmap = form.gif
BmpTrans = 0 255 0
Slider_Enabled = 1
Slider_Speed = 10
Slider_Timer = 10
Slider_Delay = 300000
FontName = Tahoma
FontColor = 255 255 255
FontSize = 8
This is also where you used to adjust the slider (what makes the notifier "pop-up"), but since you can control that yourself in the plugin, its really not needed to know what this stuff does. But here is an explanation of what everything means anyway:
Slider_Enabled = 1 enables slider, 0 disables
Slider_Speed = pixels-per-timer (see below)
Slider_Timer = how fast to move the window in milliseconds
Slider_Delay = pause in milliseconds for window
FontName, FontColor, and FontSize are all the default font settings that will be used. Tahoma is the default pre-Windows XP font, so it will do nicely. FontColor is a RGB number, just go into MS Paint and find the color you want with the color picker. 255 255 255 is white.
Step 5: Controls and Bitmap
Now for the meat of the code. Copy and paste this header:
Code: Select all
############################################
# CONTROLS
############################################
The first control we will code will be the POP Peeper logo.
Code: Select all
[popIcon]
Type = _TYPE_Static
Pos = 6 6
Bitmap = icon.gif
BmpTrans = 0 255 0
Step 6: Text
This control will now just place text onto the base image. Here is the following code:
Code: Select all
[titleBar]
Type = _TYPE_Static
Pos = 25 6
Size = 150 150
Label = POP Peeper - New Message
Step 7: Variables
Here is where we will code the variables that tell you from who the message is from, what account, and what the subject is.
Code: Select all
[msgFromVar]
Type = _TYPE_Static
Pos = 172 32
Size = 145 100
Label = %Msg_From_1%
FontColor = 0 0 0
[msgActVar]
Type= _TYPE_Static
Pos = 172 54
Size = 145 200
Label = %Msg_Account_1%
FontColor = 0 0 0
[msgSubVar]
Type = _TYPE_Static
Pos = 172 75
Size = 145 100
Label = %Msg_Subject_1%
FontColor = 0 0 0
Step 8: Buttons
The final step, add the buttons. Buttons can also use BmpTrans, but we are not going to. The first button we are going to add is the close button.
Code: Select all
[btnClose]
Type = _TYPE_Button
Pos = 307 6
Command = _CMD_DISMISS
Bitmap = x.gif
Bitmap2 = x_2.gif
Code: Select all
[btnOpenPOP]
Type = _TYPE_Button
Pos = 10 35
Size = 100 20
Label = Open POP Peeper
FontColor = 0 0 0
Command = _CMD_OPENPP
[btnOpenClient]
Type = _TYPE_Button
Pos = 10 65
Size = 100 20
Label = Open Email Client
FontColor = 0 0 0
Command = _CMD_CLIENT
Final Code
Code: Select all
############################################
[INFO]
############################################
Skin_Name = Tutorial
Skin_Info =
Skin_Author =
Skin_Mail =
Skin_Web =
Skin_Dim = 329 x 98
############################################
[CONSTANTS]
############################################
# Control Types
_TYPE_Window = 0
_TYPE_Button = 1
_TYPE_Editbox = 2
_TYPE_Static = 3
# System Button Commands
_IDOK = 1
_IDCANCEL = 2
# App-defined Constants
_CMD_OPENPP = 10
_CMD_CLIENT = 11
_CMD_DISMISS = 12
_CMD_RELOADSKIN = 25
############################################
[VARIABLES]
############################################
%NumNewMsg% = number of new messages
%Account1% = Account Name for first account with new messages
%NumNewAct1% = Number of New Messages for first account
%Account2% = Account Name for second account with new messages
%NumNewAct2% = Number of New Messages for second account
# etc.
############################################
[MAIN]
############################################
Bitmap = form.gif
BmpTrans = 0 255 0
Slider_Enabled = 1
Slider_Speed = 10
Slider_Timer = 10
Slider_Delay = 300000
FontName = Tahoma
FontColor = 255 255 255
FontSize = 8
############################################
# CONTROLS
############################################
[popIcon]
Type = _TYPE_Static
Pos = 6 6
Bitmap = icon.gif
BmpTrans = 0 255 0
[titleBar]
Type = _TYPE_Static
Pos = 25 6
Size = 150 150
Label = POP Peeper - New Message
[msgFromVar]
Type = _TYPE_Static
Pos = 172 32
Size = 145 100
Label = %Msg_From_1%
FontColor = 0 0 0
[msgActVar]
Type= _TYPE_Static
Pos = 172 54
Size = 145 200
Label = %Msg_Account_1%
FontColor = 0 0 0
[msgSubVar]
Type = _TYPE_Static
Pos = 172 75
Size = 145 100
Label = %Msg_Subject_1%
FontColor = 0 0 0
[btnClose]
Type = _TYPE_Button
Pos = 307 6
Command = _CMD_DISMISS
Bitmap = x.gif
Bitmap2 = x_2.gif
[btnOpenPOP]
Type = _TYPE_Button
Pos = 10 35
Size = 100 20
Label = Open POP Peeper
FontColor = 0 0 0
Command = _CMD_OPENPP
[btnOpenClient]
Type = _TYPE_Button
Pos = 10 65
Size = 100 20
Label = Open Email Client
FontColor = 0 0 0
Command = _CMD_CLIENT
Now just go into settings and test out your new skin. Everything should be working perfectly. Enjoy.
