API Documentation > Interface Classes > Class uifcOptionMenu
Class uifcOptionMenu

# include <uifcOptionMenu.h>

class
uifcOptionMenu
: public virtual
uifcSelection
{
xaideclare(uifcOptionMenu)
...
};


Description
User Guide References:
Methods Inherited from Class uifcComponent::
Methods Inherited from Class uifcSelection::
Method Summary
void
void
void
CreateTimer (uifcOptionMenuTimer_ptr timer, xrstring timerName, xbool writeInTrail)
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
SetDigits (xint value)
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
SetWidth (xint value)
void
void
StartTimer (xrstring timerName, xint duration)
void
StopTimer (xrstring timerName)
void
Method Detail
void
InsertItem
(uifcOptionMenuItem_ptr optionmenuitem, uifcItemPositionData_ptr item_pos_data)
Parameters:
optionmenuitem
item_pos_data
Returns:
GetFrameOrigin
()
Determine the position of the component, in pixels, relative to its parent.
Returns:
void
DeleteGroupsByName
Delete groups from the component.
Parameters:
names
Returns:
GetCaretPosition
()
Get the caret position.
Returns:
void
OpenPopup
()
Display the drop-down List of the OptionMenu.
Returns:
void
InputBackspaceKeys
(xint count)
Execute a number of BACKSPACE key presses in the component.
Parameters:
count
Returns:
void
ReplaceSelectionWithText
(xint start, xint end, xrstring text)
Replace the text between the start and end caret positions with the given text.
Parameters:
start
end
text
Returns:
void
InsertTextIntoSelection
(xrstring text)
Insert the given text at the current caret position, replacing any selected text.
Parameters:
text
Returns:
GetLineLength
(xint line)
Get the length of the given line, i.e. the number of characters in it.
Parameters:
line
Returns:
void
MoveItemsByName
Reorders the items of the component so that the given array of items are placed in the given order (implied by the order of names in the array) immediately after the named item. When the items are reordered any item-related data is also reordered, i.e. the labels, help-texts, states, foreground and background colors, etc.
Parameters:
name
names
Returns:
void
SelectAll
()
Select all the text of the TextArea. The use of this operation has been superceded by SelectedRange operation is provided for backwards compatibility only.
Returns:
InsertPopupMenu
(uifcComponent_ptr component)
Add a MenuPane to be displayed when the user presses the right mouse button over the component.
Parameters:
component
Returns:
void
UndoLastChange
()
Undo the last change applied to the text.
Returns:
void
InsertGroup
(uifcOptionMenuGroup_ptr optionmenugroup, uifcItemPositionData_ptr item_pos_data)
Parameters:
optionmenugroup
item_pos_data
Returns:
void
MoveItemsByIndex
(xint item, xintsequence_ptr items)
Reorders the items of the component so that the given array of items are placed in the given order (implied by the order of names in the array) immediately after the named item indices. When the items are reordered any item-related data is also reordered, i.e. the labels, help-texts, states, foreground and background colors, etc.
Parameters:
item
items
Returns:
void
SetSelectedRange
(uifcPoint_ptr value)
Select the text between the start and end caret positions. Note: If start < 0 then the selection is removed, forcing the selection anchor to move to the caret position. If end < 0, the entire text is selected from the start position onwards.
Parameters:
value
Returns:
void
PasteClipboardToSelection
()
Replace the selected text with the contents of the system clipboard.
Returns:
GetFrameSize
()
Determine the size of the component, in pixels.
Returns:
void
DeletePopupMenu
()
Delete a MenuPane from the component.
Returns:
GetScreenOrigin
()
Determine the screen position of the component, in pixels.
Returns:
void
SetFrameOrigin
(uifcPoint_ptr value)
Set the screen position of the component, in pixels, relative to its parent. This operation is only supported when the component's parent is one of the following classes : DrawingArea NakedWindow PGLWindow
Parameters:
value
Returns:
void
CopySelectionToClipboard
()
Copy the selected text into the system clipboard.
Returns:
void
CutSelectionToClipboard
()
Copy the selected text into the system clipboard and then delete the selected text.
Returns:
void
SetFrameSize
Set the size of the component, in pixels. This operation is only supported when the component's parent is one of the following classes : DrawingArea NakedWindow PGLWindow
Parameters:
value
Returns:
void
InputDeleteKeys
(xint count)
Execute a number of DELETE key presses in the component.
Parameters:
count
Returns:
void
SetCaretPosition
(xint position)
Set the caret and the selection anchor positions.
Parameters:
position
Returns:
void
InsertItems
Parameters:
optionmenuitems
posData
Returns:
GetFrameRectangle
()
Determine the size and position of the component, in pixels.
Returns:
void
DeleteItemsByName
Delete items from the component.
Parameters:
names
Returns:
void
DeleteItemsByIndex
Delete items from the component using item indices.
Parameters:
items
Returns:
GetSelectedRange
()
Get the caret positions of the start and the end of the selected text.
Returns:
GetFrameMinimumSize
()
Determine the minimum size of the component, in pixels.
Returns:
GetScreenRectangle
()
Determine the size and screen position of the component, in pixels.
Returns:
void
SetFrameRectangle
Set the size and screen position of the component, in pixels. This operation is only supported when the component's parent is one of the following classes : DrawingArea NakedWindow PGLWindow
Parameters:
rect
Returns:
void
RedoLastUndo
()
Repeat the last change which was undone.
Returns:
GetSelectedText
()
Get the selected text of the component.
Returns:
GetRectangleOfMonitor
()
Determine the rectangle of the screen upon which the majority of the given component is displayed.
Returns:
GetMaximumDoubleValue
()
Returns:
The maximum double value of the contents of the OptionMenu.
void
SetMaximumDoubleValue
(xreal value)
Sets the maximum double value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetWidth
()
Returns:
The width of the OptionMenu, in character widths.
void
SetWidth
(xint value)
Sets the width of the OptionMenu, in character widths.
Parameters:
value
Returns:
GetSelectedItemNameArray
()
Returns:
The names of the selected items of the component.
void
SetSelectedItemNameArray
Sets the names of the selected items of the component.
Parameters:
values
Returns:
GetMinimumWidth
()
Returns:
The minimum width of the OptionMenu, in character widths.
void
SetMinimumWidth
(xint value)
Sets the minimum width of the OptionMenu, in character widths.
Parameters:
value
Returns:
GetDoubleValue
()
Returns:
The double value of the contents of the OptionMenu.
void
SetDoubleValue
(xreal value)
Sets the double value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetGroupItemNameArray
()
Returns:
The names of the first item of each of the groups of the OptionMenu.
void
SetGroupItemNameArray
Sets the names of the first item of each of the groups of the OptionMenu.
Parameters:
values
Returns:
GetGroupNameArray
()
Returns:
The names of the group headers of the OptionMenu.
void
SetGroupNameArray
Sets the names of the group headers of the OptionMenu.
Parameters:
values
Returns:
CanDrawContentDisabled
()
Returns:
Flag indicating whether the images embedded in the label of an item of the OptionMenu should be greyed-out whenever the item is insensitive.
void
SetCanDrawContentDisabled
(xbool flag)
Sets flag indicating whether the images embedded in the label of an item of the OptionMenu should be greyed-out whenever the item is insensitive.
Parameters:
flag
Returns:
GetDefaultHelpText
()
Returns:
The popup help-text to be displayed whilst the pointer is over the OptionMenu but is not over any of the items of the drop-down list.
void
SetDefaultHelpText
(xrstring value)
Sets the popup help-text to be displayed whilst the pointer is over the OptionMenu but is not over any of the items of the drop-down list.
Parameters:
value
Returns:
IsComboBox
()
Returns:
Flag indicating whether the text contents of the OptionMenu may be modified by the user.
void
SetComboBox
(xbool flag)
Sets flag indicating whether the text contents of the OptionMenu may be modified by the user.
Parameters:
flag
Returns:
GetDropDownHeight
()
Returns:
The number of visible rows of the drop-down list of the OptionMenu.
void
SetDropDownHeight
(xint value)
Sets the number of visible rows of the drop-down list of the OptionMenu.
Parameters:
value
Returns:
HasTextChanged
()
Returns:
Flag indicating whether the text contents of the OptionMenu have been modified.
The OptionMenu sets the value of this attribute to xfalse when the entire text is modified programmatically. The value is then automatically set to xtrue when the text is next changed.
This flag is provided for application use so that any "save if needed" functionality can be implemented for text editors. In this case the value should be set to xfalse once the text has been saved.
void
SetHasTextChanged
(xbool flag)
Sets flag indicating whether the text contents of the OptionMenu have been modified.
The OptionMenu sets the value of this attribute to xfalse when the entire text is modified programmatically. The value is then automatically set to xtrue when the text is next changed.
This flag is provided for application use so that any "save if needed" functionality can be implemented for text editors. In this case the value should be set to xfalse once the text has been saved.
Parameters:
flag
Returns:
GetStringValue
()
Returns:
The contents of the OptionMenu as a string.
void
SetStringValue
(xrstring value)
Sets the contents of the OptionMenu as a string.
Parameters:
value
Returns:
GetGroupOpenArray
()
Returns:
The expanded / collapsed state of each of the group headers of the OptionMenu.
void
SetGroupOpenArray
(xintsequence_ptr values)
Sets the expanded / collapsed state of each of the group headers of the OptionMenu.
Parameters:
values
Returns:
GetImage
()
Returns:
The image to be displayed to the left of the value of an editable OptionMenu
void
SetImage
(xrstring value)
Sets the image to be displayed to the left of the value of an editable OptionMenu
Parameters:
value
Returns:
GetMaximumIntegerValue
()
Returns:
The maximum integer value of the contents of the OptionMenu.
void
SetMaximumIntegerValue
(xint value)
Sets the maximum integer value of the contents of the OptionMenu.
Parameters:
value
Returns:
DoesSizeByContents
()
Returns:
Flag indicating whether the OptionMenu should be sized according to its contents (xtrue) or whether it should use its Width attribute.
void
SetSizeByContents
(xbool flag)
Sets flag indicating whether the OptionMenu should be sized according to its contents (xtrue) or whether it should use its Width attribute.
Parameters:
flag
Returns:
IsWidthFixed
()
Returns:
Flag indicating whether the OptionMenu should increase its width to accomodate its contents (xfalse) or whether it should maintain its width as the contents grow (xtrue).
void
SetWidthFixed
(xbool flag)
Sets flag indicating whether the OptionMenu should increase its width to accomodate its contents (xfalse) or whether it should maintain its width as the contents grow (xtrue).
Parameters:
flag
Returns:
GetStringValueArray
()
Returns:
The string items of the component.
void
SetStringValueArray
Sets the string items of the component.
Parameters:
values
Returns:
GetDoubleValueArray
()
Returns:
The double items of the component.
void
SetDoubleValueArray
Sets the double items of the component.
Parameters:
values
Returns:
GetIntegerValue
()
Returns:
The integer value of the contents of the OptionMenu.
void
SetIntegerValue
(xint value)
Sets the integer value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetItemTextColorArray
()
Returns:
The foreground colors of the items of the component, as a uifcColor.
void
SetItemTextColorArray
(uifcColors_ptr colors)
Sets the foreground colors of the items of the component, as a uifcColor.
Parameters:
colors
Returns:
GetMinimumIntegerValue
()
Returns:
The minimum integer value of the contents of the OptionMenu.
void
SetMinimumIntegerValue
(xint value)
Sets the minimum integer value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetDropItemName
()
Returns:
The name of the item beneath the pointer whilst the pointer is over the component during a drag & drop operation.
GetItemImageArray
()
Returns:
The images of the items of the component.
Each image may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.
void
SetItemImageArray
Sets the images of the items of the component.
Each image may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.
Parameters:
values
Returns:
GetValueType
()
Returns:
The data-type of the contents of the OptionMenu.
INPUT_TYPE_INTEGER
An integer using IntegerValueArray attribute
INPUT_TYPE_DOUBLE
A double using DoubleValueArray attribute
INPUT_TYPE_STRING
A string using StringValueArray attribute
INPUT_TYPE_WIDESTRING
A wide-string using both ItemNameArray attribute and ItemTextArray attribute
void
SetValueType
(uifcInputType value)
Sets the data-type of the contents of the OptionMenu.
INPUT_TYPE_INTEGER
An integer using IntegerValueArray attribute
INPUT_TYPE_DOUBLE
A double using DoubleValueArray attribute
INPUT_TYPE_STRING
A string using StringValueArray attribute
INPUT_TYPE_WIDESTRING
A wide-string using both ItemNameArray attribute and ItemTextArray attribute
Parameters:
value
Returns:
GetReadingOrder
()
Returns:
If the current locale supports multi-directional text (e.g. Hebrew) then this flag indicates the reading order of the text contents of the InputPanel, otherwise the attribute value is ignored.
READING_ORDER_LEFT_TO_RIGHT
The text is displayed left-to-right
READING_ORDER_RIGHT_TO_LEFT
The text is displayed right-to-left
void
SetReadingOrder
Sets if the current locale supports multi-directional text (e.g. Hebrew) then this flag indicates the reading order of the text contents of the InputPanel, otherwise the attribute value is ignored.
READING_ORDER_LEFT_TO_RIGHT
The text is displayed left-to-right
READING_ORDER_RIGHT_TO_LEFT
The text is displayed right-to-left
Parameters:
value
Returns:
DoesAlwaysShowValueSign
()
Returns:
Flag indicating whether to display the signum of numerical values in the OptionMenu.
void
SetAlwaysShowValueSign
(xbool flag)
Sets flag indicating whether to display the signum of numerical values in the OptionMenu.
Parameters:
flag
Returns:
GetItemHelpTextArray
()
Returns:
The popup help-text to be displayed for the items of the component whilst the pointer is over the component.
void
SetItemHelpTextArray
Sets the popup help-text to be displayed for the items of the component whilst the pointer is over the component.
Parameters:
values
Returns:
GetAutoCompleteLength
()
Returns:
The minimum number of characters which must match before any text matching is carried out.
void
SetAutoCompleteLength
(xint value)
Sets the minimum number of characters which must match before any text matching is carried out.
Parameters:
value
Returns:
GetDigits
()
Returns:
The number of digits to be displayed if the contents are being treated as a number.
A value of 0 indicates that this attribute should be ignored when formatting the value.
void
SetDigits
(xint value)
Sets the number of digits to be displayed if the contents are being treated as a number.
A value of 0 indicates that this attribute should be ignored when formatting the value.
Parameters:
value
Returns:
GetDoubleFormat
()
Returns:
The format of the contents of the OptionMenu if they are being treated as a double.
The value of this attribute is a C formatting string which can handle the precision and value of the contents of the OptionMenu.
void
SetDoubleFormat
(xrstring value)
Sets the format of the contents of the OptionMenu if they are being treated as a double.
The value of this attribute is a C formatting string which can handle the precision and value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetImageWidth
()
Returns:
The width of the images of the OptionMenu, in pixels
void
SetImageWidth
(xint value)
Sets the width of the images of the OptionMenu, in pixels
Parameters:
value
Returns:
GetItemBackgroundColorArray
()
Returns:
The background colors of the items of the component, as a uifcColor.
void
SetItemBackgroundColorArray
(uifcColors_ptr colors)
Sets the background colors of the items of the component, as a uifcColor.
Parameters:
colors
Returns:
IsCaretVisible
()
Returns:
Flag indicating whether the input caret should be displayed when the OptionMenu has the keyboard input focus.
void
SetCaretVisible
(xbool flag)
Sets flag indicating whether the input caret should be displayed when the OptionMenu has the keyboard input focus.
Parameters:
flag
Returns:
CanTruncateText
()
Returns:
Flag indicating whether any leading spaces of the label of the selected item of the OptionMenu should be ignored when displaying the selection in the top-line of the component.
void
SetCanTruncateText
(xbool flag)
Sets flag indicating whether any leading spaces of the label of the selected item of the OptionMenu should be ignored when displaying the selection in the top-line of the component.
Parameters:
flag
Returns:
DoesAutoOpen
()
Returns:
Flag indicating whether the OptionMenu should open automatically when the arrow button is pressed.
void
SetAutoOpen
(xbool flag)
Sets flag indicating whether the OptionMenu should open automatically when the arrow button is pressed.
Parameters:
flag
Returns:
GetMaximumWidth
()
Returns:
The maximum width of the drop-down of the OptionMenu, in character widths.
A value of 0 indicates that the drop-down should size itself based upon the OptionMenu.
void
SetMaximumWidth
(xint value)
Sets the maximum width of the drop-down of the OptionMenu, in character widths.
A value of 0 indicates that the drop-down should size itself based upon the OptionMenu.
Parameters:
value
Returns:
GetItemNameArray
()
Returns:
The names of the items of the component.
void
SetItemNameArray
Sets the names of the items of the component.
Parameters:
values
Returns:
GetTextValueMaximumLength
()
Returns:
The maximum length of the text contents of the OptionMenu.
void
SetTextValueMaximumLength
(xint value)
Sets the maximum length of the text contents of the OptionMenu.
Parameters:
value
Returns:
GetImageHeight
()
Returns:
The height of the images of the OptionMenu, in pixels
void
SetImageHeight
(xint value)
Sets the height of the images of the OptionMenu, in pixels
Parameters:
value
Returns:
IsSelectionVisible
()
Returns:
Flag indicating whether the selected text should be drawn highlighted when the OptionMenu does not have the keyboard input focus.
void
SetSelectionVisible
(xbool flag)
Sets flag indicating whether the selected text should be drawn highlighted when the OptionMenu does not have the keyboard input focus.
Parameters:
flag
Returns:
CanResizeWhenNeeded
()
Returns:
Flag indicating whether the OptionMenu should attempt to resize when its contents are changed.
void
SetCanResizeWhenNeeded
(xbool flag)
Sets flag indicating whether the OptionMenu should attempt to resize when its contents are changed.
Parameters:
flag
Returns:
GetEnabledItemNameArray
()
Returns:
The names of the selectable items of the component. An empty array indicates that every item of the component may be selected.
void
SetEnabledItemNameArray
Sets the names of the selectable items of the component. An empty array indicates that every item of the component may be selected.
Parameters:
values
Returns:
CanRedraw
()
Returns:
Flag indicating whether redraws are permitted in the OptionMenu.
void
SetCanRedraw
(xbool flag)
Sets flag indicating whether redraws are permitted in the OptionMenu.
Parameters:
flag
Returns:
GetGroupHelpTextArray
()
Returns:
The popup help-text to be displayed for the group headers of the OptionMenu whilst the pointer is over the component.
void
SetGroupHelpTextArray
Sets the popup help-text to be displayed for the group headers of the OptionMenu whilst the pointer is over the component.
Parameters:
values
Returns:
GetMostRecentItemName
()
Returns:
The item which was beneath the pointer the last time the pointer was over the component.
DoesOpenOnMnemonic
()
Returns:
Flag indicating whether the OptionMenu should open automatically when the menu is opened via a mnemonic.
void
SetOpenOnMnemonic
(xbool flag)
Sets flag indicating whether the OptionMenu should open automatically when the menu is opened via a mnemonic.
Parameters:
flag
Returns:
GetPrompt
()
Returns:
The text to be displayed in the OptionMenu when the component does not have the focus and its contents are empty.
void
SetPrompt
(xrstring value)
Sets the text to be displayed in the OptionMenu when the component does not have the focus and its contents are empty.
Parameters:
value
Returns:
GetMinimumDoubleValue
()
Returns:
The minimum double value of the contents of the OptionMenu.
void
SetMinimumDoubleValue
(xreal value)
Sets the minimum double value of the contents of the OptionMenu.
Parameters:
value
Returns:
GetGroupTextArray
()
Returns:
The labels of the group headers of the OptionMenu.
void
SetGroupTextArray
Sets the labels of the group headers of the OptionMenu.
Parameters:
values
Returns:
GetItemTextArray
()
Returns:
The labels of the items of the component.
void
SetItemTextArray
Sets the labels of the items of the component.
Parameters:
values
Returns:
IsAutoCompleteCaseSensitive
()
Returns:
Flag indicating whether text matching is case-sensitive (xtrue) or whether it is irrespective of case (xfalse).
void
SetAutoCompleteCaseSensitive
(xbool flag)
Sets flag indicating whether text matching is case-sensitive (xtrue) or whether it is irrespective of case (xfalse).
Parameters:
flag
Returns:
GetTextGravity
()
Returns:
The gravity of the OptionMenu, which is used to determine where the caret should be placed after the contents are modified.
TEXT_GRAVITY_START
The caret is placed at the start of the text
TEXT_GRAVITY_END
The caret is placed at the end of the text
void
SetTextGravity
(xint value)
Sets the gravity of the OptionMenu, which is used to determine where the caret should be placed after the contents are modified.
TEXT_GRAVITY_START
The caret is placed at the start of the text
TEXT_GRAVITY_END
The caret is placed at the end of the text
Parameters:
value
Returns:
GetGroupImageArray
()
Returns:
The images of the group headers of the OptionMenu.
Each image may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.
void
SetGroupImageArray
Sets the images of the group headers of the OptionMenu.
Each image may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.
Parameters:
values
Returns:
HasBorder
()
Returns:
Flag indicating whether the OptionMenu has a decorated shadow border.
void
SetHasBorder
(xbool flag)
Sets flag indicating whether the OptionMenu has a decorated shadow border.
Parameters:
flag
Returns:
GetIntegerValueArray
()
Returns:
The integer items of the component.
void
SetIntegerValueArray
(xintsequence_ptr values)
Sets the integer items of the component.
Parameters:
values
Returns:
DoesAutoCompleteReplace
()
Returns:
Flag indicating whether any matched text should be completely selected when a match occurs (xtrue) or whether only the appended text should be selected (xfalse).
void
SetAutoCompleteReplace
(xbool flag)
Sets flag indicating whether any matched text should be completely selected when a match occurs (xtrue) or whether only the appended text should be selected (xfalse).
Parameters:
flag
Returns:
GetTextValue
()
Returns:
The text contents of the OptionMenu if the OptionMenu is editable.
void
SetTextValue
(xrstring value)
Sets the text contents of the OptionMenu if the OptionMenu is editable.
Parameters:
value
Returns:
void
AddActionListener
Parameters:
listener
Returns:
void
PushAction
Parameters:
action
Returns:
void
CreateTimer
(uifcOptionMenuTimer_ptr timer, xrstring timerName, xbool writeInTrail)
Parameters:
timer
timerName
writeInTrail
Returns:
void
StartTimer
(xrstring timerName, xint duration)
Parameters:
timerName
duration
Returns:
void
StopTimer
(xrstring timerName)
Parameters:
timerName
Returns:
Was this helpful?