newspeoplefor developersdocumentationdownloads

nGuiFormLayout Class Reference
[Graphical User Interface]

#include <nguiformlayout.h>

Inheritance diagram for nGuiFormLayout:

nGuiWidget nRoot nObject nNode nReferenced nSignalEmitter nGuiCategoryBrowser nGuiCheckButtonGroup2 nGuiColorAdjust nGuiColorSliderGroup nGuiDiagramCanvas nGuiHoriSliderGroup nGuiSettingsForm nGuiSkyEditor nGuiSlider2 nGuiTabbedLayout nGuiTextTable nGuiTextView List of all members.

Detailed Description

Lays out size and position of child widgets based on own position.

This works similar to a MEL formLayout.

Relations between child widgets and the form layout are defined by connecting their edges either to the form, to other widgets, or to a (relative) position:

  • Attach To Form: Attaches the edge of a child widget to an edge of the form

  • Attach To Widget: Attaches the edge of a child widget to the closest edge of another child widget.

  • Attach To Position: Attaches the edge of a child widget to a relative position, expressed in percent of the form layout's size.

(C) 2004 RadonLabs GmbH

Definition at line 31 of file nguiformlayout.h.


Public Types

enum  Edge {
  InvalidEdge,
  Top,
  Bottom,
  Left,
  Right,
  HCenter,
  VCenter
}
 edge types More...

Public Member Functions

 nGuiFormLayout ()
 constructor
virtual ~nGuiFormLayout ()
 destructor
void ClearAttachRules ()
 clear attachment rules
int AttachForm (nGuiWidget *widget, Edge where, float offset)
 add an "Attach To Form" layout rule
int AttachWidget (nGuiWidget *widget, Edge where, nGuiWidget *other, float offset)
 add an "Attach To Widget" layout rule
int AttachPos (nGuiWidget *widget, Edge where, float pos)
 add an "Attach To Position" layout rule
virtual void OnRectChange (const rectangle &newRect)
 called when widget position or size changes

Static Public Member Functions

static Edge StringToEdge (const char *str)
 convert string enum to Edge

Protected Types

enum  AttachType {
  Form,
  Widget,
  Pos
}
 attachment types More...

Protected Member Functions

void UpdateLayout (const rectangle &newRect)
 update the layout of child widgets
void FixMinMaxSize (nGuiWidget *widget, Edge anchor, rectangle &rect)
 fix rectangle size based on widget's min/max size

Protected Attributes

nArray< RuleattachRules

Classes

struct  Rule
 holds an attachment rule More...

Member Enumeration Documentation

enum nGuiFormLayout::Edge
 

edge types

Enumerator:
InvalidEdge 
Top 
Bottom 
Left 
Right 
HCenter 
VCenter 

Definition at line 35 of file nguiformlayout.h.

enum nGuiFormLayout::AttachType [protected]
 

attachment types

Enumerator:
Form 
Widget 
Pos 

Definition at line 70 of file nguiformlayout.h.


Constructor & Destructor Documentation

nGuiFormLayout::nGuiFormLayout  ) 
 

constructor

Definition at line 12 of file nguiformlayout_main.cc.

nGuiFormLayout::~nGuiFormLayout  )  [virtual]
 

destructor

Definition at line 21 of file nguiformlayout_main.cc.


Member Function Documentation

void nGuiFormLayout::ClearAttachRules  )  [inline]
 

clear attachment rules

Definition at line 95 of file nguiformlayout.h.

int nGuiFormLayout::AttachForm nGuiWidget widget,
Edge  where,
float  offset
 

add an "Attach To Form" layout rule

Definition at line 30 of file nguiformlayout_main.cc.

int nGuiFormLayout::AttachWidget nGuiWidget widget,
Edge  where,
nGuiWidget other,
float  offset
 

add an "Attach To Widget" layout rule

Definition at line 48 of file nguiformlayout_main.cc.

int nGuiFormLayout::AttachPos nGuiWidget widget,
Edge  where,
float  pos
 

add an "Attach To Position" layout rule

Definition at line 66 of file nguiformlayout_main.cc.

void nGuiFormLayout::OnRectChange const rectangle newRect  )  [virtual]
 

called when widget position or size changes

Called when the size of the widget changes. Will re-apply the layout rules on its children widgets.

Reimplemented from nGuiWidget.

Reimplemented in nGuiSlider2, and nGuiTextView.

Definition at line 363 of file nguiformlayout_main.cc.

nGuiFormLayout::Edge nGuiFormLayout::StringToEdge const char *  str  )  [inline, static]
 

convert string enum to Edge

Definition at line 105 of file nguiformlayout.h.

void nGuiFormLayout::UpdateLayout const rectangle newRect  )  [protected]
 

update the layout of child widgets

Update the layout of child widgets. Will be called from and OnRectChange().

Definition at line 195 of file nguiformlayout_main.cc.

void nGuiFormLayout::FixMinMaxSize nGuiWidget widget,
Edge  anchor,
rectangle rect
[protected]
 

fix rectangle size based on widget's min/max size

Fix the rectangle inplace so that it honors the widget's minimum and maximum size.

Definition at line 86 of file nguiformlayout_main.cc.


Member Data Documentation

nArray<Rule> nGuiFormLayout::attachRules [protected]
 

Definition at line 87 of file nguiformlayout.h.


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

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.