Main Page   Alphabetical List   Data Structures   File List   Data Fields  

SNAPINFO Struct Reference

#include <MDISnapper.h>


Detailed Description

holds the data for calculating a modified window rect.

Since it only works on coordinate rects, it can be used without any actual Windows. To use it:

Definition at line 21 of file MDISnapper.h.

Public Methods

void  Init (RECT const &oldRect, RECT const &newRect, DWORD snapwidth)
  Initialize, specifying a pre-move and post-move rect.

void  Init (RECT const &r, DWORD snapWidth, bool moveOnly=false)
  Initialize, specifying only one rectangle.

void  SnapHLine (long y)
  snap to a horizontal line

void  SnapVLine (long x)
  snap to a vertical line

RECT &  EndSnap ()
  ends snapping sequence and returns final coords


Data Fields

DWORD  snapWidth
  distance over which snapping works

RECT  rold
  original rect

RECT  rnew
  post-move rect (if specified)

RECT  rout
  accumulates the final rect


Member Function Documentation

void SNAPINFO::Init RECT const &    oldRect,
RECT const &    newRect,
DWORD    snapwidth
 

Initialize, specifying a pre-move and post-move rect.

use this method if the window is about to be moved or resized (e.g. in WM_SIZING or WM_MOVING handler)

Parameters:
oldRect  Location of the window before being moved
newRect  new location of the window
snapwidth  "catch range" in pixels

Definition at line 40 of file MDISnapper.cpp.

void SNAPINFO::Init RECT const &    r,
DWORD    snapwidth,
bool    moveOnly = false
 

Initialize, specifying only one rectangle.

Parameters:
r  Location of the window
snapwidth  "catch range" in pixels
moveOnly  if true, the modified rectangle will have the same size as r

Definition at line 67 of file MDISnapper.cpp.

void SNAPINFO::SnapHLine long    y
 

snap to a horizontal line

Parameters:
y  y-coordinate of the horizontal line to snap to

Definition at line 122 of file MDISnapper.cpp.

void SNAPINFO::SnapVLine long    x
 

snap to a vertical line

Parameters:
x  x-coordinate of the vertical line to snap to

Definition at line 84 of file MDISnapper.cpp.


The documentation for this struct was generated from the following files:
Generated on Sat Jan 18 22:13:03 2003 for testproject by doxygen1.3-rc2