io.encodings.string classes.struct ;
IN: ui.backend.cocoa.views
-SLOT: window
-
: send-mouse-moved ( view event -- )
[ mouse-location ] [ drop window ] 2bi
[ move-hand fire-motion yield ] [ drop ] if* ;
METHOD: char validateUserInterfaceItem: id event
[
- self window [
- event -> action utf8 alien>string validate-action
- [ >c-bool ] [ drop self event SUPER-> validateUserInterfaceItem: ] if
- ] [ 0 ] if*
+ self window :> window
+ window [
+ window world-focus :> gadget
+ 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$ ] ;
] unless
gadget preedit? [
gadget [ remove-preedit-text ] [ remove-preedit-info ] bi
- ] when
- str gadget user-input* drop
- f gadget preedit-selection-mode?<<
+ str gadget user-input* drop
+ f gadget preedit-selection-mode?<<
+ ] [
+ str window user-input
+ ] if
] [
str window user-input
] if
<CGRect>
] ;
+ METHOD: void doCommandBySelector: SEL selector [ ] ;
+
! Initialization
METHOD: void updateFactorGadgetSize: id notification
[
] when
] ;
- METHOD: void doCommandBySelector: SEL selector [ ] ;
-
METHOD: id initWithFrame: NSRect frame pixelFormat: id pixelFormat
[
self frame pixelFormat SUPER-> initWithFrame:pixelFormat:
: focus-path ( gadget -- seq )
[ focus>> ] follow ;
+GENERIC: preedit? ( gadget -- ? )
+
+M: gadget preedit? drop f ;
+
USE: vocabs.loader
{ "ui.gadgets" "prettyprint" } "ui.gadgets.prettyprint" require-when
[ gesture>> ] [ world>> world-focus ] bi
[ handle-gesture ] with each-parent drop ;
-GENERIC: preedit? ( gadget -- ? )
-
-M: gadget preedit? drop f ;
-
:: propagate-key-gesture ( gesture world -- )
world world-focus preedit? [
gesture world \ propagate-key-gesture-tuple queue-gesture