Handbook
Glossary
draw-boundary ( gadget pen -- )
Factor handbook
»
UI framework
»
Implementing new gadgets
»
Customizing gadget appearance
»
UI pen protocol
Prev:
draw-interior ( gadget pen -- )
Vocabulary
ui
.
pens
Inputs
gadget
a
gadget
pen
an
object
Outputs
None
Generic word contract
Draws the boundary of a gadget by making OpenGL calls. The
boundary
slot may be set to objects implementing this generic word.
Definition
IN:
ui.pens
GENERIC:
draw-boundary
( gadget pen -- )
Methods
USING:
kernel
ui.gadgets.buttons
ui.pens
;
M:
button-pen
draw-boundary
lookup-button-pen
[
draw-boundary
]
[
drop
]
if*
;
USING:
accessors
opengl
sequences
ui.gadgets.grid-lines
ui.gadgets.grid-lines.private
ui.pens
;
M:
grid-lines
draw-boundary
color>>
gl-color
compute-grid-lines
[
first2
gl-line
]
each
;
USING:
accessors
arrays
colors
kernel
opengl
sequences
ui.gadgets.debug
ui.gadgets.labels
ui.pens
ui.text
;
M:
metrics-paint
draw-boundary
drop
COLOR:
red
gl-color
[
dim>>
]
[
>label<
line-metrics
]
bi
[
[
first
]
[
ascent>>
]
bi*
[
nip
0
swap
2array
]
[
2array
]
2bi
gl-line
]
[
drop
{
0 0
}
swap
gl-rect
]
2bi
;
USING:
accessors
kernel
opengl
opengl.gl
ui.pens
ui.pens.polygon
;
M:
polygon
draw-boundary
nip
[
color>>
gl-color
]
[
boundary-vertices>>
gl-vertex-pointer
]
[
[
GL_LINE_STRIP
0
]
dip
boundary-count>>
glDrawArrays
]
tri
;
USING:
accessors
kernel
math
opengl
opengl.gl
sequences
ui.pens
ui.pens.rounded
ui.pens.rounded.private
;
M:
rounded
draw-boundary
[
(rounded)
GL_LINE_STRIP
0
]
[
boundary-vertices>>
]
bi
[
gl-vertex-pointer
]
[
length
2/
glDrawArrays
]
bi
;
USING:
kernel
ui.gadgets.sliders.private
ui.pens
;
M:
slider-pen
draw-boundary
dupd
current-pen
draw-boundary
;
USING:
accessors
kernel
opengl
ui.pens
ui.pens.solid
ui.pens.solid.private
;
M:
solid
draw-boundary
[
(solid)
]
[
boundary-vertices>>
gl-vertex-pointer
]
bi
(gl-rect)
;
USING:
accessors
kernel
ui.pens
ui.render.test
;
M:
take-screenshot
draw-boundary
dup
first-time?>>
[
over
check-rendering
f
>>first-time?
]
when
2drop
;