: : : : : : 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(
ChannelNo: Integer,Mode: Integer)
: : : : : : MyFunction(ChannelNo: Integer
,Mode: Integer)
: : : : : :
: : : : : : 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(
hWnd:HWND;Msg:Cardinal;wParam:Integer;lParam:Integer)
: : and NOT like
: : SendMessage(
hWnd:HWND;Msg:Cardinal;wParam:Integer;lParam:Integer)
: :
: :
: I've tested a code like this, and it worked like the way you want:
:
: procedure TForm1.PaintBox1Paint(Sender: TObject);
: begin
: PaintBox1.Canvas.TextOut(10,10,'Hello');
: PaintBox1.Canvas.Font.Style := [fsBold];
: PaintBox1.Canvas.TextOut(10,30,'Hello');
: end;
:
: It shows the second hello in bold, while the first remained normal.
:
Thanks a lot friend.