If this option is set, the widgets inside this Container will be part of the focus ordering of the parent widget. This means that when this Container gets the focus, its first widget will be focused. When the focus leaves the last widget inside the Container it will give the focus back to the parent instead of cycling back to the first widget in this Container. This option is useful to create a sub-class packed with common used widgets, making the reuse easier.
o <B>newB> ( )
Create a new instance of the Curses::UI::Container class.
o <B>addB> ( ID, CLASS, OPTIONS )
This is the main method for this class. Using this method it is easy to add widgets to the container.
The ID is an identifier that you want to use for the added widget. This may be any string you want. If you do not need an ID, you may also us an undefined value. The container will automatically create an ID for you.
The CLASS is the class which you want to add to the container. If CLASS does not contain :: or CLASS matches Dialog::... then Curses::UI will be prepended to it. This way you do not have to specifiy the full class name for widgets that are in the Curses::UI hierarchy. It is not necessary to call use CLASS yourself. The <B>addB> method will call the <B>usemoduleB> method from Curses::UI to automatically load the module.
The hash OPTIONS contains the options that you want to pass on to the new instance of CLASS.
$container->add( myid, # ID Label, # CLASS -text => Hello, world!, # OPTIONS -x => 10, -y => 5, );
o <B>deleteB> ( ID )
This method deletes the contained widget with the given ID from the container.
o <B>hasaB> ( CLASS ) o <B>layoutB> ( )
Layout the Container and all its contained widgets.
o <B>drawB> ( BOOLEAN )
Draw the Container and all its contained widgets.
If BOOLEAN is true, the screen will not update after drawing. By default this argument is false, so the screen will update after drawing the container.
o <B>intellidrawB> ( )
See Curses::UI::Widget for an explanation of this method.
o <B>focusB> ( )
If the container contains no widgets, this routine will return immediately. Else the container will get focus.
If the container gets focus, one of the contained widgets will get the focus. The returnvalue of this widget determines what has to be done next. Here are the possible cases:
As soon as a widget returns this value, the container will loose its focus and return the returnvalue and the last pressed key to the caller.
The container will not loose focus and the focus will stay at the same widget of the container.
* Any other returnvalue
The focus will go to the next widget in the container.
o <B>getobjB> ( ID )
This method returns the object reference of the contained widget with the given ID.
o <B>getfocusobjB> ( )
This method returns the object reference of the contained widget which currently has the focus.
o <B>set_focusorderB> ( IDLIST )
Normally the order in which widgets get focused in a container is determined by the order in which they are added to the container. Use <B>set_focusorderB> if you want a different focus order. IDLIST contains a list of ids.
o <B>set_draworderB> ( IDLIST )
Normally the order in which widgets are drawn in a container is determined by the order in which they are added to the container. Use <B>set_draworderB> if you want a different draw order. IDLIST contains a list of ids.
o <B>loadmoduleB> ( CLASS )
This will load the module for the CLASS. If loading fails, the program will die.
o <B>onFocusB> ( CODEREF ) o <B>onBlurB> ( CODEREF )
Since interacting is not handled by the container itself, but by the contained widgets, this class does not have any key bindings.
Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
Maintained by Marcus Thiesen (firstname.lastname@example.org)
This package is free software and is provided as is without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.
|perl v5.20.3||CURSES::UI::CONTAINER (3)||2011-09-01|