![]() ![]() |
GoFiler Legato Script Reference
Legato v 1.6l Application v 6.6b
|
| Table of Contents | < < Previous | Next >> |
Chapter Nine — Dialog Functions (continued)
9.6 Dialog Controls and Common Controls
Dialog pages are essentially a collection of various Windows Common Controls and custom controls. This section covers the common controls and styles.
The appearance of common control varies between versions of Windows and may also change depending on the selected display theme.
The codes for window styles are placed into a style word and an extended style word. For example, WS_CAPTION tells Windows to add a caption to the window. These styles occupy the high word (16-bits) of the window style dword (32-bits) while the low word is reserved for bit related to the specific window or control. Style bits can be set for each control and for the containing dialog as part of the dialog resource.
For example:
CONTROL "", 101, "listbox", LBS_NOTIFY | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_Vscroll | WS_TABSTOP, 12, 17, 160, 84, 0
The styles consist of WS_ items for defining the control style as a child window (of the dialog page), initially visible, with a border with adding a vertical scrollbar and as a tab stop within the dialog page. The LBS_ style belongs to the specific class “listbox” telling that control how to behave.
For the complete dialog:
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION
In this case, three WS_ styles are from the same set expressing how the main dialog page (which is also the contain dialog) is to look and behave. The DS_ style expresses how the dialog manager should behave.
After a window or control has been created, some of the styles can be changed. Legato does not directly support access to the styles once set.
Styles break into two broad types: Windows window types and specific control styles. Window styles generally apply to all windows and deal with things like containing borders, shading and overall behavior with respect to interaction with other windows. To slightly complicate matters as Windows functionality has expanded over the years, extended styles have been added as a separate style word known as extended window styles. Their designators start with WS_EX_ prefix.
Styles are always ORed using the | operator.
Windows styles set many behaviors, some of which may conflict. For a complete discussion of styles and all style definitions, see MSDN. While these styles (amongst others) can be used on most any window, the columns “Dialog or Page” and “Control” can be used as a guide for best or typical use.
The table below is an overview of the window styles relevant to dialogs and controls:
| Windows Definition |
Bitwise Value |
Dialog or Page |
Control | Description | ||||||
| WS_BORDER | 0x00800000 | N | Y | The window is created with a thin-line border. | ||||||
| WS_CAPTION | 0x00C00000 | Y | N | The window has a title bar (includes the WS_BORDER style). | ||||||
| WS_CHILD | 0x40000000 | Y | Y | The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style. | ||||||
| WS_DISABLED | 0x08000000 | N | Y | The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the ControlEnable or ControlDisable function. | ||||||
| WS_DLGFRAME | 0x00400000 | Y | N | The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar. | ||||||
| WS_GROUP | 0x00020000 | N | Y | The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys. | ||||||
| WS_HSCROLL | 0x00100000 | Y | Y | The window has a horizontal scrollbar. | ||||||
| WS_SYSMENU | 0x00080000 | Y | N | The window has a window menu on its title bar. The WS_CAPTION style must also be specified. | ||||||
| WS_TABSTOP | 0x00010000 | N | Y | The window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style. | ||||||
| WS_VISIBLE | 0x10000000 | N | Y | The window is initially visible. | ||||||
| WS_VSCROLL | 0x00200000 | Y | Y | Adds a vertical scrollbar. |
The relevant extended styles are as follows:
Class names used are either embedded into the installed operating system, by the application or by third-party applications. Legato supports the following embedded common controls and their styles:
| Defined Name | Class Name | Description | ||||
|---|---|---|---|---|---|---|
| WC_BUTTON | Button | Press/push button style controls such as buttons, checkboxes, radio buttons. Use the Button and Checkbox functions to access. | ||||
| WC_COMBOBOX | ComboBox | Combination edit and list box. Use the ComboBox functions to access. | ||||
| WC_COMBOBOXEX | ComboBoxEx32 | Combination edit and list box. Use the ComboBox functions to access. | ||||
| DATETIMEPICK_CLASS | SysDateTimePick32 | Date and time pickers. Use the Date and Time control functions to access. | ||||
| WC_EDIT | Edit | Single and multiple line edit input control. Use the Edit functions to access. | ||||
| WC_HEADER | SysHeader32 | Header control. There are presently no specific access functions. | ||||
| WC_IPADDRESS | SysIPAddress32 | IP address control. There are presently no specific access functions. | ||||
| WC_LINK | SysLink | A static style text control with link highlighting. Use the HypertextControl functions to access. | ||||
| WC_LISTBOX | ListBox | List box control. Use the ListBox functions to access. | ||||
| WC_LISTVIEW | SysListView32 | List box style control. There are presently no specific access functions. | ||||
| WC_NATIVEFONTCTL | NativeFontCtl | Windows control. There are presently no specific access functions. | ||||
| WC_PAGESCROLLER | SysPager | Windows control. There are presently no specific access functions. | ||||
| WC_TABCONTROL | SysTabControl32 | Tab rack control. Use the TabControl functions to access. | ||||
| WC_TRACKBAR | msctls_trackbar32 | Trackbar Control. Use the Trackbar functions to access. | ||||
| WC_TREEVIEW | SysTreeView32 | Tree style control. There are presently no specific access functions. | ||||
| WC_SCROLLBAR | ScrollBar | Scrollbar control. Use the Scrollbar functions to access. | ||||
| WC_STATIC | Static | Static display control for text, lines, rectangles, bitmaps and icons. Use the StaticControl functions to access. | ||||
Additional window classes can be used but must be manually accessed. Many controls respond to EditSetText and EditGetText.
Application embedded classes can include:
| Class Name | Description | |||
|---|---|---|---|---|
| data_control | Spread sheet style control embedded into Legato. Use the DataControl functions to access. | |||
| img_preview_control | A control to allow the previewing of various image types. Use the EditSetText function to display an image. | |||
| page_view | An HTML page editor. Use the Page Control functions to access. This control is only available on applications with HTML editing enabled. |
The following table lists the style bits that can be used with the button common control window class. Note that some of the styles dramatically change the appearance and behavior of the control. Also note, that when a control type such as AUTOCHECKBOX is employed, it will automatically fold in certain style bits.
The following table lists the style bits that can be used with the combobox common control window class.
| Constant | Description | |||
|---|---|---|---|---|
| LBS_COMBOBOX | Notifies a list box that it is part of a combo box. This allows coordination between the two controls so that they present a unified UI. The combo box itself must set this style. If the style is set by anything but the combo box, the list box will regard itself incorrectly as a child of a combo box and a failure will result. | |||
| LBS_DISABLENOSCROLL | Shows a disabled horizontal or vertical scrollbar when the list box does not contain enough items to scroll. If you do not specify this style, the scrollbar is hidden when the list box does not contain enough items. This style must be used with the WS_VSCROLL or WS_HSCROLL style. | |||
| LBS_EXTENDEDSEL | Allows multiple items to be selected by using the SHIFT key and the mouse or special key combinations. | |||
| LBS_MULTIPLESEL | Turns string selection on or off each time the user clicks or double-clicks a string in the list box. The user can select any number of strings. | |||
| LBS_NOINTEGRALHEIGHT | Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, the system sizes a list box so that the list box does not display partial items. For list boxes with the LBS_OWNERDRAWVARIABLE style, the LBS_NOINTEGRALHEIGHT style is always enforced. | |||
| LBS_NOREDRAW | Specifies that the list box’s appearance is not updated when changes are made. To change the redraw state of the control, use the WM_SETREDRAW message. | |||
| LBS_NOSEL | Specifies that the list box contains items that can be viewed but not selected. | |||
| LBS_NOTIFY | Causes the list box to send a notification code to the parent window whenever the user clicks a list box item (LBN_SELCHANGE), double-clicks an item (LBN_DBLCLK), or cancels the selection (LBN_SELCANCEL). | |||
| LBS_SORT | Sorts strings in the list box alphabetically. | |||
| LBS_STANDARD | Sorts strings in the list box alphabetically. The parent window receives a notification code whenever the user clicks a list box item, double-clicks an item, or cancels the selection. The list box has a vertical scrollbar, and it has borders on all sides. This style combines the LBS_NOTIFY, LBS_SORT, WS_VSCROLL, and WS_BORDER styles. | |||
| LBS_USETABSTOPS | Enables a list box to recognize and expand tab characters when drawing its strings. Use the ListBoxSetTabPositions function to set the tab stops in dialog units. | |||
| LBS_WANTKEYBOARDINPUT | Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key and the list box has the input focus. This enables an application to perform special processing on the keyboard input. |
| Constant | Description | |||
|---|---|---|---|---|
| SS_BITMAP | A bitmap is to be displayed in the static control. The text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap. | |||
| SS_BLACKFRAME | A box with a frame drawn in the same color as the window frames. This color is black in the default color scheme. | |||
| SS_BLACKRECT | A rectangle filled with the current window frame color. This color is black in the default color scheme. | |||
| SS_CENTER | A simple rectangle and the text is centered in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next centered line. Words that are longer than the width of the control are truncated. | |||
| SS_CENTERIMAGE | A bitmap is centered in the static control that contains it. The control is not resized so a bitmap too large for the control will be clipped. If the static control contains a single line of text, the text is centered vertically in the client area of the control. Unused portions of the control will remain the background color. | |||
| SS_EDITCONTROL | The static control duplicates the text-displaying characteristics of a multi-line edit control. Specifically, the average character width is calculated in the same manner as with an edit control, and the function does not display a partially visible last line. | |||
| SS_ENDELLIPSIS | If the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses. Using this style will force the control’s text to be on one line with no word wrap. Compare with SS_PATHELLIPSIS and SS_WORDELLIPSIS. | |||
| SS_ENHMETAFILE | An enhanced metafile is to be displayed in the static control. The text is the name of a metafile. An enhanced metafile static control has a fixed size; the metafile is scaled to fit the static control’s client area. | |||
| SS_GRAYFRAME | A box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default color scheme. | |||
| SS_GRAYRECT | A rectangle filled with the current screen background color. This color is gray in the default color scheme. | |||
| SS_ICON | An icon to be displayed in the dialog box. If the control is created as part of a dialog box, the text is the name of an icon (not a filename) defined elsewhere in the resource file. | |||
| SS_LEFT | A simple rectangle and the text is left-aligned in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line. Words that are longer than the width of the control are truncated. | |||
| SS_LEFTNOWORDWRAP | A simple rectangle and the text is left-aligned in the rectangle. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped. | |||
| SS_NOPREFIX | Prevents interpretation of any ampersand (&) characters in the control’s text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls. You can combine SS_NOPREFIX with other styles. This can be useful when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box. | |||
| SS_NOTIFY | Sends the parent window STN_CLICKED, STN_DBLCLK, STN_DISABLE, and STN_ENABLE notification codes when the user clicks or double-clicks the control. | |||
| SS_PATHELLIPSIS | Replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, SS_PATHELLIPSIS preserves as much as possible of the text after the last backslash. Using this style will force the control’s text to be on one line with no word wrap. Compare with SS_ENDELLIPSIS and SS_WORDELLIPSIS. | |||
| SS_REALSIZECONTROL | Adjusts the bitmap to fit the size of the static control. For example, changing the locale can change the system font, and thus controls might be resized. If a static control had a bitmap, the bitmap would no longer fit the control. This style bit dictates automatic redimensioning of bitmaps to fit their controls. If SS_CENTERIMAGE is specified, the bitmap or icon is centered (and clipped if needed). If SS_CENTERIMAGE is not specified, the bitmap or icon is stretched or shrunk. Note that the redimensioning in the two axes are independent, and the result may have a changed aspect ratio. Compare with SS_REALSIZEIMAGE. | |||
| SS_REALSIZEIMAGE | Specifies that the actual resource width is used and the icon is loaded using LoadIcon. SS_REALSIZEIMAGE is always used in conjunction with SS_ICON. SS_REALSIZEIMAGE uses LoadIcon, overriding the process normally followed under SS_ICON. | |||
| SS_RIGHT | A simple rectangle and the text is right-aligned in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next right-aligned line. Words that are longer than the width of the control are truncated. | |||
| SS_RIGHTJUST | The lower right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon. | |||
| SS_SIMPLE | A simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or altered in any way. Also, if the control is disabled, the control does not gray its text. | |||
| SS_SUNKEN | Draws a half-sunken border around a static control. | |||
| SS_TYPEMASK | A composite style bit that results from using the OR operator on SS_* style bits. Can be used to mask out valid SS_* bits from a given bitmask. Note that this is out of date and does not correctly include all valid styles. Thus, you should not use this style. | |||
| SS_WHITEFRAME | A box with a frame drawn with the same color as the window background. This color is white in the default color scheme. | |||
| SS_WHITERECT | A rectangle filled with the current window background color. This color is white in the default color scheme. | |||
| SS_WORDELLIPSIS | Truncates any word that does not fit in the rectangle and adds ellipses. Using this style will force the control’s text to be on one line with no word wrap. Compare with SS_ENDELLIPSIS and SS_PATHELLIPSIS. |
| Constant | Description | |||
|---|---|---|---|---|
| TBS_AUTOTICKS | The trackbar control has a tick mark for each increment in its range of values. The frequency of the ticks can be adjusted via the TrackbarSetTickFrequency function. | |||
| TBS_BOTH | The trackbar control displays tick marks on both sides of the control. This will be both top and bottom when used with TBS_HORZ or both left and right if used with TBS_VERT. | |||
| TBS_BOTTOM | The trackbar control displays tick marks below the control. This style is valid only with TBS_HORZ. | |||
| TBS_DOWNISLEFT | By default, the trackbar control uses down equal to right and up equal to left. Use the TBS_DOWNISLEFT style to reverse the default, making down equal left and up equal right. | |||
| TBS_ENABLESELRANGE | The trackbar control displays a selection range only. The tick marks at the starting and ending positions of a selection range are displayed as triangles (instead of vertical dashes), and the selection range is highlighted. | |||
| TBS_FIXEDLENGTH | The trackbar control allows the size of the slider to be changed with TrackbarSetSliderSize function. | |||
| TBS_HORZ | The trackbar control is oriented horizontally. This is the default orientation. | |||
| TBS_LEFT | The trackbar control displays tick marks to the left of the control. This style is valid only with TBS_VERT. | |||
| TBS_NOTHUMB | The trackbar control does not display a slider. | |||
| TBS_NOTICKS | The trackbar control does not display any tick marks. | |||
| TBS_NOTIFYBEFOREMOVE | Trackbar should notify parent before repositioning the slider due to user action (enables snapping). When present, the TRBN_THUMBPOSCHANGING is sent via the action procedure. | |||
| TBS_REVERSED | This style bit is used for "reversed" trackbars, where a smaller number indicates "higher" and a larger number indicates "lower." It has no effect on the control; it is simply a label that can be checked to determine whether a trackbar is normal or reversed. | |||
| TBS_RIGHT | The trackbar control displays tick marks to the right of the control. This style is valid only with TBS_VERT. | |||
| TBS_TOP | The trackbar control displays tick marks above the control. This style is valid only with TBS_HORZ. | |||
| TBS_TOOLTIPS | The trackbar control supports tooltips. When a trackbar control is created using this style, it automatically creates a default tooltip control that displays the slider's current position. You can change where the tooltips are displayed by using the TrackbarSetToolTipPosition function. | |||
| TBS_TRANSPARENTBKGND | Background is painted by the parent. | |||
| TBS_VERT | The trackbar control is oriented vertically. The default is horizontal. |
Page revised 2026-11-16
| Table of Contents | < < Previous | Next >> |
© 2012-2026 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission is prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. Novaworks, GoFiler™ and Legato™ are registered trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are the property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.