ScrollContainer

Container for widgets to make them scrollable, with optional scrollbars

Constructors

this
this()

constructor

Destructor

~this
~this()
Undocumented in source.

Members

Functions

drawScrollbars
void drawScrollbars()

draws scrollbars, very basic stuff

eventSubscribe
void eventSubscribe()
Undocumented in source. Be warned that the author may not have intended to support it.
keyboardEvent
bool keyboardEvent(KeyboardEvent key, bool cycle)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseEvent
bool mouseEvent(MouseEvent mouse)
Undocumented in source. Be warned that the author may not have intended to support it.
requestResize
void requestResize()
Undocumented in source. Be warned that the author may not have intended to support it.
requestScrollX
bool requestScrollX(uint x)
Undocumented in source. Be warned that the author may not have intended to support it.
requestScrollY
bool requestScrollY(uint y)
Undocumented in source. Be warned that the author may not have intended to support it.
rescroll
void rescroll(bool callScrollEvent)

re-assings display buffer based on _subScrollX/Y, and calls scrollEvent on child

resizeEvent
bool resizeEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
scrollEvent
bool scrollEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
setWidget
bool setWidget(QWidget child)

Sets the child widget.

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

Properties

scrollOnMouseWheel
bool scrollOnMouseWheel [@property getter]
bool scrollOnMouseWheel [@property setter]

Whether to scroll on mouse scroll wheel

scrollOnPageUpDown
bool scrollOnPageUpDown [@property getter]
bool scrollOnPageUpDown [@property setter]

Whether to scroll on page up/down keys

scrollbarH
bool scrollbarH [@property setter]

Whether to show horizontal scrollbar. Modifying this will request update

scrollbarH
bool scrollbarH [@property getter]

Whether to show horizontal scrollbar. Modifying this will request update

scrollbarV
bool scrollbarV [@property getter]
bool scrollbarV [@property setter]

Whether to show vertical scrollbar. Modifying this will request update

Variables

_drawAreaHeight
uint _drawAreaHeight;
_drawAreaWidth
uint _drawAreaWidth;

height and width after subtracting space for scrollbars

_mouseWheel
bool _mouseWheel;

if mouse wheel should scroll

_pgDnUp
bool _pgDnUp;

if page down/up button should scroll

_scrollbarH
bool _scrollbarH;

if vertical and horizontal scrollbars are to be shown

_scrollbarV
bool _scrollbarV;

if vertical and horizontal scrollbars are to be shown

_widget
QWidget _widget;

the widget to be scrolled

Inherited Members

From QWidget

_minWidth
uint _minWidth;

minimum width

_maxWidth
uint _maxWidth;

maximum width

_minHeight
uint _minHeight;

minimum height

_maxHeight
uint _maxHeight;

maximum height

viewportX
uint viewportX [@property getter]
viewportY
uint viewportY [@property getter]

viewport coordinates. (drawable area for widget)

viewportWidth
uint viewportWidth [@property getter]
viewportHeight
uint viewportHeight [@property getter]

viewport size. (drawable area for widget)

isWritable
bool isWritable(uint x, uint y)

If a coordinate is within writing area, and writing area actually exists

moveTo
void moveTo(uint newX, uint newY)

move seek for next write to terminal. can only write in between: (_viewX .. _viewX + _viewWidth, _viewY .. _viewX + _viewHeight)

write
bool write(dchar c, Color fg, Color bg)

writes a character on terminal

write
uint write(dstring s, Color fg, Color bg)

writes a (d)string to terminal. if it does not fit in one line, it is wrapped

fillLine
uint fillLine(dchar c, Color fg, Color bg, uint max)

fill current line with a character. max is ignored if max==0

searchAndActivateWidget
bool searchAndActivateWidget(QWidget target)

activate the passed widget if this is actually the correct widget

eventSubscribe
void eventSubscribe(uint newSub)

called by itself, to update events subscribed to

eventSubscribe
void eventSubscribe()

called by children when they want to re-subscribe to events

requestCursorPos
void requestCursorPos(int x, int y)

to set cursor position on terminal. will only work if this is active widget. set x or y or both to negative to hide cursor

requestScrollX
bool requestScrollX(uint x)

called to request to scrollX

requestScrollY
bool requestScrollY(uint y)

called to request to scrollY

initialize
bool initialize()

Called after UI has been run

mouseEvent
bool mouseEvent(MouseEvent mouse)

Called when mouse is clicked with cursor on this widget.

keyboardEvent
bool keyboardEvent(KeyboardEvent key, bool cycle)

Called when key is pressed and this widget is active.

resizeEvent
bool resizeEvent()

Called when widget size is changed, or widget should recalculate it's child widgets' sizes;

scrollEvent
bool scrollEvent()

Called when the widget is rescrolled, but size not changed.

activateEvent
bool activateEvent(bool isActive)

called right after this widget is activated, or de-activated

timerEvent
bool timerEvent(uint msecs)

called often. msecs is the msecs since last timerEvent, not accurate

updateEvent
bool updateEvent()

Called to update this widget

requestUpdate
void requestUpdate()

To request parent to trigger an update event

requestResize
void requestResize()

To request parent to trigger a resize event

onInitEvent
InitFunction onInitEvent [@property setter]

use to change the custom initialize event

onMouseEvent
MouseEventFuction onMouseEvent [@property setter]

use to change the custom mouse event

onKeyboardEvent
KeyboardEventFunction onKeyboardEvent [@property setter]

use to change the custom keyboard event

onResizeEvent
ResizeEventFunction onResizeEvent [@property setter]

use to change the custom resize event

onActivateEvent
ActivateEventFunction onActivateEvent [@property setter]

use to change the custom activate event

onTimerEvent
TimerEventFunction onTimerEvent [@property setter]

use to change the custom timer event

isActive
bool isActive [@property getter]
eventSub
uint eventSub [@property getter]
sizeRatio
uint sizeRatio [@property getter]
uint sizeRatio [@property setter]

specifies ratio of height or width (depending on parent layout type)

show
bool show [@property getter]
bool show [@property setter]

visibility of the widget.

scrollX
uint scrollX [@property getter]
uint scrollX [@property setter]

horizontal scroll.

scrollY
uint scrollY [@property getter]
uint scrollY [@property setter]

vertical scroll.

width
uint width [@property getter]

width of widget

width
uint width [@property setter]

fixed width setter. This will actually do minWidth=maxWidth=value and call requestResize

height
uint height [@property getter]

height of widget

height
uint height [@property setter]

fixed height setter. This will actually do minHeight=maxHeight=value and call requestResize

minWidth
uint minWidth [@property getter]
uint minWidth [@property setter]

minimum width

minHeight
uint minHeight [@property getter]
uint minHeight [@property setter]

minimum height

maxWidth
uint maxWidth [@property getter]
uint maxWidth [@property setter]

maximum width

maxHeight
uint maxHeight [@property getter]
uint maxHeight [@property setter]

maximum height

Meta