# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1326667001 0 # Node ID 4a9c574d5c173499ddbdec13ce4f3c5cb91b8b96 # Parent 5b5da6d21f08a7021701595271a8804bba64c336 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. diff -r 5b5da6d21f08 -r 4a9c574d5c17 dw.h --- 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; diff -r 5b5da6d21f08 -r 4a9c574d5c17 gtk/dw.c --- 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 + * (C) 2000-2012 Brian Smith * (C) 2003-2011 Mark Hessling * (C) 2002 Nickolay V. Shmyrev */ diff -r 5b5da6d21f08 -r 4a9c574d5c17 gtk3/dw.c --- 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 + * (C) 2000-2012 Brian Smith * (C) 2003-2011 Mark Hessling * (C) 2002 Nickolay V. Shmyrev */ diff -r 5b5da6d21f08 -r 4a9c574d5c17 mac/dw.m --- 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 + * (C) 2012 Brian Smith * (C) 2011 Mark Hessling * * 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) diff -r 5b5da6d21f08 -r 4a9c574d5c17 os2/dw.c --- 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 + * (C) 2000-2012 Brian Smith * (C) 2003-2011 Mark Hessling * (C) 2000 Achim Hasenmueller * (C) 2000 Peter Nielsen @@ -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) diff -r 5b5da6d21f08 -r 4a9c574d5c17 template/dw.c --- 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 - * (C) 2011 Mark Hessling + * (C) 2011-2012 Brian Smith + * (C) 2011-2012 Mark Hessling * */ diff -r 5b5da6d21f08 -r 4a9c574d5c17 win/dw.c --- 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 + * (C) 2000-2012 Brian Smith * (C) 2003-2011 Mark Hessling * */ @@ -31,6 +31,23 @@ #endif #include +#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)