1. Tool tips & win32lib

------------------------------------------------------------------------------------------

--To: any one concerned <euforum at topica.com>
--Subject: Tool tips & win32lib
--Date: Mon, 25 March, 2002.
--From: Jordah Ferguson <jorfergie03 at yahoo.com>
--Priority: 3
--Saved by: Jordah Ferguson (Acc. Name: jordah ferguson )


Hi all,

I have a couple of questions i would like to ask about the tooltip 
control

1) Can toottips be multiline? Cause i have a long message i would like 
to present when a certain listview 
   item is clicked. When i make the tooltip text long, it is like 
sending a long unwrapped text to the printer!
2)Can the background and foreground colour of a tooltip be changed? I 
kinda want to make a special good 
   looking tooltip for the secial listview items that are being clicked.
3)Can tooltips be created with extra styles such as having a 3D border?
4)Can an Icon control or bitmap control be added to a tooltip?

That wraps up the questions i had about win32lib tooltips..

Thanx in advance
Jordah Ferguson
jorfergie03 at yahoo.com

--Processed and saved using: Cirrus Mail ver 0.2a

new topic     » topic index » view message » categorize

2. Re: Tool tips & win32lib

Thanks, I'll give it a try.
----- Original Message -----
From: "Tony Steward" <tony at locksdownunder.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Tool tips & win32lib


>
> Hi Jordan,
> Heres an old post by euman which may help
>
> cut...
> Someone wrote me and asked how do I set the multi-column on a tooltip
>  well, here it is.....(Derek you might want to add this)
>
>  Find:
> global procedure setHintEx(integer id,sequence text,atom exflags)
>
>  near the end of the procedure you should see this
>
>  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
>
>  Put the next line above the one I just typed above "Like this"
>
>  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, 100)
>  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
>
> I tried to set this up in lTTmsg but couldnt figure out how to connect
> the
> length on the string so that it would be automatic.
>
>  Note:
>  You will need to set the with where I have 100 on the end of the
>  message to length you wish to wrap the line...'
>
>  Alternatively you could do this:
>
>  global procedure setHintEx(integer id,sequence text,atom exflags,
> integer len)
>
>  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, len)
>
>  and in your program do this:
>
> >>>>> (Here's the Change)
>  setHintEx( id, "text", 0, 100 )
>
>  and this should work fine.
>
>
>  Euman
>  euman at bellsouth.net
> end cut....
> jordah ferguson wrote:
> >
> >
> > --To: any one concerned <euforum at topica.com>
> > --Subject: Tool tips & win32lib
> > --Date: Mon, 25 March, 2002.
> > --From: Jordah Ferguson <jorfergie03 at yahoo.com>
> > --Priority: 3
> > --Saved by: Jordah Ferguson (Acc. Name: jordah ferguson )
> >
> >
> > Hi all,
> >
> > I have a couple of questions i would like to ask about the tooltip
> > control
> >
> > 1) Can toottips be multiline? Cause i have a long message i would like
> > to present when a certain listview
> >    item is clicked. When i make the tooltip text long, it is like
> > sending a long unwrapped text to the printer!
> > 2)Can the background and foreground colour of a tooltip be changed? I
> > kinda want to make a special good
> >    looking tooltip for the secial listview items that are being clicked.
> > 3)Can tooltips be created with extra styles such as having a 3D border?
> > 4)Can an Icon control or bitmap control be added to a tooltip?
> >
> > That wraps up the questions i had about win32lib tooltips..
> >
> > Thanx in advance
> > Jordah Ferguson
> > jorfergie03 at yahoo.com
> >
> > --Processed and saved using: Cirrus Mail ver 0.2a
> >
> >
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: Tool tips & win32lib

Jordah,

Maybe this will help?

Multiline ToolTips:
"The ToolTip control will wrap the lines automatically, or you can use a
carriage return/line feed combination, \r\n, to force line breaks at
particular locations."

Dan Moyer

>From microsoft,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/commctls/tooltip/usingtooltips.asp

Multiline ToolTips
Multiline ToolTips allow text to be displayed on more than one line. They
are supported by version 4.70 and later of the common controls. Your
application creates a multiline ToolTip by responding to a TTN_GETDISPINFO
notification message. To force the ToolTip control to use multiple lines,
send a TTM_SETMAXTIPWIDTH message, specifying the width of the display
rectangle. Text that exceeds this width will wrap to the next line rather
than widening the display region. The rectangle height will be increased as
needed to accommodate the additional lines. The ToolTip control will wrap
the lines automatically, or you can use a carriage return/line feed
combination, \r\n, to force line breaks at particular locations.

Note that the text buffer specified by the szText member of the NMTTDISPINFO
structure can accommodate only 80 characters. If you need to use a longer
string, point the lpszText member of NMTTDISPINFO to a buffer containing the
desired text.


----- Original Message -----
From: "jordah ferguson" <jorfergie03 at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, March 27, 2002 8:26 AM
Subject: RE: Tool tips & win32lib


>
> i tried the method, it strictly allows characters up to the specified
> range for example if your word if euman at bellsouth.net
> and your range is 100
> you get
> -------
> |euman@|
> |bellso|
> |uth.ne|
> |t     |
> --------
>
> isn't there a way of doing, clever wrapping
>
> jordah ferguson
>
> Derek Parnell wrote:
> > Thanks, I'll give it a try.
> > ----- Original Message -----
> > From: "Tony Steward" <tony at locksdownunder.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Tuesday, March 26, 2002 10:00 PM
> > Subject: RE: Tool tips & win32lib
> >
> >
> > > Hi Jordan,
> > > Heres an old post by euman which may help
> > >
> > > cut...
> > > Someone wrote me and asked how do I set the multi-column on a tooltip
> > >  well, here it is.....(Derek you might want to add this)
> > >
> > >  Find:
> > > global procedure setHintEx(integer id,sequence text,atom exflags)
> > >
> > >  near the end of the procedure you should see this
> > >
> > >  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
> > >
> > >  Put the next line above the one I just typed above "Like this"
> > >
> > >  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, 100)
> > >  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
> > >
> > > I tried to set this up in lTTmsg but couldnt figure out how to connect
> > > the
> > > length on the string so that it would be automatic.
> > >
> > >  Note:
> > >  You will need to set the with where I have 100 on the end of the
> > >  message to length you wish to wrap the line...'
> > >
> > >  Alternatively you could do this:
> > >
> > >  global procedure setHintEx(integer id,sequence text,atom exflags,
> > > integer len)
> > >
> > >  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, len)
> > >
> > >  and in your program do this:
> > >
> > > >>>>> (Here's the Change)
> > >  setHintEx( id, "text", 0, 100 )
> > >
> > >  and this should work fine.
> > >
> > >
> > >  Euman
> > >  euman at bellsouth.net
> > > end cut....
> > > jordah ferguson wrote:
> > > >
> > > >
> > > > --To: any one concerned <euforum at topica.com>
> > > > --Subject: Tool tips & win32lib
> > > > --Date: Mon, 25 March, 2002.
> > > > --From: Jordah Ferguson <jorfergie03 at yahoo.com>
> > > > --Priority: 3
> > > > --Saved by: Jordah Ferguson (Acc. Name: jordah ferguson )
> > > >
> > > >
> > > > Hi all,
> > > >
> > > > I have a couple of questions i would like to ask about the tooltip
> > > > control
> > > >
> > > > 1) Can toottips be multiline? Cause i have a long message i would
like
> > > > to present when a certain listview
> > > >    item is clicked. When i make the tooltip text long, it is like
> > > > sending a long unwrapped text to the printer!
> > > > 2)Can the background and foreground colour of a tooltip be changed?
I
> > > > kinda want to make a special good
> > > >    looking tooltip for the secial listview items that are being
clicked.
> > > > 3)Can tooltips be created with extra styles such as having a 3D
border?
> > > > 4)Can an Icon control or bitmap control be added to a tooltip?
> > > >
> > > > That wraps up the questions i had about win32lib tooltips..
> > > >
> > > > Thanx in advance
> > > > Jordah Ferguson
> > > > jorfergie03 at yahoo.com
> > > >
> > > > --Processed and saved using: Cirrus Mail ver 0.2a

new topic     » goto parent     » topic index » view message » categorize

4. Re: Tool tips & win32lib

Heres a shot in the dark,

I actually wrote this in my emailerso dont expect too much.

Completely untested code...beware!

integer xGetTextExtentPoint32 
xGetTextExtentPoint32 = define_c_proc(gdi32, "GetTextExtentPoint32",
        {C_LONG, C_POINTER, C_INT, C_POINTER})

constant -- tagSIZE 
   tagSIZE_x = 0,
   tagSIZE_y = 4

tagSize = allocate(8)

sequence str
str = " --type your text here "

str_len = length(str)
pstr = allocate_string(str)

hdc = GetDC(hwnd)
c_proc(xGetTextExtentPoint32,{hdc, pstr, str_len, tagSize})
ReleaseDC(hwnd, hdc) 

integer str_width
str_width = peek4u(tagSize + 4)

-- You do the math on this! you could even get real fancy and have euphoria
-- look for a  '32' whitespace closes to your estimated largest width and
-- set the width there but this is up to you.

integer tip_width
if str_width > 50 and str_width < 100 then
   tip_width = 100
end if

object junk
junk=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, tip_width)


Euman
euman at bellsouth.net

new topic     » goto parent     » topic index » view message » categorize

5. Re: Tool tips & win32lib

whoops again, Left an 'A' out and didnt declare pstr 

This part has been tested and seems to work OK on my Win98 SE

integer xGetTextExtentPoint32 
xGetTextExtentPoint32 = define_c_proc(gdi32, "GetTextExtentPoint32A",{C_LONG,
C_POINTER, C_INT, C_POINTER})

atom tagSize
tagSize = allocate(8)

sequence str
str = " --type your text here "

integer str_len
atom pstr
str_len = length(str)
pstr = allocate_string(str)

atom hdc
hdc = GetDC(hwnd)
c_proc(xGetTextExtentPoint32,{hdc, pstr, str_len, tagSize})
ReleaseDC(hwnd, hdc) 

integer str_width
str_width = peek4u(tagSize + 4)

--  str = " --type your text here " was returned as str_width = 86 on my box

-- You do the math on this! you could even get real fancy and have euphoria
-- look for a  '32' whitespace closes to your estimated largest width and
-- set the width there but this is up to you.

integer tip_width
if str_width > 50 and str_width < 100 then
   tip_width = 100
end if

Euman
euman at bellsouth.net

new topic     » goto parent     » topic index » view message » categorize

6. Re: Tool tips & win32lib

One extra note involved here...

str_width = peek4u(tagSize) -- returns the X or width in pixels
str_width = peek4u(tagSize + 4) -- returns the Y or height in pixels

in my example I had tested Y last and didnt change this back to X
just incase someone actually tries this.

by the way, I changed font sizes in windows and the size did increase
as it should. Using standard small fonts my X / width for " --type your text
here "
is 138 pixels.

Euman

----- Original Message ----- 
From: <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>

> whoops again, Left an 'A' out and didnt declare pstr 
> 
> This part has been tested and seems to work OK on my Win98 SE
> 
> integer xGetTextExtentPoint32 
> xGetTextExtentPoint32 = define_c_proc(gdi32, "GetTextExtentPoint32A",{C_LONG,
> C_POINTER, C_INT, C_POINTER})
> 
> atom tagSize
> tagSize = allocate(8)
> 
> sequence str
> str = " --type your text here "
> 
> integer str_len
> atom pstr
> str_len = length(str)
> pstr = allocate_string(str)
> 
> atom hdc
> hdc = GetDC(hwnd)
> c_proc(xGetTextExtentPoint32,{hdc, pstr, str_len, tagSize})
> ReleaseDC(hwnd, hdc) 
> 
> integer str_width
> str_width = peek4u(tagSize + 4)
> 
> --  str = " --type your text here " was returned as str_width = 86 on my box
> 
> -- You do the math on this! you could even get real fancy and have euphoria
> -- look for a  '32' whitespace closes to your estimated largest width and
> -- set the width there but this is up to you.
> 
> integer tip_width
> if str_width > 50 and str_width < 100 then
>    tip_width = 100
> end if
> 
> Euman
> euman at bellsouth.net

new topic     » goto parent     » topic index » view message » categorize

7. Re: Tool tips & win32lib

From: <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Tool tips & win32lib

> One extra note involved here...
> 
> str_width = peek4u(tagSize) -- returns the X or width in pixels
> str_width = peek4u(tagSize + 4) -- returns the Y or height in pixels
> 
> in my example I had tested Y last and didnt change this back to X
> just incase someone actually tries this.
> 
> by the way, I changed font sizes in windows and the size did increase
> as it should. Using standard small fonts my X / width for " --type your text
> here "
> is 138 pixels.
> 
> Euman

18 hours isnt bad to showup on the list eh?

I sent this at 6:00am not 9:05 and I just recieved it from topica at 12:05am
on the next day.....

Topica Really Sucks.

Euman

new topic     » goto parent     » topic index » view message » categorize

8. Re: Tool tips & win32lib

Yes, but not yet.
----- Original Message -----
From: "Tony Steward" <tony at locksdownunder.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Tool tips & win32lib


>
> Hi Jordan,
> Heres an old post by euman which may help
>
> cut...
> Someone wrote me and asked how do I set the multi-column on a tooltip
>  well, here it is.....(Derek you might want to add this)
>
>  Find:
> global procedure setHintEx(integer id,sequence text,atom exflags)
>
>  near the end of the procedure you should see this
>
>  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
>
>  Put the next line above the one I just typed above "Like this"
>
>  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, 100)
>  VOID=sendMessage(tooltipControl,lTTmsg,0,ti)
>
> I tried to set this up in lTTmsg but couldnt figure out how to connect
> the
> length on the string so that it would be automatic.
>
>  Note:
>  You will need to set the with where I have 100 on the end of the
>  message to length you wish to wrap the line...'
>
>  Alternatively you could do this:
>
>  global procedure setHintEx(integer id,sequence text,atom exflags,
> integer len)
>
>  VOID=sendMessage(tooltipControl, TTM_SETMAXTIPWIDTH, 0, len)
>
>  and in your program do this:
>
> >>>>> (Here's the Change)
>  setHintEx( id, "text", 0, 100 )
>
>  and this should work fine.
>
>
>  Euman
>  euman at bellsouth.net
> end cut....
> jordah ferguson wrote:
> >
> >
> > --To: any one concerned <euforum at topica.com>
> > --Subject: Tool tips & win32lib
> > --Date: Mon, 25 March, 2002.
> > --From: Jordah Ferguson <jorfergie03 at yahoo.com>
> > --Priority: 3
> > --Saved by: Jordah Ferguson (Acc. Name: jordah ferguson )
> >
> >
> > Hi all,
> >
> > I have a couple of questions i would like to ask about the tooltip
> > control
> >
> > 1) Can toottips be multiline? Cause i have a long message i would like
> > to present when a certain listview
> >    item is clicked. When i make the tooltip text long, it is like
> > sending a long unwrapped text to the printer!
> > 2)Can the background and foreground colour of a tooltip be changed? I
> > kinda want to make a special good
> >    looking tooltip for the secial listview items that are being clicked.
> > 3)Can tooltips be created with extra styles such as having a 3D border?
> > 4)Can an Icon control or bitmap control be added to a tooltip?
> >
> > That wraps up the questions i had about win32lib tooltips..
> >
> > Thanx in advance
> > Jordah Ferguson
> > jorfergie03 at yahoo.com
> >
> > --Processed and saved using: Cirrus Mail ver 0.2a
> >
> >
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu