68 |
def OnWMDefault(hwnd, msg, wParam, lParam, widget): |
def OnWMDefault(hwnd, msg, wParam, lParam, widget): |
69 |
return win32gui.DefWindowProc(hwnd, msg, wParam, lParam) |
return win32gui.DefWindowProc(hwnd, msg, wParam, lParam) |
70 |
|
|
|
|
|
71 |
# |
# |
72 |
# GFUserInterface |
# GFUserInterface |
73 |
# |
# |
76 |
# |
# |
77 |
class GFUserInterface(commonToolkit.GFUserInterface): |
class GFUserInterface(commonToolkit.GFUserInterface): |
78 |
_wndclass = None |
_wndclass = None |
79 |
|
|
80 |
_message_map = { |
_message_map = { |
81 |
win32con.WM_MENUSELECT : OnWMMenuselect, |
win32con.WM_MENUSELECT : OnWMMenuselect, |
82 |
win32con.WM_NOTIFY : OnWMNotify, |
win32con.WM_NOTIFY : OnWMNotify, |
90 |
commonToolkit.GFUserInterface.__init__(self,eventController,disableSplash) |
commonToolkit.GFUserInterface.__init__(self,eventController,disableSplash) |
91 |
self._disabledColour = afxres.AFX_IDC_COLOR_LIGHTGRAY |
self._disabledColour = afxres.AFX_IDC_COLOR_LIGHTGRAY |
92 |
|
|
93 |
|
|
94 |
|
def _wndproc(self, hwnd, msg, wParam, lParam): |
95 |
|
try: |
96 |
|
widget = self._win32app._HwndToTkObj[hwnd] |
97 |
|
except: |
98 |
|
return win32gui.DefWindowProc(hwnd, msg, wParam, lParam) |
99 |
|
try: |
100 |
|
OnWM = self._message_map.get(msg, OnWMDefault) |
101 |
|
x = OnWM(hwnd, msg, wParam, lParam, widget) |
102 |
|
except: |
103 |
|
x = -1 |
104 |
|
return x |
105 |
|
|
106 |
|
|
107 |
|
def initialize(self): |
108 |
|
self._win32app = getWin32App() |
109 |
|
|
110 |
################################################################ |
################################################################ |
111 |
# win32 Specifics |
# win32 Specifics |
112 |
################################################################ |
################################################################ |
127 |
wc.lpfnWndProc = self._wndproc |
wc.lpfnWndProc = self._wndproc |
128 |
self.__class__._wndclass = win32gui.RegisterClass(wc) |
self.__class__._wndclass = win32gui.RegisterClass(wc) |
129 |
|
|
|
def _wndproc(self, hwnd, msg, wParam, lParam): |
|
|
try: |
|
|
widget = self._IdToTkObj[hwnd] |
|
|
except: |
|
|
return win32gui.DefWindowProc(hwnd, msg, wParam, lParam) |
|
|
try: |
|
|
OnWM = self._message_map.get(msg, OnWMDefault) |
|
|
x = OnWM(hwnd, msg, wParam, lParam, widget) |
|
|
except: |
|
|
x = -1 |
|
|
return x |
|
|
|
|
|
|
|
|
def initialize(self): |
|
|
self._win32app = getWin32App() |
|
|
|
|
130 |
# |
# |
131 |
# SplashScreen |
# SplashScreen |
132 |
# |
# |
186 |
|
|
187 |
if exitApp: |
if exitApp: |
188 |
for child in self._children: |
for child in self._children: |
189 |
|
self._win32app._MainWindowList.remove(child.mainWindow) |
190 |
child.mainWindow.Destroy() |
child.mainWindow.Destroy() |
191 |
|
|
192 |
win32gui.PostQuitMessage(0) # Terminate the app. |
if formName != "__main__": |
193 |
|
win32gui.PostQuitMessage(0) # Terminate the dialog |
194 |
|
else: |
195 |
|
if len(self._win32app._MainWindowList) == 0: |
196 |
|
win32gui.PostQuitMessage(0) # Terminate the app. |
197 |
|
|
198 |
for child in self._children: |
for child in self._children: |
199 |
if child._form.name != formName: |
if child._form.name != formName: |
200 |
child.mainWindow.Enable(1) |
child.mainWindow.Enable(1) |