Skip to content

XUIInspectorPopupItem

Implements XUIInspectorItem

Description

An item containing a popup menu and caption.

Properties

Name Type Read-Only
Caption String
CaptionWidth Integer
mBounds Rect
mCaption String
mClosedPopupBottomEdge Double
mClosedPopupRightEdge Double
mClosedPopupTopEdge Double
mID String
mItems() String
mOpen Boolean
mOwner WeakRef
mPopupBounds Rect
mPopupWidth Double
mSection WeakRef
mSelectedIndex Integer

Methods

Name Parameters Returns
Bounds Rect
Bounds Assigns b As Rect
CanAcceptTabFocus Boolean
Constructor ID As String, caption As String, captionWidth As Integer, items() As String
CreatePopupMenu XUIInspectorItemPopupMenu
DidReceiveTabFocus
DrawPopupBox x As Double, y As Double, g As Graphics, style As XUIInspectorStyle
Height style As XUIInspectorStyle Double
ID String
LostFocus
MouseDown x As Integer, y As Integer, clickType As XUI.ClickTypes XUIInspectorMouseDownData
MouseExit Boolean
MouseMoved x As Double, y As Double XUIInspectorMouseMoveData
MouseUp x As Integer, y As Integer, clickType As XUI.ClickTypes XUIInspectorMouseUpData
Owner XUIInspector
Owner Assigns inspector As XUIInspector
PopupDismissed
PopupItemSelected index As Integer
Render g As Graphics, x As Double, y As Double, width As Double, style As XUIInspectorStyle Double
Section XUIInspectorSection
Section Assigns section As XUIInspectorSection

Constants

Name Type
HPADDING Double
ITEM_WIDGET_PADDING Double
ITEM_WIDGET_WIDTH Double
POPUP_CONTENTS_HPADDING Double
POPUP_INTERNAL_VPADDING Double
VPADDING Double
WIDGET_HEIGHT Double
WIDGET_RPADDING Double
WIDGET_WIDTH Double

HPADDING As Double The number of pixels to pad the item's content left and right.


ITEM_WIDGET_PADDING As Double The number of pixels between the popup item text and the left-edge of the arrow widget.


ITEM_WIDGET_WIDTH As Double The width of the arrow widget.


POPUP_CONTENTS_HPADDING As Double The number of pixels to pad either side of each item in the popup menu.


POPUP_INTERNAL_VPADDING As Double The number of pixels to pad the contents of the popup box above and below.


VPADDING As Double The number of pixels to pad the item's content above and below.


WIDGET_HEIGHT As Double The height of the downwards facing disclosure widget.


WIDGET_RPADDING As Double The number of pixels to pad the right edge of the disclosure widget from the right edge of the popup menu.


WIDGET_WIDTH As Double The width of the downwards facing disclosure widget.


Property Descriptions

Caption As String

The caption to display besides the checkbox.


CaptionWidth As Integer

The desired width of the caption.


mBounds As Rect

The bounds of this item.


mCaption As String

The caption to display besides the checkbox.


mClosedPopupBottomEdge As Double

Cached Y position of the bottom edge of the closed popup box. Required to draw the open popup box. This is computed in Render().


mClosedPopupRightEdge As Double

Cached X position of the right edge of the closed popup box. Required to draw the open popup box. This is computed in Render().


mClosedPopupTopEdge As Double

Cached Y position of the top edge of the closed popup box. Required to draw the open popup box. This is computed in Render().


mID As String

Used to identify this item in notifications. You should ensure it is unique within the inspector.


mItems() As String

The items in the popup.


mOpen As Boolean

True if the popup is currently open.


mOwner As WeakRef

A weak reference to the inspector this item belongs to.


mPopupBounds As Rect

The hit bounds for the popup.


mPopupWidth As Double

The last computed width of the popup menu (cached in PopupWidth()).


mSection As WeakRef

A weak reference to the inspector section this item is within. May be Nil.


mSelectedIndex As Integer

The index of the item in mItems that is currently selected.


Method Descriptions

Bounds() As Rect

The bounds of this item within the inspector.

Part of the XUIInspectorItem interface.


Bounds(Assigns b As Rect)

Sets the bounds of this item in the inspector.

Part of the XUIInspectorItem interface.


CanAcceptTabFocus() As Boolean

Returns True if this item is able to accept the focus via the tab key.


Constructor(ID As String, caption As String, captionWidth As Integer, items() As String)

Constructs a new item containing a popup menu and a caption. items() are the popup menu items.


CreatePopupMenu() As XUIInspectorItemPopupMenu

Returns the data needed by the inspector to create a popup menu anchored to the right of this item, lined up with the edge of the closed popup box.


DidReceiveTabFocus()

This item has just received the focus via the tab key.


DrawPopupBox(x As Double, y As Double, g As Graphics, style As XUIInspectorStyle)

Draws the popup box to the context g.

x: The left border of the popup menu. y: The top of the item bounds.


Height(style As XUIInspectorStyle) As Double

The height of this item given the desired style.

Part of the XUIInspectorItem interface.


ID() As String

Used to identify this item in notifications. You should ensure it is unique within the inspector.

Part of the XUIInspectorItem interface.


LostFocus()

This item just lost the focus.

Part of the XUIInspectorItem interface.


MouseDown(x As Integer, y As Integer, clickType As XUI.ClickTypes) As XUIInspectorMouseDownData

Tells the item that a mouse down event has occurred within its bounds. x, y are the absolute coordinates relative to the inspector (adjusted for scrolling). Returns a MouseDownData instance instructing the inspector how to handle the event or Nil if the click didn't occur in this item.

Note: A click in this item when it has a popup menu displayed will be handled in PopupItemSelected()`.


MouseExit() As Boolean

Used to tell this item that the mouse has just exited it. Returns True if the inspector should redraw.

Part of the XUIInspectorItem interface.


MouseMoved(x As Double, y As Double) As XUIInspectorMouseMoveData

The mouse has just moved over this item. Returns data to inform the inspector how to handle the movement. May return Nil.

Part of the XUIInspectorItem interface.


MouseUp(x As Integer, y As Integer, clickType As XUI.ClickTypes) As XUIInspectorMouseUpData

Tells the item that a mouse up event has occurred within its bounds. x, y are the absolute coordinates relative to the inspector (adjusted for scrolling). Returns a MouseUpData instance instructing the inspector how to handle the event or Nil if the click didn't occur in this item.


Owner() As XUIInspector

A weak reference to the inspector this item belongs to.

Part of the XUIInspectorItem interface.


Owner(Assigns inspector As XUIInspector)

The inspector this item belongs to. A weak reference will be created.

Part of the XUIInspectorItem interface.


PopupDismissed()

Tells this item that any popup it thinks it has displayed has been dismissed with no action.

Part of the XUIInspectorItem interface.


PopupItemSelected(index As Integer)

The entry at index has been selected in this item's popup menu.

Part of the XUIInspectorItem interface.


Render(g As Graphics, x As Double, y As Double, width As Double, style As XUIInspectorStyle) As Double

The item should render itself to the passed graphics context at the specified location. Returns the position of the item's bottom edge.

Part of the XUIInspectorItem interface.

|-------------------------|
| CAPTION      [ OPTION ] |
|-------------------------|

Section() As XUIInspectorSection

A weak reference to the section this item is in.


Section(Assigns section As XUIInspectorSection)

The section this item is within to. A weak reference will be created.