Link to home
Start Free TrialLog in
Avatar of ebi1
ebi1Flag for Israel

asked on

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
Avatar of ebi1
ebi1
Flag of Israel image

ASKER

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)
Avatar of ebi1

ASKER

oops...
Avatar of TName
TName

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.


Avatar of ebi1

ASKER

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
Avatar of ebi1

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of TName
TName

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For the last solution above, forgot to tell you to declare this constant:

Const EM_SHOWSCROLLBAR = WM_USER + 96;
Avatar of ebi1

ASKER

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
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).
Avatar of ebi1

ASKER

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.