KSD_EXPORT_CLASSclass TCustomWidget

A pure-libksd way of implementing a TWidget.

Inheritance:


Public Methods

[more] TCustomWidget(TWidget* _parent)
[more] ~TCustomWidget()
[more]bool GetAutoClearBuffer() const
Returns the value set by SetAutoClearBuffer
[more]bool GetDoubleBuffered() const
Returns the value set by SetDoubleBuffered
[more]bool GetAcceptInput() const
Returns the value set by SetAcceptInput
[more]bool GetHollowClientArea() const
Returns the valeu set by SetHollowClientArea
[more]bool GetAutoSaveBuffer() const
Returns the value set by SetAutoSaveBuffer
[more]bool GetAutoResetChanged() const
Returns the value set by SetAutoResetChanged
[more]bool GetTransparentBackground() const
Returns the value set by SetTransparentBackground

Protected Methods

[more]void SetAutoClearBuffer(bool _acb)
When set to true, the buffer will automatically be cleared on each UPDATE as well as each REPAINT.
[more]void SetDoubleBuffered(bool _db)
When set to true, the widget will draw to a software back-buffer before drawing the buffer to the screen.
[more]void SetAcceptInput(bool _ai)
When set to false, this widget and its children will be passed over when input is being passed down the widget tree.
[more]void SetHollowClientArea(bool _hca)
When set to true, causes the widget client area to act like a "hole" through the widget.
[more]void SetAutoSaveBuffer(bool _asb)
When set to true along with DoubleBuffered, this widget will automatically re-draw the buffer when repainted, but not changed.
[more]void SetAutoResetChanged(bool _arc)
When set to true, the Changed flag will be reset after every draw loop.
[more]void SetTransparentBackground(bool _tb)
When set to true, the widget background will be transparent.
[more]void SetScroll(unsigned int ScrollX, unsigned int ScrollY)
Used by children to "scroll" the client area.
[more]bool IsClientWidget() const
Override to make a non-client custom widget.


Inherited from TWidget:

Public Fields

Widget event signals

Public Methods

Do-Event Functions

oTWidget* GetParent()
ovirtual std::string GetCaption() const
ovirtual int GetWidth() const
ovirtual int GetHeight() const
ovirtual TPoint2D GetPosition() const
ovirtual void SetCaption(const std::string& _caption)

void SetPosition(...)

obool IsInside(int X, int Y)
obool IsInsideLocal(int X, int Y)
ovoid MakeLocal(int& X, int& Y)
ovoid MakeGlobal(int& X, int& Y)
ovirtual TPoint2D GetChildPosition(TWidget* child) const
ovirtual void Resize(int w, int h)

Public widget flag "sets"

Widget flags "gets"

ovirtual TSurface* GetSurface()
ovirtual TSurface* GetClientSurface()

Widget Attribute "Sets"

Widget Attribute "Gets"

ovoid Show()
ovoid Hide()
ovoid SetVisible(bool v)
obool IsVisible() const
ovoid MoveUp()
ovoid MoveToFront()
ovoid SetEnabled(bool _enable)
ovoid Enable()
ovoid Disable()
obool IsEnabled() const
ovoid NeedsRepaint()
ovoid NeedsUpdate()
ovoid MarkAsChanged()
ovoid MarkAllAsChanged()
ovoid ResetChanged()
obool GetChanged() const
ovirtual bool CanAcceptInput() const
ovirtual bool CanAcceptMouseInput(int X, int Y) const

Protected Methods

obool GrabKeyboardFocus()
obool GrabJoystickFocus()
ovoid ClearBuffer()
ovoid RecreateAllBuffers()
ovirtual bool Draw(TCanvas*, DrawType dt)
ovirtual void Cycle()

Widget Implementation Functions

ovoid SetAllowChildren(bool _ac)
ovoid SetDrawOnDemand(bool _dod)

Built-in Event Functions

Protected Members

oenum DrawType


Documentation

A pure-libksd way of implementing a TWidget. Isn't the only way but this one does provide a number of good features and it makes creating your own widgets very easy.
o TCustomWidget(TWidget* _parent)

o ~TCustomWidget()

obool GetAutoClearBuffer() const
Returns the value set by SetAutoClearBuffer

obool GetDoubleBuffered() const
Returns the value set by SetDoubleBuffered

obool GetAcceptInput() const
Returns the value set by SetAcceptInput

obool GetHollowClientArea() const
Returns the valeu set by SetHollowClientArea

obool GetAutoSaveBuffer() const
Returns the value set by SetAutoSaveBuffer

obool GetAutoResetChanged() const
Returns the value set by SetAutoResetChanged

obool GetTransparentBackground() const
Returns the value set by SetTransparentBackground

ovoid SetAutoClearBuffer(bool _acb)
When set to true, the buffer will automatically be cleared on each UPDATE as well as each REPAINT. When set to false, the buffer is automatically cleared only on REPAINT.

Default: true

See Also:
ClearBuffer, GetAutoClearBuffer

ovoid SetDoubleBuffered(bool _db)
When set to true, the widget will draw to a software back-buffer before drawing the buffer to the screen. This can be used to create smoother animation, but will take more memory and can be slower.

Default: false

See Also:
SetAutoSaveBuffer, GetDoubleBuffered

ovoid SetAcceptInput(bool _ai)
When set to false, this widget and its children will be passed over when input is being passed down the widget tree. When set to true, everything will operate as expected.

Default: true

See Also:
GetAcceptInput

ovoid SetHollowClientArea(bool _hca)
When set to true, causes the widget client area to act like a "hole" through the widget. The widget will only recieve mouse events if they hit outside the client area.

Default: false

See Also:
GetHollowClientArea

ovoid SetAutoSaveBuffer(bool _asb)
When set to true along with DoubleBuffered, this widget will automatically re-draw the buffer when repainted, but not changed. This should speed up certain operations.

Default: true

See Also:
SetDoubleBuffered, GetAutoSaveBuffer

ovoid SetAutoResetChanged(bool _arc)
When set to true, the Changed flag will be reset after every draw loop. Most of the time this is the desired behavior.

See Also:
MarkAsChanged, MarkAllAsChanged

ovoid SetTransparentBackground(bool _tb)
When set to true, the widget background will be transparent. In most cases this means that the buffer is never cleared. But when it is double buffered is has to copy part of the parent surface to its buffer first. Combining double buffered and transparent background can be slow.

Default: false

See Also:
GetTransparentBackground

ovoid SetScroll(unsigned int ScrollX, unsigned int ScrollY)
Used by children to "scroll" the client area. This causes all of the children widgets and anything else on the client surface (or in the client area) to move by (-ScrollX, -ScrollY). UI might use ScrollBars, etc. in the decoration area of the widget.

obool IsClientWidget() const
Override to make a non-client custom widget. Returns true by default.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.