From 36b3356b42bb7c2699843eeb214247fc5b7b110a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 13 Feb 2009 01:43:03 -0600 Subject: [PATCH] ui.gadgets.buttons: New look for checkboxes and radio buttons --- basis/ui/gadgets/buttons/buttons.factor | 131 +++++++----------------- 1 file changed, 38 insertions(+), 93 deletions(-) diff --git a/basis/ui/gadgets/buttons/buttons.factor b/basis/ui/gadgets/buttons/buttons.factor index 346e1fd4d7..2f24166cc5 100644 --- a/basis/ui/gadgets/buttons/buttons.factor +++ b/basis/ui/gadgets/buttons/buttons.factor @@ -5,8 +5,8 @@ strings quotations assocs combinators classes colors colors.constants classes.tuple opengl opengl.gl math.vectors ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.labels ui.gadgets.theme ui.gadgets.tracks ui.gadgets.packs ui.gadgets.worlds ui.gestures -ui.pens ui.pens.solid ui.pens.caching math.rectangles locals -specialized-arrays.float fry combinators.smart ; +ui.pens ui.pens.solid ui.pens.image math.rectangles locals +fry combinators.smart ; IN: ui.gadgets.buttons TUPLE: button < border pressed? selected? quot ; @@ -21,8 +21,8 @@ TUPLE: button < border pressed? selected? quot ; hand-clicked get-global child? ; : button-update ( button -- ) - dup mouse-clicked? - over button-rollover? and + dup + [ mouse-clicked? ] [ button-rollover? ] bi and buttons-down? and >>pressed? relayout-1 ; @@ -45,28 +45,31 @@ button H{ :