Page 1 of 1

RichView & Tabs

Posted: Sun Mar 04, 2007 9:07 pm
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...

Posted: Sun Mar 04, 2007 11:26 pm
by shmp
From your code, it can be seen that Tab has been added but not set.

Posted: Mon Mar 05, 2007 12:20 am
by skydiablo
how can i set it !?

sky...

Posted: Mon Mar 05, 2007 7:24 am
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.