BCGSuite for MFC
BOOL CBCGPStaticLayout::AddAnchor ( HWND  hWnd,
XMoveType  typeMove,
XSizeType  typeSize,
const CPoint &  percMove = CPoint(100, 100),
const CPoint &  percSize = CPoint(100, 100) 
)

Adds anchor for a control to layout manager.

typeMove can be one of the following enumerated values:

  • e_MoveTypeNone - no move
  • e_MoveTypeHorz - child control is moved horizontally only
  • e_MoveTypeVert - child control is moved vertically only
  • e_MoveTypeBoth - child control is moved horizontally and vertically

typeSize can be one of the following enumerated values

  • e_SizeTypeNone - no resize
  • e_SizeTypeHorz - X dimension of child control is changed
  • e_SizeTypeVert - Y dimension of child control is changed
  • e_SizeTypeBoth - width and height of child control are changed

percMove - defines (in percents) how far a child control is moved in typeMove direction when size of host has been changed. percMove.X and percMove.Y values can be negative. If typeMove is set to e_sizeTypeHorz, percMove.Y is ignored. If typeMove is set to e_sizeTypeVert, percMove.X is ignored. If typeMove is set to e_sizeTypeNone, percMove is ignored.

For example, percMove.X is set to 50%. If size of host is changed by 20 pixels, the child is moved horizontally by 10 pixels from its current position.

percSize - defines (in percents) how child control is resized, when size of host has been changed. Here the library uses the same logic as for percMove. For example, percSize.X is set to 50%. If the size of host is changed by 20 pixels, the child is resized by 10 pixels.

Parameters
hWndA handle to child control window.
typeMoveDefines move direction.
typeSizeDefines resize method.
percMoveDefines (in percents) how far a child control is moved when a host is resized.
percSizeDefines (in percents) how child control is resized.