Class TForm1 (unit ClockFrm) |
Inherits from
TForm
procedure Aqua1Click(Sender: TObject);
procedure Blue1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Fuchsia1Click(Sender: TObject);
procedure Lime1Click(Sender: TObject);
procedure Red1Click(Sender: TObject);
procedure Silver1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure White1Click(Sender: TObject);
procedure Yellow1Click(Sender: TObject);
procedure WMCommand(var Message : TMessage);
Call default processing.
procedure WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo);
Call default processing.
procedure WMKeyDown(var Message : TWMKeyDown);
Call default processing.
procedure WMKeyUp(var Message : TWMKeyUp);
Call default processing.
procedure WMNCCalcSize(var Message : TWMNCCalcSize);
Call default processing.
procedure WMNCCreate(var Message : TWMNCCreate);
with Message do
procedure WMNCHitTest(var Message : TWMNCHitTest);
Call default processing.
procedure WMNCLButtonDblClk(var Message : TWMNCLButtonDblClk);
Indicate the system menu is not showing
procedure WMNCLButtonDown(var Message : TWMNCLButtonDown);
Call default processing.
procedure WMSysChar(var Message : TWMSysChar);
Call default processing.
procedure WMSysKeyDown(var Message : TWMSysKeyDown);
Call default processing.
procedure WMSysKeyUp(var Message : TWMSysKeyUp);
Call default processing.
procedure WndProc(var Message : TMessage);
Protected declarations Draw control box, min button, and max button as needed
function DepressMinMaxButton(HitTest : word; var rc : TRect) : boolean;
Invert the control box if needed
function DoMenu : boolean;
Initially assume no button.
procedure DrawArrow(dc : HDC; const rc : TRect; style : TButtonArrow);
Release the DC if we created in this procedure
procedure DrawButton(dc : HDC; fMin, fDepressed : boolean);
loop until the button is released
function DrawCaption(fSysMenu, fMin, fMax, fActive : boolean) : boolean;
The arrow is drawn as a series of horizontal lines
procedure DrawControlBox(dc : HDC; fInvert : boolean);
Now check the window styles, etc.
function GetButtonRect(nPos : word; var rc : TRect) : boolean;
Initially assume no max.
function GetControlBoxRect(var rc : TRect) : boolean;
Adjust for borders.
function GetMaxButtonRect(var rc : TRect) : boolean;
min.
function GetMinButtonRect(var rc : TRect) : boolean;
Initially assume no control box.
function GetTitleBarRect(var rc : TRect) : boolean;
function HasCaption : boolean;
procedure SetupSystemMenu(menu : HMenu);
Convert coordinates to screen coords.
function TestWinStyle(dwStyleBit : longint) : boolean;
height of the title bar in pixels
Aqua1 : TMenuItem;
Blue1 : TMenuItem;
Fuchsia1 : TMenuItem;
HrLED1 : TRoundLed;
HrLED16 : TRoundLed;
HrLED2 : TRoundLed;
HrLED32 : TRoundLed;
HrLED4 : TRoundLed;
HrLED8 : TRoundLed;
Lime1 : TMenuItem;
MinLED1 : TRoundLed;
MinLED16 : TRoundLed;
MinLED2 : TRoundLed;
MinLED32 : TRoundLed;
MinLED4 : TRoundLed;
MinLED8 : TRoundLed;
PopupMenu1 : TPopupMenu;
Red1 : TMenuItem;
ResolutionFix1 : TResolutionFix;
SecLED1 : TRoundLed;
SecLED16 : TRoundLed;
SecLED2 : TRoundLed;
SecLED32 : TRoundLed;
SecLED4 : TRoundLed;
SecLED8 : TRoundLed;
Silver1 : TMenuItem;
Timer1 : TTimer;
White1 : TMenuItem;
Yellow1 : TMenuItem;
fMenuUp : boolean;
Private declarations
TitleBarSize : integer;
state of the system menu
procedure Aqua1Click(Sender: TObject);
procedure Blue1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Fuchsia1Click(Sender: TObject);
procedure Lime1Click(Sender: TObject);
procedure Red1Click(Sender: TObject);
procedure Silver1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure White1Click(Sender: TObject);
procedure Yellow1Click(Sender: TObject);
procedure WMCommand(var Message : TMessage);
Call default processing.
procedure WMGetMinMaxInfo(var Message : TWMGetMinMaxInfo);
Call default processing.
procedure WMKeyDown(var Message : TWMKeyDown);
Call default processing.
procedure WMKeyUp(var Message : TWMKeyUp);
Call default processing.
procedure WMNCCalcSize(var Message : TWMNCCalcSize);
Call default processing.
procedure WMNCCreate(var Message : TWMNCCreate);
with Message do
procedure WMNCHitTest(var Message : TWMNCHitTest);
Call default processing.
procedure WMNCLButtonDblClk(var Message : TWMNCLButtonDblClk);
Indicate the system menu is not showing
procedure WMNCLButtonDown(var Message : TWMNCLButtonDown);
Call default processing.
procedure WMSysChar(var Message : TWMSysChar);
Call default processing.
procedure WMSysKeyDown(var Message : TWMSysKeyDown);
Call default processing.
procedure WMSysKeyUp(var Message : TWMSysKeyUp);
Call default processing.
procedure WndProc(var Message : TMessage);
Protected declarations
Draw control box, min button, and max button as needed
function DepressMinMaxButton(HitTest : word; var rc : TRect) : boolean;
Invert the control box if needed
function DoMenu : boolean;
Initially assume no button.
procedure DrawArrow(dc : HDC; const rc : TRect; style : TButtonArrow);
Release the DC if we created in this procedure
procedure DrawButton(dc : HDC; fMin, fDepressed : boolean);
loop until the button is released
function DrawCaption(fSysMenu, fMin, fMax, fActive : boolean) : boolean;
The arrow is drawn as a series of horizontal lines
procedure DrawControlBox(dc : HDC; fInvert : boolean);
Now check the window styles, etc.
function GetButtonRect(nPos : word; var rc : TRect) : boolean;
Initially assume no max. button.
function GetControlBoxRect(var rc : TRect) : boolean;
Adjust for borders.
function GetMaxButtonRect(var rc : TRect) : boolean;
min. box is in position 1.
function GetMinButtonRect(var rc : TRect) : boolean;
Initially assume no control box.
function GetTitleBarRect(var rc : TRect) : boolean;
function HasCaption : boolean;
procedure SetupSystemMenu(menu : HMenu);
Convert coordinates to screen coords. using functions in WinProcs unit} {("WinProcs" must be given to avoid calling TForm1's ClientToScreen()
function TestWinStyle(dwStyleBit : longint) : boolean;
height of the title bar in pixels
Aqua1 : TMenuItem;
Blue1 : TMenuItem;
Fuchsia1 : TMenuItem;
HrLED1 : TRoundLed;
HrLED16 : TRoundLed;
HrLED2 : TRoundLed;
HrLED32 : TRoundLed;
HrLED4 : TRoundLed;
HrLED8 : TRoundLed;
Lime1 : TMenuItem;
MinLED1 : TRoundLed;
MinLED16 : TRoundLed;
MinLED2 : TRoundLed;
MinLED32 : TRoundLed;
MinLED4 : TRoundLed;
MinLED8 : TRoundLed;
PopupMenu1 : TPopupMenu;
Red1 : TMenuItem;
ResolutionFix1 : TResolutionFix;
SecLED1 : TRoundLed;
SecLED16 : TRoundLed;
SecLED2 : TRoundLed;
SecLED32 : TRoundLed;
SecLED4 : TRoundLed;
SecLED8 : TRoundLed;
Silver1 : TMenuItem;
Timer1 : TTimer;
White1 : TMenuItem;
Yellow1 : TMenuItem;
fMenuUp : boolean;
Private declarations
TitleBarSize : integer;
state of the system menu