comparison dwt/widgets/Control.d @ 20:453387bb0706

Ported dwt.widgets.Shell
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sun, 07 Sep 2008 18:22:28 +0200
parents 5b53d338c709
children 642f460a0908
comparison
equal deleted inserted replaced
19:fba856099f87 20:453387bb0706
3078 3078
3079 NSView topView () { 3079 NSView topView () {
3080 return view; 3080 return view;
3081 } 3081 }
3082 3082
3083 bool translateTraversal (int key, NSEvent theEvent, bool [] consume) { 3083 bool translateTraversal (short key, NSEvent theEvent, bool [] consume) {
3084 int detail = DWT.TRAVERSE_NONE; 3084 int detail = DWT.TRAVERSE_NONE;
3085 int code = traversalCode (key, theEvent); 3085 int code = traversalCode (key, theEvent);
3086 bool all = false; 3086 bool all = false;
3087 switch (key) { 3087 switch (key) {
3088 case 53: /* Esc */ { 3088 case 53: /* Esc */ {
3137 control = control.parent; 3137 control = control.parent;
3138 } while (all && control !is null); 3138 } while (all && control !is null);
3139 return false; 3139 return false;
3140 } 3140 }
3141 3141
3142 int traversalCode (int key, NSEvent theEvent) { 3142 int traversalCode (short key, NSEvent theEvent) {
3143 int code = DWT.TRAVERSE_RETURN | DWT.TRAVERSE_TAB_NEXT | DWT.TRAVERSE_TAB_PREVIOUS; 3143 int code = DWT.TRAVERSE_RETURN | DWT.TRAVERSE_TAB_NEXT | DWT.TRAVERSE_TAB_PREVIOUS;
3144 Shell shell = getShell (); 3144 Shell shell = getShell ();
3145 if (shell.parent !is null) code |= DWT.TRAVERSE_ESCAPE; 3145 if (shell.parent !is null) code |= DWT.TRAVERSE_ESCAPE;
3146 return code; 3146 return code;
3147 } 3147 }