ListBoxLayout Class Reference

#include <Pt/Forms/ListBox.h>

Layout that tracks selected list items. More...

Inherits FlowLayout.

Public Types

enum  FocusPolicy {
  NoFocus,
  AcceptFocus,
  KeepFocus
}
 Defines whether a control can receive or retain focus. More...
 

Public Member Functions

 ListBoxLayout ()
 Creates an empty list layout.
 
const std::vector< ListBoxItem * > & selectedItems () const
 Returns the currently selected items.
 
Pt::Signal< ListBoxItem & > & selected ()
 Returns the signal emitted when an item's selected state is set.
 
void setDirection (Direction d)
 Sets the flow direction to d and requests relayout.
 
void setCenter (bool b)
 Sets whether items are packed as a centered group.
 
void setReverse (bool b)
 Sets whether children are visited in reverse order.
 
void addItem (Control &control)
 Attaches control as a flow item. More...
 
void removeItem (Control &control)
 Detaches control without destroying it.
 
void setParent (View &parent)
 Attaches this control to parent. More...
 
void unparent ()
 Detaches this control from its current parent. More...
 
void add (Control &control)
 Attaches control as a direct child. More...
 
void remove (Control &control)
 Detaches direct child control without destroying it. More...
 
const std::vector< Control * > & controls () const
 Returns the non-owning, ordered list of direct children.
 
FocusPolicy focusPolicy () const
 Returns this control's focus policy.
 
void setFocusPolicy (FocusPolicy f)
 Sets this control's focus policy. More...
 
size_t focusIndex () const
 Returns this control's focus-navigation index.
 
void setFocusIndex (size_t index)
 Sets this control's focus-navigation index. More...
 
bool hasFocus () const
 Returns true when this control currently has form focus.
 
void focus ()
 Requests focus from the containing form. More...
 
Key actionKey () const
 Returns the key that invokes onActionKey() while focused.
 
void setActionKey (const Key &ak)
 Sets the focused action key to ak. More...
 
const Keyshortcut () const
 Returns the registered form shortcut, or 0 when none is set.
 
void setShortcut (const Key *k)
 Registers k as this control's form shortcut. More...
 
const Pt::Charmnemonic () const
 Returns the registered mnemonic character, or 0 when none is set.
 
void setMnemonic (const Char &ch)
 Registers ch as this control's Alt mnemonic. More...
 
String setMnemonic (const String &text)
 Extracts and registers a mnemonic marked by an ampersand. More...
 
void setMnemonicControl (Control *control)
 Forwards mnemonic activation to control. More...
 
void processShortcut (const Key &key)
 Invokes this control's shortcut hook for key. More...
 
void processMnemonic (Pt::Char m)
 Invokes this control's mnemonic hook for m. More...
 
bool acceptsInput () const
 Returns true when this control is visible and enabled. More...
 
void raise ()
 Requests that this control be painted above its siblings. More...
 
const Gfx::RectF geometry () const
 Returns the position and size in parent logical coordinates.
 
const SizePolicysizePolicy () const
 Returns this control's requested size policy.
 
void setSizePolicy (const SizePolicy &policy)
 Sets this control's requested size policy and requests relayout. More...
 
Gfx::SizeF preferredSize () const
 Returns the result of the most recent measure() call.
 
Gfx::SizeF measure (const SizePolicy &policy)
 Measures the preferred size under parent constraint policy. More...
 
void relayout ()
 Invalidates this control's measurement and layout. More...
 
const Spacingmargin () const
 Returns the outer spacing requested around this control.
 
void setMargin (const Spacing &s)
 Sets the outer spacing to s and requests relayout.
 
void setMargin (double n)
 Sets equal outer spacing on every side and requests relayout.
 
void setMargin (double horiz, double vertical)
 Sets horizontal and vertical outer spacing and requests relayout.
 
const Spacingpadding () const
 Returns the inner spacing requested around this control's content.
 
void setPadding (const Spacing &p)
 Sets the inner spacing to p and requests relayout.
 
void setPadding (double n)
 Sets equal inner spacing on every side and requests relayout.
 
void setPadding (double horiz, double vertical)
 Sets horizontal and vertical inner spacing and requests relayout.
 
Gfx::PointF toControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from this view to control coordinates. More...
 
Gfx::PointF fromControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from control to this view coordinates. More...
 
PaintSurfacesurface ()
 Returns this view's local paint-surface adapter. More...
 
const PaintSurfacesurface () const
 Returns this view's local paint-surface adapter.
 
void setSurface (PaintSurface *surface, const Gfx::PointF &pos=Gfx::PointF())
 Assigns the surface on which this view displays its controls. More...
 
Pt::uint64_t id () const
 Returns the application-unique ID of this live widget.
 
const std::string & name () const
 Returns the optional name.
 
void setName (const std::string &n)
 Sets the optional name immediately.
 
void setNextResponder (Responder *r)
 Sets the next responder for unhandled input. More...
 
bool isConnected () const
 Returns true when the widget is connected to a screen.
 
Screenscreen ()
 Returns the connected screen, or 0 when disconnected.
 
const Screenscreen () const
 Returns the connected screen, or 0 when disconnected.
 
Widgetparent ()
 Returns the non-owning parent, or 0 when unparented.
 
const Widgetparent () const
 Returns the non-owning parent, or 0 when unparented.
 
bool isDescendantOf (const Widget &top) const
 Returns true when this widget is a strict descendant of top.
 
bool isAncestorOf (const Widget &child) const
 Returns true when this widget is a strict ancestor of child.
 
WidgethitTest (const Gfx::PointF &pos)
 Returns the descendant hit at local position pos. More...
 
Gfx::PointF toParent (const Gfx::PointF &pos) const
 Converts local position pos to parent coordinates.
 
Gfx::PointF fromParent (const Gfx::PointF &pos) const
 Converts parent position pos to local coordinates.
 
Gfx::PointF toGlobal (const Gfx::PointF &pos) const
 Converts local position pos to global coordinates. More...
 
Gfx::PointF fromGlobal (const Gfx::PointF &pos) const
 Converts global position pos to local coordinates. More...
 
void addPeer (Widget &peer)
 Adds a bidirectional, non-owning peer association with peer. More...
 
void removePeer (Widget &peer)
 Removes the bidirectional peer association with peer. More...
 
void invalidate ()
 Queues a coalesced invalidation. More...
 
virtual void repaint (const Gfx::RectF &rect)
 Requests repainting local dirty rectangle rect. More...
 
virtual void repaint ()
 Requests repainting the complete local bounds.
 
double scaleFactor () const
 Returns the current logical-to-device scale factor.
 
const Gfx::Scalingscaling () const
 Returns the current logical-to-device scaling.
 
bool isVisible () const
 Returns whether the last show event made the widget visible.
 
virtual void show (bool b=true)
 Requests that the widget be shown or hidden. More...
 
bool isEnabled () const
 Returns whether the last enable event made the widget enabled.
 
virtual void enable (bool isEnable=true)
 Requests that the widget be enabled or disabled. More...
 
void activate (bool active=true)
 Requests that the widget become active or inactive. More...
 
const Gfx::PointFposition () const
 Returns the position in parent logical coordinates.
 
virtual void move (const Gfx::PointF &pos)
 Requests a new parent-local position pos. More...
 
const Gfx::SizeFsize () const
 Returns the size in local logical coordinates.
 
const Gfx::RectFbounds () const
 Returns local bounds, whose origin is always local zero.
 
const Gfx::SizeFminimumSize () const
 Returns the locally stored minimum size. More...
 
void setMinimumSize (const Gfx::SizeF &s)
 Sets the local minimum size and notifies the size-limit hook. More...
 
void setMinimumSize (double w, double h)
 Sets the local minimum width and height.
 
void setMinimumWidth (double w)
 Sets the local minimum width.
 
void setMinimumHeight (double h)
 Sets the local minimum height.
 
const Gfx::SizeFmaximumSize () const
 Returns the locally stored maximum size. More...
 
void setMaximumSize (const Gfx::SizeF &s)
 Sets the local maximum size and notifies the size-limit hook. More...
 
void setMaximumSize (double w, double h)
 Sets the local maximum width and height.
 
void setMaximumWidth (double w)
 Sets the local maximum width.
 
void setMaximumHeight (double h)
 Sets the local maximum height.
 
virtual void resize (const Gfx::SizeF &s)
 Requests a new local size s. More...
 
void setCapture (bool capture)
 Requests pointer input capture or release. More...
 
const Cursor * cursor () const
 Returns this widget's cursor or the default cursor. More...
 
void setCursor (const Cursor *c)
 Sets a local cursor override. More...
 
void processEvent (const Pt::Event &ev)
 Processes ev through this widget's event dispatcher. More...
 
Pt::Signal< const Pt::Event & > & eventReceived ()
 Returns the event dispatcher signal. More...
 
bool mouseEvent (const MouseEvent &ev)
 Delivers ev along the mouse responder chain. More...
 
void touchEvent (const TouchEvent &ev)
 Delivers ev along the touch responder chain. More...
 
void scrollEvent (const ScrollEvent &ev)
 Delivers ev along the scroll responder chain.
 
void enterEvent (const EnterEvent &ev)
 Delivers ev along the enter responder chain.
 
void leaveEvent (const LeaveEvent &ev)
 Delivers ev along the leave responder chain.
 
void keyEvent (const KeyEvent &ev)
 Delivers ev along the key responder chain.
 

Protected Member Functions

virtual void onAddControl (Control &control)
 Forwards the added control to the base layout.
 
virtual void onRemoveControl (Control &control)
 Removes control from the selected items.
 
virtual Gfx::SizeF onMeasure (const SizePolicy &policy)
 Measures children along the flow axis.
 
virtual void onLayout (const Gfx::RectF &rect)
 Places children along the flow direction.
 
virtual void onInvalidateEvent (const InvalidateEvent &ev)
 Handles the final coalesced invalidation event. More...
 
virtual void onInvalidate ()
 Updates derived state after invalidation. More...
 
virtual void onProcessPaintEvent (const PaintEvent &ev)
 Processes a paint event and paints visible child controls. More...
 
virtual void onPaintEvent (const PaintEvent &ev)
 Handles this control's own paint event. More...
 
virtual void onPaint (PaintContext &context, const Gfx::RectF &rect)
 Paints custom content in local coordinates. More...
 
virtual void onProcessLayoutEvent (const LayoutEvent &ev)
 Processes a pending layout event. More...
 
virtual void onLayoutEvent (const LayoutEvent &ev)
 Handles the aligned layout rectangle and requests repaint.
 
virtual void onSetSizeLimits (const Gfx::SizeF &minSize, const Gfx::SizeF &maxSize)
 Requests relayout after local size limits change.
 
virtual void onSetSurface (PaintSurface *surface, const Gfx::PointF &pos)
 Propagates a surface assignment to direct children. More...
 
virtual void onActionKey (const KeyEvent &kev)
 Handles the configured action key while this control has focus.
 
virtual void onShortcut (const Key &kev)
 Handles an activated form shortcut.
 
virtual void onMnemonic (Pt::Char m)
 Handles an activated form mnemonic. More...
 
virtual void onConnect (Screen &screen)
 Connects this control and all direct descendants to screen.
 
virtual void onDisconnect ()
 Disconnects this control and all direct descendants from the screen.
 
virtual WidgetonHitTest (const Gfx::PointF &p)
 Returns the frontmost descendant hit at local position p. More...
 
virtual Gfx::PointF onToParent (const Gfx::PointF &pos) const
 Converts local coordinates to the containing view.
 
virtual Gfx::PointF onFromParent (const Gfx::PointF &pos) const
 Converts containing-view coordinates to local coordinates.
 
virtual void onRequestRepaint (const Gfx::RectF &rect)
 Forwards a local repaint request to the parent view.
 
virtual void onRequestShow (bool isShown)
 Records and forwards a visibility request to the parent view.
 
virtual void onRequestEnable (bool isEnable)
 Records and forwards an enable request to the parent view.
 
virtual void onRequestActivate (bool active)
 Forwards an activation request to the parent view.
 
virtual void onRequestMove (const Gfx::PointF &pos)
 Records and forwards a move request to the parent view.
 
virtual void onRequestResize (const Gfx::SizeF &s)
 Records and forwards a resize request to the parent view.
 
virtual void onProcessEvent (const Pt::Event &ev)
 Dispatches ev through the inherited widget event dispatcher.
 
virtual void onProcessEnableEvent (const EnableEvent &ev)
 Dispatches effective enabled state to this control and its children. More...
 
virtual void onEnableEvent (const EnableEvent &ev)
 Updates enabled state and handles an enable event.
 
virtual void onEnable (bool isEnable)
 Performs behavior associated with effective enabled state isEnable.
 
virtual void onProcessShowEvent (const ShowEvent &ev)
 Dispatches a visibility event.
 
virtual void onShowEvent (const ShowEvent &ev)
 Handles a visibility event and requests relayout.
 
virtual void onShow (bool visible)
 Performs behavior associated with visibility state visible.
 
virtual void onProcessFocusEvent (const FocusEvent &ev)
 Dispatches a focus event.
 
virtual void onFocusEvent (const FocusEvent &ev)
 Updates focus state and requests invalidation.
 
virtual void onProcessRescaleEvent (const RescaleEvent &ev)
 Dispatches a scale change to this control and all children.
 
virtual void onRescaleEvent (const RescaleEvent &ev)
 Handles a scale change.
 
virtual void onRescale (double scaling)
 Aligns local spacing and size-policy values to scaling.
 
virtual void onProcessMoveEvent (const MoveEvent &ev)
 Dispatches a move event.
 
virtual void onMoveEvent (const MoveEvent &ev)
 Updates parent-local position from a move event.
 
virtual void onProcessResizeEvent (const ResizeEvent &ev)
 Dispatches a resize event.
 
virtual void onResizeEvent (const ResizeEvent &ev)
 Updates local size and bounds from a resize event.
 
virtual void onProcessMouseEvent (const MouseEvent &ev)
 Routes mouse input to the frontmost eligible child or this control. More...
 
virtual void onProcessTouchEvent (const TouchEvent &ev)
 Routes touch input to the frontmost eligible child or this control. More...
 
virtual void onProcessScrollEvent (const ScrollEvent &ev)
 Delivers scroll input only while this control accepts input.
 
virtual void onProcessEnterEvent (const EnterEvent &ev)
 Dispatches a pointer-entry event.
 
virtual void onProcessLeaveEvent (const LeaveEvent &ev)
 Dispatches a pointer-leave event.
 
virtual void onProcessKeyEvent (const KeyEvent &ev)
 Delivers key input only while this control accepts input.
 
virtual bool onMouseEvent (const MouseEvent &ev)
 Handles mouse input in local coordinates. More...
 
virtual bool onTouchEvent (const TouchEvent &ev)
 Handles touch input in local coordinates. More...
 
virtual bool onScrollEvent (const ScrollEvent &ev)
 Handles scroll input or returns false to continue dispatch.
 
virtual bool onKeyEvent (const KeyEvent &ev)
 Handles focused action keys or continues responder dispatch.
 
virtual bool onEnterEvent (const EnterEvent &ev)
 Handles pointer entry or continues responder dispatch.
 
virtual bool onLeaveEvent (const LeaveEvent &ev)
 Handles pointer leave or continues responder dispatch.
 
virtual Gfx::PointF onToControl (const Control &control, const Gfx::PointF &pos) const
 Converts this control coordinates to direct child coordinates.
 
virtual Gfx::PointF onFromControl (const Control &control, const Gfx::PointF &pos) const
 Converts direct child coordinates to this control coordinates.
 
virtual void onAttach (Control &control)
 Stores control as a direct child and invokes onAddControl().
 
virtual void onDetach (Control &control)
 Removes control as a direct child and invokes onRemoveControl().
 
virtual void onInit (Control &control)
 Initializes runtime relationships for newly attached control. More...
 
virtual void onRelease (Control &control)
 Releases runtime relationships for detached control. More...
 
virtual void onRepaintRequest (Control &control, const Gfx::RectF &rect)
 Converts and forwards rect from control for repainting.
 
virtual void onRelayoutRequest (Control &control)
 Requests relayout after a direct child changes its layout.
 
virtual void onEnableRequest (Control &control, bool isEnable)
 Delivers an effective enable request to direct child control.
 
virtual void onActivateRequest (Control &control, bool active)
 Forwards a direct child's activation request to the parent view.
 
virtual void onShowRequest (Control &control, bool isShown)
 Delivers a visibility request to direct child control.
 
virtual void onMoveRequest (Control &control, const Gfx::PointF &pos)
 Forwards a direct child's move request to the parent view.
 
virtual void onResizeRequest (Control &control, const Gfx::SizeF &size)
 Forwards a direct child's resize request to the parent view.
 
virtual void onRaiseRequest (Control &control)
 Moves direct child control to the front of child order.
 
virtual const std::vector< KeyonGetShortcuts ()
 Returns shortcuts registered by this control.
 
virtual const std::vector< CharonGetMnemonics ()
 Returns mnemonics registered by this control.
 
virtual void onSetParent (Widget *parent)
 Records the non-owning parent relationship. More...
 
virtual Gfx::PointF onToGlobal (const Gfx::PointF &pos) const
 Converts local position pos to global coordinates. More...
 
virtual Gfx::PointF onFromGlobal (const Gfx::PointF &pos) const
 Converts global position pos to local coordinates. More...
 
virtual void onAttachPeer (Widget &peer)
 Attaches non-owning peer peer. More...
 
virtual void onDetachPeer (Widget &peer)
 Detaches non-owning peer peer. More...
 
virtual void onRequestCapture (bool capture)
 Requests application-managed pointer capture or release.
 
virtual void onProcessInvalidateEvent (const InvalidateEvent &ev)
 Coalesces and dispatches an invalidation event.
 
virtual ResponderonNextResponder ()
 Returns the non-owning next responder, or 0.
 
virtual bool onMousePress (const MouseEvent &ev)
 Handles a mouse press. The default returns false.
 
virtual bool onMouseRelease (const MouseEvent &ev)
 Handles a mouse release. The default returns false.
 
virtual bool onMouseMove (const MouseEvent &ev)
 Handles a mouse move. The default returns false.
 

Detailed Description

A ListBoxLayout is a FlowLayout used by a ListBox. It is an integrated subpart. Applications do not construct or place it.

Member Enumeration Documentation

◆ FocusPolicy

enum FocusPolicy
inherited
Enumerator
NoFocus 

The control cannot receive focus.

AcceptFocus 

The control participates in normal focus navigation.

KeepFocus 

The control retains focus during focus navigation.

Member Function Documentation

◆ addItem()

void addItem ( Control control)
inherited

The layout does not take ownership.

◆ setParent()

void setParent ( View parent)
inherited

The parent does not take ownership. If this control already has a parent, it is detached first. Attachment initializes the runtime relationships supplied by the parent, including form association, responder chain, screen connection, scaling, and paint surface.

◆ unparent()

void unparent ( )
inherited

Detachment removes the runtime relationships established during attachment but does not destroy this control.

◆ add()

void add ( Control control)
inherited

The child remains owned by its caller. Direct children paint in attachment order and are hit-tested in reverse order.

◆ remove()

void remove ( Control control)
inherited

Detachment reverses the runtime relationships established during attachment.

◆ setFocusPolicy()

void setFocusPolicy ( FocusPolicy  f)
inherited

When the control belongs to a form, the form updates its focus navigation state. Changing the policy to NoFocus removes focus from this control when it currently owns it.

◆ setFocusIndex()

void setFocusIndex ( size_t  index)
inherited

A containing form orders its focusable controls by this value.

◆ focus()

void focus ( )
inherited

The request has no effect while the control is unparented, outside a form, or uses the NoFocus policy. hasFocus() changes when the form delivers a FocusEvent.

◆ setActionKey()

void setActionKey ( const Key ak)
inherited

New controls use Key::Space.

◆ setShortcut()

void setShortcut ( const Key k)
inherited

The key is copied. Pass 0 to remove the shortcut. When multiple controls register the same key in a form, its last registration receives the shortcut.

◆ setMnemonic() [1/2]

void setMnemonic ( const Char ch)
inherited

When multiple controls register the same character in a form, its last registration receives the mnemonic.

◆ setMnemonic() [2/2]

String setMnemonic ( const String text)
inherited

For example, setMnemonic("&File") returns "File" and registers F. A doubled ampersand returns one literal ampersand. A trailing unpaired ampersand remains in the returned text.

◆ setMnemonicControl()

void setMnemonicControl ( Control control)
inherited

The target is non-owning. Pass 0 to remove mnemonic forwarding.

◆ processShortcut()

void processShortcut ( const Key key)
inherited

Forms call this after matching a registered shortcut. Applications normally register shortcuts with setShortcut() instead of calling this method directly.

◆ processMnemonic()

void processMnemonic ( Pt::Char  m)
inherited

Forms call this after matching an Alt mnemonic. Applications normally register mnemonics with setMnemonic() instead of calling this method directly.

◆ acceptsInput()

bool acceptsInput ( ) const
inherited

Parent input routing uses this predicate before delivering pointer, touch, scroll, and key input to a child.

◆ raise()

void raise ( )
inherited

The parent moves a direct child to the end of its child order, which is painted last and hit-tested first.

◆ onInvalidateEvent()

virtual void onInvalidateEvent ( const InvalidateEvent &  ev)
protectedvirtualinherited

The base implementation performs the normal widget invalidation and requests relayout. Overrides that retain this behavior must call the base implementation.

Reimplemented from Widget.

◆ onInvalidate()

virtual void onInvalidate ( )
protectedvirtualinherited

The default implementation requests relayout because changed control content may affect its preferred size.

Reimplemented from Widget.

Reimplemented in TabView, SpinBox, SpinBoxButton, Slider, ScrollBar, PushButton, ProgressBar, Panel, MenuItemBase, MenuBar, ListBox, ListBoxItem, LineEdit, Label, ComboBox, and CheckBox.

◆ onProcessPaintEvent()

virtual void onProcessPaintEvent ( const PaintEvent ev)
protectedvirtualinherited

The dirty rectangle is clipped and converted to each child's local coordinates. Overrides that retain normal painting must call the base implementation.

Reimplemented from Widget.

Reimplemented in Workspace.

◆ onPaintEvent()

virtual void onPaintEvent ( const PaintEvent ev)
protectedvirtualinherited

The base implementation creates the paint context and calls onPaint().

Reimplemented from View.

◆ onPaint()

virtual void onPaint ( PaintContext context,
const Gfx::RectF rect 
)
protectedvirtualinherited

rect is the local dirty rectangle. The default implementation does not draw.

Reimplemented from View.

Reimplemented in MenuSubItem, MenuItemBase, MenuBarItem, MenuBar, TabView, Slider, PushButton, ProgressBar, Panel, ListBox, ListBoxItem, ComboBox, CheckBox, SpinBox, SpinBoxButton, ScrollBar, LineEdit, Label, and Workspace.

◆ setSizePolicy()

void setSizePolicy ( const SizePolicy policy)
inherited

The policy size is aligned to the current device scaling.

◆ measure()

Gfx::SizeF measure ( const SizePolicy policy)
inherited

The control combines its own policy with the stricter parent modes, applies its minimum size, and caches the resulting preferred size. Fixed dimensions override the measured result; maximum dimensions cap it. The result remains cached until content, policy, limits, or scaling invalidates measurement.

◆ relayout()

void relayout ( )
inherited

The request propagates to the parent and is performed later by the containing form or layout sequence.

◆ onProcessLayoutEvent()

virtual void onProcessLayoutEvent ( const LayoutEvent &  ev)
protectedvirtualinherited

The base implementation aligns the control geometry to the device pixel grid, calls onLayoutEvent(), and queues layout events for direct children. Overrides that retain this sequence must call the base implementation.

Reimplemented in Workspace.

◆ onSetSurface()

virtual void onSetSurface ( PaintSurface surface,
const Gfx::PointF pos 
)
protectedvirtualinherited

Overrides that retain standard child painting must call the base implementation.

Reimplemented from View.

Reimplemented in Workspace.

◆ onMnemonic()

virtual void onMnemonic ( Pt::Char  m)
protectedvirtualinherited

The default implementation forwards m to the control selected by setMnemonicControl().

Reimplemented in MenuSubItem, MenuMenuItem, ListBoxItem, and Button.

◆ onHitTest()

virtual Widget* onHitTest ( const Gfx::PointF p)
protectedvirtualinherited

The control itself is returned when p is in bounds and no child is hit.

Reimplemented from Widget.

Reimplemented in Workspace.

◆ onProcessEnableEvent()

virtual void onProcessEnableEvent ( const EnableEvent &  ev)
protectedvirtualinherited

A disabled parent keeps every descendant effectively disabled.

Reimplemented from Widget.

Reimplemented in Workspace.

◆ onProcessMouseEvent()

virtual void onProcessMouseEvent ( const MouseEvent ev)
protectedvirtualinherited

A press delivered to this control requests pointer capture until release. Overrides that retain child routing must call the base implementation.

Reimplemented from Widget.

Reimplemented in MenuBar, Workspace, TabView, and ComboBox.

◆ onProcessTouchEvent()

virtual void onProcessTouchEvent ( const TouchEvent ev)
protectedvirtualinherited

A press delivered to this control requests pointer capture until release. Overrides that retain child routing must call the base implementation.

Reimplemented from Widget.

Reimplemented in Workspace, and TabView.

◆ onMouseEvent()

virtual bool onMouseEvent ( const MouseEvent ev)
protectedvirtualinherited

The default implementation requests focus on a left-button press and returns false to continue responder dispatch.

Reimplemented from Widget.

Reimplemented in MenuItemBase, MenuBar, SpinBox, Slider, ScrollLayout, ScrollBar, ListBoxItem, LineEdit, ComboBox, and Button.

◆ onTouchEvent()

virtual bool onTouchEvent ( const TouchEvent ev)
protectedvirtualinherited

The default implementation requests focus on press and returns false to continue responder dispatch.

Reimplemented from Widget.

Reimplemented in SpinBox, Slider, ScrollLayout, ScrollBar, ListBoxItem, LineEdit, ComboBox, Button, MenuItemBase, and MenuBar.

◆ onInit()

virtual void onInit ( Control control)
protectedvirtualinherited

The base implementation connects it when necessary, sets its next responder and form association, propagates scaling, and requests relayout.

Reimplemented from View.

◆ onRelease()

virtual void onRelease ( Control control)
protectedvirtualinherited

The base implementation removes its form association and next responder, disconnects it when necessary, and requests relayout.

Reimplemented from View.

◆ toControl()

Gfx::PointF toControl ( const Control control,
const Gfx::PointF pos 
) const
inherited

The default conversion subtracts the control position. Override onToControl() when the hosted control uses a different coordinate mapping.

◆ fromControl()

Gfx::PointF fromControl ( const Control control,
const Gfx::PointF pos 
) const
inherited

The default conversion adds the control position. Override onFromControl() when the hosted control uses a different coordinate mapping.

◆ surface()

PaintSurface& surface ( )
inherited

The adapter exposes this view's size, scaling, and position on the surface assigned with setSurface(). It remains available while no parent surface is assigned, but cannot then obtain a canvas.

◆ setSurface()

void setSurface ( PaintSurface surface,
const Gfx::PointF pos = Gfx::PointF() 
)
inherited

The view borrows surface and does not destroy it. Pass null to detach the view from its parent surface. pos identifies this view's origin in the assigned surface and is used to establish child-control surface positions.

◆ setNextResponder()

void setNextResponder ( Responder r)
inherited

The widget does not own r. Do not create a responder cycle.

◆ hitTest()

Widget* hitTest ( const Gfx::PointF pos)
inherited

Returns 0 when no descendant is hit. Derived classes implement their child hit-testing policy in onHitTest().

◆ toGlobal()

Gfx::PointF toGlobal ( const Gfx::PointF pos) const
inherited

The default conversion walks the parent chain.

◆ fromGlobal()

Gfx::PointF fromGlobal ( const Gfx::PointF pos) const
inherited

The default conversion walks the parent chain.

◆ addPeer()

void addPeer ( Widget peer)
inherited

Peers are not a parent, child, or screen connection and do not transfer ownership. Add a relationship only once. Both endpoints receive onAttachPeer().

◆ removePeer()

void removePeer ( Widget peer)
inherited

Both endpoints receive onDetachPeer().

◆ invalidate()

void invalidate ( )
inherited

The Forms event loop eventually calls onInvalidateEvent() after all pending invalidation requests for this widget have coalesced.

◆ repaint()

virtual void repaint ( const Gfx::RectF rect)
virtualinherited

The containing view, frame, or backend converts and forwards the rectangle. This does not paint synchronously.

◆ show()

virtual void show ( bool  b = true)
virtualinherited

isVisible() changes only when the request is confirmed by a ShowEvent.

◆ enable()

virtual void enable ( bool  isEnable = true)
virtualinherited

isEnabled() changes only when the request is confirmed by an EnableEvent.

◆ activate()

void activate ( bool  active = true)
inherited

Activation is defined by the receiving parent, frame, or backend.

◆ move()

virtual void move ( const Gfx::PointF pos)
virtualinherited

position() changes only when a MoveEvent confirms the request.

◆ minimumSize()

const Gfx::SizeF& minimumSize ( ) const
inherited

New widgets use (0, 0).

◆ setMinimumSize()

void setMinimumSize ( const Gfx::SizeF s)
inherited

This does not resize the widget or validate it against the maximum size. The receiver of onSetSizeLimits() applies the limits.

◆ maximumSize()

const Gfx::SizeF& maximumSize ( ) const
inherited

New widgets use (64000, 64000).

◆ setMaximumSize()

void setMaximumSize ( const Gfx::SizeF s)
inherited

This does not resize the widget or validate it against the minimum size. The receiver of onSetSizeLimits() applies the limits.

◆ resize()

virtual void resize ( const Gfx::SizeF s)
virtualinherited

size() and bounds() change only when a ResizeEvent confirms the request.

◆ setCapture()

void setCapture ( bool  capture)
inherited

Capture is owned by the application and routes pointer input to this widget until released. It is released during destruction.

◆ cursor()

const Cursor* cursor ( ) const
inherited

The returned cursor is always non-null and is owned by the widget or the Forms runtime.

◆ setCursor()

void setCursor ( const Cursor *  c)
inherited

Pass 0 to remove the override and restore the default cursor. The cursor is copied, so the caller retains ownership of c. When this widget is under the pointer, the platform cursor is updated immediately.

◆ processEvent()

void processEvent ( const Pt::Event ev)
inherited

Use the state-request APIs for ordinary operation. This method is for backends, tests, and code that deliberately injects events.

◆ eventReceived()

Pt::Signal<const Pt::Event&>& eventReceived ( )
inherited

Internal event-processing slots are connected to this signal. Additional slots can observe or process deliberately dispatched widget events.

◆ onSetParent()

virtual void onSetParent ( Widget parent)
protectedvirtualinherited

Container classes call this while attaching or detaching the widget. Overrides that retain the base relationship must call this implementation.

◆ onToGlobal()

virtual Gfx::PointF onToGlobal ( const Gfx::PointF pos) const
protectedvirtualinherited

The base implementation walks the parent chain through onToParent().

Implements Responder.

Reimplemented in Screen.

◆ onFromGlobal()

virtual Gfx::PointF onFromGlobal ( const Gfx::PointF pos) const
protectedvirtualinherited

The base implementation walks the parent chain through onFromParent().

Implements Responder.

Reimplemented in Screen.

◆ onAttachPeer()

virtual void onAttachPeer ( Widget peer)
protectedvirtualinherited

The base implementation stores the peer. Overrides that retain the association must call this implementation.

Reimplemented in Popup.

◆ onDetachPeer()

virtual void onDetachPeer ( Widget peer)
protectedvirtualinherited

The base implementation removes one stored association. Overrides that retain the association must call this implementation.

Reimplemented in Popup.

◆ mouseEvent()

bool mouseEvent ( const MouseEvent ev)
inherited

Converts the position to each responder's local coordinates. Returns true when a responder handles the event.

◆ touchEvent()

void touchEvent ( const TouchEvent ev)
inherited

Converts the position to each responder's local coordinates.