Move checkbox and radio button renders to ui.gadgets.buttons

release
Slava Pestov 2007-11-03 15:42:51 -04:00
parent 8584e7e95d
commit 1cac7d54a6
2 changed files with 24 additions and 26 deletions

View File

@ -95,6 +95,18 @@ repeat-button H{
repeat-button construct-empty
[ >r <bevel-button> r> set-gadget-delegate ] keep ;
TUPLE: checkmark-paint color ;
C: <checkmark-paint> checkmark-paint
M: checkmark-paint draw-interior
checkmark-paint-color gl-color
origin get [
rect-dim
{ 0 0 } over gl-line
dup { 0 1 } v* swap { 1 0 } v* gl-line
] with-translation ;
: checkmark-theme ( gadget -- )
f
f
@ -125,6 +137,18 @@ repeat-button H{
[ set-button-selected? ] <control>
dup checkbox-theme ;
TUPLE: radio-paint color ;
C: <radio-paint> radio-paint
M: radio-paint draw-interior
radio-paint-color gl-color
origin get { 4 4 } v+ swap rect-dim { 8 8 } v- 12 gl-fill-circle ;
M: radio-paint draw-boundary
radio-paint-color gl-color
origin get { 1 1 } v+ swap rect-dim { 2 2 } v- 12 gl-circle ;
: radio-knob-theme ( gadget -- )
f
f

View File

@ -140,32 +140,6 @@ M: polygon draw-interior
>r <polygon> <gadget> r> over set-rect-dim
[ set-gadget-interior ] keep ;
! Checkbox and radio button pens
TUPLE: checkmark-paint color ;
C: <checkmark-paint> checkmark-paint
M: checkmark-paint draw-interior
checkmark-paint-color gl-color
origin get [
rect-dim
{ 0 0 } over gl-line
dup { 0 1 } v* swap { 1 0 } v* gl-line
] with-translation ;
TUPLE: radio-paint color ;
C: <radio-paint> radio-paint
M: radio-paint draw-interior
radio-paint-color gl-color
origin get { 4 4 } v+ swap rect-dim { 8 8 } v- 12 gl-fill-circle ;
M: radio-paint draw-boundary
radio-paint-color gl-color
origin get { 1 1 } v+ swap rect-dim { 2 2 } v- 12 gl-circle ;
! Font rendering
SYMBOL: font-renderer