WDS_Look

WDS_Look

wds

1998 12-05


CLASS

WDS_Look - look-and-feel specification


SYNOPSIS

Class WDS_Look contains a look-and-feel specification for a widget.


The look information is organized like a two-dimensional table. At any time, a widget can be in one of several states. For each state, there are many attributes which can be set explictly or mapped to a default.


PUBLIC MEMBER FUNCTIONS


void Reset(void)
Restores the table to the default values.



void SetElement(long state,long attribute,long set)

long GetElement(long state,long attribute)
Set/Get an element of the table, for a given state and attribute. Currently acceptable values for state are as follows. Enumeration values are given for clarity; they are subject to change.



WDS_STATE_0 0
WDS_STATE_1 1
WDS_STATE_2 2
WDS_STATE_3 3
WDS_STATE_4 4
WDS_STATE_5 5
General non-specific states. Since widgets can set their own state and determine their meaning, these states don't specifically mean anything. In addition, widgets are permitted to separate the concept of look states and state-change states, although, by default, they are coordinated. Additional states could be easily added by expanding the enumeration in look.h.
WDS_STATE_ALL 0xFFFFFF When used for SetElement(), this will set the specified attribute for all states. When used for GetElement(), the return value will be the maximum for that attribute from among all the states.


In addition to all of the color type's listed for EW_Window::SetColor() (such as EW_COLOR_BACKGROUND), the currently acceptable values for attribute are as follows. All values except WDS_ELEMENT_CALLBACK_INIT default to 0. Enumeration values are given for clarity; they are subject to change. This first group of attributes has the same meaning for all widgets. (WDS_ELEMENT_FIRST = EW_COLOR_NUMBER)



WDS_ELEMENT_COLOR_WIDGET_DITHER (WDS_ELEMENT_FIRST+0) An additional color used as a 50% dither with the widget color. For example, with a WDS_COLOR_WIDGET of green and WDS_ELEMENT_COLOR_WIDGET_DITHER of white, the resulting widget would appear as faded green. A WDS_ELEMENT_COLOR_WIDGET_DITHER of 0 (black) deactivates the option. To use 50% black, specify black as the WDS_COLOR_WIDGET and the other color as the WDS_ELEMENT_COLOR_WIDGET_DITHER.
WDS_ELEMENT_BORDER (WDS_ELEMENT_FIRST+1) Border type as defined by wdsBevelBox().
WDS_ELEMENT_PREF_X (WDS_ELEMENT_FIRST+2)
WDS_ELEMENT_PREF_Y (WDS_ELEMENT_FIRST+3)
The default preferred widget size, easily overwritten by EW_Widget::SetPrefSize().
WDS_ELEMENT_INDENT (WDS_ELEMENT_FIRST+4) The distance into the widget that the border begins in addition to WDS_ELEMENT_INSET along the left edge only, usually always 0.
WDS_ELEMENT_OUTDENT (WDS_ELEMENT_FIRST+5) The distance into the widget that the border begins in addition to WDS_ELEMENT_INSET along the right edge only, usually always 0.
WDS_ELEMENT_DEPTH (WDS_ELEMENT_FIRST+6) The distance in pixels that the a border edge covers.
WDS_ELEMENT_INSET (WDS_ELEMENT_FIRST+7) The distance into the widget that the border begins.
WDS_ELEMENT_INSET_MODY (WDS_ELEMENT_FIRST+8) A difference from WDS_ELEMENT_INSET in the vertical direction, usually 0.
WDS_ELEMENT_SUBINSET (WDS_ELEMENT_FIRST+9) A secondary inset for things within the bordered area. The regular inset is for the border itself. Not neccessarily effective on all widgets.
WDS_ELEMENT_SUBINSET_MODY (WDS_ELEMENT_FIRST+10) A difference from WDS_ELEMENT_SUBINSET in the vertical direction, usually 0.
WDS_ELEMENT_SUBINDENT (WDS_ELEMENT_FIRST+11) A secondary indent for things within the bordered area.
WDS_ELEMENT_SUBOUTDENT (WDS_ELEMENT_FIRST+12) A secondary outdent for things within the bordered area.
WDS_ELEMENT_LABEL_X (WDS_ELEMENT_FIRST+13)
WDS_ELEMENT_LABEL_Y (WDS_ELEMENT_FIRST+14)
Additional displacement on the text label. Can be positive (to right/top) or negative (to left/bottom).
WDS_ELEMENT_ANNOTATION_MODE (WDS_ELEMENT_FIRST+15)
WDS_ELEMENT_ANNOTATION_X (WDS_ELEMENT_FIRST+16)
WDS_ELEMENT_ANNOTATION_Y (WDS_ELEMENT_FIRST+17)
The mode and size of the annotation. This space is taken from the total geometry of the widget. If the given annotation size is too small, more space will be used to fit the annotation text. As such, an annotation size of (-1,-1) effectively causes annotation auto-sizing. The annotation mode is a semi-automatic method of adding exterior text to a widget. Currently acceptable values listed below:




WDS_ELEMENT_INHERITANCE (WDS_ELEMENT_FIRST+18) The type code of a widget to inherit look information for any attributes set to default. If 0, this widget inherits directly from WDS_Widget.
WDS_ELEMENT_CALLBACK_INIT (WDS_ELEMENT_FIRST+19) A function pointer to be called when the look-and-feel mode has changed. Most of the WDS widgets in the standard widget set actually set this to NULL since they are defined from a common initialization for convenience. But since outside widgets can not be a part of that function, they can use an alternate method as intentionally demostrated by WDS_HierForm and WDS_HierNode. The callback is sent a value for look-and-feel style as set by WDS_Looks::Initialize(). This method of look definition may be losing relevance with the use of Look-And-Feel files.
WDS_ELEMENT_UNION (WDS_ELEMENT_FIRST+20)
WDS_ELEMENT_UNION_0 (WDS_ELEMENT_UNION+0)
WDS_ELEMENT_UNION_1 (WDS_ELEMENT_UNION+1)
WDS_ELEMENT_UNION_2 (WDS_ELEMENT_UNION+2)
WDS_ELEMENT_UNION_3 (WDS_ELEMENT_UNION+3)
WDS_ELEMENT_UNION_4 (WDS_ELEMENT_UNION+4)
These entries can hold individual meaning for each widget class who has a unique type identifier. See following description.


For some specific widgets of the WDS set, the union values can be more clearly specified as follows:



WDS_ELEMENT_BUTTON_SENSE_ANNOTATION (WDS_ELEMENT_UNION_0) If non-zero, WDS_Button will react to button presses on the button's annotation as though they occured on the borderable region.



WDS_ELEMENT_HNODE_LINES (WDS_ELEMENT_UNION_1) If non-zero, WDS_HierarchyNode draws extra lines to connect the nodes in a Win32-style tree.



WDS_ELEMENT_GETSTR_SCOPE_SHALLOW (WDS_ELEMENT_UNION_0) If non-zero, tells WDS_GetString to use a shallow scope to allow focus to shift with different areas of a window.
WDS_ELEMENT_GETSTR_UNSELECT_FG (WDS_ELEMENT_UNION_1)
WDS_ELEMENT_GETSTR_SELECT_FG (WDS_ELEMENT_UNION_2)
WDS_ELEMENT_GETSTR_SELECT_BG (WDS_ELEMENT_UNION_3)
WDS_ELEMENT_GETSTR_HIGHLIGHT_BG (WDS_ELEMENT_UNION_4)
The foreground and or background colors of unselected, selected, and highlighted text in a WDS_GetString.



WDS_ELEMENT_TEXTLIST_HIGHLIGHT_BG (WDS_ELEMENT_UNION_0) The background color of highlighted text in a WDS_TextList.



WDS_ELEMENT_FORM_SEPARATOR (WDS_ELEMENT_UNION_0) For WDS_Form, the distance placed between children in any automatic placement mode.
WDS_ELEMENT_FORM_INDENT (WDS_ELEMENT_UNION_1)
WDS_ELEMENT_FORM_INDENT_AFTER (WDS_ELEMENT_UNION_2)
For WDS_Form, horizontally indents children a specified distance for all children after a specific index.
WDS_ELEMENT_FORM_COLOR_SELECT (WDS_ELEMENT_UNION_3) For WDS_Form, the color of the extra border placed around a child selected in a form using form selectability.



WDS_ELEMENT_PARTITION_SEPARATOR (WDS_ELEMENT_UNION_0) Width of the WDS_Partition partition bars in pixels.
WDS_ELEMENT_PARTITION_KNOB_OFFSET (WDS_ELEMENT_UNION_1) If non-negative, the partition bar is drawn as a line with a square knob, instead of a thick bar (ie. like Motif instead of Microsoft). the non-negative number specifies the distance in pixels of the knob from the left or bottom of this line.
WDS_ELEMENT_PARTITION_GRAB_WIDTH (WDS_ELEMENT_UNION_2) If non-zero, activates a grabable region of given width in addition to the normal width of the partition bar.
WDS_ELEMENT_PARTITION_GRAB_LENGTH (WDS_ELEMENT_UNION_3) If greater than or equal to zero, defines a distance from the left/top of the partition bar for which the grab width is active. Otherwise, the grab width applies to the whole bar.



WDS_ELEMENT_SCROLLREGION_SCROLLABLE (WDS_ELEMENT_UNION_0) For the WDS_ScrollRegion, determines the scrollability as follows. In this case, WDS_STATE_0 refers to the horizontal and WDS_STATE_1 refers to the vertical. The following options may be OR'ed together.




WDS_ELEMENT_SCROLLBAR_WIDTH (WDS_ELEMENT_UNION_0) For WDS_ScrollBar, width of the scrollbar in pixels.
WDS_ELEMENT_SCROLLBAR_CHILDREN (WDS_ELEMENT_UNION_1) For WDS_ScrollBar, the existance and placement of children with the following settings.




WDS_ELEMENT_POPUP_IDLE_HANDOFF (WDS_ELEMENT_UNION_0) For WDS_Popup, non-zero allows selection changes without buttons pressed. For example, sub-menus can auto-pop just by having the mouse over the parent.



WDS_ELEMENT_DIVIDER_SLIDEFORM (WDS_ELEMENT_UNION_1) For WDS_Divider, offsets the divider tabs to the right.
WDS_ELEMENT_DIVIDER_OVERLAP (WDS_ELEMENT_UNION_2) For WDS_Divider, expands selected divider tab in all directions, usually overlapping adjacent divider tabs. This overlapping effect debatably contradicts clean interface design, but it duplicates functionality seen on native Win32 interfaces.



WDS_ELEMENT_PICKBUTTON_WIDTH (WDS_ELEMENT_UNION_1) The width of the button on the right side of the WDS_Pick widget.



WDS_ELEMENT_PICK_AUTO_OFFSET (WDS_ELEMENT_UNION_0) If non-zero, offsets the WDS_Pick popup window so that the previous selection is vertically centered on the WDS_Pick widget.
WDS_ELEMENT_PICK_MAINTAIN_BUTTON (WDS_ELEMENT_UNION_1) Size WDS_Pick popup window so that the auto-offset window does not overlap the WDS_PickButton on the right side.
WDS_ELEMENT_PICK_WIN_HEIGHT_MAX (WDS_ELEMENT_UNION_2) Maximum height of the WDS_Pick popup window in pixels. Lists requiring more than this will be scrolled.



WDS_ELEMENT_MENUBUTTON_WIDTH (WDS_ELEMENT_UNION_1) The width of the WDS_MenuButton graphic on the right side of the WDS_MenuNode widget. A value of zero causes no such button to appear. The graphic is useful for portraying to the user which menu nodes are parents of submenus.


A setting for SetElement() and GetElement() can be any negative number, or a non-negative integer up to 0x00FFFFFF (-4294967295 to 16777215). The other bits are reserved and only apply when the value is non-negative. They are as follows.



WDS_ELEMENT_INHERIT 0x01000000 If set, inherit values through the setting of WDS_ELEMENT_INHERITANCE. Otherwise, get defaults from WDS_Widget.
WDS_ELEMENT_DEFAULT 0x02000000 Get the value from a default instead of using the value presented.
WDS_ELEMENT_MAP 0x04000000 Map the value from the default or inherited widget using the index supplied by the non-negative number in the lower bits. For example,
supplied by the non-negative number in the lower bits. For example, SetElement( WDS_ELEMENT_INACTIVE, EW_COLOR_HALF_LIT, WDS_ELEMENT_MAP| EW_COLOR_LIT); will use the default EW_COLOR_LIT setting for the EW_COLOR_HALF_LIT of the default widget look when in the inactive state.
WDS_ELEMENT_COPY 0x08000000 Used by WDS_Widget to mark copies so it knows if it can change arrow-point directions.


Also defined is the default for entries.



WDS_ELEMENT_DEFAULT_INIT (WDS_ELEMENT_INHERIT| WDS_ELEMENT_DEFAULT) The default value for each element is to default to the inherited look, except that callbacks default to NULL.



void Dump(WDS_Typecode typecode,char *type_name,WDS_Widget *widget)
When widget is NULL, print out the look table for debugging. The typecode and type_name are just used for text output. The format is subject to change.


If widget is not NULL, interpret the look at the point of view of the widget.


FILES

wds/look.h Look-and-feel header file


SEE ALSO

WDS_intro(3), WDS_Looks(3), WDS_Widget(3)