How to build my own skin file?
The Exontrol ExSkin library installs the ExSkinBuilder component ( "Exontrol.ExSkinBuilder" is the control's identifier ) that helps you to build new skin files for your forms. Before showing how you can build your own skin file, we have to review for a bit how the ExSkinBuilder can be used. If you already know how to use the ExSkinBuilder component click here to see how to start your own skin file ( a skin file defines the window's visual apparance ).
Once that you have inserted a ExSkinBuilder component to a form or dialog, you are ready to build new skin files for your forms. Of course, you can use the ExSkinBuilder component to load and change already saved skin files. When the form that contains a ExSkinBuilder component is opened, the ExSkinBuilder component automatically shows the 'Zoom' and 'Properties' panels. The 'Zoom' panel helps user to magnify different portions of the screen. The 'Properties' panel contains information like, background color, background picture for the selected object.
By default, the builder adds all objects you need to build a window, including buttons, client area and so on.
The ExSkinBuilder's toolbox contains the following buttons:
Action | Description | |||
Open a file | Opens a file. The file should be saved previously using the Save button. By default, the builder loads *.esk file. Keep the CTRL key down to create a new skin file. | |||
Save a file | Saves the skin to a file. The builder saves everything that's required for the skin. Save As , if you are pressing the SHIFT key while clicking the 'Save' button you can choose a new file where to save the skin. By default, the builder compresses the files. Press CTRL key to save files uncompressed ( the message ' Save (uncompressed) as 'should appear on the save file dialog ). | |||
Insert Object | Creates a new child object. The newly created object is child of the selected object. By default, the newly created object has no picture or color associated to it. You have to define the object's background using the 'Properties' panel. You can also, insert a new child object while ExSkinBuilder is focused by pressing the 'Insert' key. | |||
Remove Object | Removes the selected object. Also, you can remove the selected object by pressing the 'Delete' key. | |||
Alignment | A set of six radio buttons that indicates the object's alignment relative to its parent. The list of radio buttons in their listed order is: None, Left, Right, Client, Top and Bottom. For instance, if an object has the Left Alignment, it means that the object shares the left area of the parent with itself. The object's coordinates are defined in the edit controls labeled: X, Y, CX and CY. The edit controls that handle coordinates are enabled based on the object's alignment. For instance, if the object's alignment is left, only the CX coordinate will be enabled, or if the object's alignment is None, then all coordinates are enabled. The coordinates are relative to the parent object, and they may contain arithmetic expressions, and % sign ( percent indicates that the object is % from the size of its parent ) as well. For instance, 50% means half of parent's size. | |||
Properties | A check button that indicates whether the 'Properties' panel is visible or hidden. The 'Properties' panel holds information about background of the selected object. Also, the the 'Properties' panel contains the list of pictures used by the skin. Details here. | |||
Zoom | A check button that specifies whether the 'Zoom' panel is visible or hidden. You can use the 'Zoom' panel to magnify different portions of screen. In order to visualize a specified portion of the screen you can press "CTRL" key while moving the mouse, or you can click into the 'Zoom' window and drag the focused rectangle to the area being magnified. You can magnify the are by keeping the (SHIFT + )CTRL key and clicking the Zoom Window. | |||
Draw grid lines | A check button that indicates whether the ExSkinBuilder draws the grid lines around the objects in the skin. The grid lines are not painted in the Test window. | |||
Test | Shows a test window that applies the current skin. |
In case you are not familiar with the objects that defines a window the following picture points each object in the window:
A picture that shows how hit test values are arranged on a standard window
The object in the skin can have a hit test code. The window uses the hit test code to identify the action that will take when user clicks the mouse button. The builder handles the followings hit test codes:
Action | Description | |||
HTNOWHERE | On the screen background or on a dividing line between windows | |||
HTCLIENT | In a client area. Specifies the client are of the container window. The container window uses the client area to display its children windows. | |||
HTOBJECT | You can use this hit test code to specify your own area. At runtime this type of object has no effect. | |||
HTTOPLEFT | In the upper-left corner of a window border. | |||
HTTOP | In the upper-horizontal border of a window. | |||
HTTOPRIGHT | In the upper-right corner of a window border. | |||
HTLEFT | In the left border of a window. | |||
HTSIZE | In a size box. | |||
HTRIGHT | In the right border of a window. | |||
HTBOTTOMLEFT | In the lower-left corner of a window border. | |||
HTBOTTOM | In the lower-horizontal border of a window. | |||
HTBOTTOMRIGHT | In the lower-right corner of a window border. | |||
HTMINBUTTON | In a Minimize button. | |||
HTMAXBUTTON | In a Maximize button. | |||
HTCLOSE | In a Close button. You can close the window by clicking the mouse in this area. | |||
HTHELP | In a Help button. Changes the cursor to a help cursor when the user clicks in this skin object. | |||
HTCAPTION | In a caption bar. For instance you can move the window by clicking the caption area and then dragging the mouse | |||
HTSYSMENU | In a System menu or in a Close button in a child window. | |||
HTTITLE | In title bar. The HTTITLE area displays the caption of the window. For instance you can move the window by clicking the caption area and then dragging the mouse |
Notes:
The 'Properties' panel is a resizable window that's visible only if the button is pressed. The caption of its window is 'Background'. The 'Properties' panel is always updated when the selected object is changed. The 'Properties' panel defines the list of pictures used by the skin. The 'Properties' panel looks like follows:
Use the Picture menu to insert, delete a picture object from the skin file. Note that all picture files are saved to the skin file ( ebn file ), no matter if they are used or not. The ExSkinBuilder compresses the file, so even if you are using a bitmap file or a gif file, the file of the skin will be compressed ( use the CTRL key to save the file as uncompressed ). The 'Properties''s toolbox contains the following buttons ( in their order ):
Action | Description | |||
Tile, Stretch | A set of two radio buttons that defines the way how the picture is displayed on the selected object: tiled or stretched. | |||
Transparent | A set of three radio buttons that defines the picture's transparency. If the first button is pressed, the picture is opaque, so no transparent colors are used. If the second button is pressed, the picture is transparent. No picture or background is applied to the selected object. If the third button is pressed, the last two buttons ( the black buttons ) define the transparent color from and transparent color to. In order to select a new transparent color, you have to click on the one of the last two buttons and drag to the desired color. Once that you have selected a transparency color, you have to presses the button again to apply the transparent color to the selected object. | |||
Colors | Defines a set of predefined colors. The X button clears the background color of the selected object. The bottom-right button ( bellow to X button ), helps user to add a custom color. How? Click the button and drag to desired color. Once that you have selected a custom color, you can press the button again and the builder will apply the selected color to the selected object. | |||
Picture coordinates | The X, Y, CX, CY edit controls define the coordinates of the picture on the background of the selected object. |
Now, that we are ready to go, we can start building the skin for your form. If you have already a skin file check the How to assign a skin file to my button? Between steps you can save the skin file using the Save button .