From: Peter T. <pe...@us...> - 2004-04-04 19:38:31
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30924/run Modified Files: JvComCtrls.pas Log Message: - Removed JvTabControl.pas - TJvTabControl moved to JvComCtrls.pas - Added TJvTabControlPainter and TJvTabDefaultPainter Index: JvComCtrls.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvComCtrls.pas,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** JvComCtrls.pas 4 Apr 2004 19:06:11 -0000 1.36 --- JvComCtrls.pas 4 Apr 2004 19:26:01 -0000 1.37 *************** *** 309,319 **** end; - TJvTabOutlookPainter = class(TJvTabDefaultPainter) - protected - procedure DrawTab(AControl: TCustomTabControl; Canvas: TCanvas; - Images: TCustomImageList; ImageIndex: Integer; const Caption: string; - const Rect: TRect; Active, Enabled: Boolean); override; - end; - TJvTabControl = class(TJvExTabControl) private --- 309,312 ---- *************** *** 1323,1399 **** end; - // === TJvTabOutlookPainter ==================================================== - - procedure TJvTabOutlookPainter.DrawTab(AControl: TCustomTabControl; - Canvas: TCanvas; Images: TCustomImageList; ImageIndex: Integer; - const Caption: string; const Rect: TRect; Active, Enabled: Boolean); - var - R: TRect; - SaveState: integer; - begin - R := Rect; - InflateRect(R, 0, -1); - if not Enabled then - begin - GradientFillRect(Canvas, R, DisabledColorFrom, DisabledColorTo, DisabledGradientDirection, 255); - Canvas.Font := DisabledFont; - end - else if Active then - begin - GradientFillRect(Canvas, R, ActiveColorFrom, ActiveColorTo, ActiveGradientDirection, 255); - Canvas.Font := ActiveFont; - end - else - begin - GradientFillRect(Canvas, R, InactiveColorFrom, InactiveColorTo, InactiveGradientDirection, 255); - Canvas.Font := InactiveFont; - end; - if Assigned(Images) then - begin - SaveState := SaveDC(Canvas.Handle); - try - Images.Draw(Canvas, R.Left + ((R.Right - R.Left) - Images.Width) div 2, R.Top + (R.Bottom - R.Top) div 4 - Images.Height div 2, ImageIndex, Enabled); - finally - RestoreDC(Canvas.Handle, SaveState); - end; - end; - OffsetRect(R, 0, (R.Bottom - R.Top) div 2); - Canvas.Pen.Color := clGrayText; - if Active then - begin - Canvas.MoveTo(R.Left + 4, R.Top); - Canvas.LineTo(R.Right - 5, R.Top); - Canvas.Pen.Color := clHighlightText; - Canvas.MoveTo(R.Left + 5, R.Top + 1); - Canvas.LineTo(R.Right - 4, R.Top + 1); - OffsetRect(R, 0, 2); - end - else - begin - Canvas.MoveTo(R.Left + 1, R.Top + 1); - Canvas.LineTo(R.Right - 2, R.Top + 1); - Canvas.Pen.Color := clHighlightText; - Canvas.MoveTo(R.Left + 2, R.Top + 2); - Canvas.LineTo(R.Right - 1, R.Top + 2); - OffsetRect(R, 0, 3); - end; - R.Bottom := Rect.Bottom; - if Caption <> '' then - begin - SetBkMode(Canvas.Handle, Windows.TRANSPARENT); - InflateRect(R, -2, -2); - if not Enabled then - begin - Canvas.Font := DisabledFont; - DrawText(Canvas.Handle, PChar(Caption), Length(Caption), R, DT_SINGLELINE or DT_VCENTER or DT_CENTER); - OffsetRect(R, 1, 1); - Canvas.Font.Color := clHighlightText; - DrawText(Canvas.Handle, PChar(Caption), Length(Caption), R, DT_SINGLELINE or DT_VCENTER or DT_CENTER); - end - else - DrawText(Canvas.Handle, PChar(Caption), Length(Caption), R, DT_SINGLELINE or DT_VCENTER or DT_CENTER); - end; - end; - // === TJvTabControl ======================================================== --- 1316,1319 ---- |