]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/popupctl.py
in unescape add normal characters in addition to unescaped characters :)
[wxWidgets.git] / wxPython / wx / lib / popupctl.py
index 8815018f1dc751727dd8a69034cc2dad9ac93bf8..ed3f3a03576eec1634353f746b39433d878d9655 100644 (file)
 #
 # o 2.5 compatability update.
 #
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxPopupDialog -> PopupDialog
+# o wxPopupControl -> PopupControl
+#
 
 import  wx
 from wx.lib.buttons import GenButtonEvent
@@ -99,8 +104,8 @@ class PopButton(wx.PyControl):
         else:
             dc.SetPen(self.shadowPen)
         for i in range(2):
-            dc.DrawLine((x1+i, y1), (x1+i, y2-i))
-            dc.DrawLine((x1, y1+i), (x2-i, y1+i))
+            dc.DrawLine(x1+i, y1, x1+i, y2-i)
+            dc.DrawLine(x1, y1+i, x2-i, y1+i)
 
         # draw the lower right sides
         if self.up:
@@ -108,20 +113,20 @@ class PopButton(wx.PyControl):
         else:
             dc.SetPen(self.highlightPen)
         for i in range(2):
-            dc.DrawLine((x1+i, y2-i), (x2+1, y2-i))
-            dc.DrawLine((x2-i, y1+i), (x2-i, y2))
+            dc.DrawLine(x1+i, y2-i, x2+1, y2-i)
+            dc.DrawLine(x2-i, y1+i, x2-i, y2)
 
     def DrawArrow(self,dc):
         w, h = self.GetSize()
         mx = w / 2
         my = h / 2
         dc.SetPen(self.highlightPen)
-        dc.DrawLine((mx-5,my-5), (mx+5,my-5))
-        dc.DrawLine((mx-5,my-5), (mx,my+5))
+        dc.DrawLine(mx-5,my-5, mx+5,my-5)
+        dc.DrawLine(mx-5,my-5, mx,my+5)
         dc.SetPen(self.shadowPen)
-        dc.DrawLine((mx+4,my-5), (mx,my+5))
+        dc.DrawLine(mx+4,my-5, mx,my+5)
         dc.SetPen(self.blackPen)
-        dc.DrawLine((mx+5,my-5), (mx,my+5))
+        dc.DrawLine(mx+5,my-5, mx,my+5)
 
     def OnPaint(self, event):
         width, height = self.GetClientSize()
@@ -142,7 +147,7 @@ class PopButton(wx.PyControl):
 
 
 # Tried to use wxPopupWindow but the control misbehaves on MSW
-class wxPopupDialog(wx.Dialog):
+class PopupDialog(wx.Dialog):
     def __init__(self,parent,content = None):
         wx.Dialog.__init__(self,parent,-1,'', style = wx.BORDER_SIMPLE|wx.STAY_ON_TOP)
 
@@ -187,7 +192,7 @@ class wxPopupDialog(wx.Dialog):
 #---------------------------------------------------------------------------
 
 
-class wxPopupControl(wx.PyControl):
+class PopupControl(wx.PyControl):
     def __init__(self,*_args,**_kwargs):
         if _kwargs.has_key('value'):
             del _kwargs['value']
@@ -216,7 +221,7 @@ class wxPopupControl(wx.PyControl):
     def OnButton(self,evt):
         if not self.pop:
             if self.content:
-                self.pop = wxPopupDialog(self,self.content)
+                self.pop = PopupDialog(self,self.content)
                 del self.content
             else:
                 print 'No Content to pop'
@@ -250,4 +255,4 @@ class wxPopupControl(wx.PyControl):
 
 
 # an alias
-wxPopupCtrl = wxPopupControl
+PopupCtrl = PopupControl