nux-0.9.48

nux::Area Class Reference

#include <Nux/Area.h>

Inheritance diagram for nux::Area:
nux::InitiallyUnownedObject nux::Focusable nux::Object nux::Trackable nux::InputArea nux::Layout nux::View nux::GridHLayout nux::GridVLayout nux::HLayout nux::LayeredLayout nux::SpaceLayout nux::VLayout nux::AbstractButton nux::AbstractComboBox nux::AbstractSeparator nux::AnimatedTextureArea nux::BaseWindow nux::BezierCurveControl nux::BezierCurveControl2 nux::ClientArea nux::ColorArea nux::ColorEditor nux::ColorGradient nux::ColorPreview nux::CurveControl nux::EditTextBox nux::FileSelector nux::FunctionGraph nux::GroupBox nux::GroupBox2 nux::Histogram nux::HSplitter nux::HToolBar nux::Matrix3Editor nux::Matrix3Preview nux::Matrix4Editor nux::Matrix4Preview nux::MenuBar nux::MenuItem nux::MenuPage nux::MenuSeparator nux::MouseAreaCtrl nux::RangeValue nux::RangeValueInteger nux::RGBValuator nux::ScrollBar nux::ScrollView nux::SpinBox_Logic nux::SplineCurveEditor nux::SplineCurvePreview nux::StaticText nux::StaticTextBox nux::TabView nux::TextEntry nux::TextureArea nux::TimeGraph nux::ToolButton nux::Valuator nux::Vector3Valuator nux::VSplitter nux::VToolBar

Data Structures

class  LayoutProperties

Public Member Functions

 Area (NUX_FILE_LINE_DECL)
virtual ~Area ()
int GetBaseX () const
int GetBaseY () const
int GetBaseWidth () const
int GetBaseHeight () const
void SetBaseX (int x)
void SetBaseY (int y)
void SetBaseXY (int x, int y)
void SetBaseWidth (int w)
void SetBaseHeight (int h)
void SetBaseSize (int w, int h)
 Set the size of the object.
void SetMinimumSize (int w, int h)
void SetMaximumSize (int w, int h)
void SetMinMaxSize (int w, int h)
void SetMinimumWidth (int w)
void SetMaximumWidth (int w)
void SetMinimumHeight (int h)
void SetMaximumHeight (int h)
int GetMinimumWidth () const
int GetMaximumWidth () const
int GetMinimumHeight () const
int GetMaximumHeight () const
void ApplyMinWidth ()
void ApplyMinHeight ()
void ApplyMaxWidth ()
void ApplyMaxHeight ()
Size GetMinimumSize () const
Size GetMaximumSize () const
Geometry GetGeometry () const
 Get the geometry of the object.
void SetGeometry (int x, int y, int w, int h)
 Set the geometry of the object.
void SetGeometry (const Geometry &geo)
 Set the geometry of the object.
void IncreaseSize (int x, int y)
void SetBaseString (const TCHAR *Caption)
const NStringGetBaseString () const
AreaGetToplevel ()
 Return the Top level parent of this area.
AreaGetTopLevelViewWindow ()
 Return the Top level BaseWindow of this area.
bool HasTopLevelParent ()
 Return true is this area has a top level parent.
virtual long ComputeChildLayout ()
virtual void PositionChildLayout (float offsetX, float offsetY)
virtual long ComputeLayout2 ()
virtual void ComputePosition2 (float offsetX, float offsetY)
virtual bool IsArea () const
virtual bool IsInputArea () const
virtual bool IsView () const
virtual bool IsLayout () const
virtual bool IsSpaceLayout () const
virtual bool IsViewWindow () const
void SetLayoutProperties (LayoutProperties *properties)
 Set the layout properties for this area.
LayoutPropertiesGetLayoutProperties ()
 Get the layout properties for this area.
AreaGetParentObject () const
void SetVisible (bool visible)
 Set visibility of the area.
bool IsVisible ()
 Get the visibility of the area.
void SetSensitive (bool sensitive)
 Set sensitivity of the area.
bool IsSensitive ()
 Get whether the area is sensitive.
virtual bool DoGetFocused ()
virtual void DoSetFocused (bool focused)
virtual bool DoCanFocus ()
virtual void DoActivateFocus ()
void QueueRelayout ()
 Queue a relayout.
virtual unsigned int GetStretchFactor ()
virtual void SetStretchFactor (unsigned int sf)
virtual MinorDimensionPosition GetPositioning ()
virtual void SetPositioning (MinorDimensionPosition p)
virtual MinorDimensionSize GetExtend ()
virtual void SetExtend (MinorDimensionSize ext)
virtual float GetPercentage ()
virtual void SetPercentage (float f)
virtual bool IsLayoutDone ()
virtual void SetLayoutDone (bool b)
void Set2DMatrix (const Matrix4 &mat)
void Set2DTranslation (float tx, float ty, float tz)
Matrix4 Get2DMatrix () const
Matrix4 Get3DMatrix () const
bool Is3DArea () const
Geometry GetAbsoluteGeometry () const
 Return the position of this object with regard to its top left corner of the physical window.
int GetAbsoluteX () const
 Return the area absolute x coordinate.
int GetAbsoluteY () const
 Return the area absolute y coordinate.
int GetAbsoluteWidth () const
 Return the area absolute width.
int GetAbsoluteHeight () const
 Return the area absolute height.
Geometry GetRootGeometry () const
 Return the position of this object with regard to its top level parent (the main layout or a BaseWindow).
int GetRootX () const
 Return the area root x coordinate.
int GetRootY () const
 Return the area root y coordinate.
int GetRootWidth () const
 Return the area root width.
int GetRootHeight () const
 Return the area root height.
virtual void SetParentObject (Area *)
virtual void UnParentObject ()
 Un-parent and area.

Data Fields

sigc::signal< void, Area * > FocusActivated
sigc::signal< void, Area * > FocusChanged
sigc::signal< void, Area
*, Area * > 
ChildFocusChanged
sigc::signal< void, int, int,
int, int > 
OnResize
 Signal emitted when an area is resized.
sigc::signal< void, Area *, bool > OnVisibleChanged
sigc::signal< void, Area *, bool > OnSensitiveChanged
sigc::signal< void, Area
*, Geometry & > 
OnGeometryChanged

Protected Member Functions

virtual void GeometryChangePending ()
virtual void GeometryChanged ()
virtual void RequestBottomUpLayoutComputation (Area *bo_initiator)
 Request a Layout recompute after a change of size.
Geometry InnerGetAbsoluteGeometry (const Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.
Geometry InnerGetRootGeometry (const Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.

Protected Attributes

bool _is_focused

Friends

class Layout
class View
class WindowThread
class HSplitter
class VSplitter
class WindowCompositor

Constructor & Destructor Documentation

nux::Area::Area ( NUX_FILE_LINE_DECL  )
virtual nux::Area::~Area ( ) [virtual]

Member Function Documentation

void nux::Area::ApplyMaxHeight ( )
void nux::Area::ApplyMaxWidth ( )
void nux::Area::ApplyMinHeight ( )
void nux::Area::ApplyMinWidth ( )
virtual long nux::Area::ComputeChildLayout ( ) [virtual]
virtual long nux::Area::ComputeLayout2 ( ) [virtual]
virtual void nux::Area::ComputePosition2 ( float  offsetX,
float  offsetY 
) [virtual]
virtual void nux::Area::DoActivateFocus ( ) [virtual]

Reimplemented from nux::Focusable.

Reimplemented in nux::Layout.

virtual bool nux::Area::DoCanFocus ( ) [virtual]

Reimplemented from nux::Focusable.

Reimplemented in nux::Layout, and nux::View.

virtual bool nux::Area::DoGetFocused ( ) [virtual]

Reimplemented from nux::Focusable.

Reimplemented in nux::Layout, and nux::View.

virtual void nux::Area::DoSetFocused ( bool  focused) [virtual]
virtual void nux::Area::GeometryChanged ( ) [inline, protected, virtual]

Reimplemented in nux::TextEntry, and nux::View.

virtual void nux::Area::GeometryChangePending ( ) [inline, protected, virtual]

Reimplemented in nux::View.

Matrix4 nux::Area::Get2DMatrix ( ) const
Matrix4 nux::Area::Get3DMatrix ( ) const
Geometry nux::Area::GetAbsoluteGeometry ( ) const

Return the position of this object with regard to its top left corner of the physical window.

Return the position of the Area inside the physical window. For the main layout set in WindowThread, The following functions are equivalent:

  • GetGeometry ()
  • GetRootGeometry ()
  • GetAbsoluteGeometry ()
int nux::Area::GetAbsoluteHeight ( ) const

Return the area absolute height.

As long as _2d_xform contains only translations, the absolute height is the same as value returned by GetBaseHeight ();

int nux::Area::GetAbsoluteWidth ( ) const

Return the area absolute width.

As long as _2d_xform contains only translations, the absolute width is the same as value returned by GetBaseWidth ();

int nux::Area::GetAbsoluteX ( ) const

Return the area absolute x coordinate.

int nux::Area::GetAbsoluteY ( ) const

Return the area absolute y coordinate.

int nux::Area::GetBaseHeight ( ) const
const NString& nux::Area::GetBaseString ( ) const
int nux::Area::GetBaseWidth ( ) const
int nux::Area::GetBaseX ( ) const
int nux::Area::GetBaseY ( ) const
virtual MinorDimensionSize nux::Area::GetExtend ( ) [virtual]
Geometry nux::Area::GetGeometry ( ) const

Get the geometry of the object.

Returns:
The Geometry of the object.
See also:
GetBaseWidth(), GetBaseHeight(), GetBaseX(), GetBaseY().
LayoutProperties* nux::Area::GetLayoutProperties ( )

Get the layout properties for this area.

Retrieves the LayoutProperties sub-class with this area. See SetLayoutProperties

Returns:
LayoutProperties sub-class associated with this area.
int nux::Area::GetMaximumHeight ( ) const
Size nux::Area::GetMaximumSize ( ) const
int nux::Area::GetMaximumWidth ( ) const
int nux::Area::GetMinimumHeight ( ) const
Size nux::Area::GetMinimumSize ( ) const
int nux::Area::GetMinimumWidth ( ) const
Area* nux::Area::GetParentObject ( ) const
virtual float nux::Area::GetPercentage ( ) [virtual]
virtual MinorDimensionPosition nux::Area::GetPositioning ( ) [virtual]
Geometry nux::Area::GetRootGeometry ( ) const

Return the position of this object with regard to its top level parent (the main layout or a BaseWindow).

Return the position of the Area inside the physical window. For the main layout set in WindowThread or for a BaseWindow, GetRootGeometry () is equivalent to GetGeometry ().

int nux::Area::GetRootHeight ( ) const

Return the area root height.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth ();

int nux::Area::GetRootWidth ( ) const

Return the area root width.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth ();

int nux::Area::GetRootX ( ) const

Return the area root x coordinate.

int nux::Area::GetRootY ( ) const

Return the area root y coordinate.

virtual unsigned int nux::Area::GetStretchFactor ( ) [virtual]
Area* nux::Area::GetToplevel ( )

Return the Top level parent of this area.

The top Level parent is either a BaseWindow or the main layout.

Returns:
The top level parent or Null.
Area* nux::Area::GetTopLevelViewWindow ( )

Return the Top level BaseWindow of this area.

Returns:
The top level BaseWindow or NULL.
bool nux::Area::HasTopLevelParent ( )

Return true is this area has a top level parent.

Returns:
True if this area has a top level parent.
void nux::Area::IncreaseSize ( int  x,
int  y 
)
Geometry nux::Area::InnerGetAbsoluteGeometry ( const Geometry geometry) [protected]

Return the absolute geometry starting with a relative geometry passed as argument.

Geometry nux::Area::InnerGetRootGeometry ( const Geometry geometry) [protected]

Return the absolute geometry starting with a relative geometry passed as argument.

bool nux::Area::Is3DArea ( ) const
virtual bool nux::Area::IsArea ( ) const [virtual]

Reimplemented in nux::InputArea, and nux::View.

virtual bool nux::Area::IsInputArea ( ) const [virtual]
virtual bool nux::Area::IsLayout ( ) const [virtual]

Reimplemented in nux::Layout, and nux::View.

virtual bool nux::Area::IsLayoutDone ( ) [virtual]
bool nux::Area::IsSensitive ( )

Get whether the area is sensitive.

Gets whether the area is sensitive to input events

Returns:
whether the area is visible
virtual bool nux::Area::IsSpaceLayout ( ) const [virtual]

Reimplemented in nux::Layout, nux::SpaceLayout, and nux::View.

virtual bool nux::Area::IsView ( ) const [virtual]

Reimplemented in nux::View.

virtual bool nux::Area::IsViewWindow ( ) const [virtual]
bool nux::Area::IsVisible ( )

Get the visibility of the area.

Gets whether the area is visible to the user and will be visible to the user. Default is true.

Returns:
whether the area is visible
virtual void nux::Area::PositionChildLayout ( float  offsetX,
float  offsetY 
) [virtual]
void nux::Area::QueueRelayout ( )

Queue a relayout.

Queues a relayout before the next paint cycle. This is safe to call multiple times within a cycle.

virtual void nux::Area::RequestBottomUpLayoutComputation ( Area bo_initiator) [protected, virtual]

Request a Layout recompute after a change of size.

Reimplemented in nux::Layout.

void nux::Area::Set2DMatrix ( const Matrix4 mat)
void nux::Area::Set2DTranslation ( float  tx,
float  ty,
float  tz 
)
void nux::Area::SetBaseHeight ( int  h)
void nux::Area::SetBaseSize ( int  w,
int  h 
)

Set the size of the object.

void nux::Area::SetBaseString ( const TCHAR Caption)

Reimplemented in nux::InputArea.

void nux::Area::SetBaseWidth ( int  w)
void nux::Area::SetBaseX ( int  x)
void nux::Area::SetBaseXY ( int  x,
int  y 
)
void nux::Area::SetBaseY ( int  y)
virtual void nux::Area::SetExtend ( MinorDimensionSize  ext) [virtual]
void nux::Area::SetGeometry ( int  x,
int  y,
int  w,
int  h 
)

Set the geometry of the object.

Set the width, height, and x, y position of the object on the screen.

Parameters:
xHorizontal position.
yVertical position.
wWidth.
hHeight.
See also:
SetBaseWidth(), SetBaseHeight(), SetBaseX(), SetBaseY().
void nux::Area::SetGeometry ( const Geometry geo)

Set the geometry of the object.

This is an overloaded member function, provided for convenience. It behaves essentially like SetGeometry(int x, int y, int w, int h).

Parameters:
geoGeometry object.
See also:
SetWidth(), SetHeight(), SetX(), SetY().

Reimplemented in nux::BaseWindow, nux::MenuPage, nux::MouseAreaCtrl, nux::ScrollView, nux::StaticTextBox, nux::TableCtrl, and nux::View.

virtual void nux::Area::SetLayoutDone ( bool  b) [virtual]
void nux::Area::SetLayoutProperties ( LayoutProperties properties)

Set the layout properties for this area.

Allows the Layout managing this area to store the properties specifc to this area. Layouts should create a sub-class of LayoutProperties. The LayoutProperties of an area will be deleted upon destruction.

Parameters:
propertiesthe LayoutProperties sub-class associated with this area. Can be NULL to unset.
void nux::Area::SetMaximumHeight ( int  h)
void nux::Area::SetMaximumSize ( int  w,
int  h 
)
void nux::Area::SetMaximumWidth ( int  w)
void nux::Area::SetMinimumHeight ( int  h)
void nux::Area::SetMinimumSize ( int  w,
int  h 
)
void nux::Area::SetMinimumWidth ( int  w)
void nux::Area::SetMinMaxSize ( int  w,
int  h 
)
virtual void nux::Area::SetParentObject ( Area ) [virtual]

SetParentObject/UnParentObject are protected API. it is not meant to be used directly by users. Users add widgets to layouts and layout have to be attached to a composition for objects to be rendered. Setting a parent to and child widget does not mean that when the parent is rendered, the child is also rendered. For instance, setting a button the be the child of a check-box means absolutely nothing is terms of rendering. A widget with a parent cannot be added to a added to a layout for rendering. The widget has to be un-parented first. A layout with a parent cannot be added to a widget or another layout for rendering. The layout has to be un-parented first. In essence only View and Layouts should be calling SetParentObject/UnParentObject.

virtual void nux::Area::SetPercentage ( float  f) [virtual]
virtual void nux::Area::SetPositioning ( MinorDimensionPosition  p) [virtual]
void nux::Area::SetSensitive ( bool  sensitive)

Set sensitivity of the area.

If sensitive, an area will receive input events. Default is true.

Parameters:
ifthe area should receive input events
virtual void nux::Area::SetStretchFactor ( unsigned int  sf) [virtual]
void nux::Area::SetVisible ( bool  visible)

Set visibility of the area.

If visible, an area will be drawn. Default: true.

Parameters:
visibleif the area is visible to the user
virtual void nux::Area::UnParentObject ( ) [virtual]

Un-parent and area.

For un-parented areas the following functions are equivalent:

  • GetGeometry ()
  • GetRootGeometry ()
  • GetAbsoluteGeometry ()

Friends And Related Function Documentation

friend class HSplitter [friend]
friend class Layout [friend]

Reimplemented in nux::HScrollBar, nux::View, and nux::VScrollBar.

friend class View [friend]
friend class VSplitter [friend]
friend class WindowCompositor [friend]
friend class WindowThread [friend]

Reimplemented in nux::BaseWindow.


Field Documentation

bool nux::Area::_is_focused [protected]
sigc::signal<void, Area*, Area*> nux::Area::ChildFocusChanged
sigc::signal<void, Area *> nux::Area::FocusActivated
sigc::signal<void, Area *> nux::Area::FocusChanged
sigc::signal<void, Area *, Geometry&> nux::Area::OnGeometryChanged
sigc::signal<void, int, int, int, int> nux::Area::OnResize

Signal emitted when an area is resized.

sigc::signal<void, Area *, bool> nux::Area::OnSensitiveChanged
sigc::signal<void, Area *, bool> nux::Area::OnVisibleChanged

The documentation for this class was generated from the following file: