comparison FBGUI/FBGUI.cs @ 39:41b2d01ae458

FBGUI: Fixed cursor handling in forms
author Ivo Smits <Ivo@UCIS.nl>
date Wed, 24 Apr 2013 00:30:18 +0200
parents 70bde4fa6a2f
children e3329f686b95
comparison
equal deleted inserted replaced
37:2e3f57f326b3 39:41b2d01ae458
870 case NonClientOps.ResizeBottom | NonClientOps.ResizeLeft: e.Cursor = FBGCursor.SizeBottomLeft; break; 870 case NonClientOps.ResizeBottom | NonClientOps.ResizeLeft: e.Cursor = FBGCursor.SizeBottomLeft; break;
871 case NonClientOps.ResizeBottom | NonClientOps.ResizeRight: e.Cursor = FBGCursor.SizeBottomRight; break; 871 case NonClientOps.ResizeBottom | NonClientOps.ResizeRight: e.Cursor = FBGCursor.SizeBottomRight; break;
872 } 872 }
873 } 873 }
874 protected override void HandlePointingEvent(FBGPointingEvent e) { 874 protected override void HandlePointingEvent(FBGPointingEvent e) {
875 e.Cursor = Cursor; 875 if (Cursor != null) e.Cursor = Cursor;
876 if (HandlePointingEventA(e)) base.HandlePointingEvent(e); 876 if (HandlePointingEventA(e)) base.HandlePointingEvent(e);
877 } 877 }
878 Boolean HandlePointingEventA(FBGPointingEvent e) { 878 Boolean HandlePointingEventA(FBGPointingEvent e) {
879 e.Cursor = Cursor;
880 switch (e.Type) { 879 switch (e.Type) {
881 case FBGPointingEventType.Move: return MouseMove(e.Position, e.Buttons, e); 880 case FBGPointingEventType.Move: return MouseMove(e.Position, e.Buttons, e);
882 case FBGPointingEventType.ButtonDown: return MouseDown(e.Position, e.Buttons, e); 881 case FBGPointingEventType.ButtonDown: return MouseDown(e.Position, e.Buttons, e);
883 case FBGPointingEventType.ButtonUp: return MouseUp(e.Position, e.Buttons, e); 882 case FBGPointingEventType.ButtonUp: return MouseUp(e.Position, e.Buttons, e);
884 default: return true; 883 default: return true;
896 } else { 895 } else {
897 return true; 896 return true;
898 } 897 }
899 } 898 }
900 Boolean MouseMove(Point position, MouseButtons buttons, FBGPointingEvent e) { 899 Boolean MouseMove(Point position, MouseButtons buttons, FBGPointingEvent e) {
901 SetCursorForNonClientOperation(moveresize == 0 ? GetNonClientOperation(position) : moveresize, e); 900 NonClientOps mr = moveresize;
902 if (moveresize == 0) return true; 901 if (mr == 0) mr = GetNonClientOperation(position);
902 if (mr == 0) return true;
903 SetCursorForNonClientOperation(mr, e);
903 if ((moveresize & NonClientOps.MoveResize) != 0) { 904 if ((moveresize & NonClientOps.MoveResize) != 0) {
904 Rectangle b = Bounds; 905 Rectangle b = Bounds;
905 int dx = position.X - prevPosition.X; 906 int dx = position.X - prevPosition.X;
906 int dy = position.Y - prevPosition.Y; 907 int dy = position.Y - prevPosition.Y;
907 if (moveresize == NonClientOps.Move) { 908 if (moveresize == NonClientOps.Move) {