ToolTips possible for disabled gadgets?
ToolTips possible for disabled gadgets?
Like the topic says... is there a way (in Windows) to force a tooltip for a disabled gadget? (I have a disabled StringGadget but it would nice to explain to the user what it's currently showing, since the content is dynamic. And no, making the StringGadget read-only is not an option).
Re: ToolTips possible for disabled gadgets?
Hi BarryG
Code: Select all
If OpenWindow(0, 0, 0, 400, 300, "StringGadget Flags", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(0,8,10,300,24,0)
GadgetToolTip(0,"String Gadget Disabled")
StringGadget(1, 0,0, 300, 24, "Normal StringGadget...")
GadgetToolTip(1,"String Gadget")
SetWindowLongPtr_( GadgetID(1), #GWL_HWNDPARENT,GadgetID(0))
ButtonGadget(2,10,270,60,24,"RUN")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 2
Run ! 1
If run = 1
DisableGadget(1,1)
Else
DisableGadget(1,0)
EndIf
EndSelect
EndSelect
Until Quit = 1
EndIf
Egypt my love
Re: ToolTips possible for disabled gadgets?
Thanks, Rashad! Nice example, and it taught me that all I need to do is put an ImageGadget (with its own tooltip) over my disabled StringGadget to do it. I don't even need the #GWL_HWNDPARENT flag to be applied.
Re: ToolTips possible for disabled gadgets?
Hi BarryG
You need SetWindowLongPtr_( GadgetID(1), #GWL_HWNDPARENT,GadgetID(0))
To be able to use the StringGadget() as usual
You need SetWindowLongPtr_( GadgetID(1), #GWL_HWNDPARENT,GadgetID(0))
To be able to use the StringGadget() as usual
Egypt my love
Re: ToolTips possible for disabled gadgets?
I see. In my case, the StringGadget is always disabled (it's just for show instead of a TextGadget, because TextGadgets can't have thin one-pixel borders).
Re: ToolTips possible for disabled gadgets?
If TextGadget() is more suitable for you
TextGadget with 1 pix border and ToolTip
TextGadget with 1 pix border and ToolTip
Code: Select all
If OpenWindow(0, 0, 0, 270, 160, "TextGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0,10,10,250, 20, "TextGadget Center + Border")
TextGadget(1, 10, 40, 250, 20, "TextGadget Center + Border", #SS_NOTIFY|#WS_BORDER)
GadgetToolTip(1,"TEST")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Egypt my love
Re: ToolTips possible for disabled gadgets?
Sorry, I should've been more clear. Those thin borders are black, instead of gray like the borders of ButtonGadgets and other gadgets. So a thin TextGadget border looks visually different and out of place. Look:
Re: ToolTips possible for disabled gadgets?
OK In that case maybe you can use FrameGadget() default with no text and borderless TextGadget()
I do not remember which frame style is grayed
I do not remember which frame style is grayed
Egypt my love
Re: ToolTips possible for disabled gadgets?
I've tried all styles before, which is why I settled with a disabled StringGadget, because it was closest.RASHAD wrote:I do not remember which frame style is grayed
But I might try your FrameGadget() idea as well. Thanks for the reminder about that approach.