@pymethod |win32ui|CreatePropertySheet|Creates a property sheet object.
| 107 | } |
| 108 | // @pymethod <o PyCPropertySheet>|win32ui|CreatePropertySheet|Creates a property sheet object. |
| 109 | PyObject *PyCPropertySheet::create( PyObject *self, PyObject *args ) |
| 110 | { |
| 111 | PyObject *obParent = NULL, |
| 112 | *obCaption; |
| 113 | TCHAR *Caption; |
| 114 | CWnd *pParent = NULL; |
| 115 | int iSelect = 0; |
| 116 | if (!PyArg_ParseTuple(args,"O|Oi", |
| 117 | &obCaption, // @pyparm <o PyResourceId>|caption||The caption for the property sheet, or id of the caption |
| 118 | &obParent, // @pyparm <o PyCWnd>|parent|None|The parent window of the property sheet. |
| 119 | &iSelect)) // @pyparm int|select|0|The index of the first page to be selected. |
| 120 | return NULL; |
| 121 | if (obParent) { |
| 122 | if (!ui_base_class::is_uiobject(obParent, &PyCWnd::type)) |
| 123 | RETURN_TYPE_ERR("parameter 2 must be a PyCWnd object"); |
| 124 | pParent = (CWnd *)PyCWnd::GetPythonGenericWnd(obParent); |
| 125 | } |
| 126 | CPythonPropertySheet *pPS; |
| 127 | if (!PyWinObject_AsResourceId(obCaption, &Caption, FALSE)) |
| 128 | return NULL; |
| 129 | |
| 130 | if (IS_INTRESOURCE(Caption)){ |
| 131 | GUI_BGN_SAVE; |
| 132 | pPS = new CPythonPropertySheet(MAKEINTRESOURCE(Caption), pParent, iSelect); |
| 133 | GUI_END_SAVE; |
| 134 | } |
| 135 | else{ |
| 136 | GUI_BGN_SAVE; |
| 137 | pPS = new CPythonPropertySheet(Caption, pParent, iSelect); |
| 138 | GUI_END_SAVE; |
| 139 | } |
| 140 | PyWinObject_FreeResourceId(Caption); |
| 141 | PyCPropertySheet *ret = (PyCPropertySheet *)ui_assoc_object::make( PyCPropertySheet::type, pPS); |
| 142 | return ret; |
| 143 | } |
| 144 | |
| 145 | /////////////////////////////////////// |
| 146 | // |
nothing calls this directly
no test coverage detected