commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7538 - trunk/gnue-forms/src/uidrivers/win32


From: btami
Subject: [gnue] r7538 - trunk/gnue-forms/src/uidrivers/win32
Date: Sat, 7 May 2005 12:55:49 -0500 (CDT)

Author: btami
Date: 2005-05-07 12:55:48 -0500 (Sat, 07 May 2005)
New Revision: 7538

Modified:
   trunk/gnue-forms/src/uidrivers/win32/UIdriver.py
Log:
white background for detail text

Modified: trunk/gnue-forms/src/uidrivers/win32/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/win32/UIdriver.py    2005-05-07 17:10:58 UTC 
(rev 7537)
+++ trunk/gnue-forms/src/uidrivers/win32/UIdriver.py    2005-05-07 17:55:48 UTC 
(rev 7538)
@@ -431,6 +431,7 @@
   def __init__ (self, group, name, message, detail):
 
     BaseDialog.__init__(self, self._TITLE.get (group, _('Error')), cancel = 
False, ok = False)
+    self.message_map [win32con.WM_CTLCOLORSTATIC] = self.OnCtlColorStatic
 
     self.detail = detail.replace('\n','\r\n')
     
@@ -455,7 +456,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])
 
@@ -492,6 +493,11 @@
         win32gui.SetDlgItemText(hwnd, id, u_(">> Details"))
         self.Recalculate()
 
+  def OnCtlColorStatic(self, hwnd, msg, wparam, lparam):
+    if win32gui.GetDlgCtrlID(lparam) == self.detailID:
+      win32gui.SetBkMode(wparam, win32con.OPAQUE) #TRANSPARENT) #
+      win32gui.SetTextColor(wparam, win32api.RGB(0, 0, 0))
+      return 1
 
   def Recalculate(self):
     border = 10
@@ -514,11 +520,11 @@
       win32gui.SetWindowPos(dlgItem, 0, 0, 0, 0, 0, 0)
 
     self.SetPosition(self.detailsID, dlgWidth + 2*border \
-                     - self.Width(self.detailsID) -4, ypos + 15)
+                     - self.Width(self.detailsID) - 8, ypos + 10)
 
     self.SetPosition(win32con.IDCLOSE, dlgWidth + 2*border \
                      - self.Width(self.detailsID) \
-                     - self.Width(win32con.IDCLOSE) -8, ypos + 15)
+                     - self.Width(win32con.IDCLOSE) -15, ypos + 10)
 
     ypos += self.Height(win32con.IDCLOSE) + border
     
@@ -560,6 +566,8 @@
         h = sum ([self.dc.GetTextExtent(t) [1] for t in text.split ('\r\n')])
       else:
         w, h = self.dc.GetTextExtent(text)
+      if id == self.detailID:
+        h += 2 # extra for WS_EX_STATICEDGE
       return h
     else:
       l,t,r,b = win32gui.GetWindowRect(item)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]