diff 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
line wrap: on
line diff
--- a/win/dw.c	Thu Jan 12 17:21:31 2012 +0000
+++ b/win/dw.c	Thu Jan 12 18:21:54 2012 +0000
@@ -4396,7 +4396,8 @@
 /* Internal function to calculate the widget's required size..
  * These are the general rules for widget sizes:
  * 
- * Scrolled(Container,Tree,MLE)/Render/Unspecified: 1x1
+ * Render/Unspecified: 1x1
+ * Scrolled(Container,Tree,MLE): 500x200
  * Entryfield/Combobox/Spinbutton: 150x(maxfontheight)
  * Spinbutton: 50x(maxfontheight)
  * Text/Status: (textwidth)x(textheight)
@@ -4473,14 +4474,31 @@
       thiswidth = 50;
       extraheight = 6;
    }
-   /* Entryfields */
-   else if(strnicmp(tmpbuf, EDITCLASSNAME, strlen(EDITCLASSNAME)+1) == 0 &&
-           !(GetWindowLong(handle, GWL_STYLE) & ES_MULTILINE))
-   {
-      dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight);
-      thiswidth = 150;
-      extraheight = 6;
-   }
+   /* Entryfields and MLE */
+   else if(strnicmp(tmpbuf, EDITCLASSNAME, strlen(EDITCLASSNAME)+1) == 0)
+   {
+      if((GetWindowLong(handle, GWL_STYLE) & ES_MULTILINE))
+      {
+         /* MLE */
+         thiswidth = 500;
+         thisheight = 200;
+      }
+      else
+      {
+         /* Entryfield */
+         dw_font_text_extents_get(handle, NULL, testtext, NULL, &thisheight);
+         thiswidth = 150;
+         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)
+   {
+      thiswidth = 500;
+      thisheight = 200;
+   }
+   /* Buttons */
    else if(strnicmp(tmpbuf, BUTTONCLASSNAME, strlen(BUTTONCLASSNAME)+1) == 0)
    {
       ULONG style = GetWindowLong(handle, GWL_STYLE);