|
| | Window (WindowManager *parent=0, WindowType type=WindowType::Default) |
| | Creates a detached, enabled window of type.
|
|
virtual | ~Window () |
| | Detaches the window from its manager and releases its frame.
|
| void | setParent (WindowManager &parent) |
| | Attaches the window to parent.
|
| void | unparent () |
| | Detaches the window from its current manager.
|
|
WindowManager * | windowManager () |
| | Returns the current non-owning window manager, or null.
|
|
const WindowManager * | windowManager () const |
| | Returns the current non-owning window manager, or null.
|
| WindowFrame * | frame () |
| | Returns the internal frame that presents the window, or null.
|
|
const WindowFrame * | frame () const |
| | Returns the internal frame that presents the window, or null.
|
| void | getBitmap (Gfx::Bitmap &bitmap) const |
| | Copies the complete window content into bitmap.
|
| void | getBitmap (Gfx::Bitmap &bitmap, const Gfx::RectF &rect) const |
| | Copies a window content rectangle into bitmap.
|
| void | autoCenter () |
| | Centers the window in its manager's available area.
|
| void | autoSize (const SizePolicy &policy) |
| | Enables automatic sizing with policy.
|
|
void | autoSize () |
| | Enables automatic sizing with preferred width and height.
|
|
Type | type () const |
| | Returns the type selected when the window was created.
|
|
const Gfx::Image & | icon () const |
| | Returns the window icon.
|
| void | setIcon (const Gfx::Image &icon) |
| | Sets the window icon to a copy of icon.
|
|
const std::string & | title () const |
| | Returns the window title.
|
| void | setTitle (const std::string &title) |
| | Sets the window title to title.
|
|
bool | isAbove () const |
| | Returns whether the window requests manager-relative stacking.
|
| void | setAbove (bool above) |
| | Changes the manager-relative stacking preference to above.
|
|
bool | isActive () const |
| | Returns the current locally stored activation state.
|
|
WindowState | state () const |
| | Returns the requested window state.
|
| void | setState (const WindowState &state) |
| | Sets the requested window state to state.
|
| void | showModal () |
| | Runs the window as a modal dialog until it closes.
|
|
bool | isClosed () const |
| | Returns whether a close event has completed the close transition.
|
| void | close () |
| | Requests that the current frame close the window.
|
|
Signal & | closed () |
| | Returns the signal sent after the close transition completes.
|
| bool | acceptsInput () const |
| | Returns whether the window accepts pointer, touch, scroll, and keyboard input.
|
|
const Gfx::Brush & | background () const |
| | Returns the background override or the application background.
|
|
void | setBackground (const Gfx::Brush &background) |
| | Copies background as the window background and invalidates it.
|
|
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.
|
|
|
virtual Gfx::SizeF | onProcessMeasure () |
| | Updates automatic sizing and performs the standard measurement.
|
|
virtual void | onProcessLayout (const Gfx::RectF &rect) |
| | Applies automatic sizing and performs the standard layout.
|
|
virtual Gfx::SizeF | onMeasure (const SizePolicy &policy) |
| | Measures the content with policy.
|
|
virtual void | onLayout (const Gfx::RectF &rect) |
| | Lays out the content in rect.
|
| virtual void | onConnect (Screen &screen) |
| | Connects the window and applies its stored frame configuration.
|
|
virtual void | onDisconnect () |
| | Disconnects the window form from its screen.
|
| virtual Widget * | onHitTest (const Gfx::PointF &point) |
| | Finds the deepest visible widget at point.
|
|
virtual Gfx::PointF | onToParent (const Gfx::PointF &pos) const |
| | Converts window coordinates pos to parent coordinates.
|
|
virtual Gfx::PointF | onFromParent (const Gfx::PointF &pos) const |
| | Converts parent coordinates pos to window coordinates.
|
|
virtual void | onProcessEvent (const Pt::Event &ev) |
| | Dispatches event through the standard form event path.
|
|
virtual void | onRequestRepaint (const Gfx::RectF &rect) |
| | Requests repainting rect from the current frame.
|
|
virtual void | onRequestEnable (bool enabled) |
| | Stores and forwards the enabled request enabled.
|
|
virtual void | onRequestActivate (bool active) |
| | Stores and forwards the activation request active.
|
| virtual void | onRequestShow (bool shown) |
| | Stores the visibility request shown and presents the window.
|
| virtual void | onRequestMove (const Gfx::PointF &pos) |
| | Records and forwards a normal-state move request to pos.
|
|
virtual void | onRequestResize (const Gfx::SizeF &size) |
| | Records and forwards a normal-state resize request to size.
|
|
virtual void | onSetSizeLimits (const Gfx::SizeF &minSize, const Gfx::SizeF &maxSize) |
| | Applies and forwards the size limits to the current frame.
|
|
virtual void | onInvalidateEvent (const InvalidateEvent &ev) |
| | Processes an invalidation event through the standard form path.
|
|
virtual void | onInvalidate () |
| | Updates the cached background and repaints the complete window.
|
|
virtual void | onProcessPaintEvent (const PaintEvent &event) |
| | Paints a visible, non-empty dirty region from event.
|
|
virtual void | onPaint (PaintContext &context, const Gfx::RectF &rect) |
| | Fills rect with the current window background.
|
|
virtual void | onProcessRescaleEvent (const RescaleEvent &ev) |
| | Processes a scale event through the standard form path.
|
|
virtual void | onRescaleEvent (const RescaleEvent &ev) |
| | Handles a scale event after standard form processing.
|
|
virtual void | onRescale (double scaling) |
| | Updates scaling and realigns normal-state window geometry.
|
|
virtual void | onProcessMoveEvent (const MoveEvent &ev) |
| | Processes a move event through the standard form path.
|
|
virtual void | onMoveEvent (const MoveEvent &ev) |
| | Updates move state without repainting the window surface.
|
|
virtual void | onProcessResizeEvent (const ResizeEvent &ev) |
| | Processes a resize event through the standard form path.
|
|
virtual void | onResizeEvent (const ResizeEvent &ev) |
| | Updates resize state and the requested window size.
|
|
virtual void | onProcessShowEvent (const ShowEvent &ev) |
| | Processes a visibility event through the standard form path.
|
|
virtual void | onShowEvent (const ShowEvent &event) |
| | Processes event and invalidates the window.
|
|
virtual void | onShow (bool visible) |
| | Updates the visible state to visible.
|
|
virtual void | onProcessEnableEvent (const EnableEvent &ev) |
| | Processes an enabled event without enabling against a disable request.
|
|
virtual void | onEnableEvent (const EnableEvent &ev) |
| | Handles an enabled event through the standard form path.
|
|
virtual void | onEnable (bool enabled) |
| | Updates the enabled state to enabled and invalidates the window.
|
|
virtual void | onProcessActivateEvent (const ActivateEvent &event) |
| | Dispatches event to onActivateEvent().
|
|
virtual void | onActivateEvent (const ActivateEvent &event) |
| | Updates the active state from event.
|
|
virtual void | onProcessWindowStateEvent (const WindowStateEvent &event) |
| | Dispatches event to onWindowStateEvent().
|
|
virtual void | onWindowStateEvent (const WindowStateEvent &event) |
| | Updates the window state from event.
|
|
virtual void | onProcessCloseEvent (const CloseEvent &event) |
| | Dispatches event to onCloseEvent().
|
|
virtual void | onCloseEvent (const CloseEvent &ev) |
| | Hides, detaches, closes, and sends closed().
|
|
virtual void | onProcessMouseEvent (const MouseEvent &event) |
| | Routes event when the window accepts input.
|
|
virtual void | onProcessTouchEvent (const TouchEvent &event) |
| | Routes event when the window accepts input.
|
|
virtual void | onProcessScrollEvent (const ScrollEvent &event) |
| | Routes event when the window accepts input.
|
|
virtual void | onProcessEnterEvent (const EnterEvent &event) |
| | Routes the pointer-entry event.
|
|
virtual void | onProcessLeaveEvent (const LeaveEvent &event) |
| | Routes the pointer-leave event.
|
|
virtual void | onProcessKeyEvent (const KeyEvent &event) |
| | Routes event when the window accepts input.
|
|
virtual bool | onMouseEvent (const MouseEvent &ev) |
| | Handles a mouse event and returns whether it was consumed.
|
|
virtual bool | onTouchEvent (const TouchEvent &ev) |
| | Handles a touch event and returns whether it was consumed.
|
|
virtual bool | onScrollEvent (const ScrollEvent &ev) |
| | Handles a scroll event and returns whether it was consumed.
|
|
virtual bool | onKeyEvent (const KeyEvent &ev) |
| | Handles a key event and returns whether it was consumed.
|
|
virtual bool | onEnterEvent (const EnterEvent &ev) |
| | Restores the default cursor, handles the event, and returns consumption.
|
|
virtual bool | onLeaveEvent (const LeaveEvent &ev) |
| | Handles a pointer-leave event and returns whether it was consumed.
|
|
virtual void | onRequestRelayout () |
| | Queues the layout event for a requested layout pass.
|
| virtual void | onProcessLayoutEvent (const LayoutEvent &ev) |
| | Processes a queued layout event.
|
|
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 | onRequestCapture (bool capture) |
| | Forwards a pointer capture request to the Forms application.
|
| virtual void | onPaintEvent (const PaintEvent &ev) |
| | Paints the form's own view content.
|
|
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 | onSetParent (Widget *parent) |
| | Records the non-owning parent relationship.
|
| 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 | 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 Window is a Form shown by a WindowManager. Show it after attaching its content with setContent(). The window translates form requests for geometry, visibility, activation, repainting, and input into operations on the platform window. Its content remains owned by the caller and must outlive its attachment.
Construct a window, configure its content, title, icon, geometry, and presentation state, and then call show(). An unparented window is added to the primary screen's window manager when it is shown. Use setParent() only to select another manager, for example the manager of a workspace. The manager supplies a frame that connects the window to the screen and applies pending configuration when that connection is made.
move() and resize() request normal-window geometry. autoSize() measures the content with a SizePolicy, while autoCenter() asks the current frame to choose a position in its manager's available area. A manual move or resize returns the window to the normal state and can end the corresponding automatic behavior. setAbove() controls stacking within the current manager; it is not an operating-system-wide always-on-top guarantee.
WindowType selects the normal or borderless frame. WindowState is normal, minimized, or maximized. Visibility, enabled state, and activation are requested from the frame and confirmed by ShowEvent, MoveEvent, ResizeEvent, WindowStateEvent, ActivateEvent, and CloseEvent. A window accepts pointer, touch, scroll, and keyboard input only while it is visible and enabled. close() requests a close transition. Once processed, the window is hidden, detached, marked closed, and emits closed(); it is not destroyed. showModal() runs a nested event loop and temporarily disables the other top-level windows, so reserve it for intentionally synchronous dialogs.