Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / TixGrid.pod
CommitLineData
86530b38
AT
1# Copyright (c) 1996, Expert Interface Technologies
2# See the file "license.terms" for information on usage and
3# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
4# The file man.macros and some of the macros used by this file are
5# copyrighted: (c) 1990 The Regents of the University of California.
6# (c) 1994-1995 Sun Microsystems, Inc.
7# The license terms of the Tcl/Tk distribution are in the file
8# license.tcl.
9
10## TO CHECK:
11##
12## callback: checked for defined of code ref (compare -edit*cmd)
13##
14## option
15## formatcmd mentions format method but there is no format
16## method documented
17##
18## methods:
19## bdtype: what is it? no description given
20## see: not documented? Not implemented??
21##
22## todo: missing peaces marked by ????
23
24=head1 NAME
25
26Tk::TixGrid - Create and manipulate Tix Grid widgets
27
28=for pm TixGrid/TixGrid.pm
29
30=for category Tix Extensions
31
32=head1 SYNOPSIS
33
34S< >I<$tixgrid> = I<$parent>->B<TixGrid>?(I<options>)?;
35
36 The port of C code and bindings is done but needs
37 debugging. THERE ARE KNOWN BUGS. Work in progress ...
38
39=head1 STANDARD OPTIONS
40
41B<-background>
42 B<-borderwidth>
43 B<-cursor>
44 B<-font>
45 B<-foreground>
46 B<-height>
47 B<-highlightbackground>
48 B<-highlightcolor>
49 B<-highlightthickness>
50 B<-padx>
51 B<-pady>
52 B<-relief>
53 B<-selectbackground>
54 B<-selectborderwidth>
55 B<-selectforeground>
56 B<-state>
57 B<-takefocus>
58 B<-width>
59 B<-xscrollcommand>
60 B<-yscrollcommand>
61
62See L<Tk::options> for details of the standard options.
63
64=head1 WIDGET-SPECIFIC OPTIONS
65
66=over 4
67
68=item Name: B<browseCmd>
69
70=item Class: B<BrowseCmd>
71
72=item Switch: B<-browsecmd>
73
74?docu here? Not in configure output but used in bindings ??!!
75
76If defined, gives a perl/Tk L<callback|Tk::callbacks>
77to be executed when the
78user browses a grid cell (This is normally the case when
79the user clicks on an entry). When this callback is called, it is
80passed with two additional parameters: I<x> I<y>, where (I<x>,I<y>)
81is the location of the cell that has just been clicked.
82
83=item Name: B<Command>
84
85=item Class: B<Command>
86
87=item Switch: B<-command>
88
89?docu here? Not in configure output but used in bindings ??!!
90
91=item Name: B<editDoneCmd>
92
93=item Class: B<EditDoneCmd>
94
95=item Switch: B<-editdonecmd>
96
97If defined, gives a perl/Tk L<callback|Tk::callbacks>
98to be executed when the
99user has edited grid cell. When this callback is called, it is
100passed with two additional parameters: I<x> I<y>, where (I<x>,I<y>)
101is the location of the cell that has just been edited.
102
103=item Name: B<editNotifyCmd>
104
105=item Class: B<EditNotifyCmd>
106
107=item Switch: B<-editnotifycmd>
108
109If defined gives a perl/Tk L<callback|Tk::callbacks>
110to be executed when the user tries to edit a grid cell.
111When this callback is called, it is passed with two additional
112parameters: I<x> I<y>, where (I<x>,I<y>,) is the location
113of the cell. This callback should return a boolean value: B<true>
114indicates that the cell is editable and B<false> otherwise.
115
116=item Name: B<FloatingCols>
117
118=item Class: B<floatingCols>
119
120=item Switch: B<-floatingcols>
121
122Defines the number of columns that fixed when the widget
123is horizontally scrolled. These column(s)
124can be used as label(s) for the column(s). The floating column(s)
125can be configured in the B<-formatcmd> callback with the
126B<formatBorder> method. The default value is 0.
127
128=item Name: B<FloatingRows>
129
130=item Class: B<floatingRows>
131
132=item Switch: B<-floatingrows>
133
134Defines the number of rows that are fixed when the widget
135is vertically scrolled. These row(s)
136can be used as label(s) for the row(s). The floating row(s)
137can be configured in the B<-formatcmd> callback with the
138B<formatBorder> method. The default value is 0.
139
140=item Name: B<formatCmd>
141
142=item Class: B<FormatCmd>
143
144=item Switch: B<-formatcmd>
145
146If defined, gives a perl/Tk L<callback|Tk::callbacks> to be
147executed when the grid cells need to be formatted on the screen.
148Normally, this callback calls the B<format> method (see below).
149When this callback is called, it is passed with five additional
150parameters: I<type> I<x1> I<y1> I<x2> I<y2>. I<type> gives the
151logical type of the region in the grid. It may be one of the
152following.
153
154=over 8
155
156=item B<x-region>
157
158the horizontal margin
159
160=item B<y-region>
161
162the vertical margin
163
164=item B<s-region>
165
166the area where the horizontal and vertical margins are joined
167
168=item B<main>
169
170all the cells that do not fall into the above three types
171
172=back
173
174I<x1> I<y1> I<x2> I<y2> gives the extent of the region that needs
175formatting.
176
177=item Name: B<leftMargin>
178
179=item Class: B<LeftMargin>
180
181=item Switch: B<-leftmargin>
182
183In the number of cells, gives the width of vertical margin.
184A zero indicates that no vertical should be drawn.
185
186=item Name: B<itemType>
187
188=item Class: B<ItemType>
189
190=item Switch: B<-itemtype>
191
192?docu here?
193
194=item Name: B<selectMode>
195
196=item Class: B<SelectMode>
197
198=item Switch: B<-selectmode>
199
200Specifies one of several styles for manipulating the selection.
201The value of the option may be arbitrary, but the default bindings
202expect it to be either B<single>, B<browse>, B<multiple>, or B<extended>;
203the default value is B<single>.
204
205=item Name: B<selectUnit>
206
207=item Class: B<SelectUnit>
208
209=item Switch: B<-selectunit>
210
211Specifies the selection unit. Valid values are B<cell>, B<column> or B<row>.
212
213=item Name: B<sizeCmd>
214
215=item Class: B<SizeCmd>
216
217=item Switch: B<-sizecmd>
218
219?docu here?
220
221=item Name: B<topMargin>
222
223=item Class: B<TopMargin>
224
225=item Switch: B<-topmargin>
226
227In the number of cells, gives the height of horizontal margin.
228A zero indicates that no horizontal should be drawn.
229
230=back
231
232=head1 DESCRIPTION
233
234The B<TixGrid> method creates a TixGrid new window and returns a
235blessed reference of this TixGrid widget.
236Additional options,
237described above, may be specified on the command line or in the
238option database to configure aspects of the B<TixGrid> widget
239such as its cursor and relief.
240
241A Grid widget displays its contents in a two dimensional grid of cells.
242Each cell may contain one Tix display item, which may be in text,
243graphics or other formats. See L<Tk::DItem> for more information
244about Tix display items. Individual cells, or groups of cells,
245can be formatted with a wide range of attributes, such as its color,
246relief and border.
247
248=head1 WIDGET METHODS
249
250The B<TixGrid> method creates a TixGrid widget and returns a blessed
251reference of this TixGrid widget. This reference may be used to
252invoke various operations on the widget. It has the following general
253form:
254
255S< >I<$tixgrid>->B<method>?(I<arg, arg, ...>)?
256
257I<arg>s determine the exact behavior of the method. The following
258methods are possible for B<TixGrid> widgets:
259
260=over 4
261
262=item I<$tixgrid>->B<anchor>(I<action>, I<x>, I<y>)
263
264=item I<$tixgrid>->B<anchor>I<Action>(I<x>, I<y>)
265
266Manipulates the B<anchor cell> of the B<TixGrid> widget.
267The anchor cell is the end of the selection that is fixed
268while the user is dragging out a selection with the mouse.
269I<Action> can be B<clear>, B<get> or B<set>. If I<action>
270is B<clear>, I<x> and I<y> args are not accepted.
271
272=item I<$tixgrid>->B<bdtype>(I<x>, I<y> ?,I<xbdWidth>, I<ybdWidth>?)
273
274????
275
276=item I<$tixgrid>->B<cget>('I<-option>')
277
278Returns the current value of the configuration option given
279by I<-option>. I<-option> may have any of the values accepted
280by the B<TixGrid> constructor method.
281
282=item I<$tixgrid>->B<configure>(?I<-option>??=>I<value>, I<-option>=>I<value>, I<...>?)
283
284Query or modify the configuration options of the widget.
285If no I<-option> is specified, returns a list describing all
286of the available options for I<$tixgrid> (see B<Tk_ConfigureInfo>
287for information on the format of this list.) If I<-option> is
288specified with no I<value>, then the method returns a list describing
289the one named option (this list will be identical to the corresponding
290sublist of the value returned if no I<-option> is specified).
291If one or more I<option-value> pairs are specified, then the
292method modifies the given widget option(s) to have the given value(s);
293in this case the method returns an empty string. I<-option> may have
294any of the values accepted by the B<TixGrid> constructor method.
295
296=item I<$tixgrid>->B<delete>(I<dim>, I<from>?, I<to>?)
297
298=item I<$tixgrid>->B<deleteColumn>(I<from>?, I<to>?)
299
300=item I<$tixgrid>->B<deleteRow>(I<from>?, I<to>?)
301
302I<Dim> may be B<row> or B<column>. If I<to> is not given,
303deletes a single row (or column) at the position I<from>.
304If I<to> is given, deletes the range of rows (or columns)
305from position I<from> through I<to>.
306
307=item I<$tixgrid>->B<dragsite>(I<option>, I<x>, I<y>)
308
309?docu here? not implemented :-(
310
311=item I<$tixgrid>->B<dropsite>(I<option>, I<x>, I<y>)
312
313?docu here? not implemented :-(
314
315=item I<$tixgrid>->B<editApply>
316
317If any cell is being edited, de-highlight the cell and
318applies the changes.
319
320=item I<$tixgrid>->B<editSet>(I<x>, I<y>)
321
322Highlights the cell at (I<x>,I<y>) for editing,
323if the B<-editnotify> callback returns true for this cell.
324
325=item I<$tixgrid>->B<entrycget>(I<x>, I<y>, 'I<-option>')
326
327Returns the current value of the configuration option given by
328I<-option> of the cell at (I<x>,I<y>). I<-option> may have any
329of the values accepted by the B<set> method.
330
331=item I<$tixgrid>->B<entryconfigure>(I<x>, I<y>?, I<-option>??=>I<value>, I<-option>=>I<value>, I<...>?)
332
333Query or modify the configuration options of the cell at (I<x>,I<y>).
334If no I<-option> is specified, returns a list describing all of the
335available options for the cell (see B<Tk_ConfigureInfo> for information
336on the format of this list.) If I<-option> is specified with no
337I<value>, then the method returns a list describing the one named
338option (this list will be identical to the corresponding sublist
339of the value returned if no I<-option> is specified.) If one or
340more I<option-value> pairs are specified, then the method modifies
341the given widget option(s) to have the given value(s); in this case
342the method returns an empty string. I<Option> may have any of the
343values accepted by the B<set> method.
344
345=item I<$tixgrid>->B<format>(I<option>, ?I<args>, ...?)
346
347=item I<$tixgrid>->B<formatBorder>(I<x1,y1>, I<x2,y2>, I<options>);
348
349=item I<$tixgrid>->B<formatGrid>(I<x1,y1>, I<x2,y2>, I<options>);
350
351the B<format> method can only be called by the B<-formatcmd> callback
352of the tixGrid widget.
353
354?docu complete?
355
356=item I<$tixgrid>->B<geometryinfo>(?I<width>, ?I<height>, ...?)
357
358?docu here? Return a list of 4 floats! Currently "{first1 last1} {first2,last2}" :-(
359
360=item I<$tixgrid>->B<index>(I<$coordx>, I<$coordy>)
361
362?docu here?
363
364retuns I<(nx, ny)> of entry at position (I<$coordx>, I<$coordy>).
365(??widget or screen offset??)
366
367=item I<$tixgrid>->B<info>(I<option>, ?I<args>, ...?)
368
369?docu here?
370
371=item I<$tixgrid>->B<move>(I<dim>, I<from>, I<to>, I<offset>)
372
373=item I<$tixgrid>->B<moveColumn>(I<from>, I<to>, I<offset>)
374
375=item I<$tixgrid>->B<moveRow>(I<from>, I<to>, I<offset>)
376
377I<Dim> may be B<row> or B<column>. Moves the range of rows
378(or columns) from position I<from> through I<to> by the distance
379indicated by I<offset>. For example,
380I<$tixgrid>->B<moveRow>(B<2>, B<4>, B<1>) moves the rows 2,3,4
381to rows 3,4,5.
382
383=item I<$tixgrid>->B<nearest>(I<x>, I<y>)
384
385?docu here? screen pos (pixels) to entry (nx,ny) translation.
386
387=item I<$tixgrid>->B<selection>(I<option>, I<x1>, I<y1> ?,I<x2>, I<y2>?)
388
389=item I<$tixgrid>->B<selection>I<Option>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
390
391Option one of: B<adjust>, B<clear>, B<includes>, B<set>, and B<toggle>.
392
393x1 (y1) has not to be greater than x2 (y2), but only x2 and y2 can be 'max'.
394
395BUG: I<selection includes>: has no visible effect (as in Tix). Eh???
396
397BUG: I<selection clear>: only works for 0, 0, max, max (as in Tix). Eh???
398
399When I<x2, y2> are not given they default to I<x1, y1>, respectively.
400
401=over 8
402
403=item I<$tixgrid>->B<selectionAdjust>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
404
405?docu here?
406
407=item I<$tixgrid>->B<selectionClear>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
408
409?docu here?
410
411=item I<$tixgrid>->B<selectionIncludes>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
412
413?docu here?
414
415=item I<$tixgrid>->B<selectionSet>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
416
417?docu here?
418
419=item I<$tixgrid>->B<selectionToggle>(I<x1>, I<y1> ?,I<x2>, I<y2>?)
420
421?docu here?
422
423=back
424
425=item I<$tixgrid>->B<set>(I<x>, I<y>?, B<-itemtype>=>I<type>??, I<-option>=>I<value>, I<...>?)
426
427Creates a new display item at the cell at (I<x>,I<y>). The optional
428B<-itemtype> parameter gives the type of the display item.
429An additional list of I<option-value> pairs specify options
430of the display item. If a display item already exists at this cell,
431the old item will be deleted automatically.
432
433=item I<$tixgrid>->B<size>(I<dim>, I<index>?, I<-option>??=>I<value>, I<...>?)
434
435=item I<$tixgrid>->B<sizeColumn>(I<index>?, I<-option>??=>I<value>, I<...>?)
436
437=item I<$tixgrid>->B<sizeRow>(I<index>?, I<-option>??=>I<value>, I<...>?)
438
439Queries or sets the size of the row or column given by I<dim> and
440I<index>. I<Dim> may be B<row> or B<column>. I<Index> may be any
441non-negative integer that gives the position of a given row (or column).
442I<Index> can also be the string B<default>; in this case, this method
443queries or sets the default size of all rows (or columns).
444When no I<option-value> pair is given, this method returns
445a list containing the current size setting of the given row (or column).
446When I<option-value> pairs are given, the corresponding options
447of the size setting of the given row are changed. I<-option> may be
448one of the following:
449
450=over 8
451
452=item B<-pad0> => I<pixels>
453
454Specifies the paddings to the left of a column or the top of a row.
455
456=item B<-pad1> => I<pixels>
457
458Specifies the paddings to the right of a column or the bottom of a row.
459
460=item B<-size> => I<val>
461
462Specifies the width of a column or the height of a row.
463I<Val> may be: B<auto> -- the width of the column is set
464the widest cell in the column; a valid Tk screen distance
465unit (see B<Tk_GetPixels>); or a real number following by the
466word B<chars> (e.g. B<3.4chars>) that sets the width of the
467column to the given number of characters.
468
469=back
470
471=item I<$tixgrid>->B<sort>(I<dimension>, I<start>, I<end>, ?I<args ...>?)
472
473?docu here? (not supported on Win* OSs up to now)
474
475=item I<$tixgrid>->B<unset>(I<x>, I<y>)
476
477Clears the cell at (I<x>,I<y>) by removing its display item.
478
479=item I<$tixgrid>->B<xview>
480
481?docu here?
482
483=item I<$tixgrid>->B<yview>
484
485?docu here?
486
487=back
488
489=head1 BINDINGS
490
491to be done.
492
493=head1 SEE ALSO
494
495L<Tk::DItem|Tk::DItem>
496L<Tk::callbacks|Tk::callbacks>
497L<Tk::FloatEntry|Tk::FloatEntry>
498
499=head1 BUGS
500
501C code and bindings of TixGrid have some bugs.
502
503=head1 KEYWORDS
504
505tix, tixgrid, table, display item, spreadsheet
506
507=cut
508