comparison os2/dw.c @ 1570:d6988022c5cf

Implemented listbox sizing on OS/2 and Windows. Mac already works and GTK3 looks like it should from the code but have not tested. Will need to check into GTK2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 22 Jan 2012 10:05:16 +0000
parents 866d7d05d425
children c5e210e04dce
comparison
equal deleted inserted replaced
1569:866d7d05d425 1570:d6988022c5cf
4782 if(thisheight < _DW_SCROLLED_MIN_HEIGHT) 4782 if(thisheight < _DW_SCROLLED_MIN_HEIGHT)
4783 thisheight = _DW_SCROLLED_MIN_HEIGHT; 4783 thisheight = _DW_SCROLLED_MIN_HEIGHT;
4784 if(thisheight > _DW_SCROLLED_MAX_HEIGHT) 4784 if(thisheight > _DW_SCROLLED_MAX_HEIGHT)
4785 thisheight = _DW_SCROLLED_MAX_HEIGHT; 4785 thisheight = _DW_SCROLLED_MAX_HEIGHT;
4786 } 4786 }
4787 /* Listbox */
4788 else if(strncmp(tmpbuf, "#7", 3)==0)
4789 {
4790 char buf[1025] = {0};
4791 int x, count = dw_listbox_count(handle);
4792 int basicwidth = thiswidth = WinQuerySysValue(HWND_DESKTOP, SV_CXVSCROLL) + 8;
4793
4794 thisheight = 8;
4795
4796 for(x=0;x<count;x++)
4797 {
4798 int height, width = 0;
4799
4800 dw_listbox_get_text(handle, x, buf, 1024);
4801
4802 if(strlen(buf))
4803 dw_font_text_extents_get(handle, NULL, buf, &width, &height);
4804 else
4805 dw_font_text_extents_get(handle, NULL, testtext, NULL, &height);
4806
4807 width += basicwidth;
4808
4809 if(width > thiswidth)
4810 thiswidth = width > _DW_SCROLLED_MAX_WIDTH ? _DW_SCROLLED_MAX_WIDTH : width;
4811 thisheight += height;
4812 }
4813
4814 if(thiswidth < _DW_SCROLLED_MIN_WIDTH)
4815 thiswidth = _DW_SCROLLED_MIN_WIDTH;
4816 if(thisheight < _DW_SCROLLED_MIN_HEIGHT)
4817 thisheight = _DW_SCROLLED_MIN_HEIGHT;
4818 if(thisheight > _DW_SCROLLED_MAX_HEIGHT)
4819 thisheight = _DW_SCROLLED_MAX_HEIGHT;
4820 }
4787 /* Container and Tree */ 4821 /* Container and Tree */
4788 else if(strncmp(tmpbuf, "#37", 4)==0) 4822 else if(strncmp(tmpbuf, "#37", 4)==0)
4789 { 4823 {
4790 /* Container */ 4824 /* Container */
4791 if(dw_window_get_data(handle, "_dw_container")) 4825 if(dw_window_get_data(handle, "_dw_container"))