[pywin32-checkins] pywin32/Pythonwin win32win.cpp,1.7,1.8
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-10-07 07:47:21
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6838 Modified Files: win32win.cpp Log Message: [ 977394 ] Integer menu ID for PyCFrameWnd.CreateWindow Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32win.cpp 9 Oct 2000 22:31:50 -0000 1.7 --- win32win.cpp 7 Oct 2004 07:45:57 -0000 1.8 *************** *** 3232,3239 **** PyObject *obParent = Py_None; PyObject *obContext = Py_None; ! char *szClass=NULL, *szTitle=NULL,*szMenuName=NULL; DWORD styleEx=0; DWORD style = WS_VISIBLE | WS_OVERLAPPEDWINDOW; ! if(!PyArg_ParseTuple(args, "zs|lOOOzl:Create", &szClass, // @pyparm string|wndClass||The window class name, or None &szTitle, // @pyparm string|title||The window title --- 3232,3240 ---- PyObject *obParent = Py_None; PyObject *obContext = Py_None; ! PyObject *obMenuID = Py_None; ! char *szClass=NULL, *szTitle=NULL; DWORD styleEx=0; DWORD style = WS_VISIBLE | WS_OVERLAPPEDWINDOW; ! if(!PyArg_ParseTuple(args, "zs|lOOOOl:Create", &szClass, // @pyparm string|wndClass||The window class name, or None &szTitle, // @pyparm string|title||The window title *************** *** 3242,3246 **** &obParent, // @pyparm parent|<o PyCWnd>|None|The parent window &obContext,// @pyparm tuple|createContext|None|A tuple representing a CREATECONTEXT structure. ! &szMenuName,// @pyparm string|pszMenuName||The string id for the menu. &styleEx)) // @pyparm int|styleEx||The extended style of the window being created. return NULL; --- 3243,3247 ---- &obParent, // @pyparm parent|<o PyCWnd>|None|The parent window &obContext,// @pyparm tuple|createContext|None|A tuple representing a CREATECONTEXT structure. ! &obMenuID,// @pyparm string or int|menuId||The string or integer id for the menu. &styleEx)) // @pyparm int|styleEx||The extended style of the window being created. return NULL; *************** *** 3267,3270 **** --- 3268,3281 ---- RETURN_TYPE_ERR("The parent window is not a valid PyFrameWnd"); } + char *szMenuName = NULL; + if (obMenuID != Py_None) + { + if (PyInt_Check(obMenuID)) + szMenuName = MAKEINTRESOURCE(PyInt_AsLong(obMenuID)); + else if (PyString_Check(obMenuID)) + szMenuName = PyString_AsString(obMenuID); + else + RETURN_TYPE_ERR("The menu id must be an integer or string"); + } GUI_BGN_SAVE; |