# groupbox class Provides a groupbox bar.
Inherits
object widget
Description
This widget can be used to display a groupbox. It will be usually a parent for other child controls. You can either use a child layout to manage the children geometries or use $setColumnLayout to manage the layout automatically.
Functions
`$setTitle(<text:String>)`
Sets the group box title to <text>.
`<string> $title()`
Returns the group box title text.
`$setFlat(<bflag:boolean>)`
Sets whether the group box is painted flat. Valid Values are 1 or 0.
`<boolean> $isFlat()`
Returns 1 (TRUE) if the group box is painted flat; otherwise returns 0 (FALSE).
`<boolean> $isCheckable()`
Returns 1 (TRUE) if the group box has a checkbox in its title; otherwise returns 0 (FALSE).
`$setCheckable(<bflag:boolean>)`
Sets whether the group box has a checkbox in its title: Valid values are 1 or 0.
`$setInsideMargin(<margin:uint>)`
Sets the the width of the inside margin to m pixels.
`<integer> $insideMargin()`
Returns the width of the empty space between the items in the group and margin of groupbox.
`$setInsideSpacing(<spacing:uint>)`
Sets the width of the empty space between each of the items in the group to m pixels.
`<integer> $insideSpacing()`
Returns the width of the empty space between each of the items in the group.
`$setColumns(<columns:uint>)`
Sets the number of columns or rows (depending of the orientation) in the group box.
`<integer> $columns()`
Returns the number of columns or rows in the groupbox.
`$addSpace()`
Adds an empty cell at the next free position.
`<string> $alignment()`
Returns the alignment of the group box title.
`$setAlignment(<alignment:string>)`
Set the alignment of the groupbox; Valid values are Left,Right,HCenter.
`$setOrientation<orientation:string>`
Sets the group box's orientation. Valid values are: Horizontal, Vertical.
`$setColumnLayout(<columns:integer>,<orientation:string>)`
Enables the automatic layout management. The children are arranged in n columns with the specified orientation. Valid values for <orientation> are: Horizontal, Vertical.
Examples
    |-Start:

    #Let's start.

    #first we'll create the main widget.

    %widget=$new(widget)

    #then the groupbox

    %gb=$new(groupbox,%widget)

    %gb->$setTitle(Login)

    %gb->$setAlignment("Left")

    #now we create the labels and lineedits.

    %labeluser=$new(label,%gb)

    %labeluser->$settext(User: )

    %labelpass=$new(label,%gb)

    %labelpass->$settext(Pass: )

    %inputuser=$new(lineedit,%gb)

    %inputpass=$new(lineedit,%gb)

    %inputpass->$setechomode("password")

    #now lets' layouting the groupbox's element's.

    %layoutgb=$new(layout,%gb)

    %layoutgb->$setmargin(20)

    %layoutgb->$addwidget(%labeluser,0,0)

    %layoutgb->$addwidget(%labelpass,1,0)

    %layoutgb->$addwidget(%inputuser,0,1)

    %layoutgb->$addwidget(%inputpass,1,1)

    # now we create a fake widget and managing the two buttons layout.

    %fakewidget=$new(widget,%widget)

    %layoutbtn=$new(layout,%fakewidget)

    %btnok=$new(button,%fakewidget)

    %btnok->$settext("OK")

    %btncancel=$new(button,%fakewidget)

    %btncancel->$settext("Cancel")

    %layoutbtn->$addwidget(%btnok,0,0)

    %layoutbtn->$addwidget(%btncancel,0,1)

    #And finally we create a main layout with the groupbox (and its "children")

    #and fakewiget (with its buttons children).
    %mainlayout=$new(layout,%widget)

    %mainlayout->$setspacing(10)

    %mainlayout->$setmargin(10)

    %mainlayout->$addwidget(%gb,0,0)

    %mainlayout->$addwidget(%fakewidget,1,0)

    #Let's show our nice login request =D !

    %widget->$show()

Index, Object Classes

KVIrc 3.4.2 Documentation
Generated by ports-i386 at Sun Mar 7 07:08:54 2010