Class TMSOfficeCaption (unit Wordcap) |
Inherits from
TComponent
constructor Create(AOwner: TComponent);
- TCaptionText.
destructor Destroy;
some people have reported problems with TForm's position being poScreenCenter.
function DrawMSOfficeCaption(fActive : boolean) : TRect;
function TMSOfficeCaption.
function HookAppWndProc(var AMsg: TMessage): Boolean;
HookWndProc
procedure HookWin;
Public declarations TMSOfficeCaption.
procedure HookWndProc(var AMsg: TMessage);
perform_NCActivate for win32 } {$endif
procedure UnhookWin;
HookWin
procedure UpdateCaption;
procedure Loaded;
TMSOfficeCaption.
procedure SetColorLeftActive(C: TColor);
SetAutoFontHeight
procedure SetColorLeftInActive(C: TColor);
procedure SetColorRightActive(C: TColor);
procedure SetColorRightInActive(C: TColor);
procedure SetEnabled(Val: TGradEnabled);
procedure SetJustification(Val: TJustification);
SetEnabled
procedure SetNumColors(Val: integer);
procedure ExcludeBtnRgn (var R: TRect);
TMSOfficeCaption.
procedure GetSystemFont(F : TFont);
UpdateCaption
function GetTextRect: TRect;
TMSOfficeCaption.
function GetTitleBarRect: TRect;
TMSOfficeCaption.
function GetVisibleButtons: TBorderIcons;
TMSOfficeCaption.
procedure GradientFill(DC: HDC; FBeginColor, FEndColor: TColor; R: TRect);
SolidFill } {----------------------------------------------------------------------------} { Gradient fill procedure } {----------------------------------------------------------------------------
function Handle_WMSetCursor(var Msg: TWMSetCursor): Boolean;
SetNumColors } {$ifdef win32
function MeasureText(DC: HDC; R: TRect; FText: TCompanyText): integer;
procedure TMSOfficeCaption.
procedure NewCaptionText;
procedure TMSOfficeCaption.
procedure PaintCaptionButtons(DC: HDC; var Rect: TRect);
procedure TMSOfficeCaption.
procedure PaintCaptionText(DC: HDC; var R: TRect; FText: TCompanyText; Active: Boolean);
procedure TMSOfficeCaption.
procedure PaintMenuIcon(DC: HDC; var R: TRect);
GetTextRect } { Paint the icon for the system menu.
procedure Perform_NCActivate(var AMsg: TMessage);
perform_NCPaint for win32
procedure Perform_NCPaint(var AMsg: TMessage);
WindowIsActive } {$ifdef win32
procedure SetAutoFontHeight(F: TFont);
GradientFill
procedure SolidFill(DC: HDC; FColor: TColor; R: TRect);
DrawMSOfficeCaption } {----------------------------------------------------------------------------} { Solid fill procedure } {----------------------------------------------------------------------------
function WindowIsActive: Boolean;
UnHookWin
property AppNameText : TAppNameText
Published declarations
property CaptionText : TCaptionText
property ColorLeftActive : TColor
property ColorLeftInActive : TColor
property ColorRightActive : TColor
property ColorRightInActive : TColor
property CompanyText : TCompanyText
property Enabled : TGradEnabled
property Justification : TJustification
property NumColors : integer
event OnDrawCaption : TOnDrawCaption
NewWndProc : Pointer;
OldWndProc : TFarProc;
Protected declarations
FActiveDefined : Boolean;
FAppNameText : TAppNameText;
Private declarations
FCaptionText : TCaptionText;
FColorLeftActive : TColor;
FColorLeftInActive : TColor;
FColorRightActive : TColor;
FColorRightInActive : TColor;
FCompanyText : TCompanyText;
FEnabled : TGradEnabled;
FHooked : Boolean;
FJustification : TJustification;
FNumColors : integer;
FOnDrawCaption : TOnDrawCaption;
FRecreating : Boolean;
FSystemFont : TFont;
FWindowActive : Boolean;
MyOwner : TForm;
MyOwnerHandle : THandle;
constructor Create(AOwner: TComponent);
TCaptionText.GetCaption } {------------------------------------------------------------------------------} { TMSOfficeCaption Component } {------------------------------------------------------------------------------
destructor Destroy;
some people have reported problems with TForm's position being poScreenCenter.
this removes the problem (I believe - I've never replicated the problem so I
can't test it).
function DrawMSOfficeCaption(fActive : boolean) : TRect;
function TMSOfficeCaption.MeasureText } {******************************************************************************} {** DrawMSOfficeCaption - the main routine to draw a shaded caption bar. **} {
function HookAppWndProc(var AMsg: TMessage): Boolean;
HookWndProc
procedure HookWin;
Public declarations
TMSOfficeCaption.Destroy
procedure HookWndProc(var AMsg: TMessage);
perform_NCActivate for win32 } {$endif
procedure UnhookWin;
HookWin
procedure UpdateCaption;
procedure Loaded;
TMSOfficeCaption.Create
procedure SetColorLeftActive(C: TColor);
SetAutoFontHeight
procedure SetColorLeftInActive(C: TColor);
procedure SetColorRightActive(C: TColor);
procedure SetColorRightInActive(C: TColor);
procedure SetEnabled(Val: TGradEnabled);
procedure SetJustification(Val: TJustification);
SetEnabled
procedure SetNumColors(Val: integer);
procedure ExcludeBtnRgn (var R: TRect);
TMSOfficeCaption.GetVisibleButtons
procedure GetSystemFont(F : TFont);
UpdateCaption
function GetTextRect: TRect;
TMSOfficeCaption.ExcludeBtnRgn
function GetTitleBarRect: TRect;
TMSOfficeCaption.NewCaptionText
function GetVisibleButtons: TBorderIcons;
TMSOfficeCaption.GetTitleBarRect
procedure GradientFill(DC: HDC; FBeginColor, FEndColor: TColor; R: TRect);
SolidFill } {----------------------------------------------------------------------------} { Gradient fill procedure } {----------------------------------------------------------------------------
function Handle_WMSetCursor(var Msg: TWMSetCursor): Boolean;
SetNumColors } {$ifdef win32
function MeasureText(DC: HDC; R: TRect; FText: TCompanyText): integer;
procedure TMSOfficeCaption.PaintCaptionButtons } {$endif
procedure NewCaptionText;
procedure TMSOfficeCaption.GetSystemFont
procedure PaintCaptionButtons(DC: HDC; var Rect: TRect);
procedure TMSOfficeCaption.PaintCaptionText } {$ifdef win32} { Paint the min/max/help/close buttons - based on code from Brad Stowers.
procedure PaintCaptionText(DC: HDC; var R: TRect; FText: TCompanyText; Active: Boolean);
procedure TMSOfficeCaption.PaintMenuIcon } { based on code from Brad Stowers
procedure PaintMenuIcon(DC: HDC; var R: TRect);
GetTextRect } { Paint the icon for the system menu. Based on code from Brad Stowers
procedure Perform_NCActivate(var AMsg: TMessage);
perform_NCPaint for win32
procedure Perform_NCPaint(var AMsg: TMessage);
WindowIsActive } {$ifdef win32
procedure SetAutoFontHeight(F: TFont);
GradientFill
procedure SolidFill(DC: HDC; FColor: TColor; R: TRect);
DrawMSOfficeCaption } {----------------------------------------------------------------------------} { Solid fill procedure } {----------------------------------------------------------------------------
function WindowIsActive: Boolean;
UnHookWin
property AppNameText : TAppNameText
Published declarations
property CaptionText : TCaptionText
property ColorLeftActive : TColor
property ColorLeftInActive : TColor
property ColorRightActive : TColor
property ColorRightInActive : TColor
property CompanyText : TCompanyText
property Enabled : TGradEnabled
property Justification : TJustification
property NumColors : integer
event OnDrawCaption : TOnDrawCaption
NewWndProc : Pointer;
OldWndProc : TFarProc;
Protected declarations
FActiveDefined : Boolean;
FAppNameText : TAppNameText;
Private declarations
FCaptionText : TCaptionText;
FColorLeftActive : TColor;
FColorLeftInActive : TColor;
FColorRightActive : TColor;
FColorRightInActive : TColor;
FCompanyText : TCompanyText;
FEnabled : TGradEnabled;
FHooked : Boolean;
FJustification : TJustification;
FNumColors : integer;
FOnDrawCaption : TOnDrawCaption;
FRecreating : Boolean;
FSystemFont : TFont;
FWindowActive : Boolean;
MyOwner : TForm;
MyOwnerHandle : THandle;