DSFMLWindow

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

Constructors

this
this(RenderWindow wnd, bool own)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

close
void close()

close window

draw
void draw()
Undocumented in source. Be warned that the author may not have intended to support it.
handleEvent
bool handleEvent(Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
invalidate
void invalidate()

request window redraw

show
void show()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

windowCaption
dstring windowCaption [@property getter]

returns window caption

windowCaption
dstring windowCaption [@property setter]

sets window caption

windowIcon
DrawBufRef windowIcon [@property setter]

sets window icon

wnd
RenderWindow wnd [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Window

_dx
int _dx;
Undocumented in source.
_dy
int _dy;
Undocumented in source.
_keyboardModifiers
uint _keyboardModifiers;
Undocumented in source.
_backgroundColor
uint _backgroundColor;
Undocumented in source.
_mainWidget
Widget _mainWidget;
Undocumented in source.
_eventList
EventList _eventList;
Undocumented in source.
_flags
uint _flags;
Undocumented in source.
flags
uint flags [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
backgroundColor
uint backgroundColor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
backgroundColor
uint backgroundColor [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
width
int width [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
height
int height [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
keyboardModifiers
uint keyboardModifiers [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
mainWidget
Widget mainWidget [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
mainWidget
Widget mainWidget [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
_caretRect
Rect _caretRect;
Undocumented in source.
caretRect
Rect caretRect [@property setter]

blinking caret position (empty rect if no blinking caret)

caretRect
Rect caretRect [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
_caretReplace
bool _caretReplace;
Undocumented in source.
caretReplace
bool caretReplace [@property setter]

blinking caret is in Replace mode if true, insert mode if false

caretReplace
bool caretReplace [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
show
void show()

show window

windowCaption
dstring windowCaption [@property getter]

returns window caption

windowCaption
dstring windowCaption [@property setter]

sets window caption

windowIcon
DrawBufRef windowIcon [@property setter]

sets window icon

invalidate
void invalidate()

request window redraw

close
void close()

close window

_windowState
WindowState _windowState;
Undocumented in source.
windowState
WindowState windowState [@property getter]

returns current window state

_windowRect
Rect _windowRect;
Undocumented in source.
windowRect
Rect windowRect [@property getter]

returns window rectangle on screen (includes window frame and title)

windowStateChanged
Signal!OnWindowStateHandler windowStateChanged;

window state change signal

handleWindowStateChange
void handleWindowStateChange(WindowState newState, Rect newWindowRect)

update and signal window state and/or size/positon changes - for using in platform inplementations

setWindowState
bool setWindowState(WindowState newState, bool activate, Rect newWindowRect)

change window state, position, or size; returns true if successful, false if not supported by platform

maximizeWindow
bool maximizeWindow(bool activate)

maximize window

minimizeWindow
bool minimizeWindow()

minimize window

restoreWindow
bool restoreWindow(bool activate)

restore window if maximized/minimized/hidden

hideWindow
bool hideWindow()

restore window if maximized/minimized/hidden

activateWindow
bool activateWindow()

just activate window

moveWindow
bool moveWindow(Point topLeft, bool activate)

change window position only

resizeWindow
bool resizeWindow(Point sz, bool activate)

change window size only

moveAndResizeWindow
bool moveAndResizeWindow(Rect rc, bool activate)

set window rectangle

requestLayout
void requestLayout()

requests layout for main widget and popups

measure
void measure()
Undocumented in source. Be warned that the author may not have intended to support it.
layout
void layout()
Undocumented in source. Be warned that the author may not have intended to support it.
onResize
void onResize(int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
_popups
PopupWidget[] _popups;
Undocumented in source.
TooltipInfo
struct TooltipInfo
Undocumented in source.
_tooltip
TooltipInfo _tooltip;
Undocumented in source.
scheduleTooltip
void scheduleTooltip(Widget ownerWidget, long delay, uint alignment, int x, int y)

schedule tooltip for widget be shown with specified delay

handleDroppedFiles
void handleDroppedFiles(string[] filenames)

called when user dragged file(s) to application window

_onFilesDropped
void delegate(string[]) _onFilesDropped;
Undocumented in source.
onFilesDropped
void delegate(string[]) onFilesDropped [@property getter]

get handler for files dropped to app window

onFilesDropped
void delegate(string[]) onFilesDropped [@property setter]

set handler for files dropped to app window

_onCanClose
bool delegate() _onCanClose;
Undocumented in source.
onCanClose
bool delegate() onCanClose [@property getter]

get handler for closing of app (it must return true to allow immediate close, false to cancel close or close window later)

onCanClose
bool delegate() onCanClose [@property setter]

set handler for closing of app (it must return true to allow immediate close, false to cancel close or close window later)

_onClose
void delegate() _onClose;
Undocumented in source.
onClose
void delegate() onClose [@property getter]

get handler for closing of window

onClose
void delegate() onClose [@property setter]

set handler for closing of window

hasModalWindowsAbove
bool hasModalWindowsAbove()

returns true if there is some modal window opened above this window, and this window should not process mouse/key input and should not allow closing

handleCanClose
bool handleCanClose()

calls onCanClose handler if set to check if system may close window

hideTooltip
void hideTooltip()

hide tooltip if shown and cancel tooltip timer if set

showTooltip
PopupWidget showTooltip(Widget content, Widget anchor, uint alignment, int x, int y)

show tooltip immediately

showPopup
PopupWidget showPopup(Widget content, Widget anchor, uint alignment, int x, int y)

show new popup

removePopup
bool removePopup(PopupWidget popup)

remove popup

modalPopup
PopupWidget modalPopup()

returns last modal popup widget, or null if no modal popups opened

isChild
bool isChild(Widget w)

returns true if widget is child of either main widget or one of popups

~this
~this()
Undocumented in source.
queueWidgetDestroy
void queueWidgetDestroy(Widget widgetToDestroy)

Allows queue destroy of widget.

PERFORMANCE_LOGGING_THRESHOLD_MS
int PERFORMANCE_LOGGING_THRESHOLD_MS;
Undocumented in source.
_firstDrawCalled
bool _firstDrawCalled;

set when first draw is called: don't handle mouse/key input until draw (layout) is called

onDraw
void onDraw(DrawBuf buf)
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleAnimation
void scheduleAnimation()

after drawing, call to schedule redraw if animation is active

setCaptureWidget
void setCaptureWidget(Widget w, MouseEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
_focusedWidget
Widget _focusedWidget;
Undocumented in source.
focusedWidget
Widget focusedWidget [@property getter]

returns current focused widget

setFocus
Widget setFocus(Widget newFocus, FocusReason reason)

change focus to widget

dispatchKeyEvent
bool dispatchKeyEvent(Widget root, KeyEvent event)

dispatch key event to widgets which have wantsKeyTracking == true

dispatchKeyEvent
bool dispatchKeyEvent(KeyEvent event)

dispatch keyboard event

dispatchMouseEvent
bool dispatchMouseEvent(Widget root, MouseEvent event, bool cursorIsSet)
Undocumented in source. Be warned that the author may not have intended to support it.
_mouseTrackingWidgets
Widget[] _mouseTrackingWidgets;

widget which tracks Move events

_mouseCaptureWidget
Widget _mouseCaptureWidget;

widget which tracks all events after processed ButtonDown

_mouseCaptureButtons
ushort _mouseCaptureButtons;
Undocumented in source.
_mouseCaptureFocusedOut
bool _mouseCaptureFocusedOut;
Undocumented in source.
_mouseCaptureFocusedOutTrackMovements
bool _mouseCaptureFocusedOutTrackMovements;

does current capture widget want to receive move events even if pointer left it

clearMouseCapture
void clearMouseCapture()
Undocumented in source. Be warned that the author may not have intended to support it.
dispatchCancel
bool dispatchCancel(MouseEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
sendAndCheckOverride
bool sendAndCheckOverride(Widget widget, MouseEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
isMouseCaptured
bool isMouseCaptured()

returns true if mouse is currently captured

dispatchAction
bool dispatchAction(Action action, Widget sourceWidget)

dispatch action to main widget

dispatchActionStateRequest
bool dispatchActionStateRequest(Action action, Widget sourceWidget)

dispatch action to main widget

dispatchThemeChanged
void dispatchThemeChanged()

handle theme change: e.g. reload some themed resources

postEvent
void postEvent(CustomEvent event)

post event to handle in UI thread (this method can be used from background thread)

executeInUiThread
void executeInUiThread(void delegate() runnable)

post task to execute in UI thread (this method can be used from background thread)

createAsyncSocket
AsyncSocket createAsyncSocket(AsyncSocketCallback callback)

Creates async socket

cancelEvent
void cancelEvent(uint uniqueId)

remove event from queue by unique id if not yet dispatched (this method can be used from background thread)

handlePostedEvent
void handlePostedEvent(uint uniqueId)

remove event from queue by unique id if not yet dispatched and dispatch it

handlePostedEvents
void handlePostedEvents()

handle all events from queue, if any (call from UI thread only)

dispatchCustomEvent
bool dispatchCustomEvent(CustomEvent event)

dispatch custom event

dispatchMouseEvent
bool dispatchMouseEvent(MouseEvent event)

dispatch mouse event to window content widgets

dispatchWidgetUpdateActionStateRecursive
void dispatchWidgetUpdateActionStateRecursive(Widget root)

calls update actions recursively

checkUpdateNeeded
void checkUpdateNeeded(Widget root, bool needDraw, bool needLayout, bool animationActive)

checks content widgets for necessary redraw and/or layout

setCursorType
void setCursorType(uint cursorType)

sets cursor type for window

dispatchWidgetUpdateActionStateRecursive
void dispatchWidgetUpdateActionStateRecursive()

update action states

checkUpdateNeeded
bool checkUpdateNeeded(bool needDraw, bool needLayout, bool animationActive)

checks content widgets for necessary redraw and/or layout

_animationActive
bool _animationActive;
Undocumented in source.
isAnimationActive
bool isAnimationActive [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
update
void update(bool force)

requests update for window (unless force is true, update will be performed only if layout, redraw or animation is required).

_actionsUpdateRequested
bool _actionsUpdateRequested;
Undocumented in source.
requestActionsUpdate
void requestActionsUpdate(bool immediateUpdate)

set action update request flag, will be cleared after redraw

actionsUpdateRequested
bool actionsUpdateRequested [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
showMessageBox
void showMessageBox(UIString title, UIString message, const(Action)[] actions, int defaultActionIndex, bool delegate(const Action result) handler)

Show message box with specified title and message (title and message as UIString)

showMessageBox
void showMessageBox(dstring title, dstring message, const(Action)[] actions, int defaultActionIndex, bool delegate(const Action result) handler)

Show message box with specified title and message (title and message as dstring)

showInputBox
void showInputBox(UIString title, UIString message, dstring initialText, void delegate(dstring result) handler)
Undocumented in source. Be warned that the author may not have intended to support it.
showInputBox
void showInputBox(dstring title, dstring message, dstring initialText, void delegate(dstring result) handler)
Undocumented in source. Be warned that the author may not have intended to support it.
_timerQueue
TimerQueue _timerQueue;
Undocumented in source.
scheduleSystemTimer
void scheduleSystemTimer(long intervalMillis)

schedule timer for interval in milliseconds - call window.onTimer when finished

pollTimers
bool pollTimers()

poll expired timers; returns true if update is needed

onTimer
void onTimer()

system timer interval expired - notify queue

setTimer
ulong setTimer(Widget destination, long intervalMillis)

set timer for destination widget - destination.onTimer() will be called after interval expiration; returns timer id

cancelTimer
void cancelTimer(ulong timerId)

cancel previously scheduled widget timer (for timerId pass value returned from setTimer)

Meta