Class Window

Window abstraction layer. Widgets can be shown only inside window.

Inherits from

Constructors

Name Description
this

Fields

Name Type Description
PERFORMANCE_LOGGING_THRESHOLD_MS immutable(int)
_actionsUpdateRequested bool
_backgroundColor uint
_dx int
_dy int
_eventList EventList
_focusedWidget Widget
_keyboardModifiers uint
_mainWidget Widget
_mouseCaptureButtons ushort
_mouseCaptureFocusedOut bool
_mouseCaptureFocusedOutTrackMovements bool does current capture widget want to receive move events even if pointer left it
_mouseCaptureWidget Widget widget which tracks all events after processed ButtonDown
_mouseTrackingWidgets Widget[] widget which tracks Move events
_onCanClose bool delegate()
_onClose void delegate()
_onFilesDropped void delegate(string[])
_popups PopupWidget[]
_timerQueue dlangui.platforms.common.platform.Window.TimerQueue
_tooltip Window.TooltipInfo

Properties

Name Type Description
actionsUpdateRequested [get] bool
backgroundColor [get] uint
backgroundColor [set] uint
focusedWidget [get] Widget returns current focused widget
height [get] int
keyboardModifiers [get] uint
mainWidget [set] Widget
mainWidget [get] Widget
onCanClose [get] bool delegate() get handler for closing of app (it must return true to allow immediate close, false to cancel close or close window later)
onCanClose [set] Window set handler for closing of app (it must return true to allow immediate close, false to cancel close or close window later)
onClose [get] void delegate() get handler for closing of window
onClose [set] Window set handler for closing of window
onFilesDropped [set] Window set handler for files dropped to app window
onFilesDropped [get] void delegate(string[]) get handler for files dropped to app window
width [get] int
windowCaption [get] dstring returns window caption
windowCaption [set] dstring sets window caption
windowIcon [set] Ref!(dlangui.graphics.drawbuf.DrawBuf) sets window icon

Methods

Name Description
cancelEvent remove event from queue by unique id if not yet dispatched (this method can be used from background thread)
cancelTimer cancel previously scheduled widget timer (for timerId pass value returned from setTimer)
checkUpdateNeeded checks content widgets for necessary redraw and/or layout
close close window
createAsyncSocket Creates async socket
dispatchAction dispatch action to main widget
dispatchActionStateRequest dispatch action to main widget
dispatchCustomEvent dispatch custom event
dispatchKeyEvent dispatch keyboard event
dispatchMouseEvent dispatch mouse event to window content widgets
dispatchThemeChanged handle theme change: e.g. reload some themed resources
executeInUiThread post task to execute in UI thread (this method can be used from background thread)
handleCanClose calls onCanClose handler if set to check if system may close window
handleDroppedFiles called when user dragged file(s) to application window
handlePostedEvent remove event from queue by unique id if not yet dispatched and dispatch it
handlePostedEvents handle all events from queue, if any (call from UI thread only)
hideTooltip hide tooltip if shown and cancel tooltip timer if set
invalidate request window redraw
isChild returns true if widget is child of either main widget or one of popups
isMouseCaptured returns true if mouse is currently captured
layout
measure
modalPopup returns last modal popup widget, or null if no modal popups opened
onDraw
onResize
postEvent post event to handle in UI thread (this method can be used from background thread)
removePopup remove popup
requestActionsUpdate set action update request flag, will be cleared after redraw
requestLayout requests layout for main widget and popups
scheduleAnimation after drawing, call to schedule redraw if animation is active
scheduleTooltip schedule tooltip for widget be shown with specified delay
setFocus change focus to widget
setTimer set timer for destination widget - destination.onTimer() will be called after interval expiration; returns timer id
show show window
showInputBox
showInputBox
showMessageBox Show message box with specified title and message (title and message as dstring)
showMessageBox Show message box with specified title and message (title and message as UIString)
showPopup show new popup
showTooltip show tooltip immediately
update requests update for window (unless force is true, update will be performed only if layout, redraw or animation is required).
checkUpdateNeeded checks content widgets for necessary redraw and/or layout
clearMouseCapture
dispatchCancel
dispatchKeyEvent dispatch key event to widgets which have wantsKeyTracking == true
dispatchMouseEvent
dispatchWidgetUpdateActionStateRecursive update action states
dispatchWidgetUpdateActionStateRecursive calls update actions recursively
onTimer system timer interval expired - notify queue
scheduleSystemTimer schedule timer for interval in milliseconds - call window.onTimer when finished
sendAndCheckOverride
setCaptureWidget
setCursorType sets cursor type for window

Inner structs

Name Description
TooltipInfo

Authors

Vadim Lopatin, coolreader.org@gmail.com

Copyright

Vadim Lopatin, 2014

License

Boost License 1.0