KLChild Class Reference

[KLE Index] [KLE Hierarchy] [Headers]


KLChild - The baseclass for all layout elements This is the baseclass for everything wich is used in the layout More...

#include <klelib/klchild.h>

Public Members

Protected Members


Detailed Description

KLChild - The baseclass for all layout elements

This is the baseclass for everything wich is used in the layout. More documentation to follow ...

Calling herachie:

 Constructor()
 { 
   Setup()
   {
     AskMinMax()
     {
       Show()
       Hide()
     }
   }
   Cleanup()
 }
 Destructor()
 

{} means, that the functions inside this "level" can be called in the given order many times. (e.g. when Show() is successfull, you can be sure that Hide() will be called before the next Show() call is done) Only when the first call in an level is successfull (e.g. Setup() or Show()) the oder calls are executed

NOTE:

   X => Vertical Row (Height)
   Y => Hriziontal Coloumn (Width)
 


void setHidden( bool hide ) [public]

Shows/Hides the object.

If hidden, all other objects in the same group will get the space of this object.

Changing this when showed forces a relayout

void setFixXSize(ulong fixXSize) [public]

Gives the object a fix x size. This overwrites the normal Min/Max sizes

Set to 0, if you not longer want a fix size. This is also the default.

Changing this when showed forces a relayout

See Also:
also

void setFixYSize(ulong fixYSize) [public]

Gives the object a fix Y size. This overwrites the normal Min/Max sizes

Set to 0, if you not longer want a fix size. This is also the default.

Changing this when showed forces a relayout

See Also:
also

void setFixSizes(ulong fixXSize, ulong fixYSize) [public]

Sets both a fix X and Y size at the same time

Only forces one relayout when showed

See Also:
also

void setXWeight(ulong xWeight) [public]

Sets the x weight of the object.

The weight is important when spreading the availble space in a group.

The formular used to calculate the space for one object is:

xSize = availspace * Sum of weight of all nonhidden objects in group  / objectweight

Ok, this is not the exact formular, because other things like min/max sizes must also be token into consideration.

The default value is 100.

A special case is a weight of 0. If an object has this weight, then the maximum will be set to the minimum, so that the object always only get itīs minmum sizes.

See Also:
setYWeight

void setYWeight(ulong yWeight) [public]

Sets the Y Weight

See Also:
setXWeight

void setWeight(ulong weight) [public]

Sets both x and y weight

See Also:
setXWeight

void setDisapearLevel(ulong disapearLevel) [public]

Sets the disapearlevel of this widget.

If you set an disapearlevel higger than 0, the minimumsize of this child will not be added to the normal minimumsize.

If the parent group runs out of space to display all childs, it will start to hide the childs with the higgest disaperlevel.

Note: This does not affect the hidden()-flag.

As higger the disapearlevel is, as sooner will this child be hidden.

Default value is 0, wich means no disapearing.

(not yet implementated in the groups)

KLSetupInfo& setupInfo() [public]

Get the setup info

KLMinMaxSizes& minMaxSizes() [public]

Get the Min/Max sizes

KLShowInfo& showInfo() [public]

Get the show info

class KLGroup *parentGroup[public]

Parent group object, or NULL if non exists

enum StateInfo ( SI_None, SI_SetupDone, SI_Showed ) [public]

Internal states of this object

KLChild() [public]

Constructor

~KLChild() [public virtual]

Destructor

bool klSetup( KLSetupInfo *setupInfo ) [public virtual]

Do your setup work (e.g. load a image, load fonts) First call baseclass, and return false if it returns false. false means, setup has failed.

bool klAskMinMax(KLMinMaxSizes *minMaxSizes) [public virtual]

Ask for the sizes of this widget. Must first call itīs base class (to do such things like adding bordersizes). If returning FALSE, return also FALSE immedatly (e.g. a fix size has been set) Otherwise ADD your sizes. (e.g. size of the setted text)

NOTE: Itīs VERY important, that you ADD your sizes You will destroy the complete layout, if you do not so !!!

Returns:
FALSE does NOT mean failure.

bool klShow(KLShowInfo *showInfo) [public virtual]

Show the element. ShowInfo contains the X and Y coords, sizes and a systemdepending device information (Window-Handle) First call baseclass, and return false if it returns false. FALSE means, show has failed

void klHide() [public virtual]

Just hide it First do your hiding stuff, then call baseclass.

void klCleanup() [public virtual]

Do your cleanup work. (e.g. flush images, or fonts) First do your hiding stuff, then call baseclass

KLChild* findChild( ulong x, ulong y ) const [public virtual]

Find the widget at x/y Can only be called between klShow() and klHide()

Returns:
child found at x/y or NULL

void klDoAskMinMax(KLMinMaxSizes *minMaxSizes) [public]

Call this function, if you want to get the minmax sizes of an object

void klPostAskMinMax(KLMinMaxSizes *minMaxSizes) [public]

*INTERNAL FUNCTON* Just checks, if the weight is 0, and if this is true sets the maxmimum to the minimum. Does also validate the minMaxSizes May be extended in future to do more, and get more parameters

void doRelayout( bool relayoutParent ) [public virtual]

Relayout this widget.

Parameters:
relayoutParent true to force relayout of parent. If there is no parent, the device is will be relayouted
See Also:
startRelayout, stopRelayout

void stopRelayout() [public virtual]

Stop the relayouting of this widget.

This function can be called nested. You must have an matching #startRelayout() call for every #stopRelayout() call

When this widget is a group, it will also call #stopRelayout() on all group members

See Also:
startRelayout, doRelayout

void startRelayout() [public virtual]

Starts the relayouting of this widget

Only relayouts, if the nexting level is 0 and the #doRelayout() was called

See Also:
stopRelayout, doRelayout

void setupGrap() [public virtual]

Setup input graping. The device knows more Can only be called when setted up.

See Also:
cleanupGrap

void cleanupGrap() [public virtual]

Cleanup input graping.

See Also:
setupGrap

void addDropMarks( KLDropMarkList * dml ) [public virtual]

Create dropmarks for this child/group

Dropmarks descripes the designer, where he is able to insert childs

KLChild does not add any dropmarks. This is usualy done by the subclasses, such as KLHVGroup or KLReplaceMe

Parameters:
dml DropMarkList to insert the dropmarks into

KLChild& operator<<(_child_change_func func) [public]

For information, how to use this streaming, just look at the supplied examples.

You set each attribute also with using streaming

KLSetupInfo a_setupInfo[protected]

Local copy of the setup information

Only valid between klSetup() and klCleanup()

KLMinMaxSizes a_minMaxSizes[protected]

Local copy of Min/Max sizes

Only valid between klAskMinMax() and klCleanup()

KLShowInfo a_showInfo[protected]

Local copy of show information

Only valid between klShow() and klHide()


Documentation generated by emmy@gate on Tue Sep 22 21:13:27 MEST 1998
Kdoc