Update of /cvsroot/pywin32/pywin32/win32/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15884/win32/src
Modified Files:
Tag: py3k
win32dynamicdialog.cpp
Log Message:
restore capability for dialog header to use None as ext. style for b/w compat.
Index: win32dynamicdialog.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32dynamicdialog.cpp,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -d -r1.5.2.1 -r1.5.2.2
*** win32dynamicdialog.cpp 29 Aug 2008 04:59:26 -0000 1.5.2.1
--- win32dynamicdialog.cpp 4 Dec 2008 01:07:20 -0000 1.5.2.2
***************
*** 256,259 ****
--- 256,260 ----
// Extracts a string or resource id/atom from a dialog template buffer
+ // and updates the pointer param to reflect how many bytes were consumed.
static PyObject *MakeResName(WCHAR **val)
{
***************
*** 280,284 ****
// Given a pointer to a dialog hdr template, return a Python list to match it
! // ??? This leaks refs all over the place ???
/* Also need to handle extended templates (DLGTEMPLATEEX), quoting from MSDN:
To distinguish between a standard template and an extended template,
--- 281,288 ----
// Given a pointer to a dialog hdr template, return a Python list to match it
! // ??? This leaks refs all over the place ??? markh: where? It looks OK
! // to me - MakeResName creates a new reference, but its always immediately
! // placed in the new list, or the list is DECREF'd on error.
! // It could be simplified with a goto error handler though...
/* Also need to handle extended templates (DLGTEMPLATEEX), quoting from MSDN:
To distinguish between a standard template and an extended template,
***************
*** 506,509 ****
--- 510,514 ----
WCHAR *caption=NULL, *menu=NULL, *wclass=NULL, *fontname=NULL;
PyObject *obcaption, *obfontname, *obfont=Py_None, *obmenu=Py_None, *obwclass=Py_None;
+ PyObject *obexstyle=Py_None;
DLGTEMPLATE tpl={0,0,0,0,0,0,0};
WORD fontsize;
***************
*** 511,523 ****
CPythonDialogTemplate *ret=NULL;
! if (!PyArg_ParseTuple(obhdr, "O(hhhh)k|kOOO:DLGTEMPLATE",
&obcaption,
&tpl.x, &tpl.y, &tpl.cx, &tpl.cy,
&tpl.style,
! &tpl.dwExtendedStyle,
&obfont,
&obmenu,
&obwclass))
! return NULL;
// @tupleitem 0|string|caption|The caption for the window
--- 516,528 ----
CPythonDialogTemplate *ret=NULL;
! if (!PyArg_ParseTuple(obhdr, "O(hhhh)k|OOOO:DLGTEMPLATE",
&obcaption,
&tpl.x, &tpl.y, &tpl.cx, &tpl.cy,
&tpl.style,
! &obexstyle,
&obfont,
&obmenu,
&obwclass))
! goto cleanup;
// @tupleitem 0|string|caption|The caption for the window
***************
*** 526,530 ****
// Note that the DS_SETFONT style need never be specified - it is determined by the font item (below)
// <nl>See MSDN documentation on Dialog Boxes for allowable values.
! // @tupleitem 3|int|extStyle|The extended style bits for the dialog. Defaults to 0 if not passed.
// @tupleitem 4|(int, string)|(fontSize, fontName)|A tuple describing the font, or None if the system default font is to be used.
// @tupleitem 5|<o PyResourceId>|menuResource|The resource ID of the menu to be used for the dialog, or None for no menu.
--- 531,535 ----
// Note that the DS_SETFONT style need never be specified - it is determined by the font item (below)
// <nl>See MSDN documentation on Dialog Boxes for allowable values.
! // @tupleitem 3|int|extStyle|The extended style bits for the dialog. Defaults to 0 if not passed and None is supported for backwards compatibility.
// @tupleitem 4|(int, string)|(fontSize, fontName)|A tuple describing the font, or None if the system default font is to be used.
// @tupleitem 5|<o PyResourceId>|menuResource|The resource ID of the menu to be used for the dialog, or None for no menu.
***************
*** 537,540 ****
--- 542,550 ----
if (!PyWinObject_AsResourceIdW(obwclass, &wclass, TRUE))
goto cleanup;
+ if (obexstyle != Py_None) {
+ tpl.dwExtendedStyle = PyLong_AsUnsignedLong(obexstyle);
+ if (tpl.dwExtendedStyle==-1 && PyErr_Occurred())
+ goto cleanup;
+ }
tpl.style &= ~DS_SETFONT;
|