@pymethod |PyCWnd|CreateWindow|Creates the actual window
| 276 | } |
| 277 | // @pymethod |PyCWnd|CreateWindow|Creates the actual window |
| 278 | PyObject * |
| 279 | ui_window_create_window(PyObject *self, PyObject *args) |
| 280 | { |
| 281 | int style, id; |
| 282 | PyObject *obParent; |
| 283 | RECT rect; |
| 284 | TCHAR *szClass=NULL, *szWndName=NULL; |
| 285 | PyObject *obClass, *obWndName, *ret=NULL; |
| 286 | CCreateContext *pCCPass = NULL; |
| 287 | PythonCreateContext cc; |
| 288 | PyObject *contextObject = Py_None; |
| 289 | if (!PyArg_ParseTuple(args, "OOi(iiii)Oi|O:CreateWindow", |
| 290 | &obClass, // @pyparm string|classId||The class ID for the window, or None |
| 291 | &obWndName, // @pyparm string|windowName||The title for the window, or None |
| 292 | &style, // @pyparm int|style||The style for the window. |
| 293 | &rect.left,&rect.top,&rect.right,&rect.bottom, |
| 294 | // @pyparm (left, top, right, bottom)|rect||The size and position of the window. |
| 295 | &obParent, // @pyparm <o PyCWnd>|parent||The parent window of the new window.. |
| 296 | &id, // @pyparm int|id||The control's ID. |
| 297 | &contextObject)) // @pyparm object|context|None|A CreateContext object. |
| 298 | return NULL; |
| 299 | |
| 300 | CWnd *pParent; |
| 301 | if (obParent==Py_None) |
| 302 | pParent = NULL; |
| 303 | else if (ui_base_class::is_uiobject(obParent, &PyCWnd::type)) { |
| 304 | pParent = GetWndPtr( obParent ); |
| 305 | if (pParent==NULL) |
| 306 | return NULL; |
| 307 | } else |
| 308 | RETURN_TYPE_ERR("parent argument must be a window object, or None"); |
| 309 | if (contextObject != Py_None) { |
| 310 | cc.SetPythonObject(contextObject); |
| 311 | pCCPass = &cc; |
| 312 | } |
| 313 | CWnd *pWnd = GetWndPtr(self); |
| 314 | if (!pWnd) |
| 315 | return NULL; |
| 316 | |
| 317 | if (PyWinObject_AsTCHAR(obClass, &szClass, TRUE)&& |
| 318 | PyWinObject_AsTCHAR(obWndName, &szWndName, TRUE)){ |
| 319 | BOOL ok; |
| 320 | GUI_BGN_SAVE; |
| 321 | // @pyseemfc CWnd|Create |
| 322 | ok = pWnd->Create(szClass, szWndName, style, rect, pParent, id, pCCPass); |
| 323 | GUI_END_SAVE; |
| 324 | if (!ok) |
| 325 | PyErr_SetString(ui_module_error, "CWnd::Create"); |
| 326 | else{ |
| 327 | Py_INCREF(Py_None); |
| 328 | ret=Py_None; |
| 329 | } |
| 330 | } |
| 331 | PyWinObject_FreeTCHAR(szClass); |
| 332 | PyWinObject_FreeTCHAR(szWndName); |
| 333 | return ret; |
| 334 | } |
| 335 |
nothing calls this directly
no test coverage detected