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

Function ui_splitter_create_view

Pythonwin/win32splitter.cpp:105–137  ·  view source on GitHub ↗

@pymethod |PyCSplitterWnd|CreateView|Creates a view in a splitter window

Source from the content-addressed store, hash-verified

103
104// @pymethod |PyCSplitterWnd|CreateView|Creates a view in a splitter window
105PyObject *ui_splitter_create_view( PyObject *self, PyObject *args )
106{
107 CPythonSplitter *wnd = PyCSplitterWnd::GetSplitterObject(self);
108 if (!wnd)
109 return NULL;
110 int row, col, width, height;
111 PyObject *ob;
112 if (!PyArg_ParseTuple(args,"Oii(ii)",
113 &ob, // @pyparm <o PyCView>|view||The view to place in the splitter pane.
114 &row, // @pyparm int|row||The row in the splitter to place the view.
115 &col, // @pyparm int|col||The column in the splitter to place the view.
116 &width, // @pyparm (int, int)|width, height||The initial size of the new view.
117 &height))
118 return NULL;
119 if (!ui_base_class::is_uiobject(ob, &PyCView::type))
120 RETURN_TYPE_ERR("Argument must be a PyCView or child");
121 CView *pView = GetView( ob );
122 if (pView==NULL)
123 return NULL;
124 CCreateContext context;
125 context.m_pLastView = pView;
126 context.m_pCurrentDoc = pView->GetDocument();
127 if (!context.m_pCurrentDoc)
128 RETURN_ERR("There is no document attached to the view");
129
130 extern void PyWin_SetViewDocument(CView *pView, CDocument *pDoc);
131 PyWin_SetViewDocument(pView, NULL);
132
133 // no thread state - CreateView is implemented by us and manages this.
134 if (!wnd->CreateView(row, col, NULL, CSize(width, height), &context)) // @pyseemfc CSplitterWnd|CreateView
135 return NULL; // exception set.
136 RETURN_NONE;
137}
138
139// @pymethod int|PyCSplitterWnd|DoKeyboardSplit|
140PyObject *ui_splitter_do_kb_split( PyObject *self, PyObject *args )

Callers

nothing calls this directly

Calls 4

GetViewFunction · 0.85
PyWin_SetViewDocumentFunction · 0.85
GetDocumentMethod · 0.45
CreateViewMethod · 0.45

Tested by

no test coverage detected