dialog-layout latest
|
Classes | |
struct | LAYOUT_COORD |
struct | LAYOUT_ITEM |
struct | LAYOUT_ITEM_LIST |
struct | LAYOUT |
Structure representing a dialog layout. More... | |
struct | LAYOUT_ITEM_RC |
struct | LAYOUT_CHILD_PARAM |
Typedefs | |
typedef struct LAYOUT_ITEM_LIST | LAYOUT_ITEM_LIST |
Functions | |
void | attach_layout (HANDLE resource, HWND dialog, LPCTSTR layout_name) |
Attach a dynamic layout to a dialog box using a layout resource. | |
void | init_layout (HWND dialog) |
Initialize dynamic layout management for a dialog. | |
BOOL | anchor_control (HWND dialog, DWORD control_id, WORD anchor_topleft, WORD anchor_bottomright) |
Anchor an individual control to specific edges of the dialog, overriding any previous anchor. | |
typedef struct LAYOUT_ITEM_LIST LAYOUT_ITEM_LIST |
BOOL anchor_control | ( | HWND | dialog, |
DWORD | control_id, | ||
WORD | anchor_topleft, | ||
WORD | anchor_bottomright ) |
Anchor an individual control to specific edges of the dialog, overriding any previous anchor.
Registers or overrides the anchor points for the specified control in the layout engine. This function can be used after attach_layout() to override anchors loaded from a resource, or after init_layout() to add anchors manually.
dialog | Handle to the dialog box (HWND). |
control_id | Control ID (e.g., IDC_BUTTON_OK). |
anchor_topleft | Anchor flags for the control's top-left corner (see Anchor flags). |
anchor_bottomright | Anchor flags for the control's bottom-right corner (see Anchor flags). |
Example usage:
void attach_layout | ( | HANDLE | resource, |
HWND | dialog, | ||
LPCTSTR | layout_resource_name ) |
Attach a dynamic layout to a dialog box using a layout resource.
Loads the layout information from the specified resource and applies it to the dialog, so its controls will resize and move according to the layout rules when the dialog is resized.
resource | Handle to the module containing the resource. |
dialog | Handle to the dialog box (HWND). |
layout_resource_name | Name of the layout resource (e.g., MAKEINTRESOURCE(ID_MAINDIALOG_LAYOUT)). |
Example usage:
void init_layout | ( | HWND | dialog | ) |
Initialize dynamic layout management for a dialog.
Prepares the dialog for dynamic layout by creating an internal layout structure. Controls can then be anchored individually using anchor_control().
dialog | Handle to the dialog box (HWND). |
Example usage: