Пример #1
0
	def _CreateDocTemplate(self, resourceId):
		return win32ui.CreateDocTemplate(resourceId)
Пример #2
0
from GUI.Canvases import Canvas
from GUI.GScrollableViews import ScrollableView as GScrollableView, \
    default_extent, default_line_scroll_amount
from GUI.Geometry import add_pt, sub_pt, offset_rect, offset_rect_neg

win_style = ui.AFX_WS_DEFAULT_VIEW

#print "ScrollableViews: Creating dummy doc"
#  PyWin32 insists on being given a CDocument when creating a CScrollView,
#  and doesn't provide any way of creating a real one without using a resource.

if 1:
    #  The following uses a resource included in win32ui.pyd.
    import pywin.mfc.object
    win_dummy_doc_template = pywin.mfc.object.CmdTarget(
        ui.CreateDocTemplate(ui.IDR_PYTHONTYPE))
    ui.GetApp().AddDocTemplate(win_dummy_doc_template)

    def win_get_dummy_doc():
        return win_dummy_doc_template.DoCreateDoc()
else:
    #  The following hack creates something that looks enough
    #  like a CDocument to keep it happy. But it doesn't work with
    #  pywin32 builds later than 212.
    win_dummy_doc = ui.CreateRichEditView().GetDocument()

    def win_get_dummy_doc():
        return win_dummy_doc


class ScrollableView(GScrollableView):