diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-16 18:17:56 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-16 18:17:56 +0200 |
| commit | 536ea04c34ba761d7031eeabb6d50adab0f0f2bd (patch) | |
| tree | 7def1b680705497636c2f5e5649c0ffeb477539c /alf/alfspacer.cpp | |
| parent | 5cbb664bd49cd2b9c035ccfc3024aa436d28c36c (diff) | |
rework grid layout
Fractional expand is now supported like Qt, and also per row/column
instead of as a widget attribute.
Instead of margins, you're now supposed to use empty rows/columns instead.
Spacer is also gone, use empty rows/columns with minimum size.
Layout engine is prepared to directly calculate edit, button, etc.
sizes without subclassing these controls
Diffstat (limited to 'alf/alfspacer.cpp')
| -rw-r--r-- | alf/alfspacer.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/alf/alfspacer.cpp b/alf/alfspacer.cpp deleted file mode 100644 index 7c0f776..0000000 --- a/alf/alfspacer.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "alfpriv.h" - -TCHAR *_alf_spacerClass = NULL; - -void -ALF_RegisterSpacerClass(void) -{ - WNDCLASS cls; - ZeroMemory(&cls, sizeof(cls)); - - TCHAR classNameBuf[256]; - ALF_BuildUniqueName(classNameBuf, TEXT("ALFSpacer."), (ULONG_PTR)&_alf_spacerClass); - - cls.hInstance = ALF_HINSTANCE; - cls.hCursor = LoadCursor(NULL, (LPTSTR)IDC_ARROW); - cls.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); - cls.lpszClassName = classNameBuf; - cls.cbWndExtra = sizeof(void*); - cls.lpfnWndProc = DefWindowProc; - - ATOM classatom = RegisterClass(&cls); - if (!classatom) - MessageBox(NULL, TEXT("FATAL: Could not register spacer class"), NULL, MB_OK); - - _alf_spacerClass = MAKEINTATOM(classatom); -} - -HWND -ALF_AddSpacer(HWND parent, WORD id, UINT x, UINT y, UINT cptWidth, UINT cptHeight, DWORD layoutFlags) -{ - HWND hwndSpacer = CreateWindowEx(0, - _alf_spacerClass, - TEXT(""), - WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, - 0, 0, 0, 0, - parent, - (HMENU)(int)id, - ALF_HINSTANCE, - NULL); - - ALFWidgetLayoutParams p; - ZeroMemory(&p, sizeof(p)); - p.hwnd = hwndSpacer; - p.x = x; - p.y = y; - p.width = cptWidth; - p.height = cptHeight; - p.flags = layoutFlags; - - ALF_AddWidgetEx(parent, &p); - - return hwndSpacer; -} |
