WIDGET_POSITIONER - ITA-Solar/solo-spice-ql GitHub Wiki
Source code: widget_positioner__define.pro
Class: PRITS_TOOLS
Table of contents generated with markdown-toc
This object can be used to position a new widget relative to another widget, or relative to the screen. This also works with multiple screens. The widget is positioned and realised by this object.
Note, this is similar to the xrealize procedure, but more sophisticated.
parent = widget_base(/column, title='Parent Widget', xsize=300, ysize=400)
widget_control, parent, /realize
new_window = widget_base(/row, title='New Widget', xsize=400, ysize=300, group_leader=parent)
wp = widget_positioner(new_window, parent=parent)
wp->position, xoffset=xoffset, yoffset=yoffset
The INIT function initialises the WIDGET_POSITIONER object.
wp_object = WIDGET_POSITIONER( WIDGET [, PARENT=PARENT] )
The ID of the widget to be positioned. Can also be set later with method 'SET_WIDGET'.
The ID of the parent widget to which the widget should get a certain position. Optional, but if provided then the parent widget must be realised already. If not provided the widget will be positioned relative to upper left corner of display. Can also be set later with method 'SET_PARENT'.
1 (True) if initialization succeeded, 0 (False) otherwise.
This routine prints out information about the class, such as name, location of definition file and version if there is a line in the header comment beginning with '$ID: ' (comes from CVS). Then it prints out each procedure and function that has a comment line right after the definition.
wp_object->HELP [, /DESCRIPTION]
If set, the header info of the class will also be printed.
This procedure calculates where the new widget should be placed and checks, whether the whole widget is within the display. If this is not the case it alters the new position, so that it is fully, if possible, within the display. It also sets the new offset to the widget and realises the widget then.
wp_object->POSITION [, XOFFSET=XOFFSET] [, YOFFSET=YOFFSET] [, N_SUBPLOT=N_SUBPLOT] [, /LEFT_ALIGN] [, /RIGHT_ALIGN] [, /TOP_ALIGN] [, /BOTTOM_ALIGN] [, /CENTER]
Optional. The offset in x-direction relativ to the parent widget or the display. Default=50 pixels. Overwritten if left_align or right_align is set.
Optional. The offset in y-direction relativ to the parent widget or the display. Default=50 pixels. Overwritten if top_align or bottom_align is set.
Optional. Number of widgets already shifted. Each widget is positioned in a slightly different position.
If set, the widget will be positioned to the left of the parent, if there is enough space.
If set, the widget will be positioned to the left of the parent, if there is enough space. Ignored if left_align is set.
If set, the widget will be positioned to the left of the parent, if there is enough space.
If set, the widget will be positioned to the left of the parent, if there is enough space. Ignored if top_align is set.
If set, the widget will be positioned in the center of the parent, or of the screen if no parent is provided.
Sets a new widget that can be positioned.
wp_object->SET_WIDGET, WIDGET
The widget ID of the widget to be set.
Sets a new widget that can be positioned.
widget_id = wp_object->GET_WIDGET()
Returns the widget that can be positioned.
Sets a new parent widget to which the widget should be relatively positioned. Set to a negative value to remove parent.
wp_object->SET_PARENT, PARENT
The widget ID of the new parent widget.
Gets the parent widget to which the widget should be relatively positioned.
parent_id = wp_object->GET_PARENT()
Returns the widget ID of the parent widget.