Tooltip style?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TerryHough.
Is there a flag to set to change the style of the tooltips
created with GadgetToolTip(#Gadget, Text$), etc. to the
balloon style?
I am trying to duplicate an application written in a different
language in PureBasic to exterminate the "bloat". The
conversion is easy enough. However, in trying to duplicate
the "look and feel" so that my users won't even know anything
has changed, I haven't been able to get balloon style tooltips.
Small difference, I know. But you know how users can be. The
least little thing gets them off track.
Thanks for your ideas.
Terry
Is there a flag to set to change the style of the tooltips
created with GadgetToolTip(#Gadget, Text$), etc. to the
balloon style?
I am trying to duplicate an application written in a different
language in PureBasic to exterminate the "bloat". The
conversion is easy enough. However, in trying to duplicate
the "look and feel" so that my users won't even know anything
has changed, I haven't been able to get balloon style tooltips.
Small difference, I know. But you know how users can be. The
least little thing gets them off track.
Thanks for your ideas.
Terry
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by MrVainSCL.
Hi TerryHough
Balon style for tooltips? Mhhh i dont know this... i only know this balontips from some appz on the systrayicon... I have cant remember to saw somewheere balonstyle tooltips else... If you have a code-snip, please let me know
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
Hi TerryHough
Balon style for tooltips? Mhhh i dont know this... i only know this balontips from some appz on the systrayicon... I have cant remember to saw somewheere balonstyle tooltips else... If you have a code-snip, please let me know
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by traumatic.
afaik the only way to do this (running on every win-version) is to use a regioned window and setup everything else on your own.
the following links only contain c++ sources, but maybe it's still useful for you:
http://www.codeproject.com/miscctrl/balloonhelp.asp
http://www.codeproject.com/dialog/message_balloons.asp
if you need a purebasic example to do window regioning/skinning let me know
--------
good programmers don't comment their code. it was hard to write - should be hard to read!
afaik the only way to do this (running on every win-version) is to use a regioned window and setup everything else on your own.
the following links only contain c++ sources, but maybe it's still useful for you:
http://www.codeproject.com/miscctrl/balloonhelp.asp
http://www.codeproject.com/dialog/message_balloons.asp
if you need a purebasic example to do window regioning/skinning let me know
--------
good programmers don't comment their code. it was hard to write - should be hard to read!
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TerryHough.
Wow...
Way to complicated for my limited abilities.
Shame though, "balloon" style has been around for
quite a while. I have been using them since Win95
in the other language. And I see them frequently
now in use in software.
I may have "balloon help" and tooltips confused, but
they perform exactly the same without effort in the
original language. Which, of course, I want to get
away from.
Thanks for the response.
Terry
Wow...
Way to complicated for my limited abilities.
Shame though, "balloon" style has been around for
quite a while. I have been using them since Win95
in the other language. And I see them frequently
now in use in software.
I may have "balloon help" and tooltips confused, but
they perform exactly the same without effort in the
original language. Which, of course, I want to get
away from.
Thanks for the response.
Terry
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
Fangles
Ask Danilo. He did this in his toolbar library and it looks pretty good. He might help.Originally posted by TerryHough
Wow...
Way to complicated for my limited abilities.
Shame though, "balloon" style has been around for
quite a while. I have been using them since Win95
in the other language. And I see them frequently
now in use in software.
I may have "balloon help" and tooltips confused, but
they perform exactly the same without effort in the
original language. Which, of course, I want to get
away from.
Thanks for the response.
Terry
Fangles
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Well, I'm not Danilo but here is what I could provide...
Tested under Win2k-Sp3. Hope this helps...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Well, I'm not Danilo but here is what I could provide...
Code: Select all
; (c) 2002 - Franco's template - absolutely freeware
; how to create a user defined tooltip
Procedure AddButtonToolTip(Handle,Text$)
ToolTipControl=CreateWindowEx_(0,"tooltips_class32","",$D0000000,0,0,0,0,WindowID(),0,GetModuleHandle_(0),0)
sendMessage_(ToolTipControl,1044,0 + 0<<8 + 255<<16,0) ;ForeColor Tooltip
sendMessage_(ToolTipControl,1043,255 + 255<<8 + 0<<16,0) ;BackColor Tooltip
sendMessage_(ToolTipControl,1048,0,180) ;Maximum Width of tooltip
Structure TOOLTIP
size.l
flags.l
handle1.l
handle2.l
notused1.l
notused2.l
notused3.l
notused4.l
notused5.l
text.l
EndStructure
ToolInfoButton.TOOLTIP\size=40
ToolInfoButton.TOOLTIP\flags=$11
ToolInfoButton.TOOLTIP\handle1=Handle
ToolInfoButton.TOOLTIP\handle2=Handle
ToolInfoButton.TOOLTIP\text=@Text$
SendMessage_(ToolTipControl,$0404,0,ToolInfoButton)
EndProcedure
If OpenWindow(0, 200, 200, 320, 240, #PB_Window_SystemMenu | #PB_Window_MaximizeGadget, "ToolTip example")
CreateGadgetList(WindowID())
hButt=ButtonGadget(1, 110,60, 100, 100, "Button")
ButtonTooltip$="Button Tooltip whatever you want is possible, even very big text like this one... nice isn't it?"
AddButtonToolTip(hButt,ButtonTooltip$)
Repeat
EventID.l = WaitWindowEvent()
Select EventID
Case #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndSelect
Until Quit = 1
EndIf
End
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.

Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Well I don't know how bubbles looks like in 'down under' but I hope this elliptic form is close enoughOriginally posted by Fangbeast
Now, how to get this into a proper balloon, speech bubble shape?? (I'm greedy)
Code: Select all
; (c) 2002 - Franco's template - absolutely freeware
; how to create a user defined tooltip
; added Elliptic form...
Procedure AddButtonToolTip(Handle,Text$)
ToolTipControl=CreateWindowEx_(0,"tooltips_class32","",$D0000000,0,0,0,0,WindowID(),0,GetModuleHandle_(0),0)
Shared Elliptic.l
Elliptic=CreateEllipticRgn_(1,1,178,56)
SetWindowRgn_(ToolTipControl,Elliptic,1)
sendMessage_(ToolTipControl,1044,0 + 0<<8 + 255<<16,0) ;ForeColor Tooltip
sendMessage_(ToolTipControl,1043,255 + 255<<8 + 0<<16,0) ;BackColor Tooltip
sendMessage_(ToolTipControl,1048,0,180) ;Maximum Width of tooltip
Structure TOOLTIP
size.l
flags.l
handle1.l
handle2.l
notused1.l
notused2.l
notused3.l
notused4.l
notused5.l
text.l
EndStructure
ToolInfoButton.TOOLTIP\size=40
ToolInfoButton.TOOLTIP\flags=$11
ToolInfoButton.TOOLTIP\handle1=Handle
ToolInfoButton.TOOLTIP\handle2=Handle
ToolInfoButton.TOOLTIP\text=@Text$
SendMessage_(ToolTipControl,$0404,0,ToolInfoButton)
EndProcedure
If OpenWindow(0, 200, 200, 320, 240, #PB_Window_SystemMenu | #PB_Window_MaximizeGadget, "ToolTip example")
CreateGadgetList(WindowID())
hButt=ButtonGadget(1, 110,60, 100, 100, "Button")
ButtonTooltip$=" Button Tooltip whatever you want is possible even very big text like this one... nice isn't it?"
AddButtonToolTip(hButt,ButtonTooltip$)
Repeat
EventID.l = WaitWindowEvent()
Select EventID
Case #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndSelect
Until Quit = 1
EndIf
DeleteObject_(Elliptic)
End
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
This is part of what I wanted. Now I need to add the downward pointing spike as if it were a chat bubble. Might be able to use the CombineRegion_ API to do that somehow
Shared RoundRect.l
RoundRect = CreateRoundRectRgn_(1, 1, 178, 56, 10, 10)
SetWindowRgn_(ToolTipControl, RoundRect, 1)
Fangles
This is part of what I wanted. Now I need to add the downward pointing spike as if it were a chat bubble. Might be able to use the CombineRegion_ API to do that somehow
Shared RoundRect.l
RoundRect = CreateRoundRectRgn_(1, 1, 178, 56, 10, 10)
SetWindowRgn_(ToolTipControl, RoundRect, 1)
Fangles
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
You simply have to add the Style TTS_BALLOON ($40)
to CreateWindowEx_():
The Code by Franco is completely unreadable because he
didnt use Constants.
How should somebody know what the Style "$D0000000" stands for ??
Can you remember this style after 1 year, Franco ?? I cant..
cya,
...Danilo
(registered PureBasic user)
You simply have to add the Style TTS_BALLOON ($40)
to CreateWindowEx_():
Code: Select all
; (c) 2002 - Franco's template - absolutely freeware
; how to create a user defined tooltip
Procedure AddButtonToolTip(Handle,Text$)
#TTS_BALLOON = $40
ToolTipControl=CreateWindowEx_(0,"tooltips_class32","",$D0000000|#TTS_BALLOON,0,0,0,0,WindowID(),0,GetModuleHandle_(0),0)
sendMessage_(ToolTipControl,1044,0 ,0) ;ForeColor Tooltip
sendMessage_(ToolTipControl,1043,$58F5D6,0) ;BackColor Tooltip
sendMessage_(ToolTipControl,1048,0,180) ;Maximum Width of tooltip
Button.TOOLINFO\cbSize=44 ; SizeOf( TOOLINFO )
Button\uFlags=$11
Button\hWnd=Handle
Button\uId=Handle
Button\lpszText=@Text$
SendMessage_(ToolTipControl,$0404,0,Button)
EndProcedure
If OpenWindow(0, 200, 200, 320, 240, #PB_Window_SystemMenu | #PB_Window_MaximizeGadget, "ToolTip example")
CreateGadgetList(WindowID())
hButt=ButtonGadget(1, 110,60, 100, 100, "Button")
ButtonTooltip$="Button Tooltip whatever you want is possible, even very big text like this one... nice isn't it?"
AddButtonToolTip(hButt,ButtonTooltip$)
Repeat
EventID.l = WaitWindowEvent()
Select EventID
Case #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndSelect
Until Quit = 1
EndIf
didnt use Constants.
How should somebody know what the Style "$D0000000" stands for ??
Can you remember this style after 1 year, Franco ?? I cant..
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Try to changeto
Sorry, but its a mess to read and change
such a wrong code...
Try to add $40 to the style in Franco´s original example...
( #define TTS_BALLOON 0x40 )
cya,
...Danilo
(registered PureBasic user)
Try to change
Code: Select all
Button.TOOLINFO\cbSize=40Code: Select all
Button.TOOLINFO\cbSize=44 ; SizeOf( TOOLINFO )such a wrong code...
Try to add $40 to the style in Franco´s original example...
( #define TTS_BALLOON 0x40 )
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by traumatic.
just wanted to add the following info:
TTS_BALLOON is only supported by 'comctl32.dll' v5.80 or higher. well, this isn't a problem but it still means that not everyone will be able to see these balloon-style tooltips.
if your software has to run on every win32-system (even on one without IE5 or commoncontrols-update) you should go the 'region-way' imho
just wanted to add the following info:
TTS_BALLOON is only supported by 'comctl32.dll' v5.80 or higher. well, this isn't a problem but it still means that not everyone will be able to see these balloon-style tooltips.
if your software has to run on every win32-system (even on one without IE5 or commoncontrols-update) you should go the 'region-way' imho
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm