"If nothing works, check the instructions.."
NOTE: Before we start, the DevPack is written in Delphi, so you should have Delphi to work with this DevPack.
This is a really short tutorial, it might look big, but it is very basic and you can probably master it in a couple of tries.
To begin with, download DevPack.zip
Unzip it and you should have 4 files and 1 folder:
(This folder has 6 files which can easily be updated in case of a newer version of DevPack, so one can just download this folder and re-compile the winJet to have the newer features included.)
Start with changing 'change_me.dpr' to whatever WinJet you are planning to create
Time.dpr ==> Time.exe or IP.dpr ==> IP.exe
Click on change_me.dpr (which is now your_component.dpr) to start Delphi. You will most propbably get a Window popup:
Cannot find resource file - your_component.res, Created
Click on 'OK'
Swith to the your_component code window and change the first line :
program your_component; //(same your_component which you defined in #3)
Now changing the icon is totally optional, but it would help keeping this project intact. So if you want, we can easily change the icon of the application by going to
Projects->Options->Application->Load Icon and load WinJets.ico (provided with DevPack)
Now starts the good stuff...
Switch to the 'Main' window code. You will see the 'CORE CODE'. Please do not change that unless you know what you are doing.
Scroll down to the bottom where it says 'END CORE'
Now to change the image which appears on the WinJet displays
In procedure TWindow.FormCreate(Sender: TObject);
default_icon := 'whatever.jpg' or 'none'//if you dont want any image
//Currently default_icon can take *.jpg or *.ico
//Try to keep it small, since that has to ship with the WinJet too
Now you can do whatever on the form. Drop a Label, EditBox, Image, Timer, whatever you like and go crazy!! If you choose a TLabel, make sure to check the its Transparent property to TRUE. Most of the times you only need a label, if you want multiple lines, you can just add #13 at the end of the line and you'll get a nice paragraph or set Wordwrap to true. Either way, labels are cool..
If you need to initialize them, do it in the TWindow.FormCreate procedure
After you done with what you want to do, there are 3 more things still needed to be done.
Create a OnMouseDownEvent of the component(s) you just dropped in the form from the Events Box and put drag_n_drop; in it. For Example:
procedure TWindow.Label1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
This enables the user to drag the WinJet around the desktop by clickin n' dragging it's component(s).
Here comes the challenge, now since you have done all the pretty stuff, you need to figure out how the user can configure the Component to their pleasure. This is upto the coder, how flexible he wants the WinJet to be. We will show a very simple example of one possible way to do it.
If you have a TLabel, TEdit etc...
Locate procedure TWindow.Configure1Click(Sender: TObject); and add stuff to it...
For Example: We will use a TFontDialog and do:
procedure TWindow.Configure1Click(Sender: TObject);
FontDialog1 : TFontDialog; //you can use TColorDialog too if you want begin
FontDialog1 := TFontDialog.create(nil);
with FontDialog1 do
Font := time_label.Font;
if Execute then
time_label.Font := Font;
FontDialog1.Free; //Remember: Always free what you create
//these 3 lines should always come in the end..
Window.AutoSize := true;
Here's the LAST part. You want the the configuration of the WinJet to be saved somewhere so that when next time the user open's the WinJet, he/she will have their old settings. By default, the x,y-coordinate, Icon, WinJets width, height and if StartAtBoot is enabled or not are saved. The configuration is saved in a .ini file so it is quite organized. You can be innovative and save whatever you want. For this, modify:
Both these procedures contain the default settings needed to be saved. Just follow the same format and add your own settings.