From 536ea04c34ba761d7031eeabb6d50adab0f0f2bd Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Thu, 16 Apr 2020 18:17:56 +0200 Subject: 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 --- alf/alfcombobox.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'alf/alfcombobox.cpp') diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index 288e3a8..33a454c 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -288,7 +288,7 @@ ALF_RegisterComboClass(void) } static HWND -ALF_InternalAddComboBox(HWND win, WORD id, UINT x, UINT y, DWORD style, const TCHAR *defaultText) +ALF_InternalAddComboBox(HWND win, WORD id, int x, int y, DWORD style, const TCHAR *defaultText) { ALFComboCreateParams cp; cp.comboStyle = style; @@ -306,28 +306,19 @@ ALF_InternalAddComboBox(HWND win, WORD id, UINT x, UINT y, DWORD style, const TC if (defaultText) SetWindowText(hwndCombo, defaultText); - ALFWidgetLayoutParams p; - ZeroMemory(&p, sizeof(p)); - p.hwnd = hwndCombo; - p.x = x; - p.y = y; - p.width = 0; - p.height = 0; - p.flags = ALF_QUERYSIZE | ALF_INHERITFONT; - - ALF_AddWidgetEx(win, &p); + ALF_AddWidget(win, x, y, hwndCombo, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT); return hwndCombo; } 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) { return ALF_InternalAddComboBox(win, id, x, y, CBS_DROPDOWN, defaultText); } HWND -ALF_AddSelectionOnlyComboBox(HWND win, WORD id, UINT x, UINT y) +ALF_AddSelectionOnlyComboBox(HWND win, WORD id, int x, int y) { return ALF_InternalAddComboBox(win, id, x, y, CBS_DROPDOWNLIST, NULL); } -- cgit v1.2.3