home *** CD-ROM | disk | FTP | other *** search
- unit UText;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Tempunit, ComCtrls, StdCtrls, Buttons, OleCtrls, CELLLib_TLB, ExtCtrls;
-
- type
- TFText = class(TTemplate)
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- FText: TFText;
-
- implementation
-
- {$R *.DFM}
-
- procedure TFText.FormShow(Sender: TObject);
- Var
- i ,j: integer;
- begin
- inherited;
- Cell1.DoSetDefaultColWidth(100);
- Cell1.DoSetDefaultRowHeight(45);
- Cell1.DoSetDefaultFont(10,0,'Verdana');
- Cell1.Cols := 5;
- Cell1.Rows := 9;
- Cell1.DoSetCellData( 0, -1, 'Snap');
- Cell1.DoSetCellAlignment( 0, 0, $9);
- Cell1.DoSetCellData(0, 0, 'Left up');
- Cell1.DoSetCellAlignment( 0, 1, $C);
- Cell1.DoSetCellData( 0, 1, 'Center up');
- Cell1.DoSetCellAlignment( 0, 2, $A);
- Cell1.DoSetCellData( 0, 2, 'Right up');
-
- Cell1.DoSetCellAlignment( 0, 3, $21);
- Cell1.DoSetCellData( 0, 3, 'Left center' );
- Cell1.DoSetCellAlignment( 0, 4, $24);
- Cell1.DoSetCellData( 0, 4, 'Center');
- Cell1.DoSetCellAlignment( 0, 5, $22);
- Cell1.DoSetCellData( 0, 5, 'Right center');
- Cell1.DoSetCellAlignment( 0, 6, $11);
- Cell1.DoSetCellData( 0, 6, 'Left low');
- Cell1.DoSetCellAlignment( 0, 7, $14);
- Cell1.DoSetCellData( 0, 7, 'Center low');
- Cell1.DoSetCellAlignment( 0, 8, $12);
- Cell1.DoSetCellData( 0, 8, 'Right low');
- Cell1.DoSetCellData( 1, -1, 'Multiline');
- j:=Cell1.Rows - 1 ;
- For i := 0 To j do
- begin
- Cell1.DoSetCellTextStyle( 1, i, 1);
- end;
-
- Cell1.DoSetCellData( 1, 0, 'Change the width');
- Cell1.DoSetCellData( 1, 1, 'Newline automatic');
- Cell1.DoSetCellData( 1, 2, 'ROW1' + Chr(13) + 'ROW2');
- Cell1.DoJoinCells ( 1, 3, 1, 4);
- Cell1.DoSetCellData( 1, 3, 'Unite multiling of text in the cell');
-
- Cell1.DoSetCellData( 2, -1, '...show');
- For i := 0 To Cell1.Rows - 1 do
- begin
- Cell1.DoSetCellTextStyle( 2, i, 2);
- end;
- Cell1.DoSetCellData( 2, 0, 'When one line is too longú¼');
- Cell1.DoSetCellData( 2, 1, 'the invisible part will be replace by "..."');
- Cell1.DoSetCellData( 2, 2, 'Change the with of cell can see it');
- Cell1.DoJoinCells ( 2, 3, 2, 4);
- Cell1.DoSetCellData( 2, 3, 'Unite all invisible lines');
-
-
- Cell1.DoSetCellData (3, -1, 'Color');
- Cell1.DoSetCellColor(3, 0, RGB(255, 0, 0), RGB(255, 255, 255));
- Cell1.DoSetCellData (3, 0, 'Each cell');
- Cell1.DoSetCellColor(3, 1, RGB(0, 255, 0), RGB(255, 255, 255));
- Cell1.DoSetCellData (3, 1, 'had their ');
- Cell1.DoSetCellColor(3, 2, RGB(0, 0, 255), RGB(255, 255, 255));
- Cell1.DoSetCellData (3, 2, 'foreground color');
- Cell1.DoSetCellColor(3, 3, RGB(127, 127, 127), RGB(0, 0, 0));
- Cell1.DoSetCellData (3, 3, '& background color');
-
- Cell1.DoSetCellData(4, -1, 'Font');
- Cell1.DoSetCellFont(4, 0, 12, 0, 'MT Extra');
- Cell1.DoSetCellData(4, 0, 'MT Extra 12');
- Cell1.DoSetCellFont(4, 1, 14, 0, 'Courier New');
- Cell1.DoSetCellData(4, 1, 'Courier New 14');
- Cell1.DoSetCellFont(4, 2, 18, 0, 'Arial');
- Cell1.DoSetCellData(4, 2, 'Arial 18');
- Cell1.DoSetCellFont(4, 3, 10, 1, 'Arial');
- Cell1.DoSetCellData(4, 3, 'Arial Bold');
- Cell1.DoSetCellFont(4, 4, 10, 2, 'Arial');
- Cell1.DoSetCellData(4, 4, 'Arial inclined');
- Cell1.DoSetCellFont(4, 5, 10, 6, 'Symbol');
- Cell1.DoSetCellData(4, 5, 'Symbol with underline');
- end;
-
- end.
-