RichView & Tabs

General TRichView support forum. Please post your questions here
Post Reply
skydiablo
Posts: 16
Joined: Wed Feb 14, 2007 1:31 pm

RichView & Tabs

Post by skydiablo »

hi (sorry for my bad english)

i want insert a icon forwards a line. i have create parastyle like:

Code: Select all

RVStyleManager.AddNewParaStyle(-20,40); 
and now i want an icon in the space forwards this line !? maybe its possible whits tabs ?

Code: Select all

  RVStyleManager.AddNewParaStyle(-40,40);
  RVStyleManager.ParaStyles[RVStyleManager.ParaStyles.Count - 1].Tabs.Add.position := 20;
and insert the text:

Code: Select all

procedure TSmilieManager.AddSmilieToRV(SmilieCode : byte; RV : TRichView; Para : integer = -1);
var GIF : TJvGIFImage;
begin
  GIF := TJvGIFImage.Create;
  try
    if SmilieCode < self.Count then
    begin
      GIF.Assign(self[SmilieCode]);
      if not GIF.Empty then
        RV.AddPictureEx('',GIF,Para,rvvaBaseline)
      else
        GIF.Free;
    end;
  except
    GIF.Free;
  end;
end;

...

SmilieManager.AddSmilieToRV(33,RV);
RV.AddNL(#9 + Text,
             TextStyle,
             ParaStyle);
but the tab is ignored ? whats wrong ?

thx & greez, sky...
shmp
Posts: 140
Joined: Sun Aug 28, 2005 10:19 am
Location: Sabah, Malaysia.
Contact:

Post by shmp »

From your code, it can be seen that Tab has been added but not set.
skydiablo
Posts: 16
Joined: Wed Feb 14, 2007 1:31 pm

Post by skydiablo »

how can i set it !?

sky...
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What's AddNewParaStyle? There is no such method in TRVStyle.

First, you call AddSmilieToRV without specifying value for Para parameter, so the default value (-1) is used. Because of this, the picture is added to the end of the existing paragraph.

Next, you call AddNL to add tab and text. This is a wrong method for this, because the string parameter of AddNL cannot contain Tab character. Use AddTextNL instead. And what's the value of ParaStyle variable? If it is not -1, tab and text will be added from new line.
Post Reply