Page 1 sur 1

Bug dans le VisualDesigner

Publié : dim. 10/oct./2004 14:28
par Chris
Bug avec BallonTips employé avec OptionGadget () ou CheckBoxGadget ()

Avec l'utilisation des thèmes XP, le BalloonTips n'apparait plus, une fois que le CheckBoxGadget () ou l' OptionGadget () a été coché.
Ce bug n'arrive pas si les thèmes XP ne sont pas activés.

Voir le code ci-dessous

Code : Tout sélectionner

Enumeration
  #Window_0
EndEnumeration

;- Gadget Constants
;
Enumeration
  #Radio_0
  #Radio_1
  #Radio_2
  #CheckBox_0
  #CheckBox_1
  #CheckBox_2
EndEnumeration


; BalloonTip Constants
#TOOLTIP_NO_ICON      = 0
#TOOLTIP_INFO_ICON    = 1
#TOOLTIP_WARNING_ICON = 2
#TOOLTIP_ERROR_ICON   = 3

Procedure BalloonTip(WindowID, Gadget, Text$ , Title$, Icon)
  
  ToolTip=CreateWindowEx_(0,"ToolTips_Class32","",#WS_POPUP | #TTS_NOPREFIX | #TTS_BALLOON,0,0,0,0,WindowID,0,GetModuleHandle_(0),0)
  SendMessage_(ToolTip,#TTM_SETTIPTEXTCOLOR,GetSysColor_(#COLOR_INFOTEXT),0)
  SendMessage_(ToolTip,#TTM_SETTIPBKCOLOR,GetSysColor_(#COLOR_INFOBK),0)
  SendMessage_(ToolTip,#TTM_SETMAXTIPWIDTH,0,180)
  Balloon.TOOLINFO\cbSize=SizeOf(TOOLINFO)
  Balloon\uFlags=#TTF_IDISHWND | #TTF_SUBCLASS
  Balloon\hWnd=GadgetID(Gadget)
  Balloon\uId=GadgetID(Gadget)
  Balloon\lpszText=@Text$
  SendMessage_(ToolTip, #TTM_ADDTOOL, 0, Balloon)
  If Title$ > ""
    SendMessage_(ToolTip, #TTM_SETTITLE, Icon, @Title$)
  EndIf
  
EndProcedure

Procedure Open_Window_0()
  If OpenWindow(#Window_0, 216, 0, 115, 234,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
    If CreateGadgetList(WindowID())
      OptionGadget(#Radio_0, 10, 10, 80, 20, "Option 1")
      BalloonTip(WindowID(), #Radio_0, "Option n° 1", "Option", #TOOLTIP_INFO_ICON)
      OptionGadget(#Radio_1, 10, 40, 80, 20, "Option 2")
      BalloonTip(WindowID(), #Radio_1, "Option n° 2", "Option", #TOOLTIP_INFO_ICON)
      OptionGadget(#Radio_2, 10, 70, 80, 20, "Option 3")
      BalloonTip(WindowID(), #Radio_2, "Option n° 3", "Option", #TOOLTIP_INFO_ICON)
      CheckBoxGadget(#CheckBox_0, 10, 130, 110, 20, "Choix 1")
      BalloonTip(WindowID(), #CheckBox_0, "Choix n° 1", "Choix", #TOOLTIP_INFO_ICON)
      CheckBoxGadget(#CheckBox_1, 10, 160, 110, 20, "Choix 2")
      BalloonTip(WindowID(), #CheckBox_1, "Choix n° 2", "Choix", #TOOLTIP_INFO_ICON)
      CheckBoxGadget(#CheckBox_2, 10, 190, 110, 20, "Choix 3")
      BalloonTip(WindowID(), #CheckBox_2, "Choix n° 3", "Choix", #TOOLTIP_INFO_ICON)
      
    EndIf
  EndIf
EndProcedure

Open_Window_0()

Repeat
  
  Event = WaitWindowEvent()
  If Event = #PB_EventGadget
    ;Debug "WindowID: " + Str(EventWindowID())
    GadgetID = EventGadgetID()
    
    If GadgetID = #Radio_0
      Debug "GadgetID: #Radio_0"
      
    ElseIf GadgetID = #Radio_1
      Debug "GadgetID: #Radio_1"
      
    ElseIf GadgetID = #Radio_2
      Debug "GadgetID: #Radio_2"
      
    ElseIf GadgetID = #CheckBox_0
      Debug "GadgetID: #CheckBox_0"
      
    ElseIf GadgetID = #CheckBox_1
      Debug "GadgetID: #CheckBox_1"
      
    ElseIf GadgetID = #CheckBox_2
      Debug "GadgetID: #CheckBox_2"
      
    EndIf
    
  EndIf
  
Until Event = #PB_EventCloseWindow

End
;