trichview.com

trichview.support




Margins


Return to index


Author

Message

Barry

Posted: 06/09/2003 18:18:48


In text controls we had to define our margins in twips. Below is the code

that would convert my margins to twips. How can I define my margins in

fractions within trichview? Also, how can I define my page width and height?




procedure TForm1.LoadPageDefaults;


begin


// TXCntrl.FormatSelection := True;


// TXCntrl.FontName := 'Courier New';


// TXCntrl.FontSize := 11;


rv.LeftMargin := trunc(MyVal('0.5') * 1440);


rv.TopMargin := trunc(MyVal('0.5') * 1440);


rv.RightMargin := trunc(MyVal('0.3') * 1440);


rv.BottomMargin := trunc(MyVal('0.5') * 1440);


// TXCntrl.PageWidth := trunc(MyVal('8.50') * 1440);


// TXCntrl.PageHeight := trunc(MyVal('11.00') * 1440);



end;


Function TForm1.MyVal(s : String) : Double;


// Val function which also works with ',' as decimal sign


Var n,


code : Integer;


begin


For n := 1 To Length(s) do begin


If Copy(s, n, 1) = ',' Then s[n] := '.';


end;


Val(s,result,code);


End;





Powered by ABC Amber Outlook Express Converter