uLib
User mode C/C++ extended API library for Win32 programmers.
|
Dialog memory templates support.
#include <uLib/DlgPlate.h>
This is by far the most finicky way to create a dialog...
However, it's purely code, so it can live without resources, such as in a lib.
After creating a memory dialog template, use f.ex. DialogBoxIndirectParam(),
passing the template pointer as your hDialogTemplate argument.
Hint: Memory templates are indispensable if you want to write a dialog editor.
Classes | |
struct | DLGTEMPLATEEX |
struct | DLGITEMTEMPLATEEX |
Macros | |
#define | ORD_BUTTON 0x0080ffff |
#define | ORD_EDIT 0x0081ffff |
#define | ORD_STATIC 0x0082ffff |
#define | ORD_LISTBOX 0x0083ffff |
#define | ORD_SCROLLBAR 0x0084ffff |
#define | ORD_COMBOBOX 0x0085ffff |
Typedefs | |
typedef DLGTEMPLATEEX * | PDLGTEMPLATEEX |
typedef DLGITEMTEMPLATEEX * | PDLGITEMTEMPLATEEX |
Functions | |
LPDLGTEMPLATE | AllocDlgTemplate (WORD Size) |
void | FreeDlgTemplate (LPDLGTEMPLATE pDlg) |
LPDLGITEMTEMPLATE | SetDlgStyle (LPDLGTEMPLATE pBuf, DWORD Style, short X, short Y, short W, short H, LPCWSTR Caption, WORD nCtls, LPCWSTR Font, WORD Points) |
LPDLGITEMTEMPLATE | AddDlgItem (LPDLGITEMTEMPLATE pBuf, DWORD Type, DWORD Style, DWORD ExStyle, short X, short Y, short W, short H, LPCWSTR Caption, WORD Id) |
PDLGTEMPLATEEX | AllocExDlgTemplate (WORD Size) |
void | FreeExDlgTemplate (PDLGTEMPLATEEX pDlg) |
PDLGITEMTEMPLATEEX | SetExDlgStyle (PDLGTEMPLATEEX pBuf, DWORD Style, short X, short Y, short W, short H, LPCWSTR Caption, DWORD HelpId, WORD nCtls, LPCWSTR Font, short Points, short Weight=FW_NORMAL, BYTE CharSet=DEFAULT_CHARSET) |
PDLGITEMTEMPLATEEX | AddExDlgItem (PDLGITEMTEMPLATEEX pBuf, DWORD Type, DWORD Style, DWORD ExStyle, short X, short Y, short W, short H, LPCWSTR Caption, WORD Id, DWORD HelpId) |
struct DLGTEMPLATEEX |
Everything after cy in DLGTEMPLATEEX is variable length,
and therefore must be determined dynamically..
See [MSDN] DLGTEMPLATEEX Structure for further details.
Definition at line 98 of file DlgPlate.h.
Class Members | ||
---|---|---|
WORD | dlgVer |
Must be 1. |
WORD | signature |
0xFFFF. |
DWORD | helpId |
Help context id. |
DWORD | exStyle |
Unused... Or is it, by now? Do some tests? |
DWORD | style |
Dialog style, DS_nn and WS_nn flags. |
WORD | cDlgItems |
Nr of DLGITEMTEMPLATEEX structs following. |
short | x |
X position in dialog units. |
short | y |
Y position in dialog units. |
short | cx |
Width in dialog units. |
short | cy |
Height in dialog units. |
struct DLGITEMTEMPLATEEX |
Everything after id in DLGITEMTEMPLATEEX is variable length,
and therefore must be determined dynamically
See [MSDN] DLGITEMTEMPLATEEX Structure for further details.
Definition at line 126 of file DlgPlate.h.
Class Members | ||
---|---|---|
DWORD | helpId |
Help context identifier for the contro. |
DWORD | exStyle |
Extended styles for the control. |
DWORD | style |
Window style flags for the control. |
short | x |
X position in dialog units. |
short | y |
Y position in dialog units. |
short | cx |
Width in dialog units. |
short | cy |
Height in dialog units. |
DWORD | id |
Dialog item Id. |
#define ORD_BUTTON 0x0080ffff |
Button (composite LE ordinal).
Definition at line 29 of file DlgPlate.h.
#define ORD_EDIT 0x0081ffff |
Edit (composite LE ordinal).
Definition at line 30 of file DlgPlate.h.
#define ORD_STATIC 0x0082ffff |
Static (composite LE ordinal).
Definition at line 31 of file DlgPlate.h.
#define ORD_LISTBOX 0x0083ffff |
List box (composite LE ordinal).
Definition at line 32 of file DlgPlate.h.
#define ORD_SCROLLBAR 0x0084ffff |
Scroll bar (composite LE ordinal).
Definition at line 33 of file DlgPlate.h.
#define ORD_COMBOBOX 0x0085ffff |
Combo box (composite LE ordinal).
Definition at line 34 of file DlgPlate.h.
typedef DLGTEMPLATEEX* PDLGTEMPLATEEX |
Definition at line 115 of file DlgPlate.h.
typedef DLGITEMTEMPLATEEX* PDLGITEMTEMPLATEEX |
Definition at line 141 of file DlgPlate.h.
LPDLGTEMPLATE AllocDlgTemplate | ( | WORD | Size | ) |
Allocate a classic dialog memory template.
The buffer is guaranteed to have the required DWORD alignment.
Definition at line 38 of file DlgPlate.cpp.
void FreeDlgTemplate | ( | LPDLGTEMPLATE | pDlg | ) |
Delete a classic dialog memory template.
Definition at line 44 of file DlgPlate.cpp.
LPDLGITEMTEMPLATE SetDlgStyle | ( | LPDLGTEMPLATE | pBuf, |
DWORD | Style, | ||
short | X, | ||
short | Y, | ||
short | W, | ||
short | H, | ||
LPCWSTR | Caption, | ||
WORD | nCtls, | ||
LPCWSTR | Font, | ||
WORD | Points | ||
) |
Setup the dialog style..
SetDlgStyle returns a pointer to where to put the first dialog item.
See [MSDN] DLGTEMPLATE structure for further details..
pBuf | DWORD aligned template buffer. |
Style | Dialog/window style flags. |
Y | X,Y = Position (dialog units). |
H | W,H = Size (dialog units). |
Caption | Window caption. |
nCtls | Nr of DLGITEMTEMPLATES to follow. |
Font | Typeface name (Option.. if DS_SETFONT). |
Points | Point size of font (Option.. if DS_SETFONT or DS_SHELLFONT). |
Definition at line 57 of file DlgPlate.cpp.
LPDLGITEMTEMPLATE AddDlgItem | ( | LPDLGITEMTEMPLATE | pBuf, |
DWORD | Type, | ||
DWORD | Style, | ||
DWORD | ExStyle, | ||
short | X, | ||
short | Y, | ||
short | W, | ||
short | H, | ||
LPCWSTR | Caption, | ||
WORD | Id | ||
) |
Add a dialog control item..
AddDlgItem returns a pointer to where to put the next dialog item.
See [MSDN] DLGITEMTEMPLATE structure for further details..
pBuf | Buffer pointer (automatically DW aligned) |
Type | Ordinal of predifined control class (ORD_nnn) |
Style | Control style flags |
ExStyle | Extended style flags |
Y | X,Y = Position (dialog units) |
H | W,H = Size (dialog units) |
Caption | Initial text |
Id | Control ID |
Definition at line 94 of file DlgPlate.cpp.
PDLGTEMPLATEEX AllocExDlgTemplate | ( | WORD | Size | ) |
Allocate/Free extended dialog templates.
The buffers are guaranteed to have the required DWORD alignment.
Definition at line 128 of file DlgPlate.cpp.
void FreeExDlgTemplate | ( | PDLGTEMPLATEEX | pDlg | ) |
Delete an extended dialog memory template.
Definition at line 133 of file DlgPlate.cpp.
PDLGITEMTEMPLATEEX SetExDlgStyle | ( | PDLGTEMPLATEEX | pBuf, |
DWORD | Style, | ||
short | X, | ||
short | Y, | ||
short | W, | ||
short | H, | ||
LPCWSTR | Caption, | ||
DWORD | HelpId, | ||
WORD | nCtls, | ||
LPCWSTR | Font, | ||
short | Points, | ||
short | Weight = FW_NORMAL , |
||
BYTE | CharSet = DEFAULT_CHARSET |
||
) |
Setup the extended dialog style..
SetExDlgStyle returns a pointer to where to put the first dialog item.
See [MSDN] DLGTEMPLATEEX Structure for further details.
pBuf | DWord aligned buffer |
Style | Dialog/window style flags |
Y | X,Y = Position (dialog units) |
H | W,H = Size (dialog units) |
Caption | Window title |
HelpId | Help ID |
nCtls | Nr of DLGITEMTEMPLATEEX to follow |
Font | Typeface name (if DS_SETFONT or DS_SHELLFONT) |
Points | Font size |
Weight | Font weight |
CharSet | Character set |
Definition at line 146 of file DlgPlate.cpp.
PDLGITEMTEMPLATEEX AddExDlgItem | ( | PDLGITEMTEMPLATEEX | pBuf, |
DWORD | Type, | ||
DWORD | Style, | ||
DWORD | ExStyle, | ||
short | X, | ||
short | Y, | ||
short | W, | ||
short | H, | ||
LPCWSTR | Caption, | ||
WORD | Id, | ||
DWORD | HelpId | ||
) |
Add an extended dialog control item..
AddExDlgItem returns a pointer to where to put the next dialog item.
See [MSDN] DLGITEMTEMPLATEEX Structure for further details.
pBuf | Buffer pointer (automatically DW aligned) |
Type | Ordinal of predifined control class (ORD_nnn) |
Style | Control style flags |
ExStyle | Extended style flags |
Y | X,Y = Position (dialog units) |
H | W,H = Size (dialog units) |
Caption | Initial text |
Id | Control ID |
HelpId | Help ID |
Definition at line 206 of file DlgPlate.cpp.