/[papo]/gnue/common/src/cursing/utility.py
ViewVC logotype

Diff of /gnue/common/src/cursing/utility.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by styxman, Fri Nov 15 15:32:55 2002 UTC revision 1.1.2.1 by anthonyl, Tue Mar 4 22:09:33 2003 UTC
# Line 16  Line 16 
16  # write to the Free Software Foundation, Inc., 59 Temple Place  # write to the Free Software Foundation, Inc., 59 Temple Place
17  # - Suite 330, Boston, MA 02111-1307, USA.  # - Suite 330, Boston, MA 02111-1307, USA.
18  #  #
19  # Copyright 2002 Free Software Foundation  # Copyright 2002-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # utility.py  # utility.py
# Line 36  import curses Line 36  import curses
36  from constants import *  from constants import *
37    
38  def _paintBorder(dialog, Y, X, H, W, integrateUpper = 0,  def _paintBorder(dialog, Y, X, H, W, integrateUpper = 0,
39                   caption=None, captionColor=0):                   caption=None, color=0, captionColor=0):
40    """ draw a border with curses_graphics    """ draw a border with curses_graphics
41    """    """
42    Screen = dialog.SCREEN    Screen = dialog.SCREEN
# Line 52  def _paintBorder(dialog, Y, X, H, W, int Line 52  def _paintBorder(dialog, Y, X, H, W, int
52      upperLC = tiUTEE      upperLC = tiUTEE
53    
54    # first line    # first line
55    Screen.PrintAt( Y,X, chr(upperLC) + (W-2) * chr(tiHLINE) + chr(upperRC))    Screen.PrintAt( Y,X, chr(upperLC) + (W-2) * chr(tiHLINE) + chr(upperRC), color)
56    
57    if caption:    if caption:
58      Screen.PrintAt (Y,X + 2, " ") #chr(tiRTEE) + " ")      Screen.PrintAt (Y,X + 2, " %s " % caption, captionColor or color)
     Screen.PrintAt (Y,X + 2 + len(caption) + 1, " ") # + chr(tiLTEE) )  
     color = Screen.GetColor()  
     Screen.SetColor(captionColor or color)  
     Screen.PrintAt (Y,X + 3, caption, curses.A_BOLD)  
     Screen.SetColor(color)  
59    
60    
61    
62    
63    # "body"    # "body"
64    for i in range(Y+1,Y+H-1):    for i in range(Y+1,Y+H-1):
65      Screen.PrintAt(i,X, chr(tiVLINE) + (W-2)*' ' + chr(tiVLINE))      Screen.PrintAt(i,X, chr(tiVLINE) + (W-2)*' ' + chr(tiVLINE), color)
66    
67    # last line    # last line
68    Screen.PrintAt( Y+H-1, X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC))    Screen.PrintAt( Y+H-1, X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC), color)
69    
70    # add title-text ?    # add title-text ?
71    if dialog.HasProperty("TITLETEXT"):    if dialog.HasProperty("TITLETEXT"):

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26