Input Completion Improvements
parent
41db42a571
commit
bada736a3f
|
@ -15,8 +15,6 @@ ui.backend.cocoa.input-methods.editors io.encodings.utf16n
|
||||||
io.encodings.string classes.struct ;
|
io.encodings.string classes.struct ;
|
||||||
IN: ui.backend.cocoa.views
|
IN: ui.backend.cocoa.views
|
||||||
|
|
||||||
SLOT: window
|
|
||||||
|
|
||||||
: send-mouse-moved ( view event -- )
|
: send-mouse-moved ( view event -- )
|
||||||
[ mouse-location ] [ drop window ] 2bi
|
[ mouse-location ] [ drop window ] 2bi
|
||||||
[ move-hand fire-motion yield ] [ drop ] if* ;
|
[ move-hand fire-motion yield ] [ drop ] if* ;
|
||||||
|
@ -364,10 +362,16 @@ PRIVATE>
|
||||||
|
|
||||||
METHOD: char validateUserInterfaceItem: id event
|
METHOD: char validateUserInterfaceItem: id event
|
||||||
[
|
[
|
||||||
self window [
|
self window :> window
|
||||||
event -> action utf8 alien>string validate-action
|
window [
|
||||||
[ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
|
window world-focus :> gadget
|
||||||
] [ 0 ] if*
|
gadget [
|
||||||
|
gadget preedit? not [
|
||||||
|
window event -> action utf8 alien>string validate-action
|
||||||
|
[ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
|
||||||
|
] [ 0 ] if
|
||||||
|
] [ 0 ] if
|
||||||
|
] [ 0 ] if
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
METHOD: void undo: id event [ self event undo-action send-action$ ] ;
|
METHOD: void undo: id event [ self event undo-action send-action$ ] ;
|
||||||
|
@ -481,9 +485,11 @@ PRIVATE>
|
||||||
] unless
|
] unless
|
||||||
gadget preedit? [
|
gadget preedit? [
|
||||||
gadget [ remove-preedit-text ] [ remove-preedit-info ] bi
|
gadget [ remove-preedit-text ] [ remove-preedit-info ] bi
|
||||||
] when
|
str gadget user-input* drop
|
||||||
str gadget user-input* drop
|
f gadget preedit-selection-mode?<<
|
||||||
f gadget preedit-selection-mode?<<
|
] [
|
||||||
|
str window user-input
|
||||||
|
] if
|
||||||
] [
|
] [
|
||||||
str window user-input
|
str window user-input
|
||||||
] if
|
] if
|
||||||
|
@ -625,6 +631,8 @@ PRIVATE>
|
||||||
<CGRect>
|
<CGRect>
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
|
METHOD: void doCommandBySelector: SEL selector [ ] ;
|
||||||
|
|
||||||
! Initialization
|
! Initialization
|
||||||
METHOD: void updateFactorGadgetSize: id notification
|
METHOD: void updateFactorGadgetSize: id notification
|
||||||
[
|
[
|
||||||
|
@ -634,8 +642,6 @@ PRIVATE>
|
||||||
] when
|
] when
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
METHOD: void doCommandBySelector: SEL selector [ ] ;
|
|
||||||
|
|
||||||
METHOD: id initWithFrame: NSRect frame pixelFormat: id pixelFormat
|
METHOD: id initWithFrame: NSRect frame pixelFormat: id pixelFormat
|
||||||
[
|
[
|
||||||
self frame pixelFormat SUPER-> initWithFrame:pixelFormat:
|
self frame pixelFormat SUPER-> initWithFrame:pixelFormat:
|
||||||
|
|
|
@ -22,7 +22,7 @@ TUPLE: editor < line-gadget
|
||||||
preedit-underlines ;
|
preedit-underlines ;
|
||||||
|
|
||||||
M: editor preedit? preedit-start>> [ t ] [ f ] if ;
|
M: editor preedit? preedit-start>> [ t ] [ f ] if ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: <loc> ( -- loc ) { 0 0 } <model> ;
|
: <loc> ( -- loc ) { 0 0 } <model> ;
|
||||||
|
|
|
@ -401,6 +401,10 @@ M: f request-focus-on 2drop ;
|
||||||
: focus-path ( gadget -- seq )
|
: focus-path ( gadget -- seq )
|
||||||
[ focus>> ] follow ;
|
[ focus>> ] follow ;
|
||||||
|
|
||||||
|
GENERIC: preedit? ( gadget -- ? )
|
||||||
|
|
||||||
|
M: gadget preedit? drop f ;
|
||||||
|
|
||||||
USE: vocabs.loader
|
USE: vocabs.loader
|
||||||
|
|
||||||
{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when
|
{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when
|
||||||
|
|
|
@ -63,10 +63,6 @@ M: propagate-key-gesture-tuple send-queued-gesture
|
||||||
[ gesture>> ] [ world>> world-focus ] bi
|
[ gesture>> ] [ world>> world-focus ] bi
|
||||||
[ handle-gesture ] with each-parent drop ;
|
[ handle-gesture ] with each-parent drop ;
|
||||||
|
|
||||||
GENERIC: preedit? ( gadget -- ? )
|
|
||||||
|
|
||||||
M: gadget preedit? drop f ;
|
|
||||||
|
|
||||||
:: propagate-key-gesture ( gesture world -- )
|
:: propagate-key-gesture ( gesture world -- )
|
||||||
world world-focus preedit? [
|
world world-focus preedit? [
|
||||||
gesture world \ propagate-key-gesture-tuple queue-gesture
|
gesture world \ propagate-key-gesture-tuple queue-gesture
|
||||||
|
|
Loading…
Reference in New Issue