SplitterGadget and ToolTips

Just starting out? Need help? Post your questions and find answers here.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

SplitterGadget and ToolTips

Post by PB »

If there is a SplitterGadget between two gadgets, and the second gadget is
disabled, and all three gadgets have tooltips, then the Splitter's tooltip will be
shown for the disabled gadget's tooltip. Reproducable example:

Code: Select all

If OpenWindow(0, 0, 0, 230, 180, "SplitterGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If CreateGadgetList(WindowID(0))

    #Button1  = 0
    #Button2  = 1
    #Splitter = 2

    ButtonGadget(#Button1, 0, 0, 0, 0, "Button 1") ; No need to specify size or coordiantes
    GadgetToolTip(#Button1, "1")
    ButtonGadget(#Button2, 0, 0, 0, 0, "Button 2") ; as they will be sized automatically
    GadgetToolTip(#Button2, "2")
    DisableGadget(#Button2, #True) ; Comment this and ToolTips are correct.
    SplitterGadget(#Splitter, 5, 5, 220, 120, #Button1, #Button2, #PB_Splitter_Separator)
    GadgetToolTip(#Splitter, "Splitter")

    TextGadget(3, 10, 135, 210, 40, "Above GUI [cut]",#PB_Text_Center )

    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
EndIf
If the second gadget is disabled, I'd have thought no tooltip would show for
it, or at least show its correct tooltip ("2" instead of "splitter" in this example).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

:idea: For win, a disabled gadget is like a invisible gadget.
The disabled gadget does not handle any event like MouseMove or LeftClick.

In your example, the mouse moves hover the splitter gadget, that's why its tooltip is visible
Last edited by eddy on Sat Sep 20, 2008 5:23 pm, edited 2 times in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

What's that got to do with my bug report?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

it's not a PB bug but perhaps a windows tooltip bug.

I noticed the problem long time ago.
You will need to code a hack to fix this problem : http://www.codeguru.com/cpp/controls/co ... .php/c2277 :roll:

Here is an other example for the same Tooltip problem :

Code: Select all

Enumeration
   #container
   #buttonInside
EndEnumeration
OpenWindow(0, 0, 0, 200, 200, "click inside", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(#container, 5, 5, 190, 190, 0, #PB_Image_Border)
GadgetToolTip(#container, "TIP CONTAINER !")
UseGadgetList(GadgetID(#container))
ButtonGadget(#buttonInside, 50, 50, 100, 100, "Disabled")
DisableGadget(#buttonInside, 1)
GadgetToolTip(#buttonInside,"TIP INSIDE !")

Repeat
   e=WaitWindowEvent()
   If e=#PB_Event_Gadget And EventGadget()=#container And EventType()=#PB_EventType_LeftClick
      Debug "click container"
   EndIf
Until e=#PB_Event_CloseWindow
- updated -
Last edited by eddy on Sat Sep 20, 2008 6:36 pm, edited 12 times in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Seems like to be a Windows issue here. When a gadget is disabled, the tooltip seems to ignore it and get the one from the gadget below it.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Why should a splitter have a tooltip anyway ?
quidquid Latine dictum sit altum videtur
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

freak wrote:Why should a splitter have a tooltip anyway ?
:D why not?... a tooltip only on the splittergadget bar
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> In your example, the mouse moves hover the splitter gadget, that's why
> its tooltip is visible

Nope. If I run my example, and move the mouse up from underneath the
window to over the disabled #Button2 gadget, I get the "Splitter" tooltip.
That's the bug. It's showing the tooltip for another gadget, even if I never
moved the mouse over the other gadget.

> Why should a splitter have a tooltip anyway ?

(1) Because the gadget supports it natively by PureBasic. :)
(2) Because my tip in my app says: "Click and drag here to resize the list".

It's to make the gadget's use more obvious to the uneducated user.

> Seems like to be a Windows issue here

So, you're saying it's not a PureBasic bug then? I should avoid using it?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply