| Class TDSMinMax (unit DSMinMax) |
TComponent
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
destructor Destroy;
procedure OwnerShow(Sender: TObject);Subclass my form's window by inserting my window procedure into the message chain
procedure UpdateParentSize;
function GetMaxPositionX: integer;
function GetMaxPositionY: integer;
function GetMaxSizeX: integer;
function GetMaxSizeY: integer;
function GetMaxTrackSizeX: integer;
function GetMaxTrackSizeY: integer;
function GetMinTrackSizeX: integer;
function GetMinTrackSizeY: integer;
procedure HookForm;
procedure SetMaxPosition(const p: TPoint);
procedure SetMaxPositionX(const x: integer);
procedure SetMaxPositionY(const y: integer);
procedure SetMaxSize(const p: TPoint);
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);| Properties |
property MaxHeight : Integer
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| Events |
| Variables |
FMaxPosition : Tpoint;
FMaxPositionAssigned : boolean;
FMaxSize : TPoint;
FMaxSizeAssigned : boolean;
FMaxTrackSize : TPoint;
FMaxTrackSizeAssigned : boolean;
FMinTrackSize : TPoint;
FMinTrackSizeAssigned : boolean;
FOldWndProcForm : TFarProc;
FOwnerOnShow : TNotifyEvent;
FParentForm : TForm;
FWindowProcedureForm : TFarProc;| Constructors |
constructor Create(AOwner: TComponent);Public declarations
| Functions |
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.
| Properties |
property MaxHeight : IntegerPublished 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| Events |
| Variables |
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;