OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [libgui/] [doc/] [tkTable.n] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\" The definitions below are for supplemental macros used in Tcl/Tk
2
'\" manual entries.
3
'\"
4
'\" .AP type name in/out ?indent?
5
'\"     Start paragraph describing an argument to a library procedure.
6
'\"     type is type of argument (int, etc.), in/out is either "in", "out",
7
'\"     or "in/out" to describe whether procedure reads or modifies arg,
8
'\"     and indent is equivalent to second arg of .IP (shouldn't ever be
9
'\"     needed;  use .AS below instead)
10
'\"
11
'\" .AS ?type? ?name?
12
'\"     Give maximum sizes of arguments for setting tab stops.  Type and
13
'\"     name are examples of largest possible arguments that will be passed
14
'\"     to .AP later.  If args are omitted, default tab stops are used.
15
'\"
16
'\" .BS
17
'\"     Start box enclosure.  From here until next .BE, everything will be
18
'\"     enclosed in one large box.
19
'\"
20
'\" .BE
21
'\"     End of box enclosure.
22
'\"
23
'\" .CS
24
'\"     Begin code excerpt.
25
'\"
26
'\" .CE
27
'\"     End code excerpt.
28
'\"
29
'\" .VS ?br?
30
'\"     Begin vertical sidebar, for use in marking newly-changed parts
31
'\"     of man pages.  If an argument is present, then a line break is
32
'\"     forced before starting the sidebar.
33
'\"
34
'\" .VE
35
'\"     End of vertical sidebar.
36
'\"
37
'\" .DS
38
'\"     Begin an indented unfilled display.
39
'\"
40
'\" .DE
41
'\"     End of indented unfilled display.
42
'\"
43
'\" .SO
44
'\"     Start of list of standard options for a Tk widget.  The
45
'\"     options follow on successive lines, in four columns separated
46
'\"     by tabs.
47
'\"
48
'\" .SE
49
'\"     End of list of standard options for a Tk widget.
50
'\"
51
'\" .OP cmdName dbName dbClass
52
'\"     Start of description of a specific option.  cmdName gives the
53
'\"     option's name as specified in the class command, dbName gives
54
'\"     the option's name in the option database, and dbClass gives
55
'\"     the option's class in the option database.
56
'\"
57
'\" .UL arg1 arg2
58
'\"     Print arg1 underlined, then print arg2 normally.
59
'\"
60
'\" SCCS: @(#) man.macros 1.8 96/02/15 20:02:24
61
'\"
62
'\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
63
.if t .wh -1.3i ^B
64
.nr ^l \n(.l
65
.ad b
66
'\"     # Start an argument description
67
.de AP
68
.ie !"\\$4"" .TP \\$4
69
.el \{\
70
.   ie !"\\$2"" .TP \\n()Cu
71
.   el          .TP 15
72
.\}
73
.ie !"\\$3"" \{\
74
.ta \\n()Au \\n()Bu
75
\&\\$1  \\fI\\$2\\fP    (\\$3)
76
.\".b
77
.\}
78
.el \{\
79
.br
80
.ie !"\\$2"" \{\
81
\&\\$1  \\fI\\$2\\fP
82
.\}
83
.el \{\
84
\&\\fI\\$1\\fP
85
.\}
86
.\}
87
..
88
'\"     # define tabbing values for .AP
89
.de AS
90
.nr )A 10n
91
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
92
.nr )B \\n()Au+15n
93
.\"
94
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
95
.nr )C \\n()Bu+\\w'(in/out)'u+2n
96
..
97
.AS Tcl_Interp Tcl_CreateInterp in/out
98
'\"     # BS - start boxed text
99
'\"     # ^y = starting y location
100
'\"     # ^b = 1
101
.de BS
102
.br
103
.mk ^y
104
.nr ^b 1u
105
.if n .nf
106
.if n .ti 0
107
.if n \l'\\n(.lu\(ul'
108
.if n .fi
109
..
110
'\"     # BE - end boxed text (draw box now)
111
.de BE
112
.nf
113
.ti 0
114
.mk ^t
115
.ie n \l'\\n(^lu\(ul'
116
.el \{\
117
.\"     Draw four-sided box normally, but don't draw top of
118
.\"     box if the box started on an earlier page.
119
.ie !\\n(^b-1 \{\
120
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
121
.\}
122
.el \}\
123
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
124
.\}
125
.\}
126
.fi
127
.br
128
.nr ^b 0
129
..
130
'\"     # VS - start vertical sidebar
131
'\"     # ^Y = starting y location
132
'\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
133
.de VS
134
.if !"\\$1"" .br
135
.mk ^Y
136
.ie n 'mc \s12\(br\s0
137
.el .nr ^v 1u
138
..
139
'\"     # VE - end of vertical sidebar
140
.de VE
141
.ie n 'mc
142
.el \{\
143
.ev 2
144
.nf
145
.ti 0
146
.mk ^t
147
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
148
.sp -1
149
.fi
150
.ev
151
.\}
152
.nr ^v 0
153
..
154
'\"     # Special macro to handle page bottom:  finish off current
155
'\"     # box/sidebar if in box/sidebar mode, then invoked standard
156
'\"     # page bottom macro.
157
.de ^B
158
.ev 2
159
'ti 0
160
'nf
161
.mk ^t
162
.if \\n(^b \{\
163
.\"     Draw three-sided box if this is the box's first page,
164
.\"     draw two sides but no top otherwise.
165
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
166
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
167
.\}
168
.if \\n(^v \{\
169
.nr ^x \\n(^tu+1v-\\n(^Yu
170
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
171
.\}
172
.bp
173
'fi
174
.ev
175
.if \\n(^b \{\
176
.mk ^y
177
.nr ^b 2
178
.\}
179
.if \\n(^v \{\
180
.mk ^Y
181
.\}
182
..
183
'\"     # DS - begin display
184
.de DS
185
.RS
186
.nf
187
.sp
188
..
189
'\"     # DE - end display
190
.de DE
191
.fi
192
.RE
193
.sp
194
..
195
'\"     # SO - start of list of standard options
196
.de SO
197
.SH "STANDARD OPTIONS"
198
.LP
199
.nf
200
.ta 4c 8c 12c
201
.ft B
202
..
203
'\"     # SE - end of list of standard options
204
.de SE
205
.fi
206
.ft R
207
.LP
208
See the \\fBoptions\\fR manual entry for details on the standard options.
209
..
210
'\"     # OP - start of full description for a single option
211
.de OP
212
.LP
213
.nf
214
.ta 4c
215
Command-Line Name:      \\fB\\$1\\fR
216
Database Name:  \\fB\\$2\\fR
217
Database Class: \\fB\\$3\\fR
218
.fi
219
.IP
220
..
221
'\"     # CS - begin code excerpt
222
.de CS
223
.RS
224
.nf
225
.ta .25i .5i .75i 1i
226
..
227
'\"     # CE - end code excerpt
228
.de CE
229
.fi
230
.RE
231
..
232
.de UL
233
\\$1\l'|0\(ul'\\$2
234
..
235
.TH table n 2.00 Tk "Tk Table Extension"
236
.HS table tk
237
.BS
238
.SH NAME
239
table \- Create and manipulate tables
240
.SH SYNOPSIS
241
\fBtable\fI \fIpathName \fR?\fIoptions\fR?
242
.SO
243
\-anchor        \-background    \-borderwidth   \-cursor
244
\-exportselection       \-font  \-foreground
245
\-highlightbackground   \-highlightcolor        \-highlightthickness
246
\-insertbackground      \-insertborderwidth     \-insertofftime
247
\-insertontime  \-insertwidth   \-invertselected        \-padx
248
\-pady  \-relief        \-takefocus     \-xscrollcommand
249
\-yscrollcommand
250
.SE
251
 
252
.SH "WIDGET-SPECIFIC OPTIONS"
253
.OP \-autoclear autoClear AutoClear
254
A boolean value which specifies whether the first keypress in a cell will
255
delete whatever text was previously there.  Defaults to 0.
256
.OP \-batchmode batchMode BatchMode
257
If true, updates are not forced out at any point, the widget waits for Tk to
258
be idle before it repaints the screen.  If false, flashes, variable updates
259
and the cursor changes are forced immediately to the screen.
260
Defaults to false.
261
.OP \-bordercursor borderCursor Cursor
262
Specifies the name of the cursor to show when over borders, a visual
263
indication that interactive resizing is allowed (it is thus affect by
264
the value of \-resizeborders).  Defaults to \fIcrosshair\fR.
265
.OP "\-browsecommand or \-browsecmd" browseCommand BrowseCommand
266
Specifies a command which will be evaluated anytime the active cell changes.
267
It uses the %\-substition model described in COMMAND SUBSTITUTION below.
268
.OP \-cache cache Cache
269
A boolean value that specifies whether an internal cache of the table
270
contents should be kept.  This greatly enhances speed performance when used
271
with \fB\-command\fR but uses extra memory.  Can maintain state when both
272
\fB\-command\fR and \fB\-variable\fR are empty.  The cache is automatically
273
flushed whenever the value of \fB\-cache\fR or \fB\-variable\fR changes,
274
otherwise you have to explicitly \fBflush\fR it.  Defaults to false.
275
.OP \-colorigin colOrigin Origin
276
Specifies what column index to interpret as the leftmost column in the table.
277
This value is used for user indices in the table.  Defaults to 0.
278
.OP \-cols cols Cols
279
Number of cols in the table.  Defaults to 10.
280
.OP \-colseparator colSeparator Separator
281
Specifies a separator character that will be interpreted as the column
282
separator when cutting or pasting data in a table.  By default, columns
283
are separated as elements of a tcl list.
284
.OP \-colstretchmode colStretchMode StretchMode
285
Specifies one of the following stretch modes for columns to fill extra
286
allocated window space:
287
.RS
288
.TP
289
\fBnone\fR
290
Columns will not stretch to fill the assigned window space.  If the columns
291
are too narrow, there will be a blank space at the right of the table.  This
292
is the default.
293
.TP
294
\fBunset\fR
295
Only columns that do not have a specific width set will be stretched.
296
.TP
297
\fBall\fR
298
All columns will be stretched by the same number of pixels to fill the
299
window space allocated to the table.  This mode can interfere with
300
interactive border resizing which tries to force column width.
301
.TP
302
\fBlast\fR
303
The last column will be stretched
304
to fill the window space allocated to the table.
305
.TP
306
\fBfill\fR (only valid for \fB\-rowstretch\fR currently)
307
The table will get more or less columns according to the window
308
space allocated to the table.  This mode has numerous quirks and
309
may disappear in the future.
310
.RE
311
.OP \-coltagcommand colTagCommand TagCommand
312
Provides the name of a procedure that will be evaluated by the widget to
313
determine the tag to be used for a given column.  When displaying a cell,
314
the table widget will first check to see if a tag has been defined using the
315
\fBtag col\fR widget method.  If no tag is found, it will evaluate the named
316
procedure passing the column number in question as the sole argument.  The
317
procedure is expected to return the name of a tag to use, or a null string.
318
Errors occuring during the evaluation of the procedure, or the return of an
319
invalid tag name are silently ignored.
320
.OP \-colwidth colWidth ColWidth
321
Default column width, interpreted as characters in the default font when
322
the number is positive, or pixels if it is negative.  Defaults to 10.
323
.OP \-command command Command
324
Specified a command to use as a procedural interface to cell values.
325
If \fB\-usecommand\fR is true, this command will be used instead of any
326
reference to the \fB\-variable\fR array.  When retrieving cell values,
327
the return value of the command is used as the value for the cell.
328
It uses the %\-substition model described in COMMAND SUBSTITUTION below.
329
.OP \-drawmode drawMode DrawMode
330
Sets the table drawing mode to one of the following options:
331
.RS
332
.TP
333
\fBslow\fR
334
The table is drawn to an offscreen pixmap using the Tk bordering functions.
335
This means there will be no flashing, but this mode is slow for all but
336
small tables.
337
.TP
338
\fBcompatible\fR
339
The table is drawn directly to the screen using the Tk border functions.
340
It is faster, but the screen may flash on update.  This is the default.
341
.TP
342
\fBfast\fR
343
The table is drawn directly to the screen and the borders are done with
344
fast X calls, so they are always one pixel wide only.  As a side effect,
345
it sets \fB\-borderwidth\fR to 1.  This mode provides best performance for
346
large tables, but can flash on redraw and is not 100% Tk compatible on the
347
border mode.
348
.TP
349
\fBsingle\fR
350
The table is drawn to the screen as in fast mode, but only single pixel
351
lines are drawn (not square borders).
352
.RE
353
.OP \-flashmode flashMode FlashMode
354
A boolean value which specifies whether cells should flash when their value
355
changes.  The table tag \fBflash\fR will be applied to these cells for the
356
duration specified by \fB\-flashtime\fR.  Defaults to 0.
357
.OP \-flashtime flashTime FlashTime
358
The amount of time, in 1/4 second increments, for which a cell should flash
359
when it is edited.  \fB\-flashmode\fR must be on.  Defaults to 2.
360
.OP \-height height Height
361
Specifies the desired height for the window, in rows.
362
If zero or less, then the desired height for the window is made just
363
large enough to hold all the rows in the table.  The height can be
364
further limited by \fB\-maxheight\fR.
365
.OP \-invertselected invertSelected InvertSelected
366
Specifies whether the foreground and background of an item should simply
367
have their values swapped instead of merging the \fIsel\fR tag options
368
when the cell is selected.  Defaults to 0 (merge).
369
.OP \-maxheight maxHeight MaxHeight
370
The max height in pixels that the window will request.  Defaults to 600.
371
.OP \-maxwidth maxWidth MaxWidth
372
The max width in pixels that the window will request.  Defaults to 800.
373
.OP \-resizeborders resizeBorders ResizeBorders
374
Specifies what kind of interactive border resizing to allow, must be one of
375
row, col, both (default) or none.
376
.OP \-rowheight rowHeight RowHeight
377
Default row height, interpreted as lines in the default font when
378
the number is positive, or pixels if it is negative.  Defaults to 1.
379
.OP \-roworigin rowOrigin Origin
380
Specifies what row index to interpret as the topmost row in the table.
381
This value is used for user indices in the table.  Defaults to 0.
382
.OP \-rows rows Rows
383
Number of rows in the table.  Defaults to 10.
384
.OP \-rowseparator rowSeparator Separator
385
Specifies a separator character that will be interpreted as the row
386
separator when cutting or pasting data in a table.  By default, rows
387
are separated as tcl lists.
388
.OP \-rowstretchmode rowStretchMode StretchMode
389
Specifies the stretch modes for rows to fill extra
390
allocated window space.  See \fB\-colstretchmode\fR for valid options.
391
.OP \-rowtagcommand rowTagCommand TagCommand
392
Provides the name of a procedure that can evaluated by the widget to
393
determine the tag to be used for a given row.  The procedure must be
394
defined by the user to accept a single argument (the row number), and
395
return a tag name or null string.  This operates in a similar manner as
396
\fB\-coltagcommand\fR, except that it applies to row tags.
397
.OP "\-selectioncommand or \-selcmd" selectionCommand SelectionCommand
398
Specifies a command to evaluate when the selection is retrieved from a table
399
via the selection mechanism (ie: evaluating "selection get").  The return
400
value from this command will become the string passed on by the selection
401
mechanism.  It uses the %\-substition model described in COMMAND SUBSTITUTION
402
below.
403
.OP \-selectmode selectMode SelectMode
404
Specifies one of several styles for manipulating the selection.  The value
405
of the option may be arbitrary, but the default bindings expect it to be
406
either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR, or \fBextended\fR; the
407
default value is \fBbrowse\fR.  These styles are like those for the Tk
408
listbox, except expanded for 2 dimensions.
409
.OP \-selecttitle selectTitles SelectTitles
410
Specifies whether title cells should be allowed in the selection.
411
Defaults to 0 (disallowed).
412
.OP \-selecttype selectType SelectType
413
Specifies one of several types of selection for the table.  The value of the
414
option may be one of \fBrow\fR, \fBcol\fR, \fBcell\fR, or \fBboth\fR
415
(meaning \fBrow && col\fR); the default value is \fBcell\fR.  These types
416
define whether an entire row/col is affected when a cell's selection is
417
changed (set or clear).
418
.OP \-state state State
419
Specifies one of two states for the entry:  \fBnormal\fR or \fBdisabled\fR.
420
If the table is disabled then the value may not be changed using widget
421
commands and no insertion cursor will be displayed, even if the input focus
422
is in the widget.  Defaults to \fBnormal\fR.
423
.OP \-titlecols titleCols TitleCols
424
Number of columns to use as a title area.  Defaults to 0.
425
.OP \-titlerows titleRows TitleRows
426
Number of rows to use as a title area.  Defaults to 0.
427
.OP \-usecommand useCommand UseCommand
428
A boolean value which specifies whether to use the \fBcommand\fR option.
429
This value sets itself to zero if \fBcommand\fR is used and returns an error.
430
Defaults to 1 (will use \fBcommand\fR if specified).
431
.OP \-validate validate Validate
432
A boolean specifying whether validation should occur for the active buffer.
433
Defaults to 0.
434
.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
435
Specifies a command to execute when the active cell is edited.  This command
436
is expected to return a Tcl boolean.  If it returns true, then it is assumed
437
the new value is OK, otherwise the new value is rejected (the edition will
438
not take place).  Errors in this command are handled in the background.  It
439
uses the %\-substition model described in COMMAND SUBSTITUTION below.
440
.OP \-variable variable Variable
441
Global Tcl array variable to attach to the table's C array.  It will be
442
created if it doesn't already exist or is a simple variable.  Keys used by
443
the table in the array are of the form \fIrow\fR,\fIcol\fR for cells and
444
the special key \fIactive\fR which contains the value of the active cell
445
buffer.  The Tcl array is managed as a sparse array (the table doesn't
446
require all valid indices have values).  No stored value for an index is
447
equivalent to the empty string, and clearing a cell will remove that index
448
from the Tcl array.
449
.OP \-width width Width
450
Specifies the desired width for the window, in columns.
451
If zero or less, then the desired width for the window is made just
452
large enough to hold all the columns in the table.  The width can be
453
further limited by \fB\-maxwidth\fR.
454
.BE
455
 
456
.SH DESCRIPTION
457
.PP
458
The \fBtable\fR command creates a 2\-dimensional grid of cells.  The table
459
can use a Tcl array variable or Tcl command for data storage and retrieval.
460
The widget has an active cell, the contents of which can be edited (when
461
the state is normal).  The widget supports a default style for the cells
462
and also multiple \fItags\fR, which can be used to change the style of a
463
row, column or cell (see TAGS for details).  A cell \fIflash\fR can be set
464
up so that changed cells will change color for a specified amount of time
465
("blink").  Cells can have embedded images or windows, as described in
466
TAGS and "EMBEDDED WINDOWS" respectively.
467
.PP
468
One or more cells may be selected as described below.  If a table is
469
exporting its selection (see \fB\-exportselection\fR option), then it will
470
observe the standard X11 protocols for handling the selection.  See THE
471
SELECTION for details.
472
.PP
473
It is not necessary for all the cells to be displayed in the table window at
474
once; commands described below may be used to change the view in the window.
475
Tables allow scrolling in both directions using the standard
476
\fB\-xscrollcommand\fR and \fB\-yscrollcommand\fR options.  They also support
477
scanning, as described below.
478
.PP
479
In order to obtain good performance, the table widget supports three drawing
480
modes, two of which are fully Tk compatible.
481
 
482
.SH "INDICES"
483
.PP
484
Many of the widget commands for tables take one or more indices as arguments.
485
An index specifies a particular cell of the table, in any of
486
the following ways:
487
.TP 12
488
\fInumber,number\fR
489
Specifies the cell as a numerical index of row,col which corresponds to the
490
index of the associated Tcl array, where \fB\-roworigin,\-colorigin\fR
491
corresponds to the first cell in the table (0,0 by default).
492
.TP 12
493
\fBactive\fR
494
Indicates the cell that has the location cursor.
495
It is specified with the \fBactivate\fR widget command.
496
.TP 12
497
\fBanchor\fR
498
Indicates the anchor point for the selection, which is set with the
499
\fBselection anchor\fR widget command.
500
.TP 12
501
\fBbottomright\fR
502
Indicates the bottom\-rightmost cell visible in the table.
503
.TP 12
504
\fBend\fR
505
Indicates the bottom right cell of the table.
506
.TP 12
507
\fBorigin\fR
508
Indicates the top\-leftmost editable cell of the table, not necessarily
509
in the display.  This takes into account the user specified origin and
510
title area.
511
.TP 12
512
\fBtopleft\fR
513
Indicates the top\-leftmost editable cell visible in the table (this
514
excludes title cells).
515
.TP 12
516
\fB@\fIx\fB,\fIy\fR
517
Indicates the cell that covers the point in the table window
518
specified by \fIx\fR and \fIy\fR (in pixel coordinates).  If no
519
cell covers that point, then the closest cell to that
520
point is used.
521
.LP
522
In the widget command descriptions below, arguments named \fIindex\fR,
523
\fIfirst\fR, and \fIlast\fR always contain text indices in one of
524
the above forms.
525
 
526
.SH TAGS
527
.PP
528
A tag is a textual string that is associated with zero or more rows, columns
529
or cells in a table.  Tags may contain arbitrary characters, but it is
530
probably best to avoid using names which look like indices.  There may be
531
any number of tags associated with rows, columns or cells in a table.  There
532
are several permanent tags in each table that can be configured by the user
533
and will determine the attributes for special cells:
534
.RS
535
.TP 10
536
\fBactive\fR
537
This tag is given to the \fIactive\fR cell
538
.TP 10
539
\fBflash\fR
540
If flash mode is on, this tag is given to any recently
541
edited cells.
542
.TP 10
543
\fBsel\fR
544
This tag is given to any selected cells.
545
.TP 10
546
\fBtitle\fR
547
This tag is given to any cells in the title rows and columns.  This
548
tag has \fB\-state\fR \fIdisabled\fR by default.
549
.RE
550
.PP
551
Tags control the way cells are displayed on the screen.
552
By default, cells are displayed as determined by the
553
\fBbackground\fR, \fBfont\fR, and \fBforeground\fR options for the
554
table widget.
555
However, display options may be associated with individual tags
556
using the ``\fIpathName \fBtag configure\fR'' widget command.
557
If a cell has been tagged, then the display options associated
558
with the tag override the default display style.
559
The following options are currently supported for tags:
560
.RS
561
.TP
562
\fB\-anchor \fIanchor\fR
563
Anchor for item in the cell space.
564
.TP
565
\fB\-background\fR or \fB\-bg\fR \fIcolor\fR
566
Background color of the cell
567
.TP
568
\fB\-font \fIfontName\fR
569
Font for text in the cell.
570
.TP
571
\fB\-foreground\fR or \fB\-fg\fR \fIcolor\fR
572
Foreground color of the cell.
573
.TP
574
\fB\-justify \fIjustify\fR
575
How to justify multi\-line text in a cell.
576
It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR.
577
.TP
578
\fB\-image \fIimageName\fR
579
An image to display in the cell instead of text.
580
.TP
581
\fB\-relief \fIrelief\fR
582
The relief for the cell.
583
.TP
584
\fB\-showtext \fIboolean\fR
585
Whether to show the text over an image.
586
.TP
587
\fB\-state \fIstate\fR
588
The state of the cell, to allow for certain cells to be disabled.
589
This prevents the cell from being edited by the \fIinsert\fR or \fIdelete\fR
590
methods, but a direct \fIset\fR will not be prevented.
591
.TP
592
\fB\-wrap \fIboolean\fR
593
Whether characters should wrap in a cell that is not wide enough.
594
.RE
595
.PP
596
A priority order is defined among tags, and this order is used in
597
implementing some of the tag\-related functions described below.  When a cell
598
is displayed, its properties are determined by the tags which are assigned
599
to it.  Including the special tags, this order is \fBflash\fR, \fBactive\fR,
600
\fBsel\fR, \fBtitle\fR, \fBcelltag\fR, \fBrowtag\fR, \fBcoltag\fR, default.
601
.PP
602
If a cell has several tags associated with it, and if their display options
603
conflict, then the options of the highest priority tag are used.  If a
604
particular display option hasn't been specified for a particular tag, or if
605
it is specified as an empty string, then that option will never be used; the
606
next\-highest\-priority tag's option will used instead.  If no tag specifies a
607
particular display option, then the default style for the widget will be
608
used.
609
.PP
610
Images are used for display purposes only.  Editing in that cell will still
611
be enabled and any querying of the cell will show the text value of the cell,
612
regardless of the value of \fB\-showtext\fR.
613
 
614
.SH "EMBEDDED WINDOWS"
615
.PP
616
There may be any number of embedded windows in a table widget (one per
617
cell), and any widget may be used as an embedded window (subject to the
618
usual rules for geometry management, which require the table window to be
619
the parent of the embedded window or a descendant of its parent).  The
620
embedded window's position on the screen will be updated as the table is
621
modified or scrolled, and it will be mapped and unmapped as it moves into
622
and out of the visible area of the table widget.  Each embedded window
623
occupies one cell's worth of space in the table widget, and it is referred
624
to by the index of the cell in the table.  Windows associated with the
625
table widget are destroyed when the table widget is destroyed.
626
.PP
627
Windows are used for display purposes only.  A value still exists for that
628
cell, but will not be shown unless the window is deleted in some way.
629
.PP
630
When an embedded window is added to a table widget with the window
631
configure widget command, several configuration options may be associated
632
with it.  These options may be modified with later calls to the window
633
configure widget command.  The following options are currently supported:
634
.RS
635
.TP
636
\fB\-create \fIscript\fR
637
NOT CURRENTLY SUPPORTED.  Specifies a Tcl script that may be evaluated to
638
create the window for the annotation.  If no \-window option has been
639
specified for this cell then this script will be evaluated when the
640
cell is about to be displayed on the screen.  Script must create a
641
window for the cell and return the name of that window as its result.
642
If the cell's window should ever be deleted, the script will be evaluated
643
again the next time the cell is displayed.
644
.TP
645
\fB\-background\fR or \fB\-bg\fR \fIcolor\fR
646
Background color of the cell.  If not
647
specified, it uses the table's default background.
648
.TP
649
\fB\-padx \fIpixels\fR
650
As defined in the Tk options man page.
651
.TP
652
\fB\-pady \fIpixels\fR
653
As defined in the Tk options man page.
654
.TP
655
\fB\-relief \fIrelief\fR
656
The relief to use for the cell in which the window lies.  If not
657
specified, it uses the table's default relief.
658
.TP
659
\fB\-sticky \fIsticky\fR
660
Stickiness of the window inside the cell, as defined by the \fBgrid\fR command.
661
.TP
662
\fB\-window \fIpathName\fR
663
Specifies the name of a window to display in the  annotation.  It must
664
exist before being specified here.
665
.RE
666
 
667
 
668
.SH "THE SELECTION"
669
.PP
670
Table selections are available as type STRING.  By default, the value of
671
the selection will be the values of the selected cells in nested Tcl list
672
form where each row is a list and each column is an element of a row list.
673
You can change the way this value is interpreted by setting the
674
\fB\-rowseparator\fR and \fB\-colseparator\fR options.  For example,
675
default Excel format would be to set \fB\-rowseparator\fR to "\\n" and
676
\fB\-colseparator\fR to "\\t".  Changes these values affects both how the
677
table sends out the selection and reads in pasted data, ensuring that the
678
table should always be able to cut and paste to itself.  It is possible to
679
change how pastes are handled by editing the table library procedure
680
\fBtk_tablePasteHandler\fR.  This might be necessary if
681
\fB\-selectioncommand\fR is set.
682
 
683
.SH "COMMAND SUBSTITUTION"
684
.PP
685
 
686
The various option based commands that the table supports all support the
687
familiar Tk %\-substitution model (see \fBbind\fR for more details).  The
688
following %\-sequences are recognized and substituted by the table widget:
689
.TP 5
690
\fB%c\fR
691
For \fBSelectionCommand\fR, it is the maximum number of columns in any
692
row in the selection.  Otherwise it is the column of the triggered cell.
693
.TP 5
694
\fB%C\fR
695
A convenience substitution for \fI%r\fR,\fI%c\fR.
696
.TP 5
697
\fB%i\fR
698
For \fBSelectionCommand\fR, it is the total number of cells in the selection.
699
For \fBCommand\fR, it is 0 for a read (get) and 1 for a write (set).
700
Otherwise it is the current cursor position in the cell.
701
.TP 5
702
\fB%r\fR
703
For \fBSelectionCommand\fR, it is the number of rows in the selection.
704
Otherwise it is the row of the triggered cell.
705
.TP 5
706
\fB%s\fR
707
For \fBValidateCommand\fR, it is the current value of the cell being validated.
708
For \fBSelectionCommand\fR, it is the default value of the selection.
709
For \fBBrowseCommand\fR, it is the index of the last active cell.
710
For \fBCommand\fR, it is empty for reads (get) and the current value of the
711
cell for writes (set).
712
.TP 5
713
\fB%S\fR
714
For \fBValidateCommand\fR, it is the potential new value of the cell
715
being validated.
716
For \fBBrowseCommand\fR, it is the index of the new active cell.
717
.TP 5
718
\fB%W\fR
719
The pathname to the window for which the command was generated.
720
.LP
721
 
722
.SH "WIDGET COMMAND"
723
.PP
724
The \fBtable\fR command creates a new Tcl command whose
725
name is \fIpathName\fR.  This command may be used to invoke various
726
operations on the widget.  It has the following general form:
727
.CS
728
\fIpathName option \fR?\fIarg arg ...\fR?
729
.CE
730
\fIOption\fR and the \fIarg\fRs
731
determine the exact behavior of the command.
732
.PP
733
The following commands are possible for \fBtable\fR widgets:
734
.TP
735
\fIpathName \fBactivate\fR \fIindex\fR
736
Sets the active cell to the one indicated by \fIindex\fR.
737
.TP
738
\fIpathName \fBbbox\fR \fIfirst\fR ?\fIlast\fR?
739
It returns the bounding box for the specified cell (range) as a 4\-tuple of
740
x, y, width and height in pixels.  It clips the box to the visible portion,
741
if any, otherwise an empty string is returned.
742
.TP
743
\fIpathName \fBborder\fR \fIoption args\fR
744
This command is a voodoo hack to implement border sizing for tables.  Its
745
options may change in the future.
746
.RS
747
.TP
748
\fIpathName \fBborder mark\fR \fIx y\fR ?\fIrow|col\fR?
749
Records \fIx\fR and \fIy\fR and the row and/or column border under that
750
point in the table window, if any; used in conjunction with later \fBborder
751
dragto\fR commands.  Typically this command is associated with a mouse
752
button press in the widget.  If \fIrow\fR or \fIcol\fR is not specified, it
753
returns a tuple of both border indices (an empty item means no border).
754
Otherwise, just the specified item is returned.
755
.TP
756
\fIpathName \fBborder dragto\fR \fIx y\fR.
757
This command computes the difference between its \fIx\fR and \fIy\fR
758
arguments and the \fIx\fR and \fIy\fR arguments to the last \fBborder
759
mark\fR command for the widget.  It then adjusts the previously marked
760
border by the difference.  This command is typically associated with mouse
761
motion events in the widget, to produce the effect of interactive border
762
resizing.
763
.RE
764
.TP
765
\fIpathName \fBcget\fR \fIoption\fR
766
Returns the current value of the configuration option given
767
by \fIoption\fR.  \fIOption\fR may have any of the values accepted
768
by the \fBtable\fR command.
769
.TP
770
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
771
Query or modify the configuration options of the widget.
772
If no \fIoption\fR is specified, returns a list describing all of
773
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
774
information on the format of this list).  If \fIoption\fR is specified
775
with no \fIvalue\fR, then the command returns a list describing the
776
one named option (this list will be identical to the corresponding
777
sublist of the value returned if no \fIoption\fR is specified).  If
778
one or more \fIoption\-value\fR pairs are specified, then the command
779
modifies the given widget option(s) to have the given value(s);  in
780
this case the command returns an empty string.
781
\fIOption\fR may have any of the values accepted by the \fBtable\fR
782
command.
783
.TP
784
\fIpathName \fBcurselection\fR ?\fIset value\fR?
785
With no arguments, it returns the sorted indices of the currently selected
786
cells.  Otherwise it sets all the selected cells to the given value.  The
787
set has no effect if there is no associated Tcl array or the state is
788
disabled.
789
.TP
790
\fIpathName \fBcurvalue\fR ?\fIvalue\fR?
791
If no value is given, the value of the cell being edited (indexed by
792
\fBactive\fR) is returned, else it is set to the given value.
793
.TP
794
\fIpathName \fBdelete\fR \fIoption arg\fR ?\fIarg\fR?
795
This command is used to delete various things in a table.  It has several
796
forms, depending on the \fIoption\fR:
797
.RS
798
.TP
799
\fIpathName \fBdelete active\fR \fIindex\fR ?\fIindex\fR?
800
Deletes text from the active cell.  If only one index is given, it deletes
801
the character after that index, otherwise it deletes from the first index to
802
the second.  \fIindex\fR can be a number, \fBinsert\fR or \fBend\fR.
803
.TP
804
\fIpathName \fBdelete cols\fR ?\fIswitches\fR? \fIindex\fR ?\fIcount\fR?
805
Deletes \fBcount\fR cols starting at (and including) col \fBindex\fR.  If
806
\fBcount\fR is negative, it deletes cols to the left.  Otherwise it deletes
807
cols to the right.  The selection will be cleared.  The optional switches
808
are:
809
.RS
810
.TP
811
\fB\-cols\fR
812
Sets an artificial maximum column boundary to use when collapsing the rest
813
of the columns.  By default it uses the value of the \fB\-cols\fR widget
814
option.  This can cause interesting side\-effects when used in conjunction
815
with the other options.
816
.TP
817
\fB\-holddimensions\fR
818
Causes the table cols to be unaffected by the deletion (empty cols may
819
appear).  By default the dimensions are adjusted by \fBcount\fR.
820
.TP
821
\fB\-holdtags\fR
822
Causes the tags specified by the \fItag\fR method to not collapse along
823
with the data.  Also prevents specific widths set by the \fIwidth\fR method
824
from being adjusted.  By default, these tags are properly adjusted.
825
.TP
826
\fB\-keeptitles\fR
827
Prevents title area cell contents from being moved.  Otherwise they are
828
treated just like regular cells and will move as specified.
829
.TP
830
\fB\-rows\fR
831
Sets an artificial maximum row boundary to use when collapsing the rest of
832
the rows.  By default it uses the value of the \fB\-rows\fR widget option.
833
This can cause interesting side\-effects when used in conjunction with the
834
other options.
835
.TP
836
\fB\-\-\fR
837
Signifies the end of the switches.
838
.RE
839
.TP
840
\fIpathName \fBdelete rows\fR ?\fIswitches\fR? \fIindex\fR ?\fIcount\fR?
841
Deletes \fBcount\fR rows starting at (and including) row \fBindex\fR.  If
842
\fBcount\fR is negative, it deletes rows going up.  Otherwise it deletes
843
rows going down.  The selection will be cleared.  The switches are the same
844
as those for column deletion.
845
.RE
846
.TP
847
\fIpathName \fBflush\fR ?\fIfirst\fR? ?\fIlast\fR?
848
Forces the table cache to be flushed from \fIfirst\fR to \fIlast\fR.  If
849
neither are specified, it flushes the entire cache.
850
.TP
851
\fIpathName \fBget\fR \fIfirst\fR ?\fIlast\fR?
852
Returns the value of the cells specified by the table indices \fIfirst\fR
853
and (optionally) \fIlast\fR in a list.
854
.TP
855
\fIpathName \fBheight\fR ?\fIrow\fR? ?\fIvalue row value ...\fR?
856
If no \fIrow\fR is specified, returns a list describing all rows for which
857
a height has been set.  If \fBrow\fR is specified with no value, it prints
858
out the height of that row in characters (positive number) or pixels
859
(negative number).  If one or more \fIrow\-value\fR pairs are specified,
860
then it sets each row to be that height in lines (positive number) or
861
pixels (negative number).  If \fIvalue\fR is \fIdefault\fR, then the row
862
uses the default height, specified by \fB\-rowheight\fR.
863
.TP
864
\fIpathName \fBicursor\fR ?\fIarg\fR?
865
With no arguments, prints out the location of the insertion cursor in the
866
active cell.  With one argument, sets the cursor to that point in the
867
string.  0 is before the first character, you can also use \fBinsert\fR or
868
\fBend\fR for the current insertion point or the end of the text.
869
.TP
870
\fIpathName \fBindex\fR \fIindex\fR ?\fIrow|col\fR?
871
Returns the integer cell coordinate that corresponds to \fIindex\fR in the
872
form row,col.  If \fBrow\fR or \fBcol\fR is specified, then only the row or
873
column index is returned.
874
.TP
875
\fIpathName \fBinsert\fR \fIoption arg arg\fR
876
This command is used to into various things into a table.  It has several
877
forms, depending on the \fIoption\fR:
878
.RS
879
.TP
880
\fIpathName \fBinsert active\fR \fIindex value\fR
881
The \fIvalue\fR is a text string which is inserted at the \fIindex\fR
882
postion of the active cell.  The cursor is then positioned after the
883
new text. \fIindex\fR can be a number, \fBinsert\fR or \fBend\fR.
884
.TP
885
\fIpathName \fBinsert cols\fR ?\fIswitches\fR? \fIindex\fR ?\fIcount\fR?
886
Inserts \fBcount\fR cols starting at col \fBindex\fR.  If \fBcount\fR is
887
negative, it inserts before the specified col.  Otherwise it inserts after
888
the specified col.  The selection will be cleared.  The switches are the
889
same as those for column deletion.
890
.TP
891
\fIpathName \fBinsert rows\fR ?\fIswitches\fR? \fIindex\fR ?\fIcount\fR?
892
Inserts \fBcount\fR rows starting at row \fBindex\fR.  If \fBcount\fR is
893
negative, it inserts before the specified row.  Otherwise it inserts after
894
the specified row.  The selection will be cleared.  The switches are the
895
same as those for column deletion.
896
.RE
897
.TP
898
\fIpathName \fBreread\fR
899
Rereads the old contents of the cell back into the editing buffer.  Useful
900
for a key binding when  is pressed to abort the edit (a default
901
binding).
902
.TP
903
\fIpathName \fBscan\fR \fIoption args\fR
904
This command is used to implement scanning on tables.  It has
905
two forms, depending on \fIoption\fR:
906
.RS
907
.TP
908
\fIpathName \fBscan mark\fR \fIx y\fR
909
Records \fIx\fR and \fIy\fR and the current view in the table
910
window;  used in conjunction with later \fBscan dragto\fR commands.
911
Typically this command is associated with a mouse button press in
912
the widget.  It returns an empty string.
913
.TP
914
\fIpathName \fBscan dragto\fR \fIx y\fR.
915
This command computes the difference between its \fIx\fR and \fIy\fR
916
arguments and the \fIx\fR and \fIy\fR arguments to the last \fBscan mark\fR
917
command for the widget.  It then adjusts the view by 5 times the difference
918
in coordinates.  This command is typically associated with mouse motion
919
events in the widget, to produce the effect of dragging the list at high
920
speed through the window.  The return value is an empty string.
921
.RE
922
.TP
923
\fIpathName \fBsee\fR \fIindex\fR
924
Adjust the view in the table so that the cell given by \fIindex\fR is
925
positioned as the cell one off from top left (excluding title rows and
926
columns) if the cell is not currently visible on the screen.  The actual
927
cell may be different to keep the screen full.
928
.TP
929
\fIpathName \fBselection\fR \fIoption arg\fR
930
This command is used to adjust the selection within a table.  It
931
has several forms, depending on \fIoption\fR:
932
.RS
933
.TP
934
\fIpathName \fBselection anchor\fR \fIindex\fR
935
Sets the selection anchor to the cell given by \fIindex\fR.  The selection
936
anchor is the end of the selection that is fixed while dragging out a
937
selection with the mouse.  The index \fBanchor\fR may be used to refer to
938
the anchor cell.
939
.TP
940
\fIpathName \fBselection clear\fR \fIfirst \fR?\fIlast\fR?
941
If any of the cells between \fIfirst\fR and \fIlast\fR (inclusive) are
942
selected, they are deselected.  The selection state is not changed for cells
943
outside this range.  \fIfirst\fR may be specified as \fBall\fR to remove
944
the selection from all cells.
945
.TP
946
\fIpathName \fBselection includes\fR \fIindex\fR
947
Returns 1 if the cell indicated by \fIindex\fR is currently
948
selected, 0 if it isn't.
949
.TP
950
\fIpathName \fBselection set\fR \fIfirst\fR ?\fIlast\fR?
951
Selects all of the cells in the range between \fIfirst\fR and \fIlast\fR,
952
inclusive, without affecting the selection state of cells outside that
953
range.
954
.RE
955
.TP
956
\fIpathName \fBset\fR \fIindex\fR ?\fIvalue\fR? ?\fIindex value ...\fR?
957
Sets the specified index to the associated value.  Table validation will not
958
be triggered via this method.
959
.TP
960
\fIpathName \fBtag\fR option ?\fIarg arg ...\fR?
961
This command is used to manipulate tags.  The exact behavior of the command
962
depends on the \fIoption\fR argument that follows the \fBtag\fR argument.
963
Only \fIcget\fR complains about unknown tag names.
964
The following forms of the command are currently supported:
965
.RS
966
.TP
967
\fIpathName \fBtag cell\fR \fItagName ?index ... ?\fR
968
With no arguments, prints out the list of cells that use the \fItag\fR.
969
Otherwise it sets the specified cells to use the \fItag\fR.  If \fItag\fR is
970
{}, the cells are reset to the default \fItag\fR.  Tags added during
971
\-*tagcommand evaluation do not register here.
972
.TP
973
\fIpathName \fBtag cget\fR \fItagName option\fR
974
This command returns the current value of the option named \fIoption\fR
975
associated with the tag given by \fItagName\fR.  \fIOption\fR may have any
976
of the values accepted by the \fBtag configure\fR widget command.
977
.TP
978
\fIpathName \fBtag col\fR \fItagName ?col ... ?\fR
979
With no arguments, prints out the list of cols that use the \fItag\fR.
980
Otherwise it sets the specified cols to use the \fItag\fR.  If \fItag\fR is
981
{}, the cols are reset to the default \fItag\fR.  Tags added during
982
\-coltagcommand evaluation do not register here.
983
.TP
984
\fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
985
This command is similar to the \fBconfigure\fR widget command except that
986
it modifies options associated with the tag given by \fItagName\fR instead
987
of modifying options for the overall table widget.  If no \fIoption\fR is
988
specified, the command returns a list describing all of the available
989
options for \fItagName\fR (see \fBTk_ConfigureInfo\fR for information on
990
the format of this list).  If \fIoption\fR is specified with no
991
\fIvalue\fR, then the command returns a list describing the one named
992
option (this list will be identical to the corresponding sublist of the
993
value returned if no \fIoption\fR is specified).  If one or more
994
\fIoption\-value\fR pairs are specified, then the command modifies the
995
given option(s) to have the given value(s) in \fItagName\fR; in this case
996
the command returns an empty string.
997
See TAGS above for details on the options available for tags.
998
.TP
999
\fIpathName \fBtag delete\fR \fItagName\fR
1000
Deletes a tag.  No error if the tag does not exist.
1001
.TP
1002
\fIpathName \fBtag exists\fR \fItagName\fR
1003
Returns 1 if the named tag exists, 0 otherwise.
1004
.TP
1005
\fIpathName \fBtag includes\fR \fItagName index\fR
1006
Returns 1 if the specified index has the named tag, 0 otherwise.
1007
.TP
1008
\fIpathName \fBtag names\fR ?\fIpattern\fR?
1009
If no pattern is specified, shows the names of all defined tags.
1010
Otherwise the \fIpattern\fR is used as a glob pattern to show only
1011
tags matching that pattern.
1012
.TP
1013
\fIpathName \fBtag row\fR \fItagName ?row ...?\fR
1014
With no arguments, prints out the list of rows that use the \fItag\fR.
1015
Otherwise it sets the specified rows to use the tag.  If tag is {}, the rows
1016
are reset to use the default tag.  Tags added during \-rowtagcommand
1017
evaluation do not register here.
1018
.RE
1019
.TP
1020
\fIpathName \fBvalidate\fR \fIindex\fR
1021
Explicitly validates the specified index based on the current
1022
\fB\-validatecommand\fR and returns 0 or 1 based on whether the cell was
1023
validated.
1024
.TP
1025
\fIpathName \fBwidth\fR ?\fIcol\fR? ?\fIvalue col value ...\fR?
1026
If no \fIcol\fR is specified, returns a list describing all cols for which
1027
a width has been set.  If \fBcol\fR is specified with no value, it prints
1028
out the width of that col in characters (positive number) or pixels
1029
(negative number).  If one or more \fIcol\-value\fR pairs are specified,
1030
then it sets each col to be that width in characters (positive number) or
1031
pixels (negative number).  If \fIvalue\fR is \fIdefault\fR, then the col
1032
uses the default width, specified by \fB\-colwidth\fR.
1033
.TP
1034
\fIpathName \fBwindow\fR option ?\fIarg arg ...\fR?
1035
This command is used to manipulate embedded windows.  The exact behavior of
1036
the command depends on the \fIoption\fR argument that follows the
1037
\fBwindow\fR argument.  The following forms of the command are currently
1038
supported:
1039
.RS
1040
.TP
1041
\fIpathName \fBwindow cget\fR \fIindex option\fR
1042
This command returns the current value of the option named \fIoption\fR
1043
associated with the window given by \fIindex\fR.  \fIOption\fR may have any
1044
of the values accepted by the \fBwindow configure\fR widget command.
1045
.TP
1046
\fIpathName \fBwindow configure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
1047
This command is similar to the \fBconfigure\fR widget command except that
1048
it modifies options associated with the embedded window given by
1049
\fIindex\fR instead of modifying options for the overall table widget.  If
1050
no \fIoption\fR is specified, the command returns a list describing all of
1051
the available options for \fIindex\fR (see \fBTk_ConfigureInfo\fR for
1052
information on the format of this list).  If \fIoption\fR is specified with
1053
no \fIvalue\fR, then the command returns a list describing the one named
1054
option (this list will be identical to the corresponding sublist of the
1055
value returned if no \fIoption\fR is specified).  If one or more
1056
\fIoption\-value\fR pairs are specified, then the command modifies the
1057
given option(s) to have the given value(s) in \fIindex\fR; in this case
1058
the command returns an empty string.
1059
See EMBEDDED WINDOWS above for details on the options available for windows.
1060
.TP
1061
\fIpathName \fBwindow delete\fR \fIindex\fR ?\fIindex ...\fR?
1062
Deletes an embedded window from the table.  The associated window will
1063
also be deleted.
1064
.TP
1065
\fIpathName \fBwindow move\fR \fIindexFrom indexTo\fR
1066
Moves an embedded window from one cell to another.  If a window already
1067
exists in the target cell, it will be deleted.
1068
.TP
1069
\fIpathName \fBwindow names\fR ?\fIpattern\fR?
1070
If no pattern is specified, shows the cells of all embedded windows.
1071
Otherwise the \fIpattern\fR is used as a glob pattern to show only
1072
cells matching that pattern.
1073
.RE
1074
.TP
1075
\fIpathName \fBxview \fIargs\fR
1076
This command is used to query and change the horizontal position of the
1077
information in the widget's window.  It can take any of the following
1078
forms:
1079
.RS
1080
.TP
1081
\fIpathName \fBxview\fR
1082
Returns a list containing two elements.
1083
Each element is a real fraction between 0 and 1;  together they describe
1084
the horizontal span that is visible in the window.
1085
For example, if the first element is .2 and the second element is .6,
1086
20% of the table's text is off\-screen to the left, the middle 40% is visible
1087
in the window, and 40% of the text is off\-screen to the right.
1088
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
1089
option.
1090
.TP
1091
\fIpathName \fBxview\fR \fIindex\fR
1092
Adjusts the view in the window so that the column given by
1093
\fIindex\fR is displayed at the left edge of the window.
1094
.TP
1095
\fIpathName \fBxview moveto\fI fraction\fR
1096
Adjusts the view in the window so that \fIfraction\fR of the
1097
total width of the table text is off\-screen to the left.
1098
\fIfraction\fR must be a fraction between 0 and 1.
1099
.TP
1100
\fIpathName \fBxview scroll \fInumber what\fR
1101
This command shifts the view in the window left or right according to
1102
\fInumber\fR and \fIwhat\fR.
1103
\fINumber\fR must be an integer.
1104
\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
1105
of one of these.
1106
If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
1107
\fInumber\fR character units (the width of the \fB0\fR character)
1108
on the display;  if it is \fBpages\fR then the view adjusts by
1109
\fInumber\fR screenfuls.
1110
If \fInumber\fR is negative then characters farther to the left
1111
become visible;  if it is positive then characters farther to the right
1112
become visible.
1113
.RE
1114
.TP
1115
\fIpathName \fByview \fI?args\fR?
1116
This command is used to query and change the vertical position of the
1117
text in the widget's window.  It can take any of the following forms:
1118
.RS
1119
.TP
1120
\fIpathName \fByview\fR
1121
Returns a list containing two elements, both of which are real fractions
1122
between 0 and 1.  The first element gives the position of the table element
1123
at the top of the window, relative to the table as a whole (0.5 means it is
1124
halfway through the table, for example).  The second element gives the
1125
position of the table element just after the last one in the window,
1126
relative to the table as a whole.  These are the same values passed to
1127
scrollbars via the \fB\-yscrollcommand\fR option.
1128
.TP
1129
\fIpathName \fByview\fR \fIindex\fR
1130
Adjusts the view in the window so that the row given by
1131
\fIindex\fR is displayed at the top of the window.
1132
.TP
1133
\fIpathName \fByview moveto\fI fraction\fR
1134
Adjusts the view in the window so that the element given by \fIfraction\fR
1135
appears at the top of the window.
1136
\fIFraction\fR is a fraction between 0 and 1;  0 indicates the first
1137
element in the table, 0.33 indicates the element one\-third the
1138
way through the table, and so on.
1139
.TP
1140
\fIpathName \fByview scroll \fInumber what\fR
1141
This command adjusts the view in the window up or down according to
1142
\fInumber\fR and \fIwhat\fR.  \fINumber\fR must be an integer.  \fIWhat\fR
1143
must be either \fBunits\fR or \fBpages\fR.  If \fIwhat\fR is \fBunits\fR,
1144
the view adjusts up or down by \fInumber\fR lines; if it is \fBpages\fR then
1145
the view adjusts by \fInumber\fR screenfuls.  If \fInumber\fR is negative
1146
then earlier elements become visible; if it is positive then later elements
1147
become visible.
1148
.RE
1149
 
1150
.SH "DEFAULT BINDINGS"
1151
.PP
1152
The initialization creates class bindings that give the
1153
following default behaviour:
1154
.IP [1]
1155
Clicking Button\-1 in a cell activates that cell.  Clicking
1156
into an already active cell moves the insertion cursor to the
1157
character nearest the mouse.
1158
.IP [2]
1159
Moving the mouse while Button\-1 is pressed will stroke out a selection area.
1160
Exiting while Button\-1 is pressed causing scanning to occur on the table
1161
along with selection.
1162
.IP [3]
1163
Moving the mouse while Button\-2 is pressed causes scanning to
1164
occur without any selection.
1165
.IP [4]
1166
Home moves the table to have the origin in view.
1167
.IP [5]
1168
End moves the table to have the \fBend\fR cell in view.
1169
.IP [6]
1170
Control\-Home moves the table to the origin and activates that cell.
1171
.IP [7]
1172
Control\-End moves the table to the end and activates that cell.
1173
.IP [8]
1174
Shift\-Control\-Home extends the selection to the origin.
1175
.IP [9]
1176
Shift\-Control\-End extends the selection to the end.
1177
.IP [10]
1178
The left, right, up and down arrows move the active cell.
1179
.IP [11]
1180
Shift\- extends the selection in that direction.
1181
.IP [12]
1182
Control\-leftarrow and Control\-rightarrow move the insertion
1183
cursor within the cell.
1184
.IP [13]
1185
Control\-slash selects all the cells.
1186
.IP [14]
1187
Control\-backslash clears selection from all the cells.
1188
.IP [15]
1189
Backspace deletes the character before the insertion cursor
1190
in the active cell.
1191
.IP [16]
1192
Delete deletes the character after the insertion cursor
1193
in the active cell.
1194
.IP [17]
1195
Escape rereads the value of the active cell from the specified data source,
1196
discarding any edits that have may been performed on the cell.
1197
.IP [18]
1198
Control\-a moves the insertion cursor to the beginning of the active cell.
1199
.IP [19]
1200
Control\-e moves the insertion cursor to the end of the active cell.
1201
.IP [20]
1202
Control\-minus and Control\-equals decrease and increase the
1203
width of the column with the active cell in it.
1204
.IP [21]
1205
Moving the mouse while Button\-3 (the right button on Windows) is pressed
1206
while you are over a border will cause interactive resizing of that row
1207
and/or column to occur, based on the value of \fB\-resizeborders\fR.
1208
.PP
1209
Some bindings may have slightly different behavior dependent on the
1210
\fB\-selectionmode\fR of the widget.
1211
.PP
1212
If the widget is disabled using the \fB\-state\fR option, then its
1213
view can still be adjusted and cells can still be selected,
1214
but no insertion cursor will be displayed and no cell modifications will
1215
take place.
1216
.PP
1217
The behavior of tables can be changed by defining new bindings for
1218
individual widgets or by redefining the class bindings.  The default
1219
bindings are either compiled in or read from a file expected to
1220
correspond to: "[lindex $tcl_pkgPath 0]/Tktable/tkTable.tcl".
1221
 
1222
.SH KEYWORDS
1223
table, widget, extension

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.