Thursday, November 22, 2007

UserData - what is this feature about?

UserData has been added in SkinCrafter v2.0.
But it looks like it still remains to be an unknown feature.

Well, let's try to define why was this functional implemented and when it may come in hand.

What's the application skin?

It's the assembled graphics or images with an appropriate settings used for applications controls skinning. By changing the skin you will change the appearance of standard controls in the application.

The above is pretty clear and simple.

Here is the case, you do develop the music player with avi file played at the splash screen while launching the player.
If you would offer your customers several skins you probably would like to play different avi files at the splash, depending on the style and the color of the skin, right?
Well, that's what UserData was developed for. You may create UserData entry in each of your skins, and put different avi files in there.
Just extract the avi at runtime from currently selected skin and play it. Your splash-screen video will be skin-dependable.

Another example.

Among standard controls you may use some 3rd party components, like Infragistics, ComponentOne or etc..
SkinCrafter will not be able to skin them as they are completely owner drawn.
However, such cool components offer a wide range of customization options and you may just tune them with the overall skin theme via setting proper colors.
Well, again that's where you may use UserData. You may create an entry for each color setting, or integrate a xml or ini file with all color settings in the skin.

I hope this will shed some light on UserData feature.

Also, you may download our UserData demo:

In it we used ini file for controls sizes and positions in each skin. Animations and music files are skin dependable (they are different in each skin)
All this was put into UserData section and was used inside the code.

Right, it's not a feature for designers.. But we do sell the component for developers, so UserData should be a good weapon in your arsenal.

Let me hear any questions. I'd be glad to explain this more.

Friday, November 09, 2007

Skins And MS Visual Studio 2005 Redisribution

There is a known problem with redistribution of non-dotNet\VC++ applications developed in VS 2005.

It's not enough to supply the required dlls, as at some points your application will still fail to launch on a fresh installations of Windows OS.

The only workaround for this situation is to deploy "Microsoft Visual C++ 2005 Redistributable Package" with your installation.

SkinCrafter engine is written in VC++, and since version 3.0 SkinCrafter ActiveX will be built in VS 2005 too.

Therefore, it's highly recommended to bare in mind the fact of MS VC++ Redist Package dependency when upgrading and deploying your products.

One more note, there are two versions of VC++ Redistribution package available at Microsoft website:

1) Microsoft Visual C++ 2005 Redistributable Package
2) Microsoft Visual C++ 2005 SP1 Redistributable Package

We will use the latest SP1 version.

Tuesday, November 06, 2007

Standard and custom skins

What is the difference between sandard and custom skins?

Standard skin includes a full set of more then 20 standard controls supported by SkinCrafter engine:

  • Window's frame, Title bar and Title bar buttons
  • MDI windows
  • Push button
  • Radio button
  • Check box
  • Push-like checkboxes and radio button
  • Scrollbars
  • Menu bar
  • Popup Menu
  • Toolbar
  • Tab conrol
  • Progress bar
  • Status bar
  • Resize grip
  • ListboxList control
  • Tree control
  • Dropdown/combo box
  • Groupbox
  • Header control
  • DateTime
  • PickerMonthCalendar

If these controls are filled with images and all your controls are skinned when this skin applied, then you are dealing with standard skin!

If you need a skin for your music player or cd burning utility, or web search anilizer or anything else, where the control buttons or other controls should have different appearence. Then you need a custom skin.

Custom skins do not depend on any templates, they usually are just drawn in graphics editor and should be cut into the skin, transforming the particular parts of drawn UI into the controls. This is what is refered when talking about custom skins.

Examles:

Standard skin:

[Skinastic]

Custom skin:

[VT Phone]

Standard skin:

[LedWidget]

Custom skin:

[Playton]

Friday, November 02, 2007

When do we need custom skins?

The Question.

I have been asked about custom skins a great number of times.
When are they really needed and how do they function?

Let's have this short article describing the topic.

First of all, we need to accept that SkinCrafter skins are skins for applications based on Windows Common Controls types.

When skin is applied, all controls are skinned with a particular graphics. I.e. all buttons look similar and all textboxes look similar.

It's not a rare case that developer needs to make some controls looking differently.

For example, he needs a greed button among the blue ones.
Or he wants to highlight the textbox with wrong input in red.
Or ...
I can list such cases endlessly.

Well, that's what the custom skins are meant for. You need them to make controls of one type look deferently than other skinned controls of this type.

Implementation.

In SkinBuilder, you should go to Custom Controls pane, and add the custom control you need.
For example, a textbox.
It will result in a new textbox item appeared in the controls tree. Which is completely the same as in Default Controls, but is here for you to put different images and colors settings.

When fulfilled, name this items according to your taste (let's say something like "redCustomTextBox" will do) and save the skin.

Now you will have two skins for textbox within a single skin file.

That's a half of the job.

If you now apply this skin to your application, all textboxes still will be skinned with default textbox skin.
That's because you need to specify in code, which control should use our custom skin .

There is an interface method - SetCustomSkinWnd - which should be used.
This method assigns a custom skin to a particular control or window.

In our case, a sample code snippet will look like this:

SkinOb.SetCustomSkinWnd(myTextBox.Handle.ToInt32(), "redCustomTextBox", false); //that's C# sample

The above code should be called after the textbox is created. And when compiled myTextBox should be skinned with custom skin and look different.

See more info about SetCustomSkinWnd method in SkinCrafter Help File.