comparison win/dw.c @ 1537:a4ecef1980db

Added code for returning a size for scrolled widgets on OS/2, Windows and Mac... They get 500x200 because this is what GTK seems to recommend. It occurs to me that listboxes may not currently be handled... will have to look into that.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 12 Jan 2012 18:21:54 +0000
parents a71ec02f3b70
children 1c6593b0ce45
comparison
equal deleted inserted replaced
1536:a71ec02f3b70 1537:a4ecef1980db
4394 } 4394 }
4395 4395
4396 /* Internal function to calculate the widget's required size.. 4396 /* Internal function to calculate the widget's required size..
4397 * These are the general rules for widget sizes: 4397 * These are the general rules for widget sizes:
4398 * 4398 *
4399 * Scrolled(Container,Tree,MLE)/Render/Unspecified: 1x1 4399 * Render/Unspecified: 1x1
4400 * Scrolled(Container,Tree,MLE): 500x200
4400 * Entryfield/Combobox/Spinbutton: 150x(maxfontheight) 4401 * Entryfield/Combobox/Spinbutton: 150x(maxfontheight)
4401 * Spinbutton: 50x(maxfontheight) 4402 * Spinbutton: 50x(maxfontheight)
4402 * Text/Status: (textwidth)x(textheight) 4403 * Text/Status: (textwidth)x(textheight)
4403 * Ranged: 100x14 or 14x100 for vertical. 4404 * Ranged: 100x14 or 14x100 for vertical.
4404 * Buttons/Bitmaps: Size of text or image and border. 4405 * Buttons/Bitmaps: Size of text or image and border.
4471 { 4472 {
4472 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight); 4473 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight);
4473 thiswidth = 50; 4474 thiswidth = 50;
4474 extraheight = 6; 4475 extraheight = 6;
4475 } 4476 }
4476 /* Entryfields */ 4477 /* Entryfields and MLE */
4477 else if(strnicmp(tmpbuf, EDITCLASSNAME, strlen(EDITCLASSNAME)+1) == 0 && 4478 else if(strnicmp(tmpbuf, EDITCLASSNAME, strlen(EDITCLASSNAME)+1) == 0)
4478 !(GetWindowLong(handle, GWL_STYLE) & ES_MULTILINE)) 4479 {
4479 { 4480 if((GetWindowLong(handle, GWL_STYLE) & ES_MULTILINE))
4480 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight); 4481 {
4481 thiswidth = 150; 4482 /* MLE */
4482 extraheight = 6; 4483 thiswidth = 500;
4483 } 4484 thisheight = 200;
4485 }
4486 else
4487 {
4488 /* Entryfield */
4489 dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight);
4490 thiswidth = 150;
4491 extraheight = 6;
4492 }
4493 }
4494 /* Container and Tree */
4495 else if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)== 0 ||
4496 strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW)+1)== 0)
4497 {
4498 thiswidth = 500;
4499 thisheight = 200;
4500 }
4501 /* Buttons */
4484 else if(strnicmp(tmpbuf, BUTTONCLASSNAME, strlen(BUTTONCLASSNAME)+1) == 0) 4502 else if(strnicmp(tmpbuf, BUTTONCLASSNAME, strlen(BUTTONCLASSNAME)+1) == 0)
4485 { 4503 {
4486 ULONG style = GetWindowLong(handle, GWL_STYLE); 4504 ULONG style = GetWindowLong(handle, GWL_STYLE);
4487 4505
4488 /* Bitmap buttons */ 4506 /* Bitmap buttons */