ecere/gui/ListBox: AutoSize tweak to consider header width
authorJerome St-Louis <jerome@ecere.com>
Fri, 3 Aug 2012 08:46:24 +0000 (04:46 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 3 Aug 2012 08:46:24 +0000 (04:46 -0400)
ecere/src/gui/controls/ListBox.ec

index fb71824..e2cc5bc 100644 (file)
@@ -170,6 +170,9 @@ public:
          Font font = listBox.fontObject;
          DataRow row;
          int width = 0;
+         if(header)
+            display.FontExtent(boldFont, header, strlen(header), &width, null);
+         width += EXTRA_SPACE;
          for(row = listBox.firstRow; row; row = row.GetNextRow())
          {
             ListBoxCell cell;