|
|
virtual | ~Form () |
| | Detaches the current content control.
|
|
Control * | content () |
| | Returns the current content control, or 0 when none is attached.
|
|
const Control * | content () const |
| | Returns the current content control, or 0 when none is attached.
|
| void | setContent (Control *control) |
| | Replaces the content root with control.
|
| Gfx::SizeF | measure (const SizePolicy &policy) |
| | Measures the preferred content size for policy.
|
| void | relayout () |
| | Queues a layout pass while the form is connected.
|
|
Control * | focusControl () |
| | Returns the focused control, or 0 when no control has focus.
|
| void | focusNext () |
| | Moves focus to the next eligible control.
|
| void | focusPrev () |
| | Moves focus to the previous eligible control.
|
| 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.
|
| PaintSurface & | surface () |
| | Returns this view's local paint-surface adapter.
|
|
const PaintSurface & | surface () 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.
|
|
Screen * | screen () |
| | Returns the connected screen, or 0 when disconnected.
|
|
const Screen * | screen () const |
| | Returns the connected screen, or 0 when disconnected.
|
|
Widget * | parent () |
| | Returns the non-owning parent, or 0 when unparented.
|
|
const Widget * | parent () 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.
|
| Widget * | hitTest (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::Scaling & | scaling () 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.
|
|
|
| Form () |
| | Creates a form without a content control.
|
|
virtual void | onRequestRelayout () |
| | Queues the layout event for a requested layout pass.
|
| virtual void | onProcessLayoutEvent (const LayoutEvent &ev) |
| | Processes a queued layout event.
|
| virtual Gfx::SizeF | onProcessMeasure () |
| | Creates the size policy used by the default layout pass.
|
|
virtual void | onProcessLayout (const Gfx::RectF &rect) |
| | Applies the result of the default layout pass to rect.
|
| virtual Gfx::SizeF | onMeasure (const SizePolicy &policy) |
| | Measures the content for policy.
|
| virtual void | onLayout (const Gfx::RectF &rect) |
| | Lays out the content in rect.
|
|
virtual void | onAddElement (Control &control) |
| | Registers control for focus traversal, shortcuts, and mnemonics.
|
|
virtual void | onRemoveElement (Control &control) |
| | Removes control from focus traversal, shortcuts, and mnemonics.
|
|
virtual void | onSetFocusPolicy (Control &control, FocusPolicy policy) |
| | Updates focus after control changes to policy.
|
|
virtual void | onSetFocusIndex (Control &control, unsigned index) |
| | Updates the focus order after control changes its focus index.
|
| virtual void | onSetFocus (Control &control) |
| | Gives focus to control and sends the corresponding focus events.
|
|
virtual void | onSetShortcut (Control &control, const std::vector< Key > &keys) |
| | Replaces the shortcut registrations for control with keys.
|
|
virtual void | onSetMnemonic (Control &control, const std::vector< Char > &chs) |
| | Replaces the mnemonic registrations for control with chs.
|
|
virtual void | onSetSurface (PaintSurface *surface, const Gfx::PointF &pos) |
| | Assigns the paint surface and translates it to the content root.
|
|
virtual void | onAttach (Control &control) |
| | Handles attachment of control to this form.
|
|
virtual void | onDetach (Control &control) |
| | Handles detachment of control from this form.
|
|
virtual void | onInit (Control &control) |
| | Connects control to this form's screen and responder chain.
|
|
virtual void | onRelease (Control &control) |
| | Disconnects control from this form's screen and responder chain.
|
|
virtual Gfx::PointF | onToControl (const Control &control, const Gfx::PointF &pos) const |
| | Converts form-local pos to coordinates local to control.
|
|
virtual Gfx::PointF | onFromControl (const Control &control, const Gfx::PointF &pos) const |
| | Converts coordinates local to control into form-local pos.
|
|
virtual void | onRepaintRequest (Control &control, const Gfx::RectF &rect) |
| | Translates a repaint request from control to form coordinates.
|
|
virtual void | onRelayoutRequest (Control &control) |
| | Queues a form layout after a request from control.
|
| virtual void | onEnableRequest (Control &control, bool isEnable) |
| | Delivers an effective enable state to control.
|
| virtual void | onActivateRequest (Control &control, bool active) |
| | Makes control the active input target when active is true.
|
|
virtual void | onShowRequest (Control &control, bool isShown) |
| | Delivers a visibility request to control.
|
|
virtual void | onMoveRequest (Control &control, const Gfx::PointF &pos) |
| | Aligns and commits a move request for control.
|
|
virtual void | onResizeRequest (Control &control, const Gfx::SizeF &size) |
| | Aligns and commits a resize request for control.
|
| virtual void | onRaiseRequest (Control &control) |
| | Receives a request to raise control.
|
|
virtual void | onConnect (Screen &screen) |
| | Connects the form and its content to screen.
|
|
virtual void | onDisconnect () |
| | Disconnects the form and its content from the screen.
|
|
virtual Widget * | onHitTest (const Gfx::PointF &pos) |
| | Returns the deepest content widget at form-local pos.
|
|
virtual void | onRequestCapture (bool capture) |
| | Forwards a pointer capture request to the Forms application.
|
| virtual void | onRequestResize (const Gfx::SizeF &s) |
| | Receives a resize request for the form itself.
|
| virtual void | onProcessEvent (const Pt::Event &ev) |
| | Dispatches ev through the widget event dispatcher.
|
|
virtual void | onInvalidateEvent (const InvalidateEvent &ev) |
| | Handles the final coalesced invalidation event.
|
|
virtual void | onInvalidate () |
| | Clears invalidation state and requests a layout pass.
|
| virtual void | onProcessPaintEvent (const PaintEvent &ev) |
| | Paints the form and the intersecting part of its content root.
|
| virtual void | onPaintEvent (const PaintEvent &ev) |
| | Paints the form's own view content.
|
|
virtual void | onProcessRescaleEvent (const RescaleEvent &ev) |
| | Updates form scaling and propagates it to the content root.
|
|
virtual void | onRescaleEvent (const RescaleEvent &ev) |
| | Handles a scale-change event for the form.
|
|
virtual void | onRescale (double scaling) |
| | Updates the form's logical-to-device scaling to scaling.
|
|
virtual void | onProcessEnableEvent (const EnableEvent &ev) |
| | Updates form enabled state and propagates it to the content root.
|
|
virtual void | onEnableEvent (const EnableEvent &ev) |
| | Handles an enable event for the form.
|
|
virtual void | onEnable (bool e) |
| | Performs behavior associated with effective enabled state e.
|
| virtual void | onProcessShowEvent (const ShowEvent &ev) |
| | Updates visibility of the form itself.
|
|
virtual void | onShowEvent (const ShowEvent &ev) |
| | Handles a visibility event for the form.
|
|
virtual void | onShow (bool visible) |
| | Performs behavior associated with form visibility visible.
|
|
virtual void | onProcessMoveEvent (const MoveEvent &ev) |
| | Processes a move event with the standard View behavior.
|
|
virtual void | onMoveEvent (const MoveEvent &ev) |
| | Repaints changed bounds and updates the form position.
|
|
virtual void | onProcessResizeEvent (const ResizeEvent &ev) |
| | Processes a resize event and schedules relayout when size changes.
|
|
virtual void | onResizeEvent (const ResizeEvent &ev) |
| | Repaints changed bounds, updates size, and requests relayout.
|
|
virtual void | onProcessMouseEvent (const MouseEvent &ev) |
| | Routes mouse input to the content under the pointer when possible.
|
|
virtual void | onProcessTouchEvent (const TouchEvent &ev) |
| | Routes touch input to the content under the pointer when possible.
|
|
virtual void | onProcessScrollEvent (const ScrollEvent &sev) |
| | Routes scrolling to the active control, then the focused control.
|
|
virtual void | onProcessEnterEvent (const EnterEvent &ev) |
| | Processes pointer entry with the standard widget responder behavior.
|
|
virtual void | onProcessLeaveEvent (const LeaveEvent &ev) |
| | Processes pointer leave with the standard widget responder behavior.
|
| virtual void | onProcessKeyEvent (const KeyEvent &ev) |
| | Routes keyboard input through form-level interaction handling.
|
|
virtual bool | onMouseEvent (const MouseEvent &ev) |
| | Does not handle mouse input and continues responder dispatch.
|
|
virtual bool | onTouchEvent (const TouchEvent &ev) |
| | Does not handle touch input and continues responder dispatch.
|
|
virtual bool | onScrollEvent (const ScrollEvent &ev) |
| | Does not handle scroll input and continues responder dispatch.
|
|
virtual bool | onEnterEvent (const EnterEvent &ev) |
| | Installs the current cursor and consumes pointer entry.
|
|
virtual bool | onLeaveEvent (const LeaveEvent &ev) |
| | Restores the default cursor and consumes pointer leave.
|
|
virtual bool | onKeyEvent (const KeyEvent &ev) |
| | Does not handle key input and continues responder dispatch.
|
|
const std::map< Key, Control * > & | shortcuts () const |
| | Returns the shortcut-to-control registrations for this form.
|
|
const std::map< Pt::Char, Control * > & | mnemonics () const |
| | Returns the mnemonic-to-control registrations for this form.
|
| virtual void | onPaint (PaintContext &context, const Gfx::RectF &rect) |
| | Paints this view into context for the local rect.
|
| virtual void | onSetParent (Widget *parent) |
| | Records the non-owning parent relationship.
|
| 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 | onProcessInvalidateEvent (const InvalidateEvent &ev) |
| | Coalesces and dispatches an invalidation event.
|
|
virtual Responder * | onNextResponder () |
| | 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.
|
A Form attaches one content Control and is the point where the content hierarchy joins a window or another form host. It is the layout root of that tree. It delegates measuring and layout to that content, forwards view requests, and does not own the control. Use setContent() to replace the content; keep the control alive until it is detached. A form is often a Window, but other hosts can derive from Form.
Attachment connects the complete tree to the screen, paint surface, responder chain, and form. Detachment reverses those links. Replacing the content detaches the old root before attaching the new one. The content root may itself contain an arbitrary control tree. These links are non-owning, so destruction order remains the caller's responsibility.
relayout() queues a layout event only while the form is connected. Pending layout requests are combined before the form measures its content and then assigns it the available bounds. Controls request layout from their parent rather than laying out an enclosing form directly. Custom form hosts override the protected measuring and layout hooks when their content needs a different allocation rule.
The form is the focus root for its content tree. It delivers focus changes as FocusEvent objects and handles Tab traversal, shortcuts, and Alt mnemonics before ordinary keyboard input reaches the focused control.