changeset 1556:4a9c574d5c17

Fixed on Windows showing themed static text on colored boxes when the window is glass. Fixed off by one in scrollbox scroller bars on Windows. Moved class name defines out of the main header and into the Windows source file. Updated copyright dates to 2012.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 15 Jan 2012 22:36:41 +0000
parents 5b5da6d21f08
children 030e9bddc1c9
files dw.h gtk/dw.c gtk3/dw.c mac/dw.m os2/dw.c template/dw.c win/dw.c
diffstat 7 files changed, 38 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Sun Jan 15 21:13:35 2012 +0000
+++ b/dw.h	Sun Jan 15 22:36:41 2012 +0000
@@ -577,23 +577,6 @@
 #define KC_SHIFT                 (1 << 1)
 #define KC_ALT                   (1 << 2)
 
-#define STATICCLASSNAME "STATIC"
-#define COMBOBOXCLASSNAME "COMBOBOX"
-#define LISTBOXCLASSNAME "LISTBOX"
-#define BUTTONCLASSNAME "BUTTON"
-#define POPUPMENUCLASSNAME "POPUPMENU"
-#define EDITCLASSNAME "EDIT"
-#define FRAMECLASSNAME "FRAME"
-#define SCROLLBARCLASSNAME "SCROLLBAR"
-
-#define ClassName "dynamicwindows"
-#define SplitbarClassName "dwsplitbar"
-#define ObjectClassName "dwobjectclass"
-#define BrowserClassName "dwbrowserclass"
-#define ScrollClassName "dwscrollclass"
-#define StatusbarClassName "dwstatusbar"
-#define DefaultFont NULL
-
 typedef struct _color {
    int fore;
    int back;
--- a/gtk/dw.c	Sun Jan 15 21:13:35 2012 +0000
+++ b/gtk/dw.c	Sun Jan 15 22:36:41 2012 +0000
@@ -3,7 +3,7 @@
  *          A GTK like cross-platform GUI
  *          GTK forwarder module for portabilty.
  *
- * (C) 2000-2011 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2012 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  * (C) 2002 Nickolay V. Shmyrev <shmyrev@yandex.ru>
  */
--- a/gtk3/dw.c	Sun Jan 15 21:13:35 2012 +0000
+++ b/gtk3/dw.c	Sun Jan 15 22:36:41 2012 +0000
@@ -3,7 +3,7 @@
  *          A GTK like cross-platform GUI
  *          GTK3 forwarder module for portabilty.
  *
- * (C) 2000-2011 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2012 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  * (C) 2002 Nickolay V. Shmyrev <shmyrev@yandex.ru>
  */
--- a/mac/dw.m	Sun Jan 15 21:13:35 2012 +0000
+++ b/mac/dw.m	Sun Jan 15 22:36:41 2012 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the MacOS GUI using Cocoa
  *
- * (C) 2011 Brian Smith <brian@dbsoft.org>
+ * (C) 2012 Brian Smith <brian@dbsoft.org>
  * (C) 2011 Mark Hessling <mark@rexx.org>
  *
  * Requires 10.5 or later.
@@ -3409,7 +3409,7 @@
  * These are the general rules for widget sizes:
  * 
  * Render/Unspecified: 1x1
- * Scrolled(Container,Tree,MLE): 500x200
+ * Scrolled(Container,Tree,MLE): Guessed size clamped to min and max in dw.h
  * Entryfield/Combobox/Spinbutton: 150x(maxfontheight)
  * Spinbutton: 50x(maxfontheight)
  * Text/Status: (textwidth)x(textheight)
--- a/os2/dw.c	Sun Jan 15 21:13:35 2012 +0000
+++ b/os2/dw.c	Sun Jan 15 22:36:41 2012 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the PM GUI
  *
- * (C) 2000-2011 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2012 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  * (C) 2000 Achim Hasenmueller <achimha@innotek.de>
  * (C) 2000 Peter Nielsen <peter@pmview.com>
@@ -4635,7 +4635,7 @@
  * These are the general rules for widget sizes:
  * 
  * Render/Unspecified: 1x1
- * Scrolled(Container,Tree,MLE): 500x200
+ * Scrolled(Container,Tree,MLE): Guessed size clamped to min and max in dw.h
  * Entryfield/Combobox/Spinbutton: 150x(maxfontheight)
  * Spinbutton: 50x(maxfontheight)
  * Text/Status: (textwidth)x(textheight)
--- a/template/dw.c	Sun Jan 15 21:13:35 2012 +0000
+++ b/template/dw.c	Sun Jan 15 22:36:41 2012 +0000
@@ -2,8 +2,8 @@
  * Dynamic Windows:
  *          A GTK like GUI implementation template.
  *
- * (C) 2011 Brian Smith <brian@dbsoft.org>
- * (C) 2011 Mark Hessling <mark@rexx.org>
+ * (C) 2011-2012 Brian Smith <brian@dbsoft.org>
+ * (C) 2011-2012 Mark Hessling <mark@rexx.org>
  *
  */
 
--- a/win/dw.c	Sun Jan 15 21:13:35 2012 +0000
+++ b/win/dw.c	Sun Jan 15 22:36:41 2012 +0000
@@ -2,7 +2,7 @@
  * Dynamic Windows:
  *          A GTK like implementation of the Win32 GUI
  *
- * (C) 2000-2011 Brian Smith <brian@dbsoft.org>
+ * (C) 2000-2012 Brian Smith <brian@dbsoft.org>
  * (C) 2003-2011 Mark Hessling <mark@rexx.org>
  *
  */
@@ -31,6 +31,23 @@
 #endif
 #include <richedit.h>
 
+#define STATICCLASSNAME "STATIC"
+#define COMBOBOXCLASSNAME "COMBOBOX"
+#define LISTBOXCLASSNAME "LISTBOX"
+#define BUTTONCLASSNAME "BUTTON"
+#define POPUPMENUCLASSNAME "POPUPMENU"
+#define EDITCLASSNAME "EDIT"
+#define FRAMECLASSNAME "FRAME"
+#define SCROLLBARCLASSNAME "SCROLLBAR"
+
+#define ClassName "dynamicwindows"
+#define SplitbarClassName "dwsplitbar"
+#define ObjectClassName "dwobjectclass"
+#define BrowserClassName "dwbrowserclass"
+#define ScrollClassName "dwscrollclass"
+#define StatusbarClassName "dwstatusbar"
+#define DefaultFont NULL
+
 #ifdef GDIPLUS
 /* GDI+ Headers are not C compatible... so define what we need here instead */
 struct GdiplusStartupInput
@@ -1410,7 +1427,7 @@
                 vsi.nMin = hsi.nMin = vsi.nMax = hsi.nMax = 0;
                 if(rect.bottom < thisbox->minheight)
                 {
-                    vsi.nMax = thisbox->minheight;
+                    vsi.nMax = thisbox->minheight - 1;
                     vsi.nPage = rect.bottom;
                     if(vsi.nPos > vsi.nMax)
                     {
@@ -1419,7 +1436,7 @@
                 }
                 if(rect.right < thisbox->minwidth)
                 {
-                    hsi.nMax = thisbox->minwidth;
+                    hsi.nMax = thisbox->minwidth - 1;
                     hsi.nPage = rect.right;
                     if(hsi.nPos > hsi.nMax)
                     {
@@ -3280,16 +3297,22 @@
 /* Window procedure to handle drawing themed text when in composited mode */
 BOOL CALLBACK _staticwndproc(HWND hwnd, ULONG msg, WPARAM mp1, LPARAM mp2)
 {
-   ColorInfo *cinfo = (ColorInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+   ColorInfo *parentcinfo, *cinfo = (ColorInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
    WNDPROC pOldProc;
 
    if (!cinfo)
       return DefWindowProc(hwnd, msg, mp1, mp2);
 
+   /* Need the parent to do the check completely */
+   parentcinfo = (ColorInfo *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+   
    /* If we don't require themed drawing */
-   if(cinfo->back != -1 && !_dw_composition || !(GetWindowLongPtr(_toplevel_window(hwnd), GWL_EXSTYLE) & WS_EX_LAYERED))
+   if(((cinfo->back != -1 && cinfo->back != DW_RGB_TRANSPARENT) || (parentcinfo && parentcinfo->back != -1)) 
+       || !_dw_composition || !(GetWindowLongPtr(_toplevel_window(hwnd), GWL_EXSTYLE) & WS_EX_LAYERED))
       return _colorwndproc(hwnd, msg, mp1, mp2);
-      
+   
+   dw_debug("Parentcinfo %x parentcinfo->back %d\n", (int)parentcinfo, parentcinfo->back);
+   
    pOldProc = cinfo->pOldProc;
    
    switch(msg)
@@ -4406,7 +4429,7 @@
  * These are the general rules for widget sizes:
  * 
  * Render/Unspecified: 1x1
- * Scrolled(Container,Tree,MLE): 500x200
+ * Scrolled(Container,Tree,MLE): Guessed size clamped to min and max in dw.h
  * Entryfield/Combobox/Spinbutton: 150x(maxfontheight)
  * Spinbutton: 50x(maxfontheight)
  * Text/Status: (textwidth)x(textheight)