bug fixes

cvs
Slava Pestov 2005-12-17 05:56:10 +00:00
parent 35c40cb781
commit 7573bc5198
3 changed files with 7 additions and 5 deletions

View File

@ -7,7 +7,7 @@ styles threads ;
TUPLE: button rollover? pressed? ;
: button-down? ( n -- ? ) hand get hand-buttons member? ;
: button-down? ( -- ? ) hand get hand-buttons empty? not ;
: mouse-over? ( gadget -- ? ) hand get hand-gadget child? ;
@ -15,7 +15,7 @@ TUPLE: button rollover? pressed? ;
: button-update ( button -- )
dup mouse-over? over set-button-rollover?
dup button-rollover? 1 button-down? and
dup button-rollover? button-down? and
over mouse-clicked? and over set-button-pressed?
relayout-1 ;

View File

@ -39,11 +39,13 @@ TUPLE: command-button object ;
command-name swons ;
: <command-menu> ( presented -- menu )
command-button-object dup applicable
dup applicable
[ <command-menu-item> ] map-with <menu> ;
: command-menu ( command-button -- )
dup button-update <command-menu> show-hand-menu ;
dup button-update
command-button-object <command-menu>
show-hand-menu ;
: command-button-actions ( gadget -- )
dup

View File

@ -18,7 +18,7 @@ C: hand ( -- hand )
: (button-gesture) ( buttons gesture -- )
swap hand get hand-clicked 3dup >r append r> handle-gesture
[ 3drop ] [ nip handle-gesture drop ] if ;
[ nip handle-gesture drop ] [ 3drop ] if ;
: button-gesture ( button gesture -- )
#! Send a gesture like [ button-down 2 ]; if nobody