Voila, j'ai un petit problème avec la fonction GetWindowRect_

J'ai récupérer une procedure sur le forum pour savoir si la souris "est passé" au dessus d'un gadget ( MouseOver ) http://purebasic.hmt-forum.com/viewtopi ... =mouseover
Mon souci vient du fait que lorsque je change d'onglet sur le PanelGadget, la procedure MouseOver me detecte toujours le bouton qui est caché...

Si quelqu'un a une idée

Merci.
Code : Tout sélectionner
Global Window_Tool,Button_Wall_Front,Button_Wall_Left,Button_Wall_Right,Button_Wall_Back,Button_Wall_Up,Button_Wall_Down,ListIcon_Texture_Wall,CheckBox_0,Label_Fake_Wall
Global Button_Door_Front, Button_Door_Left, Button_Door_Right, Button_Door_Back
Global Panel_Decor, Frame3D_0, Button_Toggle_Wall_Create_Delete
Procedure Mouse_Over(wnd)
GetWindowRect_ (wnd,re.RECT)
re\left = re\left
re\top = re\top
re\right = re\right
re\bottom = re\bottom
GetCursorPos_ (pt.POINT)
Result = PtInRect_ (re,pt\X,pt\Y)
ProcedureReturn Result
EndProcedure
Procedure Open_Window_Tool()
Window_Tool = OpenWindow(#PB_Any, 645, 0, 550, 864, "Window 0", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_TitleBar )
;OpenWindowedScreen(WindowID(Window_Tool),0,0,10,10,0,0,0)
If Window_Tool
If CreateGadgetList(WindowID(Window_Tool))
PanelGadget(Panel_Decor, 5, 64, 535, 460)
AddGadgetItem(Panel_Decor, 1, "Wall")
Button_Wall_Front = ButtonGadget(#PB_Any, 73, 74, 48, 32, "FRONT")
Button_Wall_Left = ButtonGadget(#PB_Any, 25, 106, 48, 32, "LEFT")
Button_Wall_Right = ButtonGadget(#PB_Any, 121, 106, 48, 32, "RIGHT")
Button_Wall_Back = ButtonGadget(#PB_Any, 73, 138, 48, 32, "BACK")
Button_Wall_Up = ButtonGadget(#PB_Any, 73, 38, 48, 32, "UP")
Button_Wall_Down = ButtonGadget(#PB_Any, 73, 174, 48, 32, "DOWN")
ListIcon_Texture_Wall = ListIconGadget(#PB_Any, 208, 92, 244, 292, "Textures", 230, #PB_ListIcon_FullRowSelect)
CheckBox_0 = CheckBoxGadget(#PB_Any, 92, 296, 20, 30, "", #PB_CheckBox_Right)
Label_Fake_Wall = TextGadget(#PB_Any, 20, 304, 60, 20, "Fake Wall", #PB_Text_Center)
Frame3D_0 = Frame3DGadget(#PB_Any, 5, 6, 188, 212, "", #PB_Frame3D_Single)
Button_Toggle_Wall_Create_Delete= ButtonGadget(#PB_Any, 9, 6, 180, 24, "CREATE", #PB_Button_Default | #PB_Button_Toggle)
CloseGadgetList() ; Panel_Decor ; Panel_Decor
OpenGadgetList(Panel_Decor,2)
AddGadgetItem(Panel_Decor, 2, "Door")
Button_Door_Front = ButtonGadget(#PB_Any, 73, 74, 48, 32, "FRONT")
Button_Door_Left = ButtonGadget(#PB_Any, 25, 106, 48, 32, "LEFT")
Button_Door_Right = ButtonGadget(#PB_Any, 121, 106, 48, 32, "RIGHT")
Button_Door_Back = ButtonGadget(#PB_Any, 73, 138, 48, 32, "BACK")
CloseGadgetList() ; Panel_Decor
EndIf
EndIf
EndProcedure
Open_Window_Tool()
Repeat
Event = WaitWindowEvent()
If Mouse_Over(GadgetID(Button_Wall_Front))
MessageRequester("Button_Wall_Front","Mouse is Over")
EndIf
Until Event = #PB_Event_CloseWindow
End
; jaPBe Version=3.6.4.490
; Build=0
; FirstLine=0
; CursorPosition=26
; ExecutableFormat=Windows
; DontSaveDeclare
; EOF