?
Solved

Tooltip formatting

Posted on 2003-03-06
11
Medium Priority
?
727 Views
Last Modified: 2007-12-19
Anybody know how to custom draw tooltips? I need to display a tooltip that is formatted: italics, bold, underline etc.
0
Comment
Question by:davelane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8080233
0
 

Author Comment

by:davelane
ID: 8080711
Looks good, but I really don't fancy going through the hassle of going after money to pay for it. Know of any free options?
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8080752
THTMLHint is free for non-commercial use...
You use it like normal HTML:

<B>Bold</B><I>Italic</I><U>Underline</U>...
You can also insert images from ImageList and color the text, background, make margins... lot of stuff :-)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:davelane
ID: 8081626
Yeah, looks great, if there is no other option then I will try to chase down some money for it here.

We would be using it commercially though, so would have to pay. Any other options?
0
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8093532
Hi Dave ...

You have a couple of options :-
1. Write your own,
2. Use Freeware

For freeware components that have a good list of features, and most of which include sourcecode, I'd recommend :-
http://www.delphispirit.com/rd/Delphi/24/181

If you'd prefer to write your own, this isn't too complex, let us know exactly (!) what you need, and we'll try and throw something together :-)

Hope this helps,
Steve
0
 
LVL 1

Expert Comment

by:Munim
ID: 8094279
Hello,
   How about baloon tooltip... with a bold titlebar, with an icon on left,and a multiline tip...

Munim
0
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8094397
All ...

This is the best Freeware / OpenSource VCL Component out there that I have found for D3, D4, D5, D6, D7 :-

http://www.delphiarea.com/products/assistant/

It looks, and acts exactly like MS Office Assistant. It has animations, a variety of actors(which vary in size) to read the hint, languages translations, and all source code !

Any better :-) ?
Steve
0
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8094505
ps ... I've just installed and compiled this component :-)

It requires another 3rd party component to be not installed, but to have the .PAS in the same directory as the assistant :-

http://www.the-hoskings.freeserve.co.uk/Off97Btn.htm

It is incredible !!! ... Apart from being a tad smaller, you couldn't askfor anymore ... it has everything !

Hope this was what you're looking for,
Steve
0
 
LVL 2

Accepted Solution

by:
steve_hsk earned 400 total points
ID: 8094733
I'm on a role ... maybe ... or maybe not ;-) ...

http://www.the-hoskings.freeserve.co.uk/Off97Bln.htm

Is a lighter Balloon Hint App with full source code.

It's not a component, but does include a demo project on how to use.

Adding font or italic tags would be relatively straight forwards !

Finally a really nice example which needs a component  wrapper, but works as a nice general balloon tip code :-

http://www.swissdelphicenter.com/en/showcode.php?id=1555

const
  TTS_BALLOON    = $40;
  TTM_SETTITLE = (WM_USER + 32);

var
  hTooltip: Cardinal;
  ti: TToolInfo;
  buffer : array[0..255] of char;
   
{....}

procedure CreateToolTips(hWnd: Cardinal);
begin
  hToolTip := CreateWindowEx(0, 'Tooltips_Class32', nil, TTS_ALWAYSTIP or TTS_BALLOON,
    Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
    Integer(CW_USEDEFAULT), hWnd, 0, hInstance, nil);
  if hToolTip <> 0 then
  begin
    SetWindowPos(hToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or
      SWP_NOSIZE or SWP_NOACTIVATE);
    ti.cbSize := SizeOf(TToolInfo);
    ti.uFlags := TTF_SUBCLASS;
    ti.hInst  := hInstance;
  end;
end;

procedure AddToolTip(hwnd: DWORD; lpti: PToolInfo; IconType: Integer;
  Text, Title: PChar);
var
  Item: THandle;
  Rect: TRect;
begin
  Item := hWnd;
  if (Item <> 0) and (GetClientRect(Item, Rect)) then
  begin
    lpti.hwnd := Item;
    lpti.Rect := Rect;
    lpti.lpszText := Text;
    SendMessage(hToolTip, TTM_ADDTOOL, 0, Integer(lpti));
    FillChar(buffer, SizeOf(buffer), #0);
    lstrcpy(buffer, Title);
    if (IconType > 3) or (IconType < 0) then IconType := 0;
    SendMessage(hToolTip, TTM_SETTITLE, IconType, Integer(@buffer));
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  CreateToolTips(Form1.Handle);
  AddToolTip(Memo1.Handle, @ti, 1, 'Tooltip text', 'Title');
end;

{
IconType can be:

 0 - No icon
 1 - Information
 2 - Warning
 3 - Error
}

Steve

0
 

Author Comment

by:davelane
ID: 8109526
OK Steve, better give you the points before you give me any more information :-) That was great, don't you guys have jobs? :-)
0
 
LVL 2

Expert Comment

by:steve_hsk
ID: 8109542
Glad it helped Dave ...

<< leg in plaster ... way too much time on my hands :-)

Thanks for the points  !!!
Steve
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question