ui: hand-loc and hand-click-loc should be global.
parent
f1c62deb03
commit
be85b3bee3
|
@ -536,7 +536,7 @@ SYMBOL: nc-buttons
|
|||
>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
|
||||
|
|
|
@ -9,7 +9,7 @@ math math.order sorting ;
|
|||
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 )
|
||||
|
||||
|
@ -69,4 +69,4 @@ M: ---- <menu-item>
|
|||
{ ---- } glue <commands-menu> ;
|
||||
|
||||
: show-operations-menu ( gadget target hook -- )
|
||||
<operations-menu> show-menu ;
|
||||
<operations-menu> show-menu ;
|
||||
|
|
|
@ -389,7 +389,7 @@ M: f sloppy-pick-up*
|
|||
|
||||
: begin-selection ( pane -- )
|
||||
f >>selecting?
|
||||
dup hand-loc get move-caret
|
||||
dup hand-loc get-global move-caret
|
||||
f >>mark
|
||||
drop ;
|
||||
|
||||
|
@ -397,12 +397,12 @@ M: f sloppy-pick-up*
|
|||
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
|
||||
|
@ -419,7 +419,7 @@ M: f sloppy-pick-up*
|
|||
|
||||
: 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 ;
|
||||
|
|
|
@ -170,7 +170,7 @@ SYMBOL: double-click-timeout
|
|||
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 ;
|
||||
|
@ -257,7 +257,7 @@ SYMBOL: drag-timer
|
|||
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 -- ? )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue