System Palette Viewer
What is it?
SysPal is a widget which displays the system hardware palette in display modes with 8-bit colour depth, either as a strip or a grid. The palette can be saved to disk or copied to the clipboard. SysPal has an Office 97-look user interface and can dock to the side of the desktop area. Select the "Docking View" menu item or double-click on the palette to enter docking mode, then drag the palette to the edge of the screen. Click here for screen-shots.
 
Let me at it!
This is MFC bloatware so I must apologise immediately for the huge size of my executable - about 150KB when zipped. Get it here.
 
Source Code
SysPal is probably not particularly interesting unless you happen to be writing a palette-aware application. However, it demonstrates a number of things that programmers may find useful:
  • Office 97-style menus (including context menu)
  • Office 97-style toolbar (customisable)
  • AppBar (dockable with desktop window)
  • Tracking datatips
  • Scheme for persistence of user settings (including toolbar state)
  • A class for extracting version resource info
  • Various other bits and pieces

A project file is included for Microsoft Visual C++ 5.0. Get it here (about 73KB).

 
A Bit of History
SysPal dates back to my multimedia days. It started life as a sample program in the Windows 3.x SDK which displayed the display's hardware palette in a window. Very handy for seeing what your palette manipulation code is really up to. The sample was rather spartan so I started making some improvements. Things got out of hand and SysPal took on something of a pedagogical nature. I reimplemented SysPal using MFC and learnt the art of applying the document-view model to anything other than a "Scribble"-style application. I ported SysPal to Win32 and experienced the delights of maintaining compatibility with Win32s on Windows 3.1. I am glad to say that developing software that runs on Win32s is something I am no longer burdened with, and SysPal now requires Win32 proper. A while back, I had to do some Macintosh porting using the Microsoft Visual C++ Cross-Development Edition. Again, SysPal was the perfect vehicle for learning the essentials of Mac porting. Microsoft have since ditched Visual C++ for Macintosh, and I have removed Mac support from SysPal, though you will still find the occasional "#ifdef _MAC" directive in the source code. SysPal features my implementation of Office 97-style "cool menus" and flat toolbars. Since I did that, MSJ have published a coolmenu implementation, and I believe the Stingray Objective Toolkit now supports coolmenus. Well, it was bound to happen. Most recently, I made SysPal into an "AppBar" - an app that docks to the side of the desktop window. Like Jeffery Richter, who wrote an article in MSJ (March 1996) about AppBars, I found this to be one of the trickiest things I've tried in quite a while. Finally, writing a nice 'About' box is always fun, and SysPal's was no exception.
 
 

This page was last updated on 20 August 1998.

 

1