title | description | ms.date | f1_keywords | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CMFCDynamicLayout Class |
Learn more about: CMFCDynamicLayout Class |
08/29/2019 |
|
Specifies how controls in a window are moved and resized as the user resizes the window.
class CMFCDynamicLayout : public CObject
Name | Description |
---|---|
CMFCDynamicLayout::CMFCDynamicLayout |
Constructs a CMFCDynamicLayout object. |
CMFCDynamicLayout::~CMFCDynamicLayout |
Destructor. |
Name | Description |
---|---|
CMFCDynamicLayout::AddItem | Adds a child window, typically a control, to the list of windows that are controlled by the dynamic layout manager. |
CMFCDynamicLayout::Adjust | Adds a child window, typically a control, to the list of windows that are controlled by the dynamic layout manager. |
CMFCDynamicLayout::Create | Stores and validates the host window. |
CMFCDynamicLayout::GetHostWnd | Returns a pointer to a host window. |
CMFCDynamicLayout::GetMinSize | Returns the window size below which layout is not adjusted. |
CMFCDynamicLayout::GetWindowRect | Retrieves the rectangle for the window's current client area. |
CMFCDynamicLayout::HasItem | Checks if a child control was added to dynamic layout. |
CMFCDynamicLayout::IsEmpty | Checks if a dynamic layout has no child windows added. |
CMFCDynamicLayout::LoadResource | Reads the dynamic layout from AFX_DIALOG_LAYOUT resource and then applies the layout to the host window. |
static CMFCDynamicLayout::MoveHorizontal | Gets a MoveSettings value that defines how much a child control is moved horizontally when the user resizes its hosting window. |
static CMFCDynamicLayout::MoveHorizontalAndVertical | Gets a MoveSettings value that defines how much a child control is moved horizontally when the user resizes its hosting window. |
static CMFCDynamicLayout::MoveNone | Gets a MoveSettings value that represents no motion, vertical or horizontal, for a child control. |
static CMFCDynamicLayout::MoveVertical | Gets a MoveSettings value that defines how much a child control is moved vertically when the user resizes its hosting window. |
CMFCDynamicLayout::SetMinSize | Sets the window size below which layout is not adjusted. |
static CMFCDynamicLayout::SizeHorizontal | Gets a SizeSettings value that defines how much a child control is resized horizontally when the user resizes its hosting window. |
static CMFCDynamicLayout::SizeHorizontalAndVertical | Gets a SizeSettings value that defines how much a child control is resized horizontally when the user resizes its hosting window. |
static CMFCDynamicLayout::SizeNone | Gets a SizeSettings value that represents no change in size for a child control. |
static CMFCDynamicLayout::SizeVertical | Gets a SizeSettings value that defines how much a child control is resized vertically when the user resizes its hosting window. |
Name | Description |
---|---|
CMFCDynamicLayout::MoveSettings Structure | Encapsulates move data for controls in a dynamic layout. |
CMFCDynamicLayout::SizeSettings Structure | Encapsulates size change data for controls in a dynamic layout. |
Header: afxlayout.h
Adds a child window, typically a control, to the list of windows that are controlled by the dynamic layout manager.
BOOL AddItem(
HWND hwnd,
MoveSettings moveSettings SizeSettings sizeSettings);
BOOL AddItem(
int nID,
MoveSettings moveSettings SizeSettings sizeSettings);
hwnd
The handle to the window to add.
nID
The ID of the child control to add.
moveSettings
A structure that describes how the control should be moved as the window size changes.
sizeSettings
A structure that describes how the control should be resized as the window size changes.
TRUE if the item was added successfully; otherwise FALSE.
The position and size of a child control is changed dynamically when a hosting window is being resized.
Adds a child window, typically a control, to the list of windows that are controlled by the dynamic layout manager.
void Adjust();
The position and size of a child control is changed dynamically when a hosting window is being resized.
Stores and validates the host window.
BOOL Create(CWnd* pHostWnd);
pHostWnd
A pointer to the host window.
TRUE if creation succeeded; otherwise FALSE.
Returns a pointer to a host window.
CWnd* GetHostWnd();
A pointer to the host window.
By default all child control positions recalculated relative to this window.
Returns the window size below which layout is not adjusted.
CSize GetMinSize();
The window size below which layout is not adjusted.
The position and size of a child control is changed dynamically when a hosting window is being resized, but there is a minimum size below which the layout is not adjusted. The user can resize the window to a smaller size, but parts of the window are then hidden from view.
Retrieves the rectangle for the window's current client area.
void GetHostWndRect(CRect& rect);
rect
After the function returns, this parameter contains the bounding rectangle of the layout area. This is an out parameter; the input value is overwritten.
Checks if a child control was added to dynamic layout.
BOOL HasItem(HWND hwnd);
hwnd
The window handle for the control.
TRUE if layout already has this item; otherwise FALSE.
Checks if a dynamic layout has no child windows added.
BOOL IsEmpty();
TRUE if layout has no items; otherwise FALSE.
Reads the dynamic layout from AFX_DIALOG_LAYOUT resource and then applies the layout to the host window.
static BOOL LoadResource(CWnd* pHostWnd,
LPVOID lpResource,
DWORD dwSize);
pHostWnd
A pointer to the host window.
lpResource
A pointer to the buffer that contains the AFX_DIALOG_LAYOUT resource.
dwSize
The buffer size in bytes.
TRUE if resource is loaded and applied to the host window; otherwise FALSE.
Gets a MoveSettings value that defines how much a child control is moved horizontally when the user resizes its hosting window.
static MoveSettings MoveHorizontal(int nRatio);
nRatio
Defines as a percentage how far a child control is moved horizontally when the user resizes the host window.
A MoveSettings value that encapsulates the requested move ratio.
Gets a MoveSettings value that defines how much a child control is moved horizontally when the user resizes its hosting window.
static MoveSettings MoveHorizontalAndVertical(int nXRatio int nYRatio);
nXRatio
Defines as a percentage how far a child control is moved horizontally when the user resizes the host window.
nYRatio
Defines as a percentage how far a child control is moved vertically when the user resizes the host window.
A MoveSettings value that encapsulates the requested move ratio.
Gets a MoveSettings value that represents no motion, vertical or horizontal, for a child control.
static MoveSettings MoveNone();
A MoveSettings value that fixes the control in place, so that it does not move as the user resizes the host window.
Encapsulates move data for controls in a dynamic layout.
struct CMFCDynamicLayout::MoveSettings;
This is a nested class inside CMFCDynamicLayout
.
Check if the move data specifies a nonzero horizontal move.
BOOL IsHorizontal() const
TRUE if the MoveSettings
object specifies a nonzero horizontal move.
Check if the move data specifies no movement.
BOOL IsNone() const
TRUE if the MoveSettings
object specifies no movement.
Check if the move data specifies a nonzero vertical movement.
BOOL IsVertical() const
TRUE if the MoveSettings
object specifies a nonzero vertical movement.
Gets a MoveSettings value that defines how much a child control is moved vertically when the user resizes its hosting window.
static MoveSettings MoveVertical(int nRatio);
nRatio
Defines as a percentage how far a child control is moved vertically when the user resizes the host window.
A MoveSettings value that encapsulates the requested move ratio.
Sets the window size below which layout is not adjusted.
void SetMinSize(const CSize& size);
size
The desired size below which layout is not adjusted.
The position and size of a child control is changed dynamically when a hosting window is being resized, but there is a minimum size below which the layout is not adjusted. The user can resize the window to a smaller size, but parts of the window are then hidden from view.
Gets a SizeSettings value that defines how much a child control is resized horizontally when the user resizes its hosting window.
static SizeSettings SizeHorizontal(int nRatio);
nRatio
Defines as a percentage how far a child control is resized horizontally when the user resizes the host window.
A SizeSettings value that encapsulates the requested size ratio.
Gets a SizeSettings value that defines how much a child control is resized horizontally when the user resizes its hosting window.
static SizeSettings SizeHorizontalAndVertical(int nXRatio int nYRatio);
nXRatio
Defines as a percentage how far a child control is resized horizontally when the user resizes the host window.
nYRatio
Defines as a percentage how far a child control is resized vertically when the user resizes the host window.
A SizeSettings value that encapsulates the requested size ratio.
Gets a SizeSettings value that represents no change in size for a child control.
static SizeSettings SizeNone();
A SizeSettings value that fixes the control at a certain size, so that it does not change size as the user resizes the host window.
Encapsulates size change data for controls in a dynamic layout.
struct CMFCDynamicLayout::SizeSettings;
This is a nested class inside CMFCDynamicLayout
.
Checks if the resize data specifies a nonzero horizontal resizing.
BOOL IsHorizontal() const
TRUE if the SizeSettings
object specifies a nonzero horizontal resizing.
Checks if the resize data specifies no resizing.
BOOL IsNone() const
TRUE if the SizeSettings
object specifies no resizing.
Checks if the resize data specifies a nonzero vertical resizing.
BOOL IsVertical() const
TRUE if the SizeSettings
object specifies a nonzero vertical resizing.
Gets a SizeSettings value that defines how much a child control is resized vertically when the user resizes its hosting window.
static SizeSettings SizeVertical(int nRatio);
nRatio
Defines as a percentage how far a child control is resized vertically when the user resizes the host window.
A SizeSettings value that encapsulates the requested size ratio.