Handbook
Glossary
table
Factor handbook
»
UI framework
»
Building user interfaces
»
Pre-made UI gadgets
»
Table gadgets
Next:
table? ( object -- ? )
Vocabulary
ui
.
gadgets
.
tables
Definition
USING:
kernel
ui.gadgets.line-support
;
IN:
ui.gadgets.tables
TUPLE:
table
<
line-gadget
{
renderer
initial:
trivial-renderer
}
{
action
initial:
[
drop
]
}
single-click?
{
hook
initial:
[
drop
]
}
{
gap
initial:
2
}
column-widths
total-width focus-border-color mouse-color column-line-color
selection-required? selection-index selection mouse-index
{
takes-focus?
initial:
t
}
focused? rows
;
Methods
USING:
accessors
kernel
math.vectors
sequences
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
compute-column-widths
dup
rows>>
[
drop
0
{
}
]
[
[
drop
gap>>
]
[
initial-widths
]
[
]
2tri
[
row-column-widths
vmax
]
with
each
[
compute-total-width
]
keep
]
if-empty
;
USING:
combinators
kernel
namespaces
sequences
ui.gadgets
ui.gadgets.line-support
ui.gadgets.tables
ui.gadgets.tables.private
ui.render
;
M:
table
draw-gadget*
dup
control-value
empty?
[
drop
]
[
dup
line-height
\
line-height
[
{
[
draw-selected-row
]
[
draw-lines
]
[
draw-column-lines
]
[
draw-focused-row
]
[
draw-moused-row
]
}
cleave
]
with-variable
]
if
;
USING:
accessors
ui.gadgets.line-support
ui.gadgets.tables
ui.gadgets.tables.private
;
M::
table
draw-line
( row index table -- )
row table
renderer>>
row-columns
table
column-widths>>
table
table-column-alignment
row index
table
row-font
table
gap>>
draw-columns
;
USING:
kernel
ui.gadgets
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
layout*
[
update-cached-widths
]
[
update-filled-column
]
bi
;
USING:
accessors
kernel
math
math.order
sequences
ui.gadgets.line-support
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
line-height*
[
font>>
]
[
renderer>>
prototype-row
]
bi
[
cell-dim
+
nip
]
with
[
max
]
map-reduce
;
USING:
kernel
models
ui.gadgets
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
model-changed
nip
dup
update-table-rows
dup
update-selection
dup
update-mouse-index
[
update-status
]
[
relayout
]
bi
;
USING:
arrays
kernel
math
sequences
ui.gadgets
ui.gadgets.line-support
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
pref-dim*
[
compute-column-widths
drop
]
keep
[
line-height
]
[
control-value
length
]
bi
*
2array
;
USING:
accessors
kernel
ui.gadgets.scrollers
ui.gadgets.tables
ui.gadgets.tables.private
;
M:
table
viewport-column-header
dup
renderer>>
column-titles
[
<column-headers>
]
[
drop
f
]
if
;