Skip to content

XUIInspector

Inherits NSScrollViewCanvas

Description

An inspector control that is capable of displaying multiple items, separated into sections. Items are very customisable, ranging from text fields to checkboxes.

Properties

Name Type Read-Only
AllowInertialScrolling Boolean
CaretVisible Boolean
HasBottomBorder Boolean
HasLeftBorder Boolean
HasRightBorder Boolean
HasTopBorder Boolean
ItemWithFocus XUIInspectorItem
LastClickWasContextual Boolean
LastMouseDownX Integer
LastMouseDownY Integer
mBackBuffer Picture
mCachedRequiredHeight Double
mCaretBlinkerTimer Timer
mHasBottomBorder Boolean
mHasLeftBorder Boolean
mHasRightBorder Boolean
mHasTopBorder Boolean
mItemWithFocus XUIInspectorItem
mLastClickTicks Integer
mLastClickType XUI.ClickTypes
mLastClickWasContextual Boolean
mLastMouseDownX Integer
mLastMouseDownY Integer
mLastMouseUpX Integer
mLastMouseUpY Integer
mLastMovedItem XUIInspectorItem
mLastTripleClickTicks Integer
mNeedsFullRedraw Boolean
mPopup XUIInspectorItemPopupMenu
mRefreshTimer Timer
mScrollOffsetY Integer
mSections() XUIInspectorSection
ScrollOffsetY Integer
SectionWithFocus XUIInspectorSection
Style XUIInspectorStyle

Methods

Name Parameters Returns
AddSection section As XUIInspectorSection
AddSectionAt index As Integer, section As XUIInspectorSection
CaretBlinkerTimerAction sender As Timer
Constructor
ExpandAllSections
HandleNewPopupMenu popupMenu As XUIInspectorItemPopupMenu
HandlePopupMenuClick x As Double, y As Double
IsDoubleClick x As Integer, y As Integer Boolean
IsTripleClick x As Integer, y As Integer Boolean
MoveFocusToFirstItem
MoveFocusToNextItem
RebuildBackBuffer
RedrawImmediately
RefreshTimerAction sender As Timer
RemoveSection section As XUIInspectorSection
RemoveSectionNamed name As String XUIInspectorSection
RenderDisclosureWidget g As Graphics, x As Double, y As Double, colour As Color, expanded As Boolean, bold As Boolean Rect
RequiredHeight Double
SectionNamed name As String XUIInspectorSection

Constants

Name Type
CAPTION_CONTROL_PADDING Double
CONTROL_BORDER_PADDING Double
NOTIFICATION_ITEM_CHANGED String
VSCROLL_SENSITIVITY Double
WIDGET_HEIGHT_COLLAPSED Double
WIDGET_HEIGHT_EXPANDED Double
WIDGET_WIDTH_COLLAPSED Double
WIDGET_WIDTH_EXPANDED Double

CAPTION_CONTROL_PADDING As Double The number of pixels to pad between a caption and an adjacent control.


CONTROL_BORDER_PADDING As Double The nuimber of pixels to pad between a control and the inspector's border.


NOTIFICATION_ITEM_CHANGED As String An item has changed in someway.


VSCROLL_SENSITIVITY As Double Higher number = more lines scrolled when quickly scrolling vertically. Values between 1 - 3 work well.


WIDGET_HEIGHT_COLLAPSED As Double The height in pixels of the collapsed (rightwards-facing) disclosure widget.


WIDGET_HEIGHT_EXPANDED As Double The height of the expanded (downwards-facing) disclosure widget.


WIDGET_WIDTH_COLLAPSED As Double The width in pixels of the collapsed (rightwards-facing) disclosure widget.


WIDGET_WIDTH_EXPANDED As Double The width of the expanded (downwards-facing) disclosure widget.


Property Descriptions

AllowInertialScrolling As Boolean

If True then the inspector will vertically scroll faster if the mouse wheel is moved faster.


CaretVisible As Boolean

If True and a text field is in focus then the csaret is visible, otherwise the caret is hidden.


HasBottomBorder As Boolean

If True then the inspector has a bottom border.


HasLeftBorder As Boolean

If True then the inspector has a left border.


HasRightBorder As Boolean

If True then the inspector has a left border.


HasTopBorder As Boolean

If True then the inspector has a top border.


ItemWithFocus As XUIInspectorItem

The item that currently has the focus. May be Nil.


LastClickWasContextual As Boolean

True if the mouse click that just occurred in the MouseDown event was a contextual click.


LastMouseDownX As Integer

The X coordinate of the last MouseDown event.


LastMouseDownY As Integer

The Y coordinate of the last MouseDown event (already adjusted for scrolling).


mBackBuffer As Picture

The internal picture that is rendered to the inspector's canvas.


mCachedRequiredHeight As Double

A cache of the height required to draw the inspector in full given the collapsed status of all sections computed in the last Paint() event.


mCaretBlinkerTimer As Timer

Handles blinking the caret of any active text field in the inspector.


mHasBottomBorder As Boolean

True if the inspector should draw a bottom border.


mHasLeftBorder As Boolean

True if the inspector should draw a left border.


mHasRightBorder As Boolean

True if the inspector should draw a right border.


mHasTopBorder As Boolean

True if the inspector should draw a top border.


mItemWithFocus As XUIInspectorItem

The current item with the focus. May be Nil.


mLastClickTicks As Integer

The ticks that the last mouse click occurred at.


mLastClickType As XUI.ClickTypes

The type of click that occurred in the last MouseUp event.


mLastClickWasContextual As Boolean

True if the mouse click that just occurred in the MouseDown event was a contextual click.


mLastMouseDownX As Integer

The X coordinate of the last MouseDown event. Not adjusted for any scrolling.


mLastMouseDownY As Integer

The Y coordinate of the last MouseDown event. Not adjusted for any scrolling.


mLastMouseUpX As Integer

The X mouse coordinate from the previous MouseUp event, adjusted for scrolling.


mLastMouseUpY As Integer

The Y mouse coordinate from the previous MouseUp event, adjusted for scrolling.


mLastMovedItem As XUIInspectorItem

The last item moved over by the mouse. May be Nil.


mLastTripleClickTicks As Integer

The ticks that the last triple click occurred at.


mNeedsFullRedraw As Boolean

If True then the back buffer will be recreated at the next Paint event.


mPopup As XUIInspectorItemPopupMenu

The currently displayed popup menu. Will be Nil if there isn't one.


mRefreshTimer As Timer

Responsible for regularly repainting the inspector.


mScrollOffsetY As Integer

The number of pixels we've scrolled vertically. >0 means the canvas has scrolled down.


mSections() As XUIInspectorSection

The sections within this inspector.


ScrollOffsetY As Integer

The number of pixels we've scrolled vertically. >0 means the canvas has scrolled down.


SectionWithFocus As XUIInspectorSection

The current section in focus. May be Nil.


Style As XUIInspectorStyle

This inspector's drawing style.


Method Descriptions

AddSection(section As XUIInspectorSection)

Appends section to the inspector.


AddSectionAt(index As Integer, section As XUIInspectorSection)

Adds section to this inspector at index. Raises an OutOfBoundsException if index is invalid.


CaretBlinkerTimerAction(sender As Timer)

Called whenever mCaretBlinkerTimer.Action fires.


Constructor()

Constructs a new inspector control.


ExpandAllSections()

Expands all sections in the inspector.


HandleNewPopupMenu(popupMenu As XUIInspectorItemPopupMenu)

Sets popupMenu to be the currently active popup menu in the inspector. Handles closing an existing popup menu (if any). Redraws the inspector.


HandlePopupMenuClick(x As Double, y As Double)

Handles a mouse up within mPopup.


IsDoubleClick(x As Integer, y As Integer) As Boolean

Returns True if a double click just occurred. Assumes x and y are adjusted for scrolling.


IsTripleClick(x As Integer, y As Integer) As Boolean

Returns True if a triple click just happened. Assumes x and y are adjusted for scrolling.


MoveFocusToFirstItem()

Moves the focus to the first visible item in the inspector that can accept tab focus.


MoveFocusToNextItem()

Moves the focus to the next item that can accept the tab focus.


RebuildBackBuffer()

Rebuilds the internal picture that is rendered to the inspector's graphics context.


RedrawImmediately()

Redraws the inspector immediately.


RefreshTimerAction(sender As Timer)

Called whenever mRefreshTimer.Action fires.


RemoveSection(section As XUIInspectorSection)

Removes section (if found) from this inspector.


RemoveSectionNamed(name As String) As XUIInspectorSection

Removes and returns the first section named name. Case-insensitive search. If the section is not found then Nil is returned.


RenderDisclosureWidget(g As Graphics, x As Double, y As Double, colour As Color, expanded As Boolean, bold As Boolean) As Rect This method is shared.

Renders a disclosure widget to g and returns its hit bounds. Preserves the state of g.

x: The left edge of the widget. y: The top edge of the widget. expanded: True = downwards facing, False = right-facing. bold: If True then the widget is thicker.


RequiredHeight() As Double

Returns the max height required to draw the inspector in full given the collapsed status of all sections. Will always be as tall as the height of the inspector.


SectionNamed(name As String) As XUIInspectorSection

Returns the first section named name. Case-insensitive search. May return Nil.