44 |
from gnue.forms.uidrivers.win32.GFwin32App import * |
from gnue.forms.uidrivers.win32.GFwin32App import * |
45 |
#from gnue.forms.uidrivers.wx.UIWXSplashScreen import * |
#from gnue.forms.uidrivers.wx.UIWXSplashScreen import * |
46 |
from gnue.forms.uidrivers.win32.widgets._base import * |
from gnue.forms.uidrivers.win32.widgets._base import * |
|
from gnue.forms.uidrivers.win32.common import setWidgetBaseFont |
|
47 |
|
|
48 |
|
|
49 |
def OnWMMenuselect(hwnd, msg, wParam, lParam, widget): |
def OnWMMenuselect(hwnd, msg, wParam, lParam, widget): |
134 |
|
|
135 |
|
|
136 |
font_spec = {'name':'Courier New', 'height':int(gConfigForms('pointSize'))} |
font_spec = {'name':'Courier New', 'height':int(gConfigForms('pointSize'))} |
137 |
font = win32ui.CreateFont(font_spec) |
self._font = win32ui.CreateFont(font_spec) |
|
setWidgetBaseFont(font) |
|
138 |
|
|
139 |
# |
# |
140 |
# Create a dummy window used to compute sizes |
# Create a dummy window used to compute sizes |
142 |
from pywin.mfc import window |
from pywin.mfc import window |
143 |
dummyWindow = window.Wnd(win32ui.CreateWnd()) |
dummyWindow = window.Wnd(win32ui.CreateWnd()) |
144 |
dc = dummyWindow.GetWindowDC() |
dc = dummyWindow.GetWindowDC() |
145 |
dc.SelectObject(font) |
dc.SelectObject(self._font) |
146 |
metrics = dc.GetTextMetrics() |
metrics = dc.GetTextMetrics() |
147 |
maxWidth = metrics["tmAveCharWidth"] |
maxWidth = metrics["tmAveCharWidth"] |
148 |
maxHeight = metrics["tmHeight"] |
maxHeight = metrics["tmHeight"] |