29 lines
2.7 KiB
Plaintext
29 lines
2.7 KiB
Plaintext
{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman\fprq2 Times New Roman;}{\f3\froman Times New Roman;}{\f4\froman Times New Roman;}}
|
||
{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
|
||
\deflang1033\horzdoc{\*\fchars }{\*\lchars }\pard\plain\f2\fs36\cf1\b COXSeparator
|
||
\par \plain\f2\fs20
|
||
\par \plain\f4\fs24 Separator is an example of a simple but very useful control. Separators, placed in the right position in the dialog or form view, can greatly improve the way your applications look.
|
||
\par
|
||
\par Amazingly, there is no such control among common controls. So we decided to fill the gap. We introduce new class COXSeparator that was designed primarily to provide easy-to-use separator control.
|
||
\par
|
||
\par COXSeparator is derived from CStatic class so you can use standard static control to create an object in Dialog Editor. Then you have to associate CStatic object with the control using Class Wizard and replace the name of class CStatic with COXSeparator.
|
||
\par
|
||
\par If you specify any text while creating static control in Dialog Editor then it will be displayed in the separator control. And it will be placed on the base of static control styles that you specify (SS_LEFT, SS_RIGHT,SS_CENTER). In order to display just plain separator you shouldn't associate any text with static conrol in Dialog Editor or you should call SetWindowText(_T("")) function while initializing controls. By the way, you can use SetWindowText function to set any text to separator control at run-time.
|
||
\par
|
||
\par Static control provides the functionality to display only horizontally aligned text. We go further and provide the functionality to display separator and associated text vertically. In order to set/remove vertical alignment you have to call the following function:
|
||
\par
|
||
\par \plain\f4\fs24\cf1\ul SetVertOriented
|
||
\par \plain\f4\fs24
|
||
\par By default we use horizontal orientation.
|
||
\par
|
||
\par Unfortunately only true type fonts can be used to display text vertically and usually default Windows font used in controls is not true type. Luckily you just can use standard SetFont function in order to set any font to separator control.
|
||
\par
|
||
\par We also provide customization functionality so you can specify the text color and Top/Left and Bottom/Right colors used to draw separator. Use following function in order to do that:
|
||
\par
|
||
\par \plain\f4\fs24\cf1\ul SetSeparatorColors\plain\f4\fs24
|
||
\par \plain\f4\fs24\cf1\ul SetTextColor\plain\f4\fs24
|
||
\par
|
||
\par Take a look at the "Separator" sample that demonstrate different separators. It can be found in .\\Samples\\GUI\\Separator subdirectory of your Ultimate Toolbox directory.
|
||
\par \plain\f4\fs20
|
||
\par }
|
||
|