Virtual OS/2 International Consumer Education
VOICE Home Page: http://www.os2voice.org
August 2002

[Newsletter Index]
[Previous Page] [Next Page]
[Feature Index]

editor@os2voice.org


ThemeManager - "How To" Modify existing Themes and Add New Themes

By Peter Brown © August 2002

I recently decided to modify an existing desktop theme and as I had so much fun doing it I thought maybe other people might like to give it a try. Here is a brief(?) "How To" article for those interested.

The reason for this document is that I am not the most creative person in the world. When I need an icon I tend to modify something that already exists rather than creating something from scratch. So this is for anyone who wants to modify an existing theme rather than design something new. As it also involves Adding New Themes to Theme Manager "Part 2 : Adding Themes" may be of some use to anyone considering Designing their own Themes.

I am going to use a conversion on the Ecomstation Warplike Dark theme as an example "How to". This should change the look of this theme from this:
Ecomstation Warplike Dark theme to this: Ecomstation Warplike Dark theme with pink buttons

Some of my system info that may be relevant in the following text:-

Boot Drive: = H:
Theme Manager Directory = H:\os2\Thememgr

What you need -  The Resource Manager "kit" which comprises these files:-

eCS users should find these in [Boot Drive]:\TVoice\Wiseprog\resmgr - do read the rdc.INF file for full explanations of commands and options.

You also need the Resource Compiler "kit" which includes these files:-

eCS users will find these included in the eCS Maintenance Tool. Make sure the paths to these locations are in your config.sys file to avoid typing paths on the command line.

This "THEME.RC" template from a newsgroup post by Alex Taylor - Thank you Alex

BITMAP 25 sysmen.bmp
BITMAP 26 min.bmp
BITMAP 27 max.bmp
BITMAP 28 rest.bmp
BITMAP 29 csysmen.bmp

BITMAP 30 sysmend.bmp
BITMAP 31 mind.bmp
BITMAP 32 maxd.bmp
BITMAP 33 restd.bmp
BITMAP 34 csysmend.bmp

BITMAP 48 buttons.bmp
BITMAP 50 hide.bmp
BITMAP 51 hided.bmp
BITMAP 52 close.bmp
BITMAP 53 closed.bmp

Copy the lines from BITMAP 25 to BITMAP 53 inclusive to a new editor window. IMPORTANT: It is necessary to press Enter at the end of the line starting BITMAP 53 so that the cursor is positioned at the start of a new line. I have found that the Resource Compiler fails with an "Unexpected end of file..." message if that carriage return is missing. Save this file as a "Template" using the filename THEME.RC - I chose to save this file in my Theme Manager Directory so I now have H:\os2\Thememgr\THEME.RC

Part 1 : How to modify existing themes

Step 1 - Create a "Work" directory and a "Themename" directory within the Theme Manager directory or anywhere else that you want. Using the "Themename" eCSW2pnk I now have these directories:-
H:\os2\Thememgr\eCSW2pnk
H:\os2\Thememgr\Work

Step 2 - In this example I have decided to modify Ecomstation Warplike Dark and give it a pink finish. To discover what theme manager files are involved it is necessary to open the Thememgr.idx file located in the Theme Manager Directory. Each line in this file contains a Theme name, the theme DLL file name and the preview bitmap file name. Select the line that refers to the Theme that you want to modify and copy it to a new editor window. Edit the line as necessary and save the new file to the "Themename" directory, use the "Themename".idx as the file name. In this example I have opened H:\os2\Thememgr\Thememgr.idx and selected this line:
 eComStation - warplike dark  ecswarp2.dll  ecswarp2.bmp
which I then copied to a new editor window and edited the line to read
 Warplike Pink  ecsw2pnk.dll  ecsw2pnk.bmp
I then saved it as H:\os2\Thememgr\eCSW2pnk\ecsw2pnk.idx

Step 3 - Copy the BMP file listed in the thememgr.idx file to the "Themename" directory renaming the BMP file to "Themename".BMP In this example H:\os2\Thememgr\ecswarp2.bmp is copied to H:\os2\Thememgr\eCSW2pnk\ecsw2pnk.bmp

Step 4 - Copy the DLL file listed in the themename.idx file to the "Work" directory. In this example H:\os2\Thememgr\ecswarp2.dll is copied to H:\os2\Thememgr\Work\ecswarp2.dll

Step 5 - To modify the bitmaps that make up the theme it is necessary to extract them from the DLL file to a RES file and then decompile the RES file into its components. To do this open a Command Window in the "Work" directory then type this command to create the RES file:

resmgr -x DLLNAME.DLL *.* DLLNAME.RES
The command line for the example is:-
[H:\os2\Thememgr\Work\]resmgr -x ecswarp2.DLL *.* ecswarp2.RES

It is now possible to extract the resource files to the current directory using this command:-

rdc DLLNAME.RES
The command line for the example is:-
[H:\os2\Thememgr\Work\]rdc ecswarp2.RES
This will extract all of the resources and create a DLLNAME.RC2 file - unless you specify a different filename - which is an index of the resources. My example now has a ecswarp2.RC2 file in H:\os2\Thememgr\Work

Step 6 - It is now necessary to compare the Theme.RC template with the DLLNAME.RC2 file to enable correct copying and renaming of required bitmaps. To do this open both files using a text editor. Here is a cutting from Theme.RC and ecswarp2.rc2:-

Theme.RC

BITMAP 25 sysmen.bmp
BITMAP 26 min.bmp
BITMAP 27 max.bmp
BITMAP 28 rest.bmp
BITMAP 29 csysmen.bmp
ecswarp2.RC2
BITMAP 25 res98562.bmp
BITMAP 26 res98563.bmp
BITMAP 27 res98564.bmp
BITMAP 28 res98565.bmp
BITMAP 29 res63087.bmp
As you can see the bitmaps have different filenames in these files but the BITMAP number is used to identify the bitmaps we need.

Step 7 - Copying bitmaps is achieved by using the above .RC files to locate required bitmaps in the "Work" directory and copying them to the "Themename" directory, Renaming them to the names listed in the Theme.RC file according to the BITMAP number. In this example I am copying a required bitmap using the .RC files. I will only copy a bitmap if it is listed in the Theme.RC file, so I check the BITMAP number in Theme.RC and find the same BITMAP number in ecswarp2.RC2 :-

BITMAP 25 is H:\os2\Thememgr\Work\res98562.bmp which I copied to H:\os2\Thememgr\eCSW2pnk\sysmen.bmp
BITMAP 26 is H:\os2\Thememgr\Work\res98563.bmp which I copied to H:\os2\Thememgr\eCSW2pnk\min.bmp

Having copied all the required bitmaps I then deleted the files in the "Work" directory as they are no longer required.

Step 8 - You may want to make copies of the bitmaps in the "Themename" directory before making any changes to them. Modify the bitmaps in the "Themename" directory using your favourite editor - including the preview bitmap which you copied earlier - to your taste and save them.

I used PMView to give the bitmaps in H:\os2\Thememgr\eCSW2pnk a "Pink Look" by the expedient of playing with RGB values until "The Wife" said that was what she wanted.

Just for the sake of some more graphics here is the Theme that I changed to fit in with my Blue Desktop colour scheme.

The original "Metallic - aluminum warp"              and my              "Metallic Blue Aluminum Warp"

Metallic - Aluminium warpMetallic Blue Aluminium Warp

Here is a "Roll your own" Theme - Coloured Tiles - from Alex Taylor:

This is available for download here Coloured Tiles Theme

Part 2 : Adding Themes

Step 9 - Having modified the required bitmaps it is now necessary to compile them into a RES file before we can use the Addtheme command to create the DLL file and the entry in the Thememgr.idx file. Copy the THEME.RC file to the "Themename" directory, Renaming it to "Themename".RC - the example RC filename is:- H:\os2\Thememgr\eCSW2pnk\ecsw2pnk.RC

We now have the bitmaps and the RC file in the same directory so open a command window in the "Themename" directory and use this command rc -r "Themename".RC to create the Themename.RES file. The command line for the example is:-

[H:\os2\Thememgr\eCSW2pnk\]rc -r ecsw2pnk.rc

Step 10 - Having created all the necessary files:-

Themename.idx
Themename.bmp
Themename.RES
Copy these files to the Theme Manager directory. It is necessary to have a copy of pmmrgres.dll in the Theme Manager directory for the Addtheme process to work. There should be a PMMRGRES.SAV file in the Theme Manager directory which can be copied to PMMRGRES.DLL - Do check this file exists before proceeding.

From a command line in the Theme Manager directory enter "Addtheme Themename". The Addtheme command will copy the pmmrgres.dll file to Themename.dll and update the Themename.dll file with the contents of the Themename.RES file. Addtheme also creates the entry in the Thememgr.idx file using the details in the Themename.idx file.

Having created the New Theme the files Themename.idx and Themename.RES can now be deleted from the Theme Manager Directory.

For my example I copied:-

ecsw2pnk.idx
ecsw2pnk.bmp
ecsw2pnk.RES
from H:\os2\Thememgr\eCSW2pnk to H:\os2\Thememgr

I then entered the following command:-

[H:\os2\Thememgr\]Addtheme ecsw2pnk

After receiving a "Successful completion" message I closed the command window and opened the Theme Manager directory ( [H:\os2\Thememgr] ) in icon view. There is a new DLL file, ecsw2pnk.dll, which should be the "Warplike Pink" Theme that my Mrs wanted. Running Theme Manager lists "Warplike Pink" so after Applying and Rebooting...

Does it work?

Yes :-)   I hope this helps other people address any urges they may have to Design or Modify Themes for Theme Manager.

As the graphics so far are all screen captures of theme previews displayed within Theme Manager here are a couple of gratuitous screenshots showing modified schemes in action on two Desktops.

Warplike Pink ThemeFrom Her Desktop - The Mrs'  "Warplike Pink Theme" in action.

This is a screen capture of a PMView window which contains a screen capture of Her Lotus Folder.

As you can see the Titlebar Buttons match in to the Mrs' "Pink" system Colour Scheme as displayed by the PMView Toolbar Buttons.  Also, although not displayed here, the Inactive Titlebar Colour is similar to the colour of the Titlebar Buttons.

A similar snapshot of "Metallic Blue Aluminium Warp" in action from my Desktop which has a "Blue" theme - you may have noticed this in the screenshots of the Theme Manager Previews.

References:

Other links referenced:
  Alex Taylor's Coloured Tiles theme - http://www.cs-club.org/%7Ealex/theme01.zip


[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org