MCPcopy Create free account
hub / github.com/mhammond/pywin32 / ui_propsheet_create_window

Function ui_propsheet_create_window

Pythonwin/win32prop.cpp:328–365  ·  view source on GitHub ↗

@pymethod |PyCPropertySheet|CreateWindow|Displays the property sheet as a modeless dialog.

Source from the content-addressed store, hash-verified

326
327// @pymethod |PyCPropertySheet|CreateWindow|Displays the property sheet as a modeless dialog.
328PyObject *ui_propsheet_create_window( PyObject *self, PyObject *args )
329{
330 PyObject *obParent = NULL;
331 int dwStyle = WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME | WS_VISIBLE;
332 int dwExStyle = WS_EX_DLGMODALFRAME;
333 CWnd *pParent = NULL;
334 // @pyparm <o PyCWnd>|parent|None|The parent of the dialog.
335 // @pyparm int|style|WS_SYSMENU\|WS_POPUP\|WS_CAPTION\|DS_MODALFRAME\|WS_VISIBLE|The style for the window.
336 // @pyparm int|exStyle|WS_EX_DLGMODALFRAME|The extended style for the window.
337 if (!PyArg_ParseTuple(args,"|Oll", &obParent, &dwStyle, &dwExStyle))
338 return NULL;
339 if (obParent && obParent!=Py_None) {
340 if (!ui_base_class::is_uiobject(obParent, &PyCWnd::type))
341 RETURN_TYPE_ERR("parameter 1 must be a PyCWnd object");
342 pParent = (CWnd *)PyCWnd::GetPythonGenericWnd(obParent);
343 if (!pParent)
344 return NULL;
345 }
346 CPythonPropertySheet *pPS;
347 if (!(pPS=GetPythonPropSheet(self)))
348 return NULL;
349 if (!PropSheetCheckForDisplay(pPS))
350 return NULL;
351 int rc;
352 const char *failMsg = "Create() failed";
353 GUI_BGN_SAVE;
354 try {
355 rc=pPS->Create(pParent, dwStyle, dwExStyle );
356 }
357 catch (...) {
358 rc = NULL;
359 failMsg = "Create() caused an exception - it is likely that the specified template can not be located";
360 }
361 GUI_END_SAVE;
362 if (!rc)
363 RETURN_ERR((char *)failMsg);
364 RETURN_NONE;
365}
366
367// @pymethod |PyCPropertySheet|EndDialog|Closes the dialog, with the specified result.
368PyObject *ui_propsheet_end_dialog( PyObject *self, PyObject *args )

Callers

nothing calls this directly

Calls 3

GetPythonPropSheetFunction · 0.85
PropSheetCheckForDisplayFunction · 0.85
CreateMethod · 0.45

Tested by

no test coverage detected