>lo-hi swap window move-hand fire-motion ;
:: handle-wm-mousewheel ( hWnd uMsg wParam lParam -- )
- wParam mouse-scroll hand-loc get hWnd window send-scroll ;
+ wParam mouse-scroll hand-loc get-global hWnd window send-scroll ;
: handle-wm-cancelmode ( hWnd uMsg wParam lParam -- )
#! message sent if windows needs application to stop dragging
IN: ui.gadgets.menus
: show-menu ( owner menu -- )
- [ find-world ] dip hand-loc get { 0 0 } <rect> show-glass ;
+ [ find-world ] dip hand-loc get-global { 0 0 } <rect> show-glass ;
GENERIC: <menu-item> ( target hook command -- button )
{ ---- } glue <commands-menu> ;
: show-operations-menu ( gadget target hook -- )
- <operations-menu> show-menu ;
\ No newline at end of file
+ <operations-menu> show-menu ;
: begin-selection ( pane -- )
f >>selecting?
- dup hand-loc get move-caret
+ dup hand-loc get-global move-caret
f >>mark
drop ;
hand-moved? [
[
dup selecting?>> [
- hand-loc get move-caret
+ hand-loc get-global move-caret
] [
- dup hand-clicked get child? [
+ dup hand-clicked get-global child? [
t >>selecting?
[ hand-clicked set-global ]
- [ hand-click-loc get move-caret ]
+ [ hand-click-loc get-global move-caret ]
[ caret>mark ]
tri
] [ drop ] if
: select-to-caret ( pane -- )
t >>selecting?
- [ dup mark>> [ dup caret>mark ] unless hand-loc get move-caret ]
+ [ dup mark>> [ dup caret>mark ] unless hand-loc get-global move-caret ]
[ com-copy-selection ]
[ request-focus ]
tri ;
300 milliseconds double-click-timeout set-global
: hand-moved? ( -- ? )
- hand-loc get hand-click-loc get = not ;
+ hand-loc get-global hand-click-loc get-global = not ;
: button-gesture ( gesture -- )
hand-clicked get-global propagate-gesture ;
dup hand-last-button get = ;
: multi-click-position? ( -- ? )
- hand-loc get hand-click-loc get distance 10 <= ;
+ hand-loc get-global hand-click-loc get-global distance 10 <= ;
: multi-click? ( button -- ? )
{