Ttabsheet and vertical text.

Ttabsheet and vertical text.

Post by helmu » Thu, 16 Mar 2006 17:12:31


helo all, When i set a Tpagecontrol to tpLeft how can i set the
Ttabsheet.caption so that the text reads downwards.
thanks for any info.
helmut.
 
 
 

Ttabsheet and vertical text.

Post by Ant » Thu, 16 Mar 2006 17:32:31

gues you could use the Draw tab method.

The code below just colours the text to show the selection. The code below
that will draw text onto a canvas at a rotated angle.


var
tw : Integer;
begin
with Control.Canvas do
begin
Brush.Color := clBtnFace;
Brush.Style := bsSolid;
Fillrect(Rect);
if TabIndex >= 0 then
begin
if Active then
begin
//Color of selected tabs caption
Font.Color := clBlue;
Font.Style := [fsBold];
end
else
begin
//Color of all other tabs caption
Font.Color := clNavy;
Font.Style := [fsBold];
end;
Brush.Style := bsClear;
tw := TextWidth((Control as
TPageControl).Pages[TabIndex].Caption);
case TabIndex of
0: TextRect(Rect, Rect.Left + 4, Rect.Top + 10, (Control as
TPageControl).Pages[TabIndex].Caption);
1: TextRect(Rect, (Rect.Right - Rect.Left) + (tw + 15) ,
Rect.Top + 10, (Control as TPageControl).Pages[TabIndex].Caption);
2: TextRect(Rect, Rect.Right - TW - 1, Rect.Top + 10, (Control
as TPageControl).Pages[TabIndex].Caption);
end;//case
end;
end; //with Control.canvas do




procedure TCaptionSeatMapItem.OutPutToCanvas( TheCanvas: TCanvas;
ScrollOffset: TPoint; ContrastColor : TColor; ZoomLevel : Integer;
ShowHook : Boolean );
var
lf : TLogFont;
tf : TFont;
//HookRect Shows users what to highlight to delete, generall the topLeft
corner if the
//orientation is normal
HookRect : TRect;
MyTL : TPoint;
begin
//Remeber to scale co-ords using the ZoomLevel

tf := nil;
try
tf := TFont.Create;
with TheCanvas do
begin
tf.Size := ( Self as TBaseSeatMapItem ).ScaledNumber( ZoomLevel,
fMyFont.Size );
tf.Style := fMyFont.Style;
tf.Name := fMyFont.Name;
tf.Color := fMyFont.Color;
GetObject( tf.Handle, sizeof( lf ), @lf );
//We can rotate the text to appear at different angles with the
//direction parameter
lf.lfEscapement := Self.flfEscapment;
lf.lfOrientation := lf.lfEscapement;
tf.Handle := CreateFontIndirect(lf);
TheCanvas.Font.Assign( tf ); //??
Brush.Color := Self.BkGndClr;

//Scale
MyTL := ( Self as TBaseSeatMapItem ).ScaledPoint( ZoomLevel,
Self.TopLeft );
WideCanvasTextOut( TheCanvas, MyTL.X - ScrollOffset.X,
MyTL.Y - ScrollOffset.Y, self.TheText );


//Hoooks are point that user knows to highlight to select this item
//Hooks are only needed when in create mode as user cannot delete at
any other time anyway
if ShowHook then
begin
HookRect.TopLeft := Point( MyTL.X - ScrollOffset.X - 3,
MyTL.Y - ScrollOffset.Y - 3 );
HookRect.BottomRight := Point(MyTL.X - ScrollOffset.X + 3,
MyTL.Y - ScrollOffset.Y + 3 );
//Draw a little circle for the hook to select by
Brush.Color := clWhite;
Pen.Color := clSkyBlue;
Ellipse( HookRect );
end;
end;
finally
tf.Free;
end;
end;



"helmut" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...





 
 
 

Ttabsheet and vertical text.

Post by helmu » Fri, 17 Mar 2006 05:15:22

hanks..does the trick.

"Ant" < XXXX@XXXXX.COM > wrote in message
news:4417d11e$ XXXX@XXXXX.COM ...