libyui  3.0.13
 All Classes Functions Variables Enumerations Friends
YLayoutBox Class Referenceabstract
Inheritance diagram for YLayoutBox:
Collaboration diagram for YLayoutBox:

Public Types

typedef std::vector< int > sizeVector
 
typedef std::vector< int > posVector
 

Public Member Functions

virtual ~YLayoutBox ()
 
virtual const char * widgetClass () const
 
YUIDimension primary () const
 
YUIDimension secondary () const
 
bool debugLayout () const
 
void setDebugLayout (bool deb=true)
 
virtual int preferredSize (YUIDimension dim)
 
virtual int preferredWidth ()
 
virtual int preferredHeight ()
 
virtual void setSize (int newWidth, int newHeight)
 
virtual bool stretchable (YUIDimension dimension) const
 
virtual void moveChild (YWidget *child, int newX, int newY)=0
 
- Public Member Functions inherited from YWidget
virtual ~YWidget ()
 
virtual std::string debugLabel () const
 
std::string helpText () const
 
void setHelpText (const std::string &helpText)
 
virtual const YPropertySetpropertySet ()
 
virtual bool setProperty (const std::string &propertyName, const YPropertyValue &val)
 
virtual YPropertyValue getProperty (const std::string &propertyName)
 
bool hasChildren () const
 
YWidgetfirstChild () const
 
YWidgetlastChild () const
 
YWidgetListConstIterator childrenBegin () const
 
YWidgetListConstIterator childrenEnd () const
 
int childrenCount () const
 
bool contains (YWidget *child) const
 
virtual void addChild (YWidget *child)
 
virtual void removeChild (YWidget *child)
 
void deleteChildren ()
 
YWidgetparent () const
 
bool hasParent () const
 
void setParent (YWidget *newParent)
 
YDialogfindDialog ()
 
YWidgetfindWidget (YWidgetID *id, bool doThrow=true) const
 
bool isValid () const
 
bool beingDestroyed () const
 
void * widgetRep () const
 
void setWidgetRep (void *toolkitWidgetRep)
 
bool hasId () const
 
YWidgetIDid () const
 
void setId (YWidgetID *newId_disown)
 
virtual void setEnabled (bool enabled=true)
 
void setDisabled ()
 
virtual bool isEnabled () const
 
void setStretchable (YUIDimension dim, bool newStretch)
 
void setDefaultStretchable (YUIDimension dim, bool newStretch)
 
virtual int weight (YUIDimension dim)
 
bool hasWeight (YUIDimension dim)
 
void setWeight (YUIDimension dim, int weight)
 
void setNotify (bool notify=true)
 
bool notify () const
 
void setNotifyContextMenu (bool notifyContextMenu=true)
 
bool notifyContextMenu () const
 
bool sendKeyEvents () const
 
void setSendKeyEvents (bool doSend)
 
bool autoShortcut () const
 
void setAutoShortcut (bool _newAutoShortcut)
 
int functionKey () const
 
bool hasFunctionKey () const
 
virtual void setFunctionKey (int fkey_no)
 
virtual bool setKeyboardFocus ()
 
virtual std::string shortcutString () const
 
virtual void setShortcutString (const std::string &str)
 
virtual const char * userInputProperty ()
 
void dumpWidgetTree (int indentationLevel=0)
 
void dumpDialogWidgetTree ()
 
void setChildrenEnabled (bool enabled)
 
virtual void saveUserInput (YMacroRecorder *macroRecorder)
 
void * operator new (size_t size)
 
virtual void startMultipleChanges ()
 
virtual void doneMultipleChanges ()
 

Static Public Member Functions

static bool isLayoutStretch (YWidget *child, YUIDimension dimension)
 

Protected Member Functions

 YLayoutBox (YWidget *parent, YUIDimension dim)
 
int childrenTotalWeight (YUIDimension dimension)
 
int childrenMaxPreferredSize (YUIDimension dimension)
 
int totalNonWeightedChildrenPreferredSize (YUIDimension dimension)
 
int countNonWeightedChildren (YUIDimension dimension)
 
int countStretchableChildren (YUIDimension dimension)
 
int countLayoutStretchChildren (YUIDimension dimension)
 
YWidgetfindDominatingChild ()
 
void calcPrimaryGeometry (int newSize, sizeVector &childSize, posVector &childPos)
 
void calcSecondaryGeometry (int newSize, sizeVector &childSize, posVector &childPos)
 
void doResize (sizeVector &width, sizeVector &height, posVector &x_pos, posVector &y_pos)
 
- Protected Member Functions inherited from YWidget
 YWidget (YWidget *parent)
 
YWidgetChildrenManagerchildrenManager () const
 
void setChildrenManager (YWidgetChildrenManager *manager)
 
void setBeingDestroyed ()
 
void dumpWidget (YWidget *w, int indentationLevel)
 

Detailed Description

Definition at line 35 of file YLayoutBox.h.

Constructor & Destructor Documentation

YLayoutBox::YLayoutBox ( YWidget parent,
YUIDimension  dim 
)
protected

Constructor.

Creates a VBox for dim == YD_VERT or a HBox for YD_HORIZ.

Definition at line 66 of file YLayoutBox.cc.

Here is the call graph for this function:

YLayoutBox::~YLayoutBox ( )
virtual

Destructor.

Definition at line 75 of file YLayoutBox.cc.

Member Function Documentation

void YLayoutBox::calcPrimaryGeometry ( int  newSize,
sizeVector &  childSize,
posVector &  childPos 
)
protected

Calculate the sizes and positions of all children in the primary dimension and store them in "childSize" and "childPos".

Definition at line 398 of file YLayoutBox.cc.

Here is the call graph for this function:

void YLayoutBox::calcSecondaryGeometry ( int  newSize,
sizeVector &  childSize,
posVector &  childPos 
)
protected

Calculate the sizes and positions of all children in the secondary dimension and store them in "childSize" and "childPos".

Definition at line 694 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::childrenMaxPreferredSize ( YUIDimension  dimension)
protected

Return the maximum preferred size of all children in the specified dimension.

Definition at line 231 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::childrenTotalWeight ( YUIDimension  dimension)
protected

Add up all the children's weights.

Definition at line 247 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::countLayoutStretchChildren ( YUIDimension  dimension)
protected

Count the number of "rubber bands", i.e. the number of stretchable layout spacings ( e.g. {H|V}Weight, {H|V}Spacing ). Only those without a weight are counted.

Definition at line 315 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::countNonWeightedChildren ( YUIDimension  dimension)
protected

Count the number of non-weighted children.

Definition at line 280 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::countStretchableChildren ( YUIDimension  dimension)
protected

Count the number of stretchable ( non-weighted ) children. Note: Weighted children are always considered stretchable.

Definition at line 297 of file YLayoutBox.cc.

Here is the call graph for this function:

bool YLayoutBox::debugLayout ( ) const

Returns 'true' if layout debugging (verbose logging during layout) is on.

Definition at line 96 of file YLayoutBox.cc.

void YLayoutBox::doResize ( sizeVector &  width,
sizeVector &  height,
posVector &  x_pos,
posVector &  y_pos 
)
protected

Actually perform resizing and moving the child widgets to the appropriate position.

The vectors passed are the sizes previously calculated by calcPrimaryGeometry() and calcSecondaryGeometry().

Definition at line 746 of file YLayoutBox.cc.

Here is the call graph for this function:

YWidget * YLayoutBox::findDominatingChild ( )
protected

Determine the number of the "dominating child" - the child widget that determines the overall size with respect to its weight.

Return 0 if there is no dominating child, i.e. none of the children has a weight specified.

Definition at line 185 of file YLayoutBox.cc.

Here is the call graph for this function:

bool YLayoutBox::isLayoutStretch ( YWidget child,
YUIDimension  dimension 
)
static

Check if this is a layout stretch widget in the specfied dimension, i.e. an empty widget that is stretchable.

Definition at line 333 of file YLayoutBox.cc.

Here is the call graph for this function:

virtual void YLayoutBox::moveChild ( YWidget child,
int  newX,
int  newY 
)
pure virtual

Move a child to a new position.

Derived classes are required to implement this.

int YLayoutBox::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Implements YWidget.

Definition at line 165 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::preferredSize ( YUIDimension  dim)
virtual

Preferred size of the widget in the specified dimension.

Reimplemented from YWidget.

Reimplemented from YWidget.

Definition at line 111 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Implements YWidget.

Definition at line 159 of file YLayoutBox.cc.

Here is the call graph for this function:

YUIDimension YLayoutBox::primary ( ) const

Return the primary dimension, i.e., the dimension this LayoutBox lays out its children in: YD_VERT for a VBox, YD_HORIZ for a HBox.

Definition at line 82 of file YLayoutBox.cc.

YUIDimension YLayoutBox::secondary ( ) const

Return the secondary dimension.

Definition at line 89 of file YLayoutBox.cc.

void YLayoutBox::setDebugLayout ( bool  deb = true)

Enable or disable layout debugging.

Definition at line 102 of file YLayoutBox.cc.

void YLayoutBox::setSize ( int  newWidth,
int  newHeight 
)
virtual

Sets the size of the layout box. This is where the layout policy is implemented.

Derived classes can reimplement this, but this base class method should be called in the reimplemented function.

Reimplemented from YWidget.

Implements YWidget.

Definition at line 365 of file YLayoutBox.cc.

Here is the call graph for this function:

bool YLayoutBox::stretchable ( YUIDimension  dimension) const
virtual

Returns the stretchability of the layout box: The layout box is stretchable if one of the children is stretchable in this dimension or if one of the child widgets has a layout weight in this dimension.

Reimplemented from YWidget.

Reimplemented from YWidget.

Definition at line 349 of file YLayoutBox.cc.

Here is the call graph for this function:

int YLayoutBox::totalNonWeightedChildrenPreferredSize ( YUIDimension  dimension)
protected

Add up all the non-weighted children's preferred sizes in the specified dimension.

Definition at line 263 of file YLayoutBox.cc.

Here is the call graph for this function:

const char * YLayoutBox::widgetClass ( ) const
virtual

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YWidget.

Definition at line 775 of file YLayoutBox.cc.

Here is the call graph for this function:


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