JVCL scroll the HelpPanel text

Posted on 2006-11-13
Last Modified: 2010-04-05
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
Question by:ebi1
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
  • 6
  • 4

Author Comment

ID: 17929162
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)

Author Comment

ID: 17929167
LVL 28

Expert Comment

ID: 17931775
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:



  StdCtrls,//  <-----------------------------------------------------------this
  Windows, Messages, SysUtils, Classes, Graphics, Controls,

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

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

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.

Independent Software Vendors: 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

ID: 17932528
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

Author Comment

ID: 17932565
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
LVL 28

Accepted Solution

TName earned 400 total points
ID: 17934120

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

  THPanel = class(TJvgHelpPanel)
    constructor Create(AOwner: TComponent); override;

constructor THPanel.Create(AOwner: TComponent);

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

h :HWND;
   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);

LVL 28

Expert Comment

ID: 17934172
For the last solution above, forgot to tell you to declare this constant:


Author Comment

ID: 17940156
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.
LVL 28

Expert Comment

ID: 17942960
Hi, here's an easy way to change the Font.Name and Font.Size:

Add this to the interface section of your unit:

  THack = class(TCustomPanel)
    property Canvas;

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

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

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).

Author Comment

ID: 17943131
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.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month6 days, 13 hours left to enroll

623 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