Sandstorm’s SSTBNextGen Class
I have been silent these last few days inside the forum as my interest currently lies with providing interested users better tools. And since I recently provided classes with different themes and since the responses with those are very positive; I decided to continue creating new classes that might help others who have problem with visual design.
But sometimes creating new classes doesn’t necessarily mean that it is entirely new as can be seen with what I am going to share to you now. This is about my title bar class which I worked on enhancing to provide different colors and added more features.
Unlike what I have done before which is giving one style per class, e.g., SSVista series, AikonXP, Chrome, etc.; I decided to finally include a skinning ability with this next generation.
Mike Yearwood has advised me long before to turn my title bar class into something like this but I don't have the mood yet that time. Now I have.
Like my previous 3 classes, this one can be modified on the init event of the instance of the class in a form. In addition, I have replaced the formerly 3-segmented parts of the bar in favor of 2 segments. Also, I contained a lot of objects inside so you won't accidentally move those around plus it reduces the codings and location manipulations I have to do inside.
I formerly named this Ubuntu series being the base image is my ubuntu green I shared last time with the
Enhanced RTF revealed blog. But that ubuntu green still needs a few retouches. Being a part of my first generation of 3-segmented Title Bar class, sometimes the parts are sort of misaligned. Anyway, fixed that problem. And since this is my next generation of title bar class being it has theme capability, I renamed it
SSTBNextGen. Shown below is the class while I still called it Ubuntu Series:

Like my first generation of title bar classes, this repositions itself properly in the form, then hides the form’s title bar, enables tooltip, and resizes itself along with the form’s width. All you need to do is drop it anywhere in your form and let it do the rest. Plus of course, you can change Caption.
What then are the added features? Now, in addition to the above, this one can also do the following:
- As can be seen above, you can change the color into any of the above 7 variations, i.e., blue, brown, green, orange, pink, red and yellow.
- You can change the Caption’s Font as well
- And also Caption’s Font Size
- As well as Caption’s Forecolor
- You can also make it Bold
- Or Italic. Sounds better eh? But wait,
- Now you can change Caption’s Alignment as well. You can now make the title bar’s caption Centered.
- Also added the ability to place an icon image
- Maximize and Restore will show proper images now
- It will likewise show the proper tooltip on both maximized or normal state
- Double clicking the bar will toggle it into maximize and restore
- And you can move around the form by clicking on the bar and pressing the left mouse button down
Below is what SSTBNextGen can look:

In addition, I have played with a different approach with this and the SSButton class to make commands one-lined as compared to the last 3 classes with lots of
this declarations in the init event of the class’ instance on a form. Whereas before, we do it like:
This._color = “orange”
This._Caption = “Fuel Consumption Monitoring System”
This._boldcaption = .T.
Etc…
Now we can simply do it like:
this._settings("Fuel Consumption Monitoring System","Tahoma",;
10,,.T.,,2,"orange","exicon.bmp")That is actually the commands I used to generate the above image. Sounds easier huh?
Moreover, if your VFP version already has an
Intellisense, we can make use of it to know exactly where we are in the _settings:

Can’t I make it simpler where all I need to do is place the caption like this?
This._Settings(“Fuel Consumption Monitoring System”)Yes of course. Here is what will appear with the simple command above, the rest utilizing their default values:

That will work as all parameters have
default values as shown below:

However, you still need to assign at least one of the settings to activate the class _settings method.
Very Important:With my goal of lifting some weight off the end-user’s shoulder, there is one thing you need to do. Add the images I used into your project. To do that, in
Project Manager, go to
Other Tab, then
Others, then click the
Add button and choose all the images I used for my classes. You will not see the images during the development phase as those will appear on the final exe.
Update: December 26, 2009
I already have submitted the classes for free and easy download to Eric
for the download section of foxite, so you will see those pending the
decision of Eric. In addition, I have created a thread in coderisland
to have the same available for download. Please click on the link
below:
http://www.coderisland.com/forum/viewtopic.php?f=10&t=254