CQCC::IOPtkManip - IOPtk widget class for managing data interaction
This class provides wrapper objects for a number of commonly used data manipulator widgets, hiding the implementation details and handling message translation and Parm object interaction.
As a subclass of IOPtkWidget, it inherits some basic attribute management and initialization functionality. In addition this class manages interaction with Parm objects or other values.
How the IOPtkManip object looks and behaves depends on its ``subtype'' which provides a lightweight subclassing feature. Each subtype has an initialization function that uses Perl/TK calls to define the widget; the subtype may have additional supporting methods to implement its behavior.
The currently supported subtypes include IOButton, IOLabel, IOListbox, IOListboxGrid, IOListboxTree, and IOScrolledLabel. See the method documentation on each for more information.
Data in the manipulator widget is accessed using the ManageValues method which handles getting or setting values or ranges. This should be called through the CQCC::IOPerlTK::ManipManageValues interface method.
Manipulators are created by the new method but this should be called through the CQCC::IOPerlTK::Manipulator interface method.
The IOPtkPanel ClassTest method provides an extensive test of all of the IOPtkWidget classes.
SUPPORT POLICY: See TriggerCQCC.pm for the Rational Support Policy.
IOButton subtype
$IO->Manipulator(name, parent, "IOButton", key-values)>
This subtype provides a generic button manipulator widget. It uses the Perl/TK Button object directly after translating its TITLE and setting a callback.
The callback is similar to the IOPtkMenu callbacks. The CALLBACK_OBJECT attribute defines an object and the CALLBACK attribute defines the method name or a list reference containing the method name and argument list.
This is a sample of a IOButton being created:
$IO->Manipulator("Database", "Frame2", "IOButton", TITLE=>["GUI_Database"], TK=>[ -background => 'white' ], CALLBACK_OBJECT => $self, CALLBACK => "Dialog_SelectDatabase");
IOLabel subtype
$IO->Manipulator(name, parent, "IOLabel", key-values)>
This subtype method defines a generic label widget that shows the current value of a Parm object or a raw value passed in through the VALUE attribute.
This is a sample of making an IOLabel called DatabaseName based on the value of a Parm called CQCC_DATABASE.
$IO->Manipulator("DatabaseName", "Frame2", "IOLabel", PARM=>"CQCC_DATABASE", TK => [ -background => 'white', -relief => 'sunken' ],
The TK attribute passes through one or more Perl/TK attribute pairs to customize the widget.
The VALUE attribute may be used in place of the PARM attribute to provide a direct data value.
IOListbox subtype
$IO->Manipulator(name, parent, "IOListbox", key-values)>
This subtype defines a listbox manipulator widget which provides a scrolling list of options to select from.
The widget is built from an outer frame and includes a title label if the TITLE attribute is set. The main widget is a Perl/TK Scrolled Listbox.
The RANGE attribute controls the possible selections and the VALUE is the list of selections actually made by the user.
The MODE attribute controls the selection mode (``single'', ``browse'', ``multiple'').
If HEIGHT is provided it controls the height of the IOListbox in lines.
This is a sample of a declaration of an IOListbox using the Manipulator method of IOPerl/TK.
$IO->Manipulator("List1", "Page1", "IOListbox", TITLE=>"List", MODE => "single", HEIGHT => 10, RANGE => ["a","b","c"], PACK=>[-side => "left", -fill => 'both']);
The IOListbox manipulator uses custom internal functions to modify or retrieve its range or value settings.
IOListboxGrid subtype
$IO->Manipulator(name, parent, "IOListboxGrid", key-values)>
This subtype method defines a listbox widget which provides a scrolling list of column based data to select from.
The widget is built wrapped inside a frame and includes a title label if the TITLE attribute is set. The main widget is a Perl/TK Scrolled Listbox with special column header buttons used to provide resize control and sorting for the columns.
The RANGE attribute controls the possible selections and the VALUE is the list of selections actually made by the user.
The MODE attribute controls the selection mode (``single'', ``browse'', ``multiple'').
If HEIGHT is provided it controls the height of the IOListboxGrid in lines.
The first row of data is assumed to be the column heading titles.
This is a sample of a declaration of an IOListboxGrid using the Manipulator method of IOPerl/TK.
my @data = ( [ "ID", "Heading", "State" ], [ "SAMPL0056", "Test heading 4", "Submit" ]);
$IO->Manipulator("MyListboxGrid", "Page2", "IOListboxGrid", TITLE=>"IOListboxGrid Demo", MODE => "single", HEIGHT => 10, RANGE => \@data, PACK=>[-side => "left", -fill => 'both']);
The widget will only display as many columns as the data contains but must be prebuilt with the maximum number of columns expected so that the widget can be reused with new data. The MAX_COLUMNS attribute determines this limit and defaults to 10.
The IOListboxGrid manipulator uses custom internal functions to modify or retrieve its range or value settings.
IOListboxTree subtype
$IO->Manipulator(name, parent, "IOListboxTree", key-values)>
This subtype method defines a listbox widget which provides a scrolling list showing a hierarchical tree.
The widget is built wrapped inside a frame and includes a title label if the TITLE attribute is set. The main widget is a Perl/TK Scrolled Tree widget.
The RANGE attribute controls the possible selections. The value of the widget is the list of selections actually made by the user.
The MODE attribute controls the selection mode (``single'', ``browse'', ``multiple'').
If HEIGHT is provided it controls the height of the IOListboxTree in lines.
If DIALOG_BOX and DIALOG_BUTTON are provided, it will attempt to invoke the DIALOG_BUTTON of DIALOG when a double click happens on a leaf node.
This is a sample of a declaration of a IOListboxTree using the Manipulator method of IOPerl/TK. The tree structure is determined from the pathnames of the data items. The path elements are delimited by the SEP attribute, which defaults to ``/''.
Intermediate branches are added as needed, based on the path. In the example below, the Work and Work/Personal Queries branches would be created automatically for the first item in the list. Only original data elements are selectable - selecting the intermediate branch is automatically unselected.
my @q = ("Work/Personal Queries/Report 0", "Work/Public Queries/Aging Charts/Closed 30 Day report", "Work/Public Queries/Aging Charts/Open/7 Day report");
$IO->Manipulator("MyListboxTree", "Page2", "IOListboxTree", TITLE=>"IOListboxTree Demo", MODE => "single", HEIGHT => 10, RANGE => \@q, PACK=>[-side => "left", -fill => 'both']);
The IOListboxTree manipulator uses custom internal functions to modify or retrieve its range or value settings.
IOScrolledLabel subtype
$IO->Manipulator(name,parent,"IOScrolledLabel",key-values)>
This subtype method defines a scrolled label manipulator widget that shows the current value of a Parm object or a raw value passed in through the VALUE attribute. See the information on the IOLabel subtype for more information.
ManageValues(operation, value)
GETRANGE - retrieves widget's current range as a list reference SETRANGE - sets widget range to a list reference value GETVALUE - retrieves widget's current range as a list SETVALUE - sets widget value to list reference value
The value argument is only expected by the SET* operations. Note: Manipulators attached to Parm objects should automatically update their values when the parameter is changed.
new CQCC::IOPtkManip()