How to make InstantHelp - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to make InstantHelp

dubidubi Posts: 121Member
In Delphi IDE,the editor pops up a InstantHint or Help
when we type a function name.
For example,if we type 'SendMessage(',
then instantly we get a help popup of the funtion parameters.
This Functionaly is true for our user defined functions also.
I like to add this InstantHelp functionality in the editor of
current application I am working in(also developed in Delphi).

I tried THintWindow,it works goods.
But the text in THintWindow object cannot be highlighted as it
is done in Delphi IDE Editor.
i.e cannot highlight which parameter of the function we type.
Can we draw text of different colors in THintWindow object's canvas.
Like
MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])

Many thanks for your suggestions.

Comments

  • zibadianzibadian Posts: 6,349Member
    : In Delphi IDE,the editor pops up a InstantHint or Help
    : when we type a function name.
    : For example,if we type 'SendMessage(',
    : then instantly we get a help popup of the funtion parameters.
    : This Functionaly is true for our user defined functions also.
    : I like to add this InstantHelp functionality in the editor of
    : current application I am working in(also developed in Delphi).
    :
    : I tried THintWindow,it works goods.
    : But the text in THintWindow object cannot be highlighted as it
    : is done in Delphi IDE Editor.
    : i.e cannot highlight which parameter of the function we type.
    : Can we draw text of different colors in THintWindow object's canvas.
    : Like
    : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    :
    : Many thanks for your suggestions.
    :
    It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
  • dubidubi Posts: 121Member
    : : In Delphi IDE,the editor pops up a InstantHint or Help
    : : when we type a function name.
    : : For example,if we type 'SendMessage(',
    : : then instantly we get a help popup of the funtion parameters.
    : : This Functionaly is true for our user defined functions also.
    : : I like to add this InstantHelp functionality in the editor of
    : : current application I am working in(also developed in Delphi).
    : :
    : : I tried THintWindow,it works goods.
    : : But the text in THintWindow object cannot be highlighted as it
    : : is done in Delphi IDE Editor.
    : : i.e cannot highlight which parameter of the function we type.
    : : Can we draw text of different colors in THintWindow object's canvas.
    : : Like
    : : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    : :
    : : Many thanks for your suggestions.
    : :
    : It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
    :

    Yes,I have done as you said,creating descendant of THintWindow.
    But my question is how to Paint or Draw different colors of
    text in the THintWindow descendant.
    The text I display is only of one color.
    How to show text of different colors(if possible Bold) in the Canvas of THintWindow descendant.
  • zibadianzibadian Posts: 6,349Member
    : : : In Delphi IDE,the editor pops up a InstantHint or Help
    : : : when we type a function name.
    : : : For example,if we type 'SendMessage(',
    : : : then instantly we get a help popup of the funtion parameters.
    : : : This Functionaly is true for our user defined functions also.
    : : : I like to add this InstantHelp functionality in the editor of
    : : : current application I am working in(also developed in Delphi).
    : : :
    : : : I tried THintWindow,it works goods.
    : : : But the text in THintWindow object cannot be highlighted as it
    : : : is done in Delphi IDE Editor.
    : : : i.e cannot highlight which parameter of the function we type.
    : : : Can we draw text of different colors in THintWindow object's canvas.
    : : : Like
    : : : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : : : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    : : :
    : : : Many thanks for your suggestions.
    : : :
    : : It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
    : :
    :
    : Yes,I have done as you said,creating descendant of THintWindow.
    : But my question is how to Paint or Draw different colors of
    : text in the THintWindow descendant.
    : The text I display is only of one color.
    : How to show text of different colors(if possible Bold) in the Canvas of THintWindow descendant.
    :
    Change the properties of the TCanvas.Font object before you call one of the TextXXXX() methods.
  • dubidubi Posts: 121Member
    : : : : In Delphi IDE,the editor pops up a InstantHint or Help
    : : : : when we type a function name.
    : : : : For example,if we type 'SendMessage(',
    : : : : then instantly we get a help popup of the funtion parameters.
    : : : : This Functionaly is true for our user defined functions also.
    : : : : I like to add this InstantHelp functionality in the editor of
    : : : : current application I am working in(also developed in Delphi).
    : : : :
    : : : : I tried THintWindow,it works goods.
    : : : : But the text in THintWindow object cannot be highlighted as it
    : : : : is done in Delphi IDE Editor.
    : : : : i.e cannot highlight which parameter of the function we type.
    : : : : Can we draw text of different colors in THintWindow object's canvas.
    : : : : Like
    : : : : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : : : : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    : : : :
    : : : : Many thanks for your suggestions.
    : : : :
    : : : It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
    : : :
    : :
    : : Yes,I have done as you said,creating descendant of THintWindow.
    : : But my question is how to Paint or Draw different colors of
    : : text in the THintWindow descendant.
    : : The text I display is only of one color.
    : : How to show text of different colors(if possible Bold) in the Canvas of THintWindow descendant.
    : :
    : Change the properties of the TCanvas.Font object before you call one of the TextXXXX() methods.
    :

    But that will change the entire text in the Canvas.
    Like
    SendMessage([blue]hWnd:HWND;Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]
    and NOT like
    SendMessage([red]hWnd:HWND;[/red][blue]Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]

  • zibadianzibadian Posts: 6,349Member
    : : : : : In Delphi IDE,the editor pops up a InstantHint or Help
    : : : : : when we type a function name.
    : : : : : For example,if we type 'SendMessage(',
    : : : : : then instantly we get a help popup of the funtion parameters.
    : : : : : This Functionaly is true for our user defined functions also.
    : : : : : I like to add this InstantHelp functionality in the editor of
    : : : : : current application I am working in(also developed in Delphi).
    : : : : :
    : : : : : I tried THintWindow,it works goods.
    : : : : : But the text in THintWindow object cannot be highlighted as it
    : : : : : is done in Delphi IDE Editor.
    : : : : : i.e cannot highlight which parameter of the function we type.
    : : : : : Can we draw text of different colors in THintWindow object's canvas.
    : : : : : Like
    : : : : : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : : : : : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    : : : : :
    : : : : : Many thanks for your suggestions.
    : : : : :
    : : : : It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
    : : : :
    : : :
    : : : Yes,I have done as you said,creating descendant of THintWindow.
    : : : But my question is how to Paint or Draw different colors of
    : : : text in the THintWindow descendant.
    : : : The text I display is only of one color.
    : : : How to show text of different colors(if possible Bold) in the Canvas of THintWindow descendant.
    : : :
    : : Change the properties of the TCanvas.Font object before you call one of the TextXXXX() methods.
    : :
    :
    : But that will change the entire text in the Canvas.
    : Like
    : SendMessage([blue]hWnd:HWND;Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]
    : and NOT like
    : SendMessage([red]hWnd:HWND;[/red][blue]Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]
    :
    :
    I've tested a code like this, and it worked like the way you want:
    [code]
    procedure TForm1.PaintBox1Paint(Sender: TObject);
    begin
    PaintBox1.Canvas.TextOut(10,10,'Hello');
    PaintBox1.Canvas.Font.Style := [fsBold];
    PaintBox1.Canvas.TextOut(10,30,'Hello');
    end;
    [/code]
    It shows the second hello in bold, while the first remained normal.
  • dubidubi Posts: 121Member
    : : : : : : In Delphi IDE,the editor pops up a InstantHint or Help
    : : : : : : when we type a function name.
    : : : : : : For example,if we type 'SendMessage(',
    : : : : : : then instantly we get a help popup of the funtion parameters.
    : : : : : : This Functionaly is true for our user defined functions also.
    : : : : : : I like to add this InstantHelp functionality in the editor of
    : : : : : : current application I am working in(also developed in Delphi).
    : : : : : :
    : : : : : : I tried THintWindow,it works goods.
    : : : : : : But the text in THintWindow object cannot be highlighted as it
    : : : : : : is done in Delphi IDE Editor.
    : : : : : : i.e cannot highlight which parameter of the function we type.
    : : : : : : Can we draw text of different colors in THintWindow object's canvas.
    : : : : : : Like
    : : : : : : MyFunction([Blue]ChannelNo: Integer,[/Blue]Mode: Integer)
    : : : : : : MyFunction(ChannelNo: Integer[Blue],Mode: Integer[/Blue])
    : : : : : :
    : : : : : : Many thanks for your suggestions.
    : : : : : :
    : : : : : It is possible to create your own hintwindow by designing a descendant of the THintWindow control, which has a custom Paint() method. This window must then be registered using the HintWindowClass.
    : : : : :
    : : : :
    : : : : Yes,I have done as you said,creating descendant of THintWindow.
    : : : : But my question is how to Paint or Draw different colors of
    : : : : text in the THintWindow descendant.
    : : : : The text I display is only of one color.
    : : : : How to show text of different colors(if possible Bold) in the Canvas of THintWindow descendant.
    : : : :
    : : : Change the properties of the TCanvas.Font object before you call one of the TextXXXX() methods.
    : : :
    : :
    : : But that will change the entire text in the Canvas.
    : : Like
    : : SendMessage([blue]hWnd:HWND;Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]
    : : and NOT like
    : : SendMessage([red]hWnd:HWND;[/red][blue]Msg:Cardinal;wParam:Integer;lParam:Integer)[/blue]
    : :
    : :
    : I've tested a code like this, and it worked like the way you want:
    : [code]
    : procedure TForm1.PaintBox1Paint(Sender: TObject);
    : begin
    : PaintBox1.Canvas.TextOut(10,10,'Hello');
    : PaintBox1.Canvas.Font.Style := [fsBold];
    : PaintBox1.Canvas.TextOut(10,30,'Hello');
    : end;
    : [/code]
    : It shows the second hello in bold, while the first remained normal.
    :
    Thanks a lot friend.
Sign In or Register to comment.