[Windows Mobile Software Development] poyensa:
weekday widget?

the idea comes from here

1) So first setp is download PoyTEST.rar from first post, extract the folder PoyTEST and rename it as Poy8weekday, then with m9editor open the file 30182CB6_manila located in folder \Workspace\mode9\. The idea is to create 2 graphics objects: poy8background and poy8today, no need to add more properties on them by now. Look how i have also changed names in ComponentClipCharacter and Group.

2) Then open the file CHTWidgetDev.lua with notepad2.exe (included in tools folder) and change every PoyTEST for Poy8weekday and also change the names previously defined in mode9 file (Poy8today, Poy8Group, Poy8background, Poy8ResizeLayer). Be careful its case sensitive (and do not forget to enjoy!)

3) Special attention to line #64: require("Home\\Scripts\\Home\\PoyTEST") this will be changed to #64: require("Home\\Scripts\\Home\\Poy8weekday)

4) in folder \workspace\_lua there is other 2 more files, delete translation.lua (we don not need for this widget) and open PoyTEST.lua with notepad2. First thing we need to do is change the name of this file, so the first line (green) is File name: 41CBC6DC_manila -- \windows\htc\home\scripts\home\PoyTEST.luac so change the last part to Poy8weekday.luac, then copy the full path \windows\htc\home\scripts\home\Poy8weekday.luac to manilaHASH.exe (included in tools folder) and get the manila name for this file: 1D773BFE_manila, so do change it in line #1 -- File name: 1D773BFE_manila -- \windows\htc\home\scripts\home\Poy8weekday.luac and save file as Poy8weekday.lua in _lua folder

Then do some changes of PoyTEST for Poy8weekday and so ...

This file is going to be core of our widget, it will define what the widget will do. In our case is quite simple function, it will get what day is today (from system) and then apply the corresponding texture (PNG) to our variable Poy8today. Something like "if today (from system) is Monday then Poy8today texture will be Monday.PNG; else if today (from system) is Tuesday then Poy8today texture will be Tuesday, ..." and so on. Of course using Lua language and the source freely provided by Co0kie Master

5) Once we do our lua file we should test if it works :) we do that with the file _Deploy_to_device_in_dev_mode.bat included in the kitchen. This file will compile the lua files, send all the files in our kitchen workspace folders to windows folder of our device and restart sense. Now you should connect your device to your PC via USB and synchronize. It is necessary to run only one time z_init.bat that will copy RestartManila.exe to our device. First we need to do some changes on _deploy_to_device_in_dev_mode.bat file: click on it with the right mouse button>edit then it will be opened with the simple text editor, the line regarding poyTEST.lua has to be changed to luatool /c -o ..\deploy\1D773BFE_manila ..\Workspace\_lua\Poy8weekday.lua

Also we have to put the png files in \Poy8weekday\Workspace\png. Thanks to Stopa46 who has kindly made a few set for this test.

DEVMODE its a change in the registry that activate a new slot for test widgets.

So now that we are in devMode its time to click the file _Deploy_to_device_in_dev_mode.bat, look the black screen and feel the adrenaline .... :)

Dont worry nobody get it at the first time, neither me this time I had to correct some typo-mistakes and add one end, but finally it worked :D so never forget to enjoy!

6) Tomorrow will explain making the CAB

Installation:

Copy	CHTwPoy8weekday.cab in your SD and click on it, the installation process will start.

Select install on device

accept softreset

once in the home screen again, go to edit home layout (or edit CHT lockscreen) > advanced (setting wheel) > Poy8weekday

in edit mode keeping pressed the widget a pop-up menu appear to remove, pin or resize.

the widget as it is works in WWE roms. If you are getting a white square it means your rom is not WWE (own language), then you have to change the name of the .png files of each days for the names of the weekdays in your own language, copy them to \windows folder accept overwrite and restart sense. You should see the widget working now.

You can edit the widget easily by editing the weekdays.png files, just make your favourites with PS, Gimp or any other, save them in \windows folder and restart sense. It is included also a background named Poy8background.png. And please share them with all of us!

Skins

Just edit the .png (monday.png, tuesday.png, etc.) files with PS Gimp or any other graphic editor and replace them in windows folder. have a look to this idea from Stopa:

You can get it as a cab from here