Table Center and View like Word

General TRichView support forum. Please post your questions here
Post Reply
Artis
Posts: 1
Joined: Tue Apr 13, 2010 7:45 am

Table Center and View like Word

Post by Artis »

Hi,

I am discovering Richview and it's really impressive.
I have read the help file, but i have two questions.

1) In a RichViewEdit, if i do :

Code: Select all

  Table := TRVTableItemInfo.CreateEx(1,3,RVe_CR.RVData);
  Table.BestWidth := -80;
  Table.CellHPadding := 3;
  Table.ParaNo := 1;  //This ParaStyle is Centered
  Table.InsertRows(Table.RowCount,1,0); 
  RVE_CR.InsertItem('CompteResultat', table);
  RVE_CR.Format;
The table is not centered??

2) I reuse the code of ActionTest demo.
is it possible to view only A4 page and not a blank page larger than 21 cm?
Like MsWord or OpenOffice in Standard mode.

Thanks,
Artis











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

Post by Sergey Tkachenko »

1) If you want to insert the table in the caret position, as editing operation (undoable):

Code: Select all

  Table := TRVTableItemInfo.CreateEx(1,3,RVe_CR.RVData); 
  Table.BestWidth := -80; 
  Table.CellHPadding := 3; 
  Table.InsertRows(Table.RowCount,1,0); 
  RVE_CR.ApplyParaStyle(1); //This ParaStyle is Centered 
  RVE_CR.InsertItem('CompteResultat', table); 
  // format is not needed after editing method
InsertItem ignores ParaNo specified in the item, it uses ParaNo of the paragraph at the point of insertion.

If you want to add table to the end of document, not as editing operation:

Code: Select all

  Table := TRVTableItemInfo.CreateEx(1,3,RVe_CR.RVData); 
  Table.BestWidth := -80; 
  Table.CellHPadding := 3; 
  Table.InsertRows(Table.RowCount,1,0); 
  Table.ParaNo := 1; //This ParaStyle is Centered 
  RVE_CR.AddItem('CompteResultat', table); 
  RVE_CR.Format;
2) I am not sure that I understand the question. If you want to display pages, you can use ScaleRichView addon.
Post Reply