comparison dwt/widgets/Control.d @ 17:5b53d338c709

Fixed some errors after latest merge
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 29 Aug 2008 22:04:22 +0200
parents 2952d5604c0a a9ab4c738ed8
children 453387bb0706
comparison
equal deleted inserted replaced
16:fb2555104d70 17:5b53d338c709
788 bool dragDetect (int x, int y, bool filter, bool [] consume) { 788 bool dragDetect (int x, int y, bool filter, bool [] consume) {
789 // Rect rect = new Rect (); 789 // Rect rect = new Rect ();
790 // int window = OS.GetControlOwner (handle); 790 // int window = OS.GetControlOwner (handle);
791 // CGPoint pt = new CGPoint (); 791 // CGPoint pt = new CGPoint ();
792 // OS.HIViewConvertPoint (pt, handle, 0); 792 // OS.HIViewConvertPoint (pt, handle, 0);
793 // x += (int) pt.x; 793 // x += cast(int) pt.x;
794 // y += (int) pt.y; 794 // y += cast(int) pt.y;
795 // OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect); 795 // OS.GetWindowBounds (window, cast(short) OS.kWindowStructureRgn, rect);
796 // x += rect.left; 796 // x += rect.left;
797 // y += rect.top; 797 // y += rect.top;
798 // dwt.internal.carbon.Point pt1 = new dwt.internal.carbon.Point (); 798 // dwt.internal.carbon.Point pt1 = new dwt.internal.carbon.Point ();
799 // pt1.h = (short) x; 799 // pt1.h = cast(short) x;
800 // pt1.v = (short) y; 800 // pt1.v = cast(short) y;
801 // return OS.WaitMouseMoved (pt1); 801 // return OS.WaitMouseMoved (pt1);
802 return false; 802 return false;
803 } 803 }
804 804
805 bool drawGripper (int x, int y, int width, int height, bool vertical) { 805 bool drawGripper (int x, int y, int width, int height, bool vertical) {
2220 2220
2221 bool sendMouseEvent (int type, short button, int count, int detail, bool send, int theEvent) { 2221 bool sendMouseEvent (int type, short button, int count, int detail, bool send, int theEvent) {
2222 // CGPoint pt = new CGPoint (); 2222 // CGPoint pt = new CGPoint ();
2223 // OS.GetEventParameter (theEvent, OS.kEventParamWindowMouseLocation, OS.typeHIPoint, null, CGPoint.sizeof, null, pt); 2223 // OS.GetEventParameter (theEvent, OS.kEventParamWindowMouseLocation, OS.typeHIPoint, null, CGPoint.sizeof, null, pt);
2224 // OS.HIViewConvertPoint (pt, 0, handle); 2224 // OS.HIViewConvertPoint (pt, 0, handle);
2225 // int x = (int) pt.x; 2225 // int x = cast(int) pt.x;
2226 // int y = (int) pt.y; 2226 // int y = cast(int) pt.y;
2227 // display.lastX = x; 2227 // display.lastX = x;
2228 // display.lastY = y; 2228 // display.lastY = y;
2229 // int [] chord = new int [1]; 2229 // int [] chord = new int [1];
2230 // OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord); 2230 // OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord);
2231 // int [] modifiers = new int [1]; 2231 // int [] modifiers = new int [1];
2232 // OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers); 2232 // OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
2233 // return sendMouseEvent (type, button, count, detail, send, chord [0], (short) x, (short) y, modifiers [0]); 2233 // return sendMouseEvent (type, button, count, detail, send, chord [0], cast(short) x, cast(short) y, modifiers [0]);
2234 return false; 2234 return false;
2235 } 2235 }
2236 2236
2237 bool sendMouseEvent (int type, short button, int count, bool send, int chord, short x, short y, int modifiers) { 2237 bool sendMouseEvent (int type, short button, int count, bool send, int chord, short x, short y, int modifiers) {
2238 return sendMouseEvent (type, button, count, 0, send, chord, x, y, modifiers); 2238 return sendMouseEvent (type, button, count, 0, send, chord, x, y, modifiers);
2332 void setBackground (float [] color) { 2332 void setBackground (float [] color) {
2333 } 2333 }
2334 2334
2335 void setBackground (int control, float [] color) { 2335 void setBackground (int control, float [] color) {
2336 // ControlFontStyleRec fontStyle = new ControlFontStyleRec (); 2336 // ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
2337 // OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null); 2337 // OS.GetControlData (control, cast(short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
2338 // if (color !is null) { 2338 // if (color !is null) {
2339 // fontStyle.backColor_red = (short) (color [0] * 0xffff); 2339 // fontStyle.backColor_red = cast(short) (color [0] * 0xffff);
2340 // fontStyle.backColor_green = (short) (color [1] * 0xffff); 2340 // fontStyle.backColor_green = cast(short) (color [1] * 0xffff);
2341 // fontStyle.backColor_blue = (short) (color [2] * 0xffff); 2341 // fontStyle.backColor_blue = cast(short) (color [2] * 0xffff);
2342 // fontStyle.flags |= OS.kControlUseBackColorMask; 2342 // fontStyle.flags |= OS.kControlUseBackColorMask;
2343 // } else { 2343 // } else {
2344 // fontStyle.flags &= ~OS.kControlUseBackColorMask; 2344 // fontStyle.flags &= ~OS.kControlUseBackColorMask;
2345 // } 2345 // }
2346 // OS.SetControlFontStyle (control, fontStyle); 2346 // OS.SetControlFontStyle (control, fontStyle);
2623 void setForeground (float [] color) { 2623 void setForeground (float [] color) {
2624 } 2624 }
2625 2625
2626 void setForeground (int control, float [] color) { 2626 void setForeground (int control, float [] color) {
2627 // ControlFontStyleRec fontStyle = new ControlFontStyleRec (); 2627 // ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
2628 // OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null); 2628 // OS.GetControlData (control, cast(short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
2629 // if (color !is null) { 2629 // if (color !is null) {
2630 // fontStyle.foreColor_red = (short) (color [0] * 0xffff); 2630 // fontStyle.foreColor_red = cast(short) (color [0] * 0xffff);
2631 // fontStyle.foreColor_green = (short) (color [1] * 0xffff); 2631 // fontStyle.foreColor_green = cast(short) (color [1] * 0xffff);
2632 // fontStyle.foreColor_blue = (short) (color [2] * 0xffff); 2632 // fontStyle.foreColor_blue = cast(short) (color [2] * 0xffff);
2633 // fontStyle.flags |= OS.kControlUseForeColorMask; 2633 // fontStyle.flags |= OS.kControlUseForeColorMask;
2634 // } else { 2634 // } else {
2635 // fontStyle.flags &= ~OS.kControlUseForeColorMask; 2635 // fontStyle.flags &= ~OS.kControlUseForeColorMask;
2636 // } 2636 // }
2637 // OS.SetControlFontStyle (control, fontStyle); 2637 // OS.SetControlFontStyle (control, fontStyle);