Author: btami
Date: 2006-10-30 12:37:43 -0600 (Mon, 30 Oct 2006)
New Revision: 8957
Modified:
trunk/gnue-forms/src/uidrivers/win32/common.py
trunk/gnue-forms/src/uidrivers/win32/dialogs.py
Log:
misc dialog fixes
Modified: trunk/gnue-forms/src/uidrivers/win32/common.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/win32/common.py 2006-10-30 18:33:46 UTC
(rev 8956)
+++ trunk/gnue-forms/src/uidrivers/win32/common.py 2006-10-30 18:37:43 UTC
(rev 8957)
@@ -45,8 +45,8 @@
desktop = win32gui.GetDesktopWindow()
l,t,r,b = win32gui.GetWindowRect(hwnd)
dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
- center_x, center_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2,
(dt_b-dt_t)/2) )
- win32gui.MoveWindow(hwnd, center_x-(r/2), center_y-(b/2), r-l, b-t, 1)
+ center_x, center_y = (dt_r-dt_l)/2, (dt_b-dt_t)/2
+ win32gui.MoveWindow(hwnd, center_x-((r-l)/2), center_y-((b-t)/2), r-l, b-t,
1)
def textEncode(u_string):
Modified: trunk/gnue-forms/src/uidrivers/win32/dialogs.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/win32/dialogs.py 2006-10-30 18:33:46 UTC
(rev 8956)
+++ trunk/gnue-forms/src/uidrivers/win32/dialogs.py 2006-10-30 18:37:43 UTC
(rev 8957)
@@ -522,7 +522,7 @@
self.detailID = ID = getNextId()
s = cs | win32con.ES_MULTILINE | win32con.ES_READONLY |
win32con.WS_TABSTOP \
- | win32con.ES_AUTOVSCROLL #| win32con.WS_VSCROLL
+ | win32con.ES_AUTOVSCROLL | win32con.WS_VSCROLL
es = win32con.WS_EX_STATICEDGE
self.template.append([EDIT, textEncode(self.detail), ID, position, s, es])
@@ -629,11 +629,11 @@
if id == self.detailID:
text = self.detail
if '\r\n' in text:
- h = sum ([win32gui.GetTextExtentPoint32(self.dc, t) [1] for t in
text.split ('\r\n')])
+ h = sum ([win32gui.GetTextExtentPoint32(self.dc, t) [1] -2 for t in
text.split ('\r\n')])
else:
w, h = win32gui.GetTextExtentPoint32(self.dc, text)
if id == self.detailID:
- h += 2 # extra for WS_EX_STATICEDGE
+ h += -8 # extra for WS_EX_STATICEDGE
return h
else:
l,t,r,b = win32gui.GetWindowRect(item)
@@ -648,7 +648,10 @@
win32con.SWP_NOACTIVATE | win32con.SWP_NOZORDER)
-if __name__ == '__main__':
+if __name__ == '__main__':
+ dialog = ExceptionDialog('system', 'name', 'message', 'detail')
+ dialog.DoModal ()
+
desc = "This is a quite long description of the application.\n" \
"It also contains newlines as well as a lot of text. This text " \
"get's continued in the third line too.\n" \
_______________________________________________
commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue