nux-0.9.48

nux::Layout Class Reference

#include <Nux/Layout.h>

Inheritance diagram for nux::Layout:
nux::Area nux::InitiallyUnownedObject nux::Focusable nux::Object nux::Trackable nux::GridHLayout nux::GridVLayout nux::HLayout nux::LayeredLayout nux::SpaceLayout nux::VLayout

Public Member Functions

 Layout (NUX_FILE_LINE_PROTO)
virtual ~Layout ()
virtual void AddLayout (Layout *, unsigned int stretchFactor=1, MinorDimensionPosition=eAbove, MinorDimensionSize extend=eFull, float percentage=100.0f)
virtual void AddView (Area *baseobject, unsigned int stretchFactor=1, MinorDimensionPosition positioning=eAbove, MinorDimensionSize extend=eFull, float percentage=100.0f)
 Add an object to the layout.
virtual void AddSpace (unsigned int width, unsigned int stretchFactor=0)
virtual void Clear ()
virtual unsigned int GetMaxStretchFactor ()
unsigned int GetMinStretchFactor ()
unsigned int GetNumStretchFactor (unsigned int sf)
int GetContentWidth () const
int GetContentHeight () const
int GetHorizontalInternalMargin () const
int GetHorizontalExternalMargin () const
void SetHorizontalInternalMargin (int m)
void SetHorizontalExternalMargin (int m)
int GetVerticalInternalMargin () const
int GetVerticalExternalMargin () const
void SetVerticalInternalMargin (int m)
void SetVerticalExternalMargin (int m)
virtual bool IsLayout () const
virtual bool IsSpaceLayout () const
virtual void GetCompositeList (std::list< Area * > *ViewList)
virtual void Draw ()
void removeParentLayout ()
void DoneRedraw ()
bool SearchInAllSubNodes (Area *bo)
bool SearchInFirstSubNodes (Area *bo)
virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
 Process Event.
virtual void ProcessDraw (GraphicsEngine &GfxContext, bool force_draw)
 Draw Element.
virtual void QueueDraw ()
 Mark all element in the layout as dirty.
virtual void NeedRedraw ()
 deprecated
bool IsQueuedForDraw ()
 Return true if a draw has been scheduled for this layout.
virtual void SetContentDistribution (LayoutContentDistribution stacking_order)
 Define how elements are spread out inside the layout.
virtual LayoutContentDistribution GetContentDistribution ()
virtual bool FindWidget (Area *WidgetObject) const
virtual bool IsEmpty () const
virtual void RemoveChildObject (Area *)
virtual void RequestBottomUpLayoutComputation (Area *bo_initiator)
 Request a Layout recompute after a change of size.
std::list< Area * > & GetChildren ()
virtual void ChildViewQueuedDraw (View *view)
virtual void ChildLayoutQueuedDraw (Layout *layout)
virtual void ChildLayoutChildQueuedDraw (Area *area)
virtual void DoSetFocused (bool focused)
virtual bool DoGetFocused ()
virtual bool DoCanFocus ()
virtual void DoActivateFocus ()
bool HasFocusableEntries ()
long ProcessFocusEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
void SetFocusControl (bool focus_control)
bool HasFocusControl ()

Data Fields

sigc::signal< void, Layout * > OnQueueDraw
 Signal emitted when a layout is scheduled for a draw.
sigc::signal< void, Area * > OnChildQueueDraw
sigc::signal< void, Layout
*, Area * > 
ViewAdded
sigc::signal< void, Layout
*, Area * > 
ViewRemoved
bool _has_focus_control
bool _ignore_focus

Protected Member Functions

AreaGetFocusedChild ()
virtual long DoFocusPrev (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual long DoFocusNext (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual long DoFocusUp (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual long DoFocusDown (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual long DoFocusLeft (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual long DoFocusRight (IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
virtual bool FocusFirstChild ()
virtual bool FocusLastChild ()
virtual bool FocusNextChild (Area *child)
virtual bool FocusPreviousChild (Area *child)
void OnChildFocusChanged (Area *parent, Area *child)
long SendEventToArea (Area *area, IEvent &ievent, long TraverseInfo, long ProcessEventInfo)

Protected Attributes

std::map< Area
*, sigc::connection > 
_connection_map
bool _queued_draw
Size m_ContentSize
int m_contentWidth
int m_contentHeight
int m_fittingWidth
int m_fittingHeight
int m_h_in_margin
int m_h_out_margin
int m_v_in_margin
int m_v_out_margin
std::list< Area * > _layout_element_list
NString m_name
LayoutContentDistribution m_ContentStacking

Constructor & Destructor Documentation

nux::Layout::Layout ( NUX_FILE_LINE_PROTO  )
virtual nux::Layout::~Layout ( ) [virtual]

Member Function Documentation

virtual void nux::Layout::AddLayout ( Layout ,
unsigned int  stretchFactor = 1,
MinorDimensionPosition  = eAbove,
MinorDimensionSize  extend = eFull,
float  percentage = 100.0f 
) [virtual]

Reimplemented in nux::LayeredLayout, and nux::SpaceLayout.

virtual void nux::Layout::AddSpace ( unsigned int  width,
unsigned int  stretchFactor = 0 
) [virtual]

Reimplemented in nux::SpaceLayout.

virtual void nux::Layout::AddView ( Area baseobject,
unsigned int  stretchFactor = 1,
MinorDimensionPosition  positioning = eAbove,
MinorDimensionSize  extend = eFull,
float  percentage = 100.0f 
) [virtual]

Add an object to the layout.

Add an object to the layout. A baseobject minor dimension with respect to a layout object is the dimension opposite to the layout flow. A baseobject major dimension with respect to a layout object is the dimension aligned with the layout flow. A layout object minor dimension is the dimension opposite to the layout flow. A layout object major dimension is the dimension aligned with the layout flow.

Add an object to the layout. The added object get its size and position managed by the layout. When a baseobject is added with a stretches factor equal to 0, its major dimension assumes its minimum value. For instance, if the layout is a vertical layout and the added object has a stretch factor equal 0, then during the layout, the added object height will be set to its minimum value using ApplyMinHeight().

The positioning parameter controls how the layout will place the object within itself. A vertical layout object controls the horizontal positioning of its children baseobject, While an horizontal layout object controls the vertical positioning of its children baseobject.

The extend parameter controls how much size the baseobject minor dimension gets from the layout minor dimension. See MinorDimensionSize.

/param baseobject The object that is being added. /param stretchFactor This value controls how the layout object share space between its children baseobject. /param positioning Controls how the layout position the object. /param extend Controls the object minor dimension size. /param percentage Controls the object minor dimension size in percentage of the layout minor dimension size.

Reimplemented in nux::LayeredLayout, and nux::SpaceLayout.

virtual void nux::Layout::ChildLayoutChildQueuedDraw ( Area area) [virtual]
virtual void nux::Layout::ChildLayoutQueuedDraw ( Layout layout) [virtual]
virtual void nux::Layout::ChildViewQueuedDraw ( View view) [virtual]
virtual void nux::Layout::Clear ( ) [virtual]

Reimplemented in nux::LayeredLayout.

virtual void nux::Layout::DoActivateFocus ( ) [virtual]

Reimplemented from nux::Area.

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

Reimplemented from nux::Area.

virtual long nux::Layout::DoFocusDown ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::GridHLayout, and nux::HLayout.

virtual long nux::Layout::DoFocusLeft ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::GridHLayout, and nux::VLayout.

virtual long nux::Layout::DoFocusNext ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::LayeredLayout.

virtual long nux::Layout::DoFocusPrev ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::LayeredLayout.

virtual long nux::Layout::DoFocusRight ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::GridHLayout, and nux::VLayout.

virtual long nux::Layout::DoFocusUp ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected, virtual]

Reimplemented in nux::GridHLayout, and nux::HLayout.

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

Reimplemented from nux::Area.

void nux::Layout::DoneRedraw ( )
virtual void nux::Layout::DoSetFocused ( bool  focused) [virtual]

Reimplemented from nux::Area.

virtual void nux::Layout::Draw ( ) [inline, virtual]
virtual bool nux::Layout::FindWidget ( Area WidgetObject) const [virtual]

Reimplemented in nux::SpaceLayout.

virtual bool nux::Layout::FocusFirstChild ( ) [protected, virtual]

Reimplemented in nux::LayeredLayout.

virtual bool nux::Layout::FocusLastChild ( ) [protected, virtual]

Reimplemented in nux::LayeredLayout.

virtual bool nux::Layout::FocusNextChild ( Area child) [protected, virtual]
virtual bool nux::Layout::FocusPreviousChild ( Area child) [protected, virtual]
std::list<Area *>& nux::Layout::GetChildren ( ) [inline]

References _layout_element_list.

virtual void nux::Layout::GetCompositeList ( std::list< Area * > *  ViewList) [inline, virtual]
virtual LayoutContentDistribution nux::Layout::GetContentDistribution ( ) [virtual]
int nux::Layout::GetContentHeight ( ) const [inline]

References m_contentHeight.

int nux::Layout::GetContentWidth ( ) const [inline]

References m_contentWidth.

Area* nux::Layout::GetFocusedChild ( ) [protected]
int nux::Layout::GetHorizontalExternalMargin ( ) const [inline]

References m_h_out_margin.

int nux::Layout::GetHorizontalInternalMargin ( ) const [inline]

References m_h_in_margin.

virtual unsigned int nux::Layout::GetMaxStretchFactor ( ) [virtual]
unsigned int nux::Layout::GetMinStretchFactor ( )
unsigned int nux::Layout::GetNumStretchFactor ( unsigned int  sf)
int nux::Layout::GetVerticalExternalMargin ( ) const [inline]

References m_v_out_margin.

int nux::Layout::GetVerticalInternalMargin ( ) const [inline]

References m_v_in_margin.

bool nux::Layout::HasFocusableEntries ( )
bool nux::Layout::HasFocusControl ( )
virtual bool nux::Layout::IsEmpty ( ) const [virtual]

Reimplemented in nux::SpaceLayout.

virtual bool nux::Layout::IsLayout ( ) const [inline, virtual]

Reimplemented from nux::Area.

bool nux::Layout::IsQueuedForDraw ( )

Return true if a draw has been scheduled for this layout.

Returns:
True if a draw has been scheduled for this layout.
virtual bool nux::Layout::IsSpaceLayout ( ) const [inline, virtual]

Reimplemented from nux::Area.

Reimplemented in nux::SpaceLayout.

virtual void nux::Layout::NeedRedraw ( ) [virtual]

deprecated

void nux::Layout::OnChildFocusChanged ( Area parent,
Area child 
) [protected]
virtual void nux::Layout::ProcessDraw ( GraphicsEngine GfxContext,
bool  force_draw 
) [virtual]

Draw Element.

Draw all elements inside the layout. If force_draw is true then the system requests that all objects redraw themselves completely.

Parameters:
force_draw
TraverseInfo
ProcessEventInfo
Returns:
The state of the Process Event.

Reimplemented in nux::GridHLayout, nux::GridVLayout, and nux::LayeredLayout.

virtual long nux::Layout::ProcessEvent ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [virtual]

Process Event.

Propagate event to all element contained in the layout.

Parameters:
ievent
TraverseInfo
ProcessEventInfo
Returns:
The state of the Process Event.

Reimplemented in nux::LayeredLayout.

long nux::Layout::ProcessFocusEvent ( IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
)
virtual void nux::Layout::QueueDraw ( ) [virtual]

Mark all element in the layout as dirty.

Mark all element in the layout as dirty. This will also mark all sub elements as dirty. InputArea element are not marked as dirty (they don't have the flags). Emits the signal OnQueueDraw.

virtual void nux::Layout::RemoveChildObject ( Area ) [virtual]

Reimplemented in nux::LayeredLayout.

void nux::Layout::removeParentLayout ( )
virtual void nux::Layout::RequestBottomUpLayoutComputation ( Area bo_initiator) [virtual]

Request a Layout recompute after a change of size.

Reimplemented from nux::Area.

bool nux::Layout::SearchInAllSubNodes ( Area bo)
bool nux::Layout::SearchInFirstSubNodes ( Area bo)
long nux::Layout::SendEventToArea ( Area area,
IEvent ievent,
long  TraverseInfo,
long  ProcessEventInfo 
) [protected]
virtual void nux::Layout::SetContentDistribution ( LayoutContentDistribution  stacking_order) [virtual]

Define how elements are spread out inside the layout.

Typically, a layout stacks it elements from left to right (HLayout) or top to bottom (VLayout). When the elements don't uses all the space that is available, the content stacking policy allows alternatives ways to position the elements. This does not affect the elements size, only their position inside the layout.

Parameters:
stacking_order
void nux::Layout::SetFocusControl ( bool  focus_control)
void nux::Layout::SetHorizontalExternalMargin ( int  m) [inline]

References m_h_out_margin.

void nux::Layout::SetHorizontalInternalMargin ( int  m) [inline]

References m_h_in_margin.

void nux::Layout::SetVerticalExternalMargin ( int  m) [inline]

References m_v_out_margin.

void nux::Layout::SetVerticalInternalMargin ( int  m) [inline]

References m_v_in_margin.


Field Documentation

std::map<Area*, sigc::connection> nux::Layout::_connection_map [protected]
std::list<Area *> nux::Layout::_layout_element_list [protected]

Referenced by GetChildren().

bool nux::Layout::_queued_draw [protected]

Referenced by GetContentHeight().

int nux::Layout::m_contentWidth [protected]

Referenced by GetContentWidth().

int nux::Layout::m_fittingWidth [protected]
sigc::signal<void, Area*> nux::Layout::OnChildQueueDraw
sigc::signal<void, Layout*> nux::Layout::OnQueueDraw

Signal emitted when a layout is scheduled for a draw.

sigc::signal<void, Layout*, Area*> nux::Layout::ViewAdded
sigc::signal<void, Layout*, Area*> nux::Layout::ViewRemoved

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