Reference Guide > W Routines > WoLinestyleOptionMenu Function
  

WoLinestyleOptionMenu Function
Creates an option menu for selecting linestyles.
Usage
widget = WoLinestyleOptionMenu(parent, toolname)
Input Parameters
parent — Specifies the parent widget ID of the option menu (long).
toolname — (string) Specifies the unique name of the VDA Tool to which the option menu is to be attached.
Returned Value
widget — The widget ID of the option menu (long).
Keywords
Nolinestyle — Adds a None option to the linestyles option menu.
Start_Value — Specifies a string containing the index of the initially selected linestyle.
Attachment Keywords
Bottom — If a widget ID is specified (for example, Bottom=wid), then the bottom of the option menu is attached to the top of the specified widget. If no widget ID is specified (for example, /Bottom), then the bottom of the option menu is attached to the bottom of the parent widget.
Left — If a widget ID is specified (for example, Left=wid), then the left side of the option menu is attached to the right side of the specified widget. If no widget ID is specified (for example, /Left), then the left side of the option menu is attached to the left side of the parent widget.
Right — If a widget ID is specified (for example, Right=wid), then the right side of the option menu is attached to the left side of the specified widget. If no widget ID is specified (for example, /Right), then the right side of the option menu is attached to the right side of the parent widget.
Top — If a widget ID is specified (for example, Top=wid), then the top of the option menu is attached to the bottom of the specified widget. If no widget ID is specified (for example, /Top), then the top of the option menu is attached to the top of the parent widget.
Discussion
The available linestyles and their index numbers are listed in Linestyle Indexes.
 
Table 19-2: Linestyle Indexes
Index
X Windows Style
Microsoft Windows Style
0
Solid
Solid
1
Dotted
Short dashes
2
Dashed
Long dashes
3
Dash dot
Long-short dashes
4
Dash-dot-dot-dot
Long-short-short dashes
5
Long dashes
Long dashes
Example
This example creates a linestyle option menu inside a layout widget. The default linestyle on the menu is set to dash-dot.
PRO OkApplyCB, wid, which
   ; ...
   ; Retrieve the currently selected linestyle from the option
   ; menu. The returned value will be an integer between 0 and 5 
   ; that corresponds to the setting of the !P.Linestyle system 
   ; variable.
   linestyleWid = WwGetValue (wid, /Userdata)
   linestyle = WoLinestyleOptionMenuGetValue (linestyleWid)
   ; ...
END
 
PRO ChangeLinestyleCB, wid, which
   ; ...
   ; Set the linestyle in the option menu. The new value should be
   ; an integer between 0 and 5; see !P.Linestyle for more
   ; details.
   linestyleWid = WwGetValue (wid, /Userdata)
 
   WoLineStyleOptionMenuSetValue, lineStyleWid, new_linestyle
   ; ...
END
 
PRO CreateStuff
   ; ...
   top = WwInit ('example', 'Example', layout)
   ; Create a linestyle option menu as a child of the layout 
   ; widget. When the option menu appears, it will have the
   ; "dash-dot" linestyle displayed.
   linestyleOmWid = WoLinestyleOptionMenu (layout, $
      START_VALUE = 3)
   ; ...
   status = WwSetValue (top, /Display)
   WwLoop
END
See Also
WoLinestyleOptionMenuGetValue, WoLinestyleOptionMenuSetValue

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.