JVCL scroll the HelpPanel text

Hi guys,

Can anyone give me a source example of ho do add vertical scroll to the HelpPanel of the JVCL please?

* I tried Inheritance, but i'm DON'T know much about OO, so i probably didnt do it right.
* I also tried HelpPanel.Parent:=ScrollBox, but that put ALL the JVCL's HelpPanel inside the Scroll Box, and i need only the text part, NOT all the HelpPanel componnent.
* There is no WordWrap Property to the HelpPanel componnent.
* There is no ScrollBars Property to the HelpPanel componnent.

I'm begginer Delphi lover, so please give me a working and documented (as much as you can)

MANY thanks
ebi1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ebi1Author Commented:
Oh, and one more thing i forgot.

The Font Property, doesn't seem to work at all.
Nothing that i do changes anything in Capstion of the HelpPanel.
Changin the Font.Color, Font.Name, Font.Size, Font.Style Etc' make no difference.
Am i doing something wrong, or is it a bug in the componnent?

After adding this other questiong (about the same componnent ) i'm changing the points and raise it to 350.

MANY thanks (again)
0
ebi1Author Commented:
oops...
0
TNameCommented:
Hi ebi1,
It's quite easy to do (after finding the component!! I guess you mean JvgHelpPanel on the JVCL Globus 2  tab of the Jedi VCL...) but you'd have to add two lines to the source of JvgHelpPanel.pas, and I'm not sure if that would be such a good idea if you're unexperienced...

You'd have to go to  ...JVCL3.0\jvcl\lib\d7 (the name of the last directory depends on the Delphi version) and rename JvgHelpPanel.dcu to something else (so Delphi won't find it and you'd still have it as a backup). Then you'd have to add the directory in which the pas file (JvgHelpPanel.pas) is located (in my case ...\JVCL3.0\jvcl\run) to the library path:
Tools > Environment Options > Library -> Library Path

//then you'd have to add 2 lines to JvgHelpPanel.pas:

interface

uses

  {$IFDEF USEJVCL}
  {$IFDEF UNITVERSIONING}
  JclUnitVersioning,
  {$ENDIF UNITVERSIONING}
  {$ENDIF USEJVCL}
  StdCtrls,//  <-----------------------------------------------------------this
  Windows, Messages, SysUtils, Classes, Graphics, Controls,
  {$IFDEF USEJVCL}

//and in the constructor (constructor TJvgHelpPanel.Create(...)):

 if not (csDesigning in ComponentState) then
  begin
    FRich := TRichEdit.Create(Self);
    FRich.Parent := Self;
    FRich.ReadOnly := True;
    FRich.ScrollBars:=ssVertical;  //<-----------------------------------this
  end;


BTW, this would change the font (in the Paint procedure):

  Canvas.Font.Style := [fsBold];
  Canvas.Font.Name:='Courier New'; //<-----------------e.g. Here
  if FHighlightButton then


As I said, I'm not sure if it's a good idea...  (on the other hand, this is a way to learn how things work and look like in there;)
In any case you'd have to backup the original JvgHelpPanel.pas !!

You could also copy the pas file into your project directory, add the file to your project (Project>Add to project) and to the uses clause, and add the said code to THAT file. Then you'd have to create the HelpPanel at runtime.


0
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

ebi1Author Commented:
Hi TName,

You'r right.  it's not a good idea....    lol
My time is REALLY killing, so i really dont have time for testing my UNskillful "technics"  :)

Is there a way to do that programaticaly from within my program without recompiling/installing the whole JVCL package (if that's what i need to do...  me=noob) ?

btw, I tried the Canvas.Font.Style, and Canvas.Font.Name and i put it in the OnClick Event just to see if it changes the status, but it's not "working" because there is no "Canvas" Property to the TJvgHelpPanel...   :D

please bear with me (and forgive my english)

MANY MANY thanks for your time and help
0
ebi1Author Commented:
i forgot to mention (again) that i use Delphi 6 Ent, and yes, the component is the JvgHelpPanel on the JVCL Globus 2  tab of the Jedi VCL.

sorry about that and Thanks again
0
TNameCommented:

The problem is that the text field (a TRichEdit) is declared in the TJvgHelpPanel class as private, so you cannot acces it by subclassing from another unit. If it was only  protected, you could simply say

 type
  THPanel = class(TJvgHelpPanel)
  private
  protected
  public
    constructor Create(AOwner: TComponent); override;
  end;

constructor THPanel.Create(AOwner: TComponent);
begin
   inherited;
   FRich.ScrollBars:=ssVertical;
end;






The only other way I can think of is to let Windows do it (Put this e.g. in FormShow):

var
h :HWND;
begin
   h := FindWindowEx(Handle, 0, 'TJvgHelpPanel', nil);
   if h<>0 then begin
     h := FindWindowEx(h, 0, 'TRichEdit', nil);
        if h<>0 then begin
           SendMessage(h, EM_SHOWSCROLLBAR, SB_VERT, 1);  //for some reason you have to call this twice
           SendMessage(h, EM_SHOWSCROLLBAR, SB_VERT, 1);
        end;
    end;
end;




0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TNameCommented:
For the last solution above, forgot to tell you to declare this constant:

Const EM_SHOWSCROLLBAR = WM_USER + 96;
0
ebi1Author Commented:
ohhh  man,  this works GREAT.

can you also help me with the second part of the question please?
(the one that doesnt change the TJvgHelpPanel headline font)

let me know if you want me to make it as a new question

i'm rasing the points to 400 and i will give another 400 points for the font problem

you REALLY helped me, my friend.
THANK YOU
0
TNameCommented:
Hi, here's an easy way to change the Font.Name and Font.Size:

Add this to the interface section of your unit:

type
  THack = class(TCustomPanel)
  private
  public
  published
    property Canvas;
  end;



and this to your FormShow (e.g. at the end of the procedure):

THack(JvgHelpPanel1).Canvas.Font.Name:='Courier New';  //or any other font
THack(JvgHelpPanel1).Canvas.Font.Size:=10;


you can't change the font color and style like this, because color and style are set in the paint procedure of the component, and will overwrite these settings.
To change them, you'd have to (subclass and) repaint the component (overwriting the original OnPaint).
0
ebi1Author Commented:
Well, you did again   :)

i will post another "question" just for you to give you the other 400 points i promissed.
i'll be happy if you accept them.

MANY thanks my friend.  you helped me A LOT.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.