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 |
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 |
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"): |