comparison win/dw.c @ 1542:edbc7405ed4d

Added code to auto-size container on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 13 Jan 2012 02:35:59 +0000
parents 1c6593b0ce45
children 78a2e6a51285
comparison
equal deleted inserted replaced
1541:1c6593b0ce45 1542:edbc7405ed4d
4536 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight); 4536 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight);
4537 thiswidth = 150; 4537 thiswidth = 150;
4538 extraheight = 6; 4538 extraheight = 6;
4539 } 4539 }
4540 } 4540 }
4541 /* Container and Tree */ 4541 /* Container */
4542 else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)== 0 || 4542 else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)== 0)
4543 strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW)+1)== 0) 4543 {
4544 DWORD result = ListView_ApproximateViewRect(handle, _DW_SCROLLED_MAX_WIDTH, _DW_SCROLLED_MAX_HEIGHT, -1);
4545
4546 thiswidth = LOWORD(result);
4547 thisheight = HIWORD(result);
4548
4549 if(thiswidth > _DW_SCROLLED_MAX_WIDTH)
4550 thiswidth = _DW_SCROLLED_MAX_WIDTH;
4551 if(thiswidth < _DW_SCROLLED_MIN_WIDTH)
4552 thiswidth = _DW_SCROLLED_MIN_WIDTH;
4553 if(thisheight < _DW_SCROLLED_MIN_HEIGHT)
4554 thisheight = _DW_SCROLLED_MIN_HEIGHT;
4555 if(thisheight > _DW_SCROLLED_MAX_HEIGHT)
4556 thisheight = _DW_SCROLLED_MAX_HEIGHT;
4557 }
4558 /* Tree */
4559 else if(strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW)+1)== 0)
4544 { 4560 {
4545 thiswidth = _DW_SCROLLED_MAX_WIDTH; 4561 thiswidth = _DW_SCROLLED_MAX_WIDTH;
4546 thisheight = _DW_SCROLLED_MAX_HEIGHT; 4562 thisheight = _DW_SCROLLED_MAX_HEIGHT;
4547 } 4563 }
4548 /* Buttons */ 4564 /* Buttons */