manual
Next    Back

Custom controls

Sometimes you need specific appearance of a control, not as an application control type in general but as a single example. For instance, you need to create a skin for a specific functional button ("Play" or "Stop" button). Obviously button controls you have admittedly skinned in basic part of "Default Controls" are not acceptable in this case because of the difference in functionality. That’s why you should accomplish a custom skin creation for some buttons.


      SkinBuilder provides an opportunity to create a custom control skin for a special control. It means that control types are available in SkinBuilder and can be skinned as additional item being named specifically in "Custom control" pane or standardly like in "Default controls" pane.

      Primary action you should do for adding a new available control must being skinned is:

right click at "Custom Controls" item shows pop-up menu with all appropriate controls (Windows, Standard controls, Common controls).

select the control you want to create skin for and it will appear as branch item in SkinBuilder "Custom Controls" tree.

one click of the right button shows pop-up menu that allows you to rename the control according to your taste (you can do it also by pressing F2), delete it or clear. If you remane your control, this name will be used further in customized skin applying (As a parameter for SetCustomSkinWnd method).

apply a new element to "Properties" and "Options" panes settings (Image, Text Color, Drawing mode etc.).

look at the example VC++ code which gives an idea of custom skins using and write your own code for your application. For all other languages the general technique remains valid.

      extern ISCSkin *pSkin;
      extern CButton *pPlayButton, *pStopButton;
      pSkin->SetCustomSkinWnd((long)pPlayButton->m_hWnd,"PlayButton",FALSE);
      pSkin->SetCustomSkinWnd((long)pStopButton->m_hWnd,"StopButton",FALSE);

      Example for Media Player "PlayButton" and "StopButton" custom skin creation:

      The description of the way how you can treat these custom skins in your application is given below.

Click right at Custom Controls item, choose Standard Controls > Button.

Set focus on appeared Custom Button item and press F2 to rename the control (right click of the button works also).

Enter the name you want for this item, in our case it should be PlayButton. The procedure for the creation of StopButton control is the same as for PlayButton.

Select the images for PlayButton and StopButton in Properties pane.

Define "Text Color" to be applied to button text, but our example doesn't require it. As normal, highlight, pressed, disabled and focused states are available for this control we need to pick out images for every state.



       

1.       Use the tool-bar in "Custom Controls" pane to manipulate with Custom Controls settings.
2. Click the Add Folder item at the tool-bar to add a new folder to organize all your controls items. Enter the name of the folder in the "Input item name" dialogue appeared and click button or press "Enter" button on a keyboard. There is no limit to the number of folders you can add. Clicking the button will close the dialogue without adding any folder.

3. Use Move down and Move up arrows to move your items in the "Custom Controls" list to one possion up or down.

4. To duplicate any item in the "Custom Controls" list choose appropriate item and click Copy item.

5. To delete one or more items select the appropriate item(s) and then click the Delete item.

6. You can also select the control you want to create skin for clicking Insert Custom Control item at the tool-bar in "Custom Controls" pane. Choose any item from the list appeared or enter the name of the item in the Input item name dialogue and click button or press "Enter" button on a keyboard. The control will appear as branch item in SkinBuilder "Custom Controls" tree. Clicking the button will close the dialogue without adding any item.

 


Next    Back