Class TCustomCaptionControl (unit CapCtrl)

Inherits from

TComponent

TCustomCaptionControl

Constructors


constructor Create(AOwner: TComponent);

Public methods

TCustomCaptionControl



Functions

destructor Destroy;


procedure Refresh;


procedure ButtonClick(ButtonIndex: Integer; var Pushed: Boolean);


procedure DrawButton(ButtonIndex: Integer; Canvas: TCanvas; Rect: TRect; var Drawn: Boolean);


procedure DrawCaption(var CaptionText: string; Canvas: TCanvas; Rect: TRect; var Drawn: Boolean);

Event calling methods

Notification for popup menu removal


procedure CalculateColors;

Internal methods

function DrawAllCaption(FormDC: HDC): TRect;

Drawing

Help appears only if no Min/Max buttons appear


procedure DrawCaptionButtons(var R: TRect);

Clean up all the drawing objects.

procedure DrawCaptionText(R: TRect);


procedure DrawMenuIcon(var R: TRect);

Paint the icon for the system menu

procedure FillRectCaption(const R: TRect; Active: boolean);

Paint the given rectangle with the caption color

procedure FillRectGradient(const R: TRect; Active: boolean);

Paint the given rectangle with the gradient pattern.

function GetCaptionRect: TRect;


function GetCoordButton(Point: TPoint): Integer;

Force window to redraw frame

procedure NewWndProc(var Message: TMessage);


procedure Notification(AComponent: TComponent; Operation: TOperation);

Replaces window procedure called by Perform

procedure OnCaptionControlDestroy(Sender: TObject);


procedure SetButtonsDirection(Value: TDirection);

Create a temporary device context to draw on

procedure SetCaptionGradient(Value: TCaptionGradient);

Property methods

magic number


procedure SetColorBands(Value: Integer);


procedure SetEnabled(Value: Boolean);


procedure SetPopupMenu(Value: TPopupMenu);


procedure SetShowButtons(Value: Boolean);


procedure WinProc(var Message: TMessage);


Properties

property Buttons : TCaptionButtons


property ButtonsDirection : TDirection


property CaptionGradient : TCaptionGradient

Value properties

property ColorBands : Integer


property Enabled : Boolean


property PopupMenu : TPopupMenu


property ShowButtons : Boolean


Events

event OnButtonClick : TCaptionButtonClickEvent


event OnButtonDraw : TCaptionButtonDrawEvent


event OnDrawCaption : TDrawCaptionEvent

Events

Variables

BtnWidth : Integer;


CaptionFont : HFONT;


Colors : array[0..1, 0..255] of TColorRef;

Internal fields

DefWinProc : TFarProc;


DefWinProcInstance : Pointer;


DrawPushed : Boolean;


FButtonDisabled : TImageList;


FButtonImages : TImageList;


FButtons : TCaptionButtons;


FButtonsDirection : TDirection;


FButtonsLeft : Integer;


FCanvas : TControlCanvas;


FCaptionGradient : TCaptionGradient;


FColorBands : Integer;


FEnabled : Boolean;

Property fields

FMaximized : Boolean;


FOnButtonClick : TCaptionButtonClickEvent;


FOnButtonDraw : TCaptionButtonDrawEvent;


FOnDrawCaption : TDrawCaptionEvent;

Event fields

FOnFormDestroy : TNotifyEvent;


FPopupMenu : TPopupMenu;


FRightPushed : Boolean;


FShowButtons : Boolean;


FWindowActive : Boolean;


OldWindowProc : TWndMethod;


Pushed : Integer;


RestoreWndProc : Boolean;


rgn : HRGN;



Constructors


constructor Create(AOwner: TComponent);

Public methods

TCustomCaptionControl


Functions


destructor Destroy;


procedure Refresh;


procedure ButtonClick(ButtonIndex: Integer; var Pushed: Boolean);


procedure DrawButton(ButtonIndex: Integer; Canvas: TCanvas; Rect: TRect; var Drawn: Boolean);


procedure DrawCaption(var CaptionText: string; Canvas: TCanvas; Rect: TRect; var Drawn: Boolean);

Event calling methods

Notification for popup menu removal


procedure CalculateColors;

Internal methods


function DrawAllCaption(FormDC: HDC): TRect;

Drawing

Help appears only if no Min/Max buttons appear


procedure DrawCaptionButtons(var R: TRect);

Clean up all the drawing objects.


procedure DrawCaptionText(R: TRect);


procedure DrawMenuIcon(var R: TRect);

Paint the icon for the system menu


procedure FillRectCaption(const R: TRect; Active: boolean);

Paint the given rectangle with the caption color


procedure FillRectGradient(const R: TRect; Active: boolean);

Paint the given rectangle with the gradient pattern.


function GetCaptionRect: TRect;


function GetCoordButton(Point: TPoint): Integer;

Force window to redraw frame


procedure NewWndProc(var Message: TMessage);


procedure Notification(AComponent: TComponent; Operation: TOperation);

Replaces window procedure called by Perform


procedure OnCaptionControlDestroy(Sender: TObject);


procedure SetButtonsDirection(Value: TDirection);

Create a temporary device context to draw on


procedure SetCaptionGradient(Value: TCaptionGradient);

Property methods

magic number


procedure SetColorBands(Value: Integer);


procedure SetEnabled(Value: Boolean);


procedure SetPopupMenu(Value: TPopupMenu);


procedure SetShowButtons(Value: Boolean);


procedure WinProc(var Message: TMessage);


Properties


property Buttons : TCaptionButtons


property ButtonsDirection : TDirection


property CaptionGradient : TCaptionGradient

Value properties


property ColorBands : Integer


property Enabled : Boolean


property PopupMenu : TPopupMenu


property ShowButtons : Boolean


Events


event OnButtonClick : TCaptionButtonClickEvent


event OnButtonDraw : TCaptionButtonDrawEvent


event OnDrawCaption : TDrawCaptionEvent

Events


Variables


BtnWidth : Integer;


CaptionFont : HFONT;


Colors : array[0..1, 0..255] of TColorRef;

Internal fields


DefWinProc : TFarProc;


DefWinProcInstance : Pointer;


DrawPushed : Boolean;


FButtonDisabled : TImageList;


FButtonImages : TImageList;


FButtons : TCaptionButtons;


FButtonsDirection : TDirection;


FButtonsLeft : Integer;


FCanvas : TControlCanvas;


FCaptionGradient : TCaptionGradient;


FColorBands : Integer;


FEnabled : Boolean;

Property fields


FMaximized : Boolean;


FOnButtonClick : TCaptionButtonClickEvent;


FOnButtonDraw : TCaptionButtonDrawEvent;


FOnDrawCaption : TDrawCaptionEvent;

Event fields


FOnFormDestroy : TNotifyEvent;


FPopupMenu : TPopupMenu;


FRightPushed : Boolean;


FShowButtons : Boolean;


FWindowActive : Boolean;


OldWindowProc : TWndMethod;


Pushed : Integer;


RestoreWndProc : Boolean;


rgn : HRGN;