summaryrefslogtreecommitdiff
path: root/alf/alf.h
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alf.h')
-rw-r--r--alf/alf.h116
1 files changed, 79 insertions, 37 deletions
diff --git a/alf/alf.h b/alf/alf.h
index a429472..4ebe205 100644
--- a/alf/alf.h
+++ b/alf/alf.h
@@ -25,11 +25,18 @@ typedef struct {
} ALFWindowVTable;
// layout flags
-#define ALF_QUERYSIZE 0x01
-#define ALF_APPLYSIZE 0x02
-#define ALF_HEXPAND 0x04
-#define ALF_VEXPAND 0x08
-#define ALF_INHERITFONT 0x10
+#define ALF_LAYOUT_SIZE_FIXED 0x00
+#define ALF_LAYOUT_SIZE_QUERY 0x01
+#define ALF_LAYOUT_SIZE_PUSHBUTTON 0x04 /* unimplemented */
+#define ALF_LAYOUT_SIZE_STATICTEXT 0x05 /* unimplemented */
+#define ALF_LAYOUT_SIZE_EDIT 0x06 /* unimplemented */
+#define ALF_LAYOUT_SIZE_RADIOBUTTON 0x07 /* unimplemented */
+#define ALF_LAYOUT_SIZE_CHECKBOX 0x07 /* unimplemented */
+#define ALF_LAYOUT_SIZETYPE_MASK 0x0f
+#define ALF_LAYOUT_INHERITFONT 0x10
+#define ALF_LAYOUT_CUSTOMPOS 0x20
+#define ALF_LAYOUT_SIZE_PX 0x40
+
// label style flags
#define ALF_LABEL_ALIGN_LEFT 0
@@ -57,12 +64,28 @@ typedef struct {
#define ALF_WM_CENTIPOINTTOPX (ALF_WM__BASE + 9)
#define ALF_WM_SETFOCUS (ALF_WM__BASE + 10)
#define ALF_WM_APPLYSIZE (ALF_WM__BASE + 12)
-#define ALF_WM_GETLAYOUTPARAMS (ALF_WM__BASE + 13)
-#define ALF_WM_SETLAYOUTPARAMS (ALF_WM__BASE + 14)
#define ALF_WM_GETWIDGETATPOS (ALF_WM__BASE + 15)
#define ALF_WM_PRETRANSLATEMSG (ALF_WM__BASE + 16)
#define ALF_WM_INVALIDATELAYOUT (ALF_WM__BASE + 17)
#define ALF_WM_VALIDATELAYOUT (ALF_WM__BASE + 18)
+#define ALF_WM_LYT_GETWIDGETPOS (ALF_WM__BASE + 19)
+#define ALF_WM_LYT_SETWIDGETPOS (ALF_WM__BASE + 20)
+#define ALF_WM_LYT_GETWIDGTSIZE (ALF_WM__BASE + 21)
+#define ALF_WM_LYT_SETWIDGTSIZE (ALF_WM__BASE + 22)
+#define ALF_WM_LYT_GETWDGTFLAGS (ALF_WM__BASE + 23)
+#define ALF_WM_LYT_SETWDGTFLAGS (ALF_WM__BASE + 24)
+#define ALF_WM_LYT_GETCOLSIZE (ALF_WM__BASE + 25)
+#define ALF_WM_LYT_SETCOLSIZE (ALF_WM__BASE + 26)
+#define ALF_WM_LYT_GETCOLEXPAND (ALF_WM__BASE + 27)
+#define ALF_WM_LYT_SETCOLEXPAND (ALF_WM__BASE + 28)
+#define ALF_WM_LYT_GETCOLFLAGS (ALF_WM__BASE + 29)
+#define ALF_WM_LYT_SETCOLFLAGS (ALF_WM__BASE + 30)
+#define ALF_WM_LYT_GETROWSIZE (ALF_WM__BASE + 31)
+#define ALF_WM_LYT_SETROWSIZE (ALF_WM__BASE + 32)
+#define ALF_WM_LYT_GETROWEXPAND (ALF_WM__BASE + 33)
+#define ALF_WM_LYT_SETROWEXPAND (ALF_WM__BASE + 34)
+#define ALF_WM_LYT_GETROWFLAGS (ALF_WM__BASE + 35)
+#define ALF_WM_LYT_SETROWFLAGS (ALF_WM__BASE + 36)
#define ALF_WM_LBL_GETSTYLE (ALF_WM__BASE + 201)
#define ALF_WM_LBL_SETSTYLE (ALF_WM__BASE + 202)
@@ -74,16 +97,6 @@ typedef struct {
ALFWindowVTable vtbl;
} ALFWindowClassParams;
-typedef struct {
- HWND hwnd;
- UINT x;
- UINT y;
- UINT width;
- UINT height;
- DWORD flags;
- UINT margins[4];
-} ALFWidgetLayoutParams;
-
typedef enum {
ALF_DPI_AWARENESS_UNAWARE,
ALF_DPI_AWARENESS_SYSTEM_AWARE,
@@ -133,13 +146,13 @@ LRESULT
ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
HWND
-ALF_AddLabel(HWND win, WORD id, UINT x, UINT y, const TCHAR *text);
+ALF_AddLabel(HWND win, WORD id, int x, int y, const TCHAR *text);
HWND
-ALF_AddEdit(HWND win, WORD id, UINT x, UINT y, const TCHAR *text);
+ALF_AddEdit(HWND win, WORD id, int x, int y, const TCHAR *text);
HWND
-ALF_AddButton(HWND win, WORD id, UINT x, UINT y, const TCHAR *text);
+ALF_AddButton(HWND win, WORD id, int x, int y, const TCHAR *text);
void
ALF_SetDefaultButton(HWND win, WORD id);
@@ -148,10 +161,7 @@ void
ALF_DestroyWidget(HWND win, WORD id);
void
-ALF_AddWidget(HWND win, UINT x, UINT y, HWND widget, UINT cptWidth, UINT cptHeight, DWORD flags);
-
-void
-ALF_AddWidgetEx(HWND win, const ALFWidgetLayoutParams *params);
+ALF_AddWidget(HWND win, int x, int y, HWND widget, int width, int height, DWORD flags);
HWND
ALF_WidgetHwndById(HWND win, WORD id);
@@ -211,27 +221,63 @@ ALF_RemoveWidgetLayoutFlag(HWND parent, HWND widget, DWORD flag)
}
BOOL
-ALF_WidgetLayoutPosition(HWND parent, HWND widget, UINT *pX, UINT *pY);
+ALF_WidgetLayoutPosition(HWND parent, HWND widget, int *pX, int *pY);
BOOL
-ALF_SetWidgetLayoutPosition(HWND parent, HWND widget, UINT x, UINT y);
+ALF_SetWidgetLayoutPosition(HWND parent, HWND widget, int x, int y);
BOOL
-ALF_WidgetLayoutSize(HWND parent, HWND widget, UINT *pCptWidth, UINT *pCptHeight);
+ALF_WidgetLayoutMinSize(HWND parent, HWND widget, int *pWidth, int *pheight);
BOOL
-ALF_SetWidgetLayoutSize(HWND parent, HWND widget, UINT cptWidth, UINT cptHeight);
+ALF_SetWidgetLayoutMinSize(HWND parent, HWND widget, int width, int height);
HWND
-ALF_WidgetAtLayoutPosition(HWND parent, UINT x, UINT y);
+ALF_WidgetAtLayoutPosition(HWND parent, int x, int y);
+
+int
+ALF_LayoutRowMinSize(HWND parent, int rowno);
+
+BOOL
+ALF_LayoutSetRowMinSize(HWND parent, int rowno, int rowsize);
+
+int
+ALF_LayoutColumnMinSize(HWND parent, int colno);
+
+BOOL
+ALF_LayoutSetColumnMinSize(HWND parent, int colno, int colsize);
+
+DWORD
+ALF_LayoutRowFlags(HWND parent, int rowno);
+
+BOOL
+ALF_LayoutSetRowFlags(HWND parent, int rowno, DWORD flags);
+
+DWORD
+ALF_LayoutColumnFlags(HWND parent, int colno);
+
+BOOL
+ALF_LayoutSetColumnFlags(HWND parent, int colno, DWORD flags);
+
+int
+ALF_LayoutRowExpandNumerator(HWND parent, int rowno);
+
+BOOL
+ALF_LayoutSetRowExpandNumerator(HWND parent, int rowno, int expand);
+
+int
+ALF_LayoutColumnExpandNumerator(HWND parent, int colno);
+
+BOOL
+ALF_LayoutSetColumnExpandNumerator(HWND parent, int colno, int expand);
// combo box
HWND
-ALF_AddEditableComboBox(HWND win, WORD id, UINT x, UINT y, const TCHAR *defaultText);
+ALF_AddEditableComboBox(HWND win, WORD id, int x, int y, const TCHAR *defaultText);
HWND
-ALF_AddSelectionOnlyComboBox(HWND win, WORD id, UINT x, UINT y);
+ALF_AddSelectionOnlyComboBox(HWND win, WORD id, int x, int y);
int /* index */
ALF_ComboBoxAddString(HWND combo, const TCHAR *text);
@@ -259,15 +305,11 @@ ALF_ComboBoxSetText(HWND combo, const TCHAR *text);
// panel
HWND
-ALF_AddPanel(HWND parent, WORD id, UINT x, UINT y);
-
-// spacer
-HWND
-ALF_AddSpacer(HWND parent, WORD id, UINT x, UINT y, UINT cptWidth, UINT cptHeight, DWORD layoutFlags);
+ALF_AddPanel(HWND parent, WORD id, int x, int y);
// tab control
HWND
-ALF_AddNotebook(HWND parent, WORD id, UINT x, UINT y);
+ALF_AddNotebook(HWND parent, WORD id, int x, int y);
HWND
ALF_NotebookAddTab(HWND notebook, const TCHAR *title);