Project

General

Profile

Color themes

The Hammer comes with the following default color themes:

  • White
  • Black
  • Blue
  • Lime
  • Sahara
  • Serene

In order to select a different theme you go in the menu to: File -> Hammer Options -> Editor tab page -> Colorer
You can select from the predefined color schemes via the Color Scheme name comboform

It is also possible to create your own theme and save it under your own name. For this use the "New" button.

Adding a custom theme as a new default

If you created your own theme and you like it a lot then we would love to add it as another default theme to the list.

Below are the steps needed to do so yourself. They are also notes for us :)

Locate your new theme details

When you create a theme or customize it, the details for that theme are saved in the Hammer configuration file which can be found under the Hammer\Data folder.
The filename is CODEMAXEDIT.ini where username is your windows login name.
If your windows login is "John" then the filename will be CODEMAXEDITJohn.ini

Open that file and search for a line that starts with "PSCOLOR,"

Copy the text after "PCSCOLOR," from that line.

Change the Hammer source to include the new theme

Now in the Hammer source files look for a file Hammer\Pkg\THColorer.h and search for the following line:

Define TH_DEFSCHEMA_SAHARA_STR  for "Default (Sahara)"

You can add your own code name for the new theme there, in a new line underneath, let's call our new theme "DEMO", so that it looks like this:

Define TH_DEFSCHEMA_SAHARA_STR  for "Default (Sahara)"
Define TH_DEFSCHEMA_DEMO_STR  for "Default (Demo)"

Then look for the actual theme data a few lines down:

Define TH_COLORSCHEMA_SAHARA    for "255255187000220225240000255255255255255255187000000000000000255255187000255000255000255255187000000000255000255255187000255000000000255255187000000000255000255255187000000128000000255255187000255000128000255255187000000128128000255255187000255000000000255255187000000000255000255255187000128000000000255255187000105105105000190200225000255255255255192192192000220225240000128128128000255215215000000000000000200225255000255255000000255035035000000128128000255255187000170195240000215107000000255255187000000,000000000000000000000000000000000000000000000001000000"

and copy the line of data from your config file in there like so:

Define TH_COLORSCHEMA_SAHARA    for "255255187000220225240000255255255255255255187000000000000000255255187000255000255000255255187000000000255000255255187000255000000000255255187000000000255000255255187000000128000000255255187000255000128000255255187000000128128000255255187000255000000000255255187000000000255000255255187000128000000000255255187000105105105000190200225000255255255255192192192000220225240000128128128000255215215000000000000000200225255000255255000000255035035000000128128000255255187000170195240000215107000000255255187000000,000000000000000000000000000000000000000000000001000000"
Define TH_COLORSCHEMA_DEMO      for "025025025000120120120000255255255255255255255255255255255000025025025000255185255000025025025000140215240000025025025000255108108000025025025000140215240000025025025000187255187000025025025000192192192000025025025000000128128000255255255255255000000000255255255255000000255000255255255255128000000000255255255255192192192000080080080000255255255255192192192000105105105000090090090000255215215000000000000000200225255000255255000000255000000000202255255000025025025000000000170000255190120000025025025000000"

As you see our demo theme is shorter. This is fine, it just means that we didn't set a custom font.

Adding the new defaults to the header file is the first step, next up is adding this new theme to the UI.

For that go to file Hammer\AppSrc\Tools\THParameters.dg

In Object oSchemaSelect, procedure Combo_Fill_List

Under line:

  Send Combo_Add_Item TH_DEFSCHEMA_SAHARA_STR

add the new theme:

  Send Combo_Add_Item TH_DEFSCHEMA_SAHARA_STR
  Send Combo_Add_Item TH_DEFSCHEMA_DEMO_STR

also Object oSchemaSelect, procedure OnChange

Under line:

  Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA   To sSchema

add your new theme

  Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA   To sSchema
  Else If (sName=TH_DEFSCHEMA_DEMO_STR) Move TH_COLORSCHEMA_DEMO   To sSchema

same method, but a few lines down:

                                    Move (not((sName=TH_DEFSCHEMA_BLACK_STR) or ;
                                              (sName=TH_DEFSCHEMA_WHITE_STR) or ;
                                              (sName=TH_DEFSCHEMA_BLUE_STR)  or ;
                                              (sName=TH_DEFSCHEMA_SERENE_STR) or ;
                                              (sName=TH_DEFSCHEMA_SAHARA_STR) or ;
                                              (sName=TH_DEFSCHEMA_LIME_STR))) ;
                                                                        to iDisableManageButtons

change into:

                                    Move (not((sName=TH_DEFSCHEMA_BLACK_STR) or ;
                                              (sName=TH_DEFSCHEMA_WHITE_STR) or ;
                                              (sName=TH_DEFSCHEMA_BLUE_STR)  or ;
                                              (sName=TH_DEFSCHEMA_SERENE_STR) or ;
                                              (sName=TH_DEFSCHEMA_SAHARA_STR) or ;
                                              (sName=TH_DEFSCHEMA_DEMO_STR) or ;
                                              (sName=TH_DEFSCHEMA_LIME_STR))) ;
                                                                        to iDisableManageButtons

Then in oSchemaDelete, procedure onClick

 If (sName=TH_DEFSCHEMA_BLACK_STR or sName=TH_DEFSCHEMA_WHITE_STR or sName=TH_DEFSCHEMA_BLUE_STR or sName=TH_DEFSCHEMA_LIME_STR or sName=TH_DEFSCHEMA_SERENE_STR or sName=TH_DEFSCHEMA_SAHARA_STR) Begin

add your theme:

 If (sName=TH_DEFSCHEMA_BLACK_STR or sName=TH_DEFSCHEMA_WHITE_STR or sName=TH_DEFSCHEMA_BLUE_STR or sName=TH_DEFSCHEMA_LIME_STR or sName=TH_DEFSCHEMA_SERENE_STR or sName=TH_DEFSCHEMA_SAHARA_STR or sName=TH_DEFSCHEMA_DEMO_STR) Begin

Next in oSchemaDefault button, procedure onClick

add under line:

  Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sColors

your own colors:

  Else If (sName=TH_DEFSCHEMA_SAHARA_STR) Move TH_COLORSCHEMA_SAHARA To sColors
  Else If (sName=TH_DEFSCHEMA_DEMO_STR) Move TH_COLORSCHEMA_DEMO To sColors

And finally in Procedure SaveEntries:

locate this part:

  If ((sSchemaName<>TH_DEFSCHEMA_BLACK_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_WHITE_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_BLUE_STR)  and ;
    (sSchemaName<>TH_DEFSCHEMA_SERENE_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_SAHARA_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_LIME_STR)) Begin

and add your own:

  If ((sSchemaName<>TH_DEFSCHEMA_BLACK_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_WHITE_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_BLUE_STR)  and ;
    (sSchemaName<>TH_DEFSCHEMA_SERENE_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_SAHARA_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_DEMO_STR) and ;
    (sSchemaName<>TH_DEFSCHEMA_LIME_STR)) Begin

Congratulations!
If you now close the Hammer and recompile your new color theme should show up and you can select it as a default theme.