.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "TableMatrix::SpreadsheetHideRows 3pm" .TH TableMatrix::SpreadsheetHideRows 3pm 2024-03-07 Tk1.29 "perl/Tk Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tk::TableMatrix::SpreadsheetHideRows \- Table Display with selectable hide/un\-hide of rows .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Tk; \& use Tk::TableMatrix::SpreadsheetHideRows \& \& my $t = $top\->Scrolled(\*(AqSpreadsheetHideRows\*(Aq, \& \-selectorCol => 3, \& \-expandData => $hashRef, \& \-rows => 21, \-cols => 11, \& \-width => 6, \-height => 6, \& \-titlerows => 1, \-titlecols => 1, \& \-variable => $arrayVar, \& \-selectmode => \*(Aqextended\*(Aq, \& \-resizeborders => \*(Aqboth\*(Aq, \& \-bg => \*(Aqwhite\*(Aq, \& ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Tk::TableMatrix::SpreadsheetHideRows is a Tk::TableMatrix::Spreadsheet\-derived widget that implements a Spreadsheet-like display of tabular information, where some of the rows in the table can be expanded/hidden by clicking a '+/\-' selector in the row. This can be used to display top-level information in a table, while allowing the user to expand certain table rows to view detail-level information. .PP See demos/SpreadsheetHideRows in the source distribution for a simple example of this widget .SH "Widget-specific Options" .IX Header "Widget-specific Options" In addition the standard Tk::TableMatrix widget options. The following options are implemented: .IP \-selectorCol 1 .IX Item "-selectorCol" Column number where the +/\- selector will appear. Clicking on the +/\- selector will expand/hide the detail information in the table for a particular row. .IP \-selectorColWidth 1 .IX Item "-selectorColWidth" Width of the column used to display the +/\- selector. Defaults to 2 .IP \-expandData 1 .IX Item "-expandData" Hash ref defining the detail-level data displayed when a row is expanded (by clicking the +/\- selector). This hash ref should have the following structure: .Sp .Vb 10 \& $expandData = { \& row1 => { tag => \*(AqdetailDataTag\*(Aq, \& data => $detailData, \& spans=> $spanData, \& expandData => $subLevelData \& }, \& row2 => { \& . \& . \& } \& \& Where: \& row1, row2, ... Row numbers that will be expandable. \& tag => \*(AqdetailDataTag\*(Aq Tag name that will be applied to the detail data. \& (optional) \& $detailData 2D Array of detail\-data to be displayed when \& the row is expanded. \& e.g. [ [ r1c1, r1c2, r1c3 ], \& [ r2c1, r2c2, r2,c3] ] \& $spans 1D array of span information (optional) to be \& used for display of the detail information. \& e.g. [ col2 => "rows,cols", col4 => "rows,cols", ... ] \& \& $subLevelData Optional Recursive expandData used to hold detail\-data of detail\-data. .Ve .SH "MEMBER DATA" .IX Header "MEMBER DATA" The following items are stored as member data .IP defaultCursor 1 .IX Item "defaultCursor" Name of the mouse cursor pointer that is used for normal (i.e. non-title, non-indicator) cells in the widget. This is set to the value of the \f(CW$widget\fR\->cget(\-cursor) option when the widget is created. .IP indRowCols 1 .IX Item "indRowCols" Hash ref of Row/Cols indexes where there are indicators stores. This is a quick lookup hash built from \fI_expandData\fR. .IP _expandData 1 .IX Item "_expandData" Internal version of the \fIexpandData\fR hash. Any sub-detail data (i.e. expand data that is at lower levels of \fIexpandData\fR) that is visible is placed at the top level of this hash, for keeping track of the visible \fIexpandData\fR. .SH "Widget Methods" .IX Header "Widget Methods" In addition the standard Tk::TableMatrix widget method. The following methods are implemented: .SS showDetail .IX Subsection "showDetail" Shows (i.e. expands the table) the detail data for a given row. This method is called when a user clicks on an indicator that is not already expanded. .PP \&\fBUsage:\fR .PP .Vb 1 \& $widget\->showDetail($row); \& \& # Shows the detail data for row number $row .Ve .SS hideDetail .IX Subsection "hideDetail" Hides the detail data for a given row. This method is called when a user clicks on an indicator that is already expanded. .PP \&\fBUsage:\fR .PP .Vb 1 \& $widget\->hideDetail($row); \& \& # Hides the detail data for row number $row .Ve