Class TDSMinMax (unit DSMinMax) |
Inherits from
TComponent
constructor Create(AOwner: TComponent);
- Public declarations
destructor Destroy;
Catch form show
procedure OwnerShow(Sender: TObject);
Protected declarations Subclass my form's window by inserting my window procedure into
the message chain
procedure UpdateParentSize;
Undo what Hookform did.
function GetMaxPositionX: integer;
Stop interfering .
function GetMaxPositionY: integer;
function GetMaxSizeX: integer;
function GetMaxSizeY: integer;
function GetMaxTrackSizeX: integer;
function GetMaxTrackSizeY: integer;
function GetMinTrackSizeX: integer;
function GetMinTrackSizeY: integer;
procedure HookForm;
The important functions for subclassing
procedure SetMaxPosition(const p: TPoint);
procedure SetMaxPositionX(const x: integer);
Make sure that the window gets another chance to process wm_GetMinMaxInfo
procedure SetMaxPositionY(const y: integer);
procedure SetMaxSize(const p: TPoint);
A bunch of assessor functions: Get & Set
procedure SetMaxSizeX(const x: integer);
procedure SetMaxSizeY(const y: integer);
procedure SetMaxTrackSize(const p: TPoint);
procedure SetMaxTrackSizeX(const x: Integer);
procedure SetMaxTrackSizeY(const y: Integer);
procedure SetMinTrackSize(const p: TPoint);
procedure SetMinTrackSizeX(const x: Integer);
procedure SetMinTrackSizeY(const y: Integer);
procedure UnhookForm;
procedure WndProcForm(var msg: TMessage);
Move my parent form so that Windows will enforce any changes I've made
in the MinMax settings.
property MaxHeight : Integer
Published declarations
property MaxLeft : Integer
property MaxTop : Integer
property MaxWidth : Integer
property ResizeMaxHeight : Integer
property ResizeMaxWidth : Integer
property ResizeMinHeight : Integer
property ResizeMinWidth : Integer
property MaxPosition : TPoint
property MaxSize : TPoint
property MaxTrackSize : TPoint
property MinTrackSize : TPoint
FMaxPosition : Tpoint;
FMaxPositionAssigned : boolean;
FMaxSize : TPoint;
FMaxSizeAssigned : boolean;
Private declarations } { We use the following to keep track of which sizes we're controlling
and what these sizes are.
FMaxTrackSize : TPoint;
FMaxTrackSizeAssigned : boolean;
FMinTrackSize : TPoint;
FMinTrackSizeAssigned : boolean;
FOldWndProcForm : TFarProc;
These are necessary to handle window subclassing
FOwnerOnShow : TNotifyEvent;
FParentForm : TForm;
FWindowProcedureForm : TFarProc;
constructor Create(AOwner: TComponent);
Public declarations
destructor Destroy;
Catch form show
procedure OwnerShow(Sender: TObject);
Protected declarations
Subclass my form's window by inserting my window procedure into
the message chain
procedure UpdateParentSize;
Undo what Hookform did... reset the window procedure and FreeObjectInstance
function GetMaxPositionX: integer;
Stop interfering ...
function GetMaxPositionY: integer;
function GetMaxSizeX: integer;
function GetMaxSizeY: integer;
function GetMaxTrackSizeX: integer;
function GetMaxTrackSizeY: integer;
function GetMinTrackSizeX: integer;
function GetMinTrackSizeY: integer;
procedure HookForm;
The important functions for subclassing
procedure SetMaxPosition(const p: TPoint);
procedure SetMaxPositionX(const x: integer);
Make sure that the window gets another chance to process wm_GetMinMaxInfo
procedure SetMaxPositionY(const y: integer);
procedure SetMaxSize(const p: TPoint);
A bunch of assessor functions: Get & Set
procedure SetMaxSizeX(const x: integer);
procedure SetMaxSizeY(const y: integer);
procedure SetMaxTrackSize(const p: TPoint);
procedure SetMaxTrackSizeX(const x: Integer);
procedure SetMaxTrackSizeY(const y: Integer);
procedure SetMinTrackSize(const p: TPoint);
procedure SetMinTrackSizeX(const x: Integer);
procedure SetMinTrackSizeY(const y: Integer);
procedure UnhookForm;
procedure WndProcForm(var msg: TMessage);
Move my parent form so that Windows will enforce any changes I've made
in the MinMax settings.
property MaxHeight : Integer
Published declarations
property MaxLeft : Integer
property MaxTop : Integer
property MaxWidth : Integer
property ResizeMaxHeight : Integer
property ResizeMaxWidth : Integer
property ResizeMinHeight : Integer
property ResizeMinWidth : Integer
property MaxPosition : TPoint
property MaxSize : TPoint
property MaxTrackSize : TPoint
property MinTrackSize : TPoint
FMaxPosition : Tpoint;
FMaxPositionAssigned : boolean;
FMaxSize : TPoint;
FMaxSizeAssigned : boolean;
Private declarations } { We use the following to keep track of which sizes we're controlling
and what these sizes are...
FMaxTrackSize : TPoint;
FMaxTrackSizeAssigned : boolean;
FMinTrackSize : TPoint;
FMinTrackSizeAssigned : boolean;
FOldWndProcForm : TFarProc;
These are necessary to handle window subclassing
FOwnerOnShow : TNotifyEvent;
FParentForm : TForm;
FWindowProcedureForm : TFarProc;