Page 1 of 1

Table Center and View like Word

Posted: Thu Apr 15, 2010 2:20 pm
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

Posted: Thu Apr 15, 2010 4:01 pm
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.