Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

window.py 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # The MFCish window classes.
  2. import win32con
  3. import win32ui
  4. from . import object
  5. class Wnd(object.CmdTarget):
  6. def __init__(self, initobj=None):
  7. object.CmdTarget.__init__(self, initobj)
  8. if self._obj_:
  9. self._obj_.HookMessage(self.OnDestroy, win32con.WM_DESTROY)
  10. def OnDestroy(self, msg):
  11. pass
  12. # NOTE NOTE - This facility is currently disabled in Pythonwin!!!!!
  13. # Note - to process all messages for your window, add the following method
  14. # to a derived class. This code provides default message handling (ie, is
  15. # identical, except presumably in speed, as if the method did not exist at
  16. # all, so presumably will be modified to test for specific messages to be
  17. # useful!
  18. # def WindowProc(self, msg, wParam, lParam):
  19. # rc, lResult = self._obj_.OnWndMsg(msg, wParam, lParam)
  20. # if not rc: lResult = self._obj_.DefWindowProc(msg, wParam, lParam)
  21. # return lResult
  22. class FrameWnd(Wnd):
  23. def __init__(self, wnd):
  24. Wnd.__init__(self, wnd)
  25. class MDIChildWnd(FrameWnd):
  26. def __init__(self, wnd=None):
  27. if wnd is None:
  28. wnd = win32ui.CreateMDIChild()
  29. FrameWnd.__init__(self, wnd)
  30. def OnCreateClient(self, cp, context):
  31. if context is not None and context.template is not None:
  32. context.template.CreateView(self, context)
  33. class MDIFrameWnd(FrameWnd):
  34. def __init__(self, wnd=None):
  35. if wnd is None:
  36. wnd = win32ui.CreateMDIFrame()
  37. FrameWnd.__init__(self, wnd)