1{%mainunit gtkwsprivate.pp} 2 3{ 4 ***************************************************************************** 5 This file is part of the Lazarus Component Library (LCL) 6 7 See the file COPYING.modifiedLGPL.txt, included in this distribution, 8 for details about the license. 9 ***************************************************************************** 10} 11 12{ TGtkPrivateWidget } 13 14class procedure TGtkPrivateWidget.UpdateCursor(AInfo: PWidgetInfo); 15var 16 Widget, FixWidget: PGtkWidget; 17 Window: PGdkWindow; 18begin 19 Widget := AInfo^.CoreWidget; 20 FixWidget := GetFixedWidget(Widget); 21 Window := GetControlWindow(FixWidget); 22 if Window = nil then Exit; 23 // always recurse windows which do not accept controls. 24 // this way we will catch all widgets with double windows 25 if not (csAcceptsControls in TControl(AInfo^.LCLObject).ControlStyle) then 26 SetWindowCursor(Window, AInfo^.ControlCursor, True) 27 else 28 SetCursorForWindowsWithInfo(Window, AInfo); 29end; 30 31class procedure TGtkPrivateWidget.SetDefaultCursor(AInfo: PWidgetInfo); 32begin 33 AInfo^.DefaultCursor := Screen.Cursors[crDefault]; 34end; 35 36class procedure TGtkPrivateWidget.SetZPosition(const AWinControl: TWinControl; const APosition: TWSZPosition); 37var 38 Widget: PGtkWidget; 39begin 40 if not WSCheckHandleAllocated(AWincontrol, 'SetZPosition') 41 then Exit; 42 43 Widget := GetWidgetWithWindow(AWincontrol.Handle); 44 if Widget = nil then Exit; 45 if Widget^.Window=nil then exit; 46 47 case APosition of 48 wszpBack: begin 49 gdk_window_lower(Widget^.Window); 50 end; 51 wszpFront: begin 52 gdk_window_raise(Widget^.Window); 53 end; 54 end; 55end; 56 57{ TGtkPrivatePaned } 58 59class procedure TGtkPrivatePaned.UpdateCursor(AInfo: PWidgetInfo); 60var 61 Widget: PGtkWidget; 62 Window: PGdkWindow; 63begin 64 Widget := AInfo^.CoreWidget; 65 Window := PGTkPaned(Widget)^.handle; 66 if Window = nil then Exit; 67 SetWindowCursor(Window, AInfo^.ControlCursor, False); 68end; 69 70 71{ TGtkPrivateEntry } 72 73class procedure TGtkPrivateEntry.SetDefaultCursor(AInfo: PWidgetInfo); 74begin 75 AInfo^.DefaultCursor := Screen.Cursors[crIBeam]; 76end; 77 78