# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1326422159 0 # Node ID edbc7405ed4d1e957e35e8f2202ea19e943e7883 # Parent 1c6593b0ce45b0c59753e649f7af2895ba3bdbb0 Added code to auto-size container on Windows. diff -r 1c6593b0ce45 -r edbc7405ed4d win/dw.c --- a/win/dw.c Fri Jan 13 02:02:28 2012 +0000 +++ b/win/dw.c Fri Jan 13 02:35:59 2012 +0000 @@ -4538,9 +4538,25 @@ extraheight = 6; } } - /* Container and Tree */ - else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)== 0 || - strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW)+1)== 0) + /* Container */ + else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)== 0) + { + DWORD result = ListView_ApproximateViewRect(handle, _DW_SCROLLED_MAX_WIDTH, _DW_SCROLLED_MAX_HEIGHT, -1); + + thiswidth = LOWORD(result); + thisheight = HIWORD(result); + + if(thiswidth > _DW_SCROLLED_MAX_WIDTH) + thiswidth = _DW_SCROLLED_MAX_WIDTH; + if(thiswidth < _DW_SCROLLED_MIN_WIDTH) + thiswidth = _DW_SCROLLED_MIN_WIDTH; + if(thisheight < _DW_SCROLLED_MIN_HEIGHT) + thisheight = _DW_SCROLLED_MIN_HEIGHT; + if(thisheight > _DW_SCROLLED_MAX_HEIGHT) + thisheight = _DW_SCROLLED_MAX_HEIGHT; + } + /* Tree */ + else if(strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW)+1)== 0) { thiswidth = _DW_SCROLLED_MAX_WIDTH; thisheight = _DW_SCROLLED_MAX_HEIGHT;