View Class Referenceabstract

#include <Pt/Forms/View.h>

Widget that hosts controls on a paint surface. More...

Inherits Widget.

Inherited by Control, and Form.

Public Types

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

Public Member Functions

virtual ~View ()
 Destroys the view and its surface adapter.
Gfx::PointF toControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from this view to control coordinates.
Gfx::PointF fromControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from control to this view coordinates.
PaintSurfacesurface ()
 Returns this view's local paint-surface adapter.
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.
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.
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.
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.
Gfx::PointF fromGlobal (const Gfx::PointF &pos) const
 Converts global position pos to local coordinates.
void addPeer (Widget &peer)
 Adds a bidirectional, non-owning peer association with peer.
void removePeer (Widget &peer)
 Removes the bidirectional peer association with peer.
void invalidate ()
 Queues a coalesced invalidation.
virtual void repaint (const Gfx::RectF &rect)
 Requests repainting local dirty rectangle rect.
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.
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.
void activate (bool active=true)
 Requests that the widget become active or inactive.
const Gfx::PointF & position () const
 Returns the position in parent logical coordinates.
virtual void move (const Gfx::PointF &pos)
 Requests a new parent-local position pos.
const Gfx::SizeF & size () const
 Returns the size in local logical coordinates.
const Gfx::RectF & bounds () const
 Returns local bounds, whose origin is always local zero.
const Gfx::SizeF & minimumSize () const
 Returns the locally stored minimum size.
void setMinimumSize (const Gfx::SizeF &s)
 Sets the local minimum size and notifies the size-limit hook.
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::SizeF & maximumSize () const
 Returns the locally stored maximum size.
void setMaximumSize (const Gfx::SizeF &s)
 Sets the local maximum size and notifies the size-limit hook.
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.
void setCapture (bool capture)
 Requests pointer input capture or release.
const Cursor * cursor () const
 Returns this widget's cursor or the default cursor.
void setCursor (const Cursor *c)
 Sets a local cursor override.
void processEvent (const Pt::Event &ev)
 Processes ev through this widget's event dispatcher.
Pt::Signal< const Pt::Event & > & eventReceived ()
 Returns the event dispatcher signal.
bool mouseEvent (const MouseEvent &ev)
 Delivers ev along the mouse responder chain.
void touchEvent (const TouchEvent &ev)
 Delivers ev along the touch responder chain.
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

 View ()
 Creates a view for a derived content host.
virtual void onSetSurface (PaintSurface *surface, const Gfx::PointF &pos)
 Notifies the view after its surface assignment changes.
virtual void onPaint (PaintContext &context, const Gfx::RectF &rect)
 Paints this view into context for the local rect.
virtual void onAttach (Control &control)
 Notifies the view that control was attached.
virtual void onDetach (Control &control)
 Notifies the view that control was detached.
virtual void onInit (Control &control)
 Initializes control after it has been attached.
virtual void onRelease (Control &control)
 Releases runtime resources associated with control.
virtual Gfx::PointF onToControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from this view to control coordinates.
virtual Gfx::PointF onFromControl (const Control &control, const Gfx::PointF &pos) const
 Converts pos from control to this view coordinates.
virtual void onRepaintRequest (Control &control, const Gfx::RectF &rect)
 Receives a repaint request for rect in control coordinates.
virtual void onRelayoutRequest (Control &control)
 Receives a request to recalculate control's layout.
virtual void onEnableRequest (Control &control, bool isEnable)
 Receives a request to enable or disable control.
virtual void onActivateRequest (Control &control, bool active)
 Receives a request to activate or deactivate control.
virtual void onShowRequest (Control &control, bool isShown)
 Receives a request to show or hide control.
virtual void onMoveRequest (Control &control, const Gfx::PointF &pos)
 Receives a request to move control to pos.
virtual void onResizeRequest (Control &control, const Gfx::SizeF &size)
 Receives a request to resize control to size.
virtual void onRaiseRequest (Control &control)
 Receives a request to raise control in its host.
virtual void onConnect (Screen &screen)
 Connects the view to screen.
virtual void onDisconnect ()
 Disconnects the view from its screen.
virtual void onPaintEvent (const PaintEvent &ev) override
 Processes a paint event and invokes onPaint().
virtual void onMoveEvent (const MoveEvent &ev) override
 Repaints the union of the old and new view bounds.
virtual void onResizeEvent (const ResizeEvent &ev) override
 Repaints the union of the old and new view bounds.
virtual void onSetParent (Widget *parent)
 Records the non-owning parent relationship.
virtual WidgetonHitTest (const Gfx::PointF &pos)
 Returns the descendant hit at local position pos.
virtual Gfx::PointF onToParent (const Gfx::PointF &pos) const =0
 Converts local position pos to parent coordinates.
virtual Gfx::PointF onFromParent (const Gfx::PointF &pos) const =0
 Converts parent position pos to local coordinates.
virtual Gfx::PointF onToGlobal (const Gfx::PointF &pos) const
 Converts local position pos to global coordinates.
virtual Gfx::PointF onFromGlobal (const Gfx::PointF &pos) const
 Converts global position pos to local coordinates.
virtual void onAttachPeer (Widget &peer)
 Attaches non-owning peer peer.
virtual void onDetachPeer (Widget &peer)
 Detaches non-owning peer peer.
virtual void onRequestRepaint (const Gfx::RectF &rect)
 Forwards a repaint request for local rectangle rect.
virtual void onRequestShow (bool e)
 Forwards a request to show or hide the widget.
virtual void onRequestEnable (bool isEnable)
 Forwards a request to enable or disable the widget.
virtual void onRequestActivate (bool active)
 Forwards a request to activate or deactivate the widget.
virtual void onRequestMove (const Gfx::PointF &pos)
 Forwards a request for parent-local position pos.
virtual void onSetSizeLimits (const Gfx::SizeF &minSize, const Gfx::SizeF &maxSize)
 Notifies that locally stored size limits changed.
virtual void onRequestResize (const Gfx::SizeF &s)
 Forwards a request for local size s.
virtual void onRequestCapture (bool capture)
 Requests application-managed pointer capture or release.
virtual void onProcessEvent (const Pt::Event &ev)
 Sends ev to the widget event dispatcher.
virtual void onProcessInvalidateEvent (const InvalidateEvent &ev)
 Coalesces and dispatches an invalidation event.
virtual void onInvalidateEvent (const InvalidateEvent &ev)
 Handles the final coalesced invalidation event.
virtual void onInvalidate ()
 Updates derived state after invalidation.
virtual void onProcessPaintEvent (const PaintEvent &ev)
 Filters and dispatches a paint event.
virtual void onProcessRescaleEvent (const RescaleEvent &ev)
 Dispatches a rescale event.
virtual void onRescaleEvent (const RescaleEvent &ev)
 Handles a rescale event.
virtual void onRescale (double scaling)
 Updates the local scaling to scaling.
virtual void onProcessShowEvent (const ShowEvent &ev)
 Ignores redundant show events and dispatches other ones.
virtual void onShowEvent (const ShowEvent &ev)
 Handles a show event.
virtual void onShow (bool visible)
 Updates the local visibility state to visible.
virtual void onProcessEnableEvent (const EnableEvent &ev)
 Dispatches an enable event.
virtual void onEnableEvent (const EnableEvent &ev)
 Updates the enabled state and handles an enable event.
virtual void onEnable (bool e)
 Performs behavior associated with enabled state e.
virtual void onProcessMoveEvent (const MoveEvent &ev)
 Dispatches a move event.
virtual void onProcessResizeEvent (const ResizeEvent &ev)
 Dispatches a resize event.
virtual void onProcessMouseEvent (const MouseEvent &ev)
 Updates pointer tracking and delivers a mouse event.
virtual void onProcessTouchEvent (const TouchEvent &ev)
 Updates pointer tracking and delivers a touch event.
virtual void onProcessScrollEvent (const ScrollEvent &ev)
 Delivers a scroll event through the responder chain.
virtual void onProcessEnterEvent (const EnterEvent &ev)
 Delivers an enter event through the responder chain.
virtual void onProcessLeaveEvent (const LeaveEvent &ev)
 Delivers a leave event through the responder chain.
virtual void onProcessKeyEvent (const KeyEvent &ev)
 Delivers a key event through the responder chain.
virtual ResponderonNextResponder ()
 Returns the non-owning next responder, or 0.
virtual bool onMouseEvent (const MouseEvent &ev)
 Handles a mouse event in local coordinates.
virtual bool onTouchEvent (const TouchEvent &ev)
 Handles a touch event in local coordinates.
virtual bool onScrollEvent (const ScrollEvent &ev)
 Handles a scroll event.
virtual bool onEnterEvent (const EnterEvent &ev)
 Handles pointer entry and installs the widget cursor.
virtual bool onLeaveEvent (const LeaveEvent &ev)
 Handles pointer leave and restores the default cursor.
virtual bool onKeyEvent (const KeyEvent &ev)
 Handles a key event.
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 View is a Widget that attaches controls to a PaintSurface. It establishes the surface and coordinate mapping for those controls and forwards their repaint, layout, visibility, geometry, and activation requests. Form and Control are the usual view implementations. Screen and WindowManager are widgets but not views.

The view owns its surface adapter, not the PaintSurface assigned through setSurface(). The adapter presents the view's local size, scaling, and offset within the borrowed surface. When a control is initialized, the view gives it that surface with an offset derived from the control's position; release clears the control's surface. Form and Control extend this mechanism to their content and child controls.

toControl() and fromControl() convert between view-local and attached control coordinates. Their default mapping uses the control position. View implementations align child move and resize requests to the active scaling before sending the corresponding Forms event. Override the protected mapping and forwarding hooks only when a custom host has a different coordinate system, surface arrangement, or request policy.

View is an implementation boundary rather than the usual application base class. Derive visible application content from Control. Derive from View only when a custom content host needs different paint-surface or coordinate behavior. A custom view must arrange a complete attach, initialize, release, and detach lifecycle for every hosted control and must not retain a surface supplied by another view beyond that lifecycle.

Member Enumeration Documentation

◆ FocusPolicy

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

◆ toControl()

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

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

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

◆ surface()

PaintSurface & surface ( )

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() )

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.

◆ onSetSurface()

virtual void onSetSurface ( PaintSurface * surface,
const Gfx::PointF & pos )
protectedvirtual

Override to propagate surface and pos to hosted controls or to establish a custom surface arrangement.

Reimplemented in Control, Form, and Workspace.

◆ onPaint()

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

The default implementation does not draw. Use this hook for custom view content rather than overriding onPaintEvent().

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

◆ onAttach()

virtual void onAttach ( Control & control)
protectedvirtual

The base implementation does not retain the control. A custom host stores controls or updates its content relationship here.

Reimplemented in Control, and Form.

◆ onDetach()

virtual void onDetach ( Control & control)
protectedvirtual

The base implementation does not manage control ownership or a child list.

Reimplemented in Control, and Form.

◆ onInit()

virtual void onInit ( Control & control)
protectedvirtual

The base implementation assigns the current parent surface at the control position. An override that retains the standard surface mapping must call the base implementation.

Reimplemented in Control, and Form.

◆ onRelease()

virtual void onRelease ( Control & control)
protectedvirtual

The base implementation removes the control's surface assignment. An override that used onInit() must call the base implementation or provide an equivalent release operation.

Reimplemented in Control, and Form.

◆ onRepaintRequest()

virtual void onRepaintRequest ( Control & control,
const Gfx::RectF & rect )
protectedvirtual

The base implementation discards the request. A content host converts and forwards the dirty region to its own repaint target.

Reimplemented in Control, and Form.

◆ onRelayoutRequest()

virtual void onRelayoutRequest ( Control & control)
protectedvirtual

The base implementation discards the request.

Reimplemented in Control, and Form.

◆ onEnableRequest()

virtual void onEnableRequest ( Control & control,
bool isEnable )
protectedvirtual

The base implementation discards the request.

Reimplemented in Control, and Form.

◆ onActivateRequest()

virtual void onActivateRequest ( Control & control,
bool active )
protectedvirtual

The base implementation discards the request.

Reimplemented in Control, and Form.

◆ onShowRequest()

virtual void onShowRequest ( Control & control,
bool isShown )
protectedvirtual

The base implementation discards the request.

Reimplemented in Control, and Form.

◆ onMoveRequest()

virtual void onMoveRequest ( Control & control,
const Gfx::PointF & pos )
protectedvirtual

The base implementation aligns pos to the active scaling, updates the control surface position, and commits a MoveEvent.

Reimplemented in Control, and Form.

◆ onResizeRequest()

virtual void onResizeRequest ( Control & control,
const Gfx::SizeF & size )
protectedvirtual

The base implementation aligns size to the active scaling and commits a ResizeEvent.

Reimplemented in Control, and Form.

◆ onRaiseRequest()

virtual void onRaiseRequest ( Control & control)
protectedvirtual

The base implementation discards the request.

Reimplemented in Control, and Form.

◆ onConnect()

virtual void onConnect ( Screen & screen)
protectedvirtual

The base implementation connects the underlying widget.

Reimplemented from Widget.

Reimplemented in Control, Form, Label, Window, and Workspace.

◆ onDisconnect()

virtual void onDisconnect ( )
protectedvirtual

The base implementation disconnects the underlying widget.

Reimplemented from Widget.

Reimplemented in Control, Form, Window, and Workspace.

◆ onPaintEvent()

virtual void onPaintEvent ( const PaintEvent & ev)
overrideprotectedvirtual

The base implementation processes the widget event, then creates a PaintContext using this view's surface adapter. Overrides that need the standard painting sequence must call the base method.

Reimplemented from Widget.

Reimplemented in Control, and Form.

◆ onMoveEvent()

virtual void onMoveEvent ( const MoveEvent & ev)
overrideprotectedvirtual

The base implementation then applies the move event to the widget.

Reimplemented from Widget.

Reimplemented in Control, Form, and Window.

◆ onResizeEvent()

virtual void onResizeEvent ( const ResizeEvent & ev)
overrideprotectedvirtual

The base implementation then applies the resize event to the widget.

Reimplemented from Widget.

Reimplemented in ComboBox, Control, Form, Label, LineEdit, and Window.

◆ 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.

◆ onHitTest()

virtual Widget * onHitTest ( const Gfx::PointF & pos)
protectedvirtualinherited

The base implementation returns 0. Derived containers define their child hit-testing order, visibility rules, and coordinate mapping.

Reimplemented in Control, Form, Screen, Window, Workspace, and WorkspaceManager.

◆ onToParent()

virtual Gfx::PointF onToParent ( const Gfx::PointF & pos) const
protectedpure virtualinherited

Every direct Widget subclass must implement this mapping.

Implemented in Control, Screen, Window, and WorkspaceManager.

◆ onFromParent()

virtual Gfx::PointF onFromParent ( const Gfx::PointF & pos) const
protectedpure virtualinherited

Every direct Widget subclass must implement this mapping.

Implemented in Control, Screen, Window, and WorkspaceManager.

◆ 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.

◆ onSetSizeLimits()

virtual void onSetSizeLimits ( const Gfx::SizeF & minSize,
const Gfx::SizeF & maxSize )
protectedvirtualinherited

The base implementation does nothing. A parent, frame, or backend can apply minSize and maxSize to its geometry policy.

Reimplemented in Control, and Window.

◆ onInvalidateEvent()

virtual void onInvalidateEvent ( const InvalidateEvent & ev)
protectedvirtualinherited

The base implementation calls onInvalidate().

Reimplemented in Control, Form, and Window.

◆ onInvalidate()

virtual void onInvalidate ( )
protectedvirtualinherited

The base implementation clears pending invalidation bookkeeping.

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

◆ onProcessPaintEvent()

virtual void onProcessPaintEvent ( const PaintEvent & ev)
protectedvirtualinherited

Empty dirty rectangles are ignored.

Reimplemented in Control, Form, Screen, Window, WindowManager, Workspace, and WorkspaceManager.

◆ onRescaleEvent()

virtual void onRescaleEvent ( const RescaleEvent & ev)
protectedvirtualinherited

The base implementation calls onRescale() with the event scale.

Reimplemented in Control, Form, Label, Panel, PushButton, Screen, and Window.

◆ onShowEvent()

virtual void onShowEvent ( const ShowEvent & ev)
protectedvirtualinherited

The base implementation calls onShow().

Reimplemented in Control, Form, Menu, Popup, and Window.

◆ onEnableEvent()

virtual void onEnableEvent ( const EnableEvent & ev)
protectedvirtualinherited

The base implementation updates isEnabled() before calling onEnable().

Reimplemented in Control, Form, and Window.

◆ onMouseEvent()

virtual bool onMouseEvent ( const MouseEvent & ev)
protectedvirtualinherited

Return true to consume it. Returning false forwards the original event to the next responder.

Reimplemented from Responder.

Reimplemented in Button, ComboBox, Control, Form, LineEdit, ListBoxItem, Menu, MenuBar, MenuItemBase, Screen, ScrollBar, ScrollLayout, Slider, SpinBox, and Window.

◆ onTouchEvent()

virtual bool onTouchEvent ( const TouchEvent & ev)
protectedvirtualinherited

Return true to consume it. Returning false forwards the original event to the next responder.

Reimplemented from Responder.

Reimplemented in Button, ComboBox, Control, Form, LineEdit, ListBoxItem, MenuBar, MenuItemBase, Screen, ScrollBar, ScrollLayout, Slider, SpinBox, and Window.

◆ onScrollEvent()

virtual bool onScrollEvent ( const ScrollEvent & ev)
protectedvirtualinherited

Return true to consume it; otherwise it is forwarded to the next responder.

Reimplemented from Responder.

Reimplemented in Button, Control, Form, ListBoxItem, Screen, ScrollLayout, and Window.

◆ onEnterEvent()

virtual bool onEnterEvent ( const EnterEvent & ev)
protectedvirtualinherited

The base implementation consumes the event. Override and return false only when it should continue through the responder chain.

Reimplemented from Responder.

Reimplemented in Button, ComboBox, Control, Form, LineEdit, ListBoxItem, Menu, MenuItemBase, ScrollBar, Slider, SpinBox, and Window.

◆ onLeaveEvent()

virtual bool onLeaveEvent ( const LeaveEvent & ev)
protectedvirtualinherited

The base implementation consumes the event. Override and return false only when it should continue through the responder chain.

Reimplemented from Responder.

Reimplemented in Button, ComboBox, Control, Form, LineEdit, ListBoxItem, Menu, MenuItemBase, ScrollBar, Slider, SpinBox, and Window.

◆ onKeyEvent()

virtual bool onKeyEvent ( const KeyEvent & ev)
protectedvirtualinherited

Return true to consume it; otherwise it is forwarded to the next responder.

Reimplemented from Responder.

Reimplemented in ComboBox, Control, Form, LineEdit, Screen, SpinBox, and Window.

◆ 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.