Posted: Wed Feb 28, 2007 11:29 pm
Couple tweaks and it all works:

Code: Select all
Procedure Window()
If OpenWindow(0, 297, 299, 340, 160, "Mouse", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateGadgetList(WindowID(0))
ScrollAreaGadget(1, 20, 20, 170, 120, 340, 240, 10)
ButtonGadget(2, 20, 25, 100, 25, "Button 1")
TextGadget(3, 20, 70, 100, 15, "Text gadget 1")
CloseGadgetList()
ButtonGadget(4, 210, 50, 100, 25, "Button 2")
TextGadget(5, 210, 90, 100, 15, "Text gadget 2")
EndIf
EndIf
EndProcedure
Window()
hCurHand = LoadCursor_(0,#IDC_HAND)
hCurArrow = LoadCursor_(0,#IDC_ARROW)
Repeat
Event = WaitWindowEvent()
WindowID = EventWindow()
GadgetID = EventGadget()
EventType = EventType()
Select Event
Case #WM_MOUSEMOVE
GetCursorPos_(@cp.POINT)
GetWindowRect_(GadgetID(1), @sa.RECT)
If PtInRect_(sa, cp\x,cp\y)
MapWindowPoints_(0,GetWindow_(GadgetID(1),#GW_CHILD),@cp,1)
parent = GetWindow_(GadgetID(1),#GW_CHILD)
Else
MapWindowPoints_(0, WindowID(0), @cp, 1)
parent = WindowID(0)
EndIf
Select GetDlgCtrlID_(ChildWindowFromPoint_(parent,cp\x,cp\y))
Case 2
SetCursor_(hCurHand); work
Case 3
SetCursor_(hCurHand); work
Case 4
SetCursor_(hCurHand); Work
Case 5
SetCursor_(hCurHand); Work
EndSelect
EndSelect
If Event = #PB_Event_Gadget
If GadgetID = 2
EndIf
If GadgetID = 3
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
End
