Mouse over gadget
Posted: Wed Feb 28, 2007 11:07 pm
Problem with mouse over gadget inside or above gadget.
Help me... 
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
Select GetDlgCtrlID_(ChildWindowFromPoint_(WindowID(0),WindowMouseX(0),WindowMouseY(0)))
;Case 1
;SetCursor_(hCurHand)
Case 2
SetCursor_(hCurHand); Not work
Case 3
SetCursor_(hCurHand); Not 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
