PocketCM

Your mobile at your fingertips
Google
You are not logged in.

Customzing PocketCM Contact

You need PocketCM 0.16 or above in order to customize PocketCM this way.

Basic concept

There is 2 way of customizing PocketCM:
  • By editing a settings.ini file in the PocketCM folder
  • By creating a theme

Editing a settings.ini file

Basic idea: edit a text file, name it settings.ini, put in PocketCM folder
  • Open notepad
  • Edit using the setting below (add only the settings you need, not everything
  • Save it as settings.ini on your desktop
  • Close completely PocketCM
  • Copy it to your device in PocketCM directory (most likely something like \Program Files\PocketCM
  • Restart PocketCM Contact.

Create a theme

This is intented for more advanced user, so no detailed explaination
  • Make a ZIP file with your settings.ini, and all the required resources (image)
  • Name it accordingly
  • Copy it to your device
  • Select the theme

Settings : General

Also, the basic idea of settings is:

[control type].[control name].[property name]=value
for instance, for the text of the send button:
button.sendsmsbutton.text=Send
button - the control type
sendsmsbutton - the name of this specific button
text - the property you want to change

if you want to apply a property to all control of the same control type, you can use * as the name.

For instance to set the background for all button:
button.*.background=fill(#FF0000)
will make all button background red. If you want the sendsmsbutton to be green, while all the other button are red, you'll do:
button.*.background=fill(#FF0000)
button.sendsmsbutton.background=fill(#00FF00)
This way, the default is green, but the specific sendsmsbutton is green.

Settings constants

The new version introduce lot of settings, so you'll end up with lot of definition, most of them will most likely use the same settings over and over (same color for instance). PocketCM gives you a way to create constants in your settings.ini, the idea is that you'll just have to modify the value of the constants, in one place in the settings.ini and not everywhere. This is very useful when tweaking theme, you can change the complete theme colors easily.

the syntax is:
  • To create a new constant:
    $constantname$=constant value
    
  • To use a constant:
    $constantname$
A quick sample: Image I have the following settings:
global.flip.background=fill(#000000)
default.item.background=fill(#000000)
Which make, the item background black and the background of the flip animation black.

Now imagine I'd like to change this behavior, and want it to be red (#FF0000), with such settings I have to change two lines, with constant I can write:
$bg$=#FF0000

global.flip.background=fill($bg$)
default.item.background=fill($bg$)

Property type

Simple property

Some property are simple: text for instance, the value is simply the text you want.

Size property

Some property are more complex than in 0.15, for instance every size, for instance, the height of a contact item, can be a number (30), or a number followed by "p" (30p).

The "p" basically make it resolution aware: it's 30 pixel for QVGA device and 60 pixels for VGA device.

Color property

Color are now hexadecimal number. #RRGGBB

Font property

smslist.*.sent.read.font=12p,regular,Segoe UI,#FFFFFF,center
size: note that you can use the "p" notation to make it resolution aware
family: regular, bold or italic
font name: full font name "as it appears in Pocket Word"
color: the color of the rendered
alignement: left, center, right


For instance, here: for all sms list, message that are read and sent will use Segoe UI, 12 pt (and 24 px on VGA device) and will be rendered in white.

Background Property

Background property are the most rich and complex.

you can use:
  • fill(#FFFFFF) - fill in white
  • vgradient(#FFFFFF,#000000) - vertical gradient from white to black
  • hgradient(#FFFFFF,#000000) - horizontal gradiant from white to black
  • fillimage(imagename.bmp) - image will be drawn (not stretched)
  • stretchimage(imagename.bmp) - image will be stretched to fill the space occupied by the control
  • alphaimage(image.png) - image will be drawn using alpha channel, use it only when needed, it's a lot slower.
  • leftimage - Image will be drawn to the left, centered vertically (used for instance in SMS conversation message)
  • rightimage - Image will be drawn to the right, centered vertically
  • margin(2) - put a 2 pixel margin around the control
  • leftmargin, rightmargin, topmargin, bottommargin also works
  • solidborder(#000000, 2) - add a 2 pixels black border around the control
  • topborder(#000000, 1) - add a one pixel top border around the control
  • bottomborder(#000000, 1) - add a one pixel top border around the control


you can mix more than one in a single background, for instance:
button.*.background=vgradient(#FFFFFF,#AAAAAA),topborder(#333333,1),bottomborder(#333333,1),margin(2)
make the button filled with a vertical gradient from white to lightgray, a border of 1 pixel in dark grey, and a bottom border.

Box setting

Box define the position of the control, like the rect in 0.15 with more: you can use % and value relative to right, bottom border.

for instance:
button.sendsmsbutton.box=75%,-32p,100%,100%
the position is always: left, top, right, bottom.

left=75% so it's drawn at 75% of the container width (so 180 pixel if the orientation is portrait on a QVGA device)
top=-32p, negative value, means relative to the opposite border, "p" means resolution aware, so it means (320 - 32 = 288px for portrait when SIP is not shown on a QVGA device).
right and bottom: 100% so the edge of the screen.


In clear: the button will be drawn as the bottom right corner, with a height of 32 pixels and a width of 60 pixel.

List of all settings

In order to get the list of all settings, the easiest way is to make a dump, using PocketCM Contact 0.19 and above, simply hit the "dump settings" button in the options. It will give you an up to date settings list for the current version.
The dump has the following section:
  • Settings for landscape
  • Settings for portrait
  • Cache dump: the settings are cached, the cache dump allow you to investigate any UI element: show the page you want settings for in pocketcm, then dump it, it should appear in the cache (so you'll get every setting name, even if they don't have a specific value in the settings for portrait or landscape)
  • Localization dump: useful for translating the soft
© 2008 Quentin Pouplard