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 |
# Dialog.py |
# Dialog.py |
56 |
self.C1 = c1 |
self.C1 = c1 |
57 |
self.C2 = c2 |
self.C2 = c2 |
58 |
self._ChildOffsetX = border |
self._ChildOffsetX = border |
59 |
self._ChildOffsetY = border |
self._ChildOffsetY = border |
60 |
self.DROPSHADOW = dropshadow |
self.DROPSHADOW = dropshadow |
61 |
self.BORDER = border |
self.BORDER = border |
62 |
|
|
75 |
self.INSET = 0 |
self.INSET = 0 |
76 |
self.buffer = self.Screen().CaptureScreen(self.R1, |
self.buffer = self.Screen().CaptureScreen(self.R1, |
77 |
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow + border*2) |
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow + border*2) |
78 |
self.SetColor(sio.C_DIALOG) |
self.SetColor('DIALOG') |
79 |
|
|
80 |
def __del__(self): |
def __del__(self): |
81 |
pass |
pass |
83 |
def Show(self): |
def Show(self): |
84 |
return self.PARENT.RaiseFrame(self) |
return self.PARENT.RaiseFrame(self) |
85 |
|
|
86 |
|
def Hide(self): |
87 |
|
self.VISIBLE = 0 |
88 |
|
## self.PARENT.Paint() |
89 |
|
|
90 |
def _PaintBorder(self): |
def _PaintBorder(self): |
91 |
GDebug.printMesg(2,'(!!!) PaintBorder') |
GDebug.printMesg(2,'(!!!) PaintBorder') |
92 |
if not self.BORDER: |
if not self.BORDER: |
93 |
return |
return |
94 |
|
|
|
self.LoLight() |
|
95 |
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2, |
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2, |
96 |
self._DialogWidth + 2, self.INSET, caption=self.CAPTION, |
self._DialogWidth + 2, self.INSET, caption=self.CAPTION, |
97 |
captionColor=sio.C_DIALOG_TITLE) |
color=self.SCREEN.colors.C_DIALOG, |
98 |
|
captionColor=self.SCREEN.colors.C_DIALOG_TITLE) |
99 |
|
|
100 |
def _PaintDropShadow(self): |
def _PaintDropShadow(self): |
101 |
if not self.DROPSHADOW: |
if not self.DROPSHADOW: |
102 |
return |
return |
103 |
|
|
104 |
color = self.SCREEN.GetColor() |
color = self.SCREEN.colors.C_DROPSHADOW |
|
self.SCREEN.SetColor(0) |
|
105 |
|
|
106 |
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1, |
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1, |
107 |
(self._DialogWidth + self.BORDER*2) * " ") |
(self._DialogWidth + self.BORDER*2) * " ", color) |
108 |
for i in range(1,self._DialogHeight + self.BORDER*2): |
for i in range(1,self._DialogHeight + self.BORDER*2): |
109 |
self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ") |
self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ", color) |
110 |
|
|
|
self.SCREEN.SetColor(color) |
|
111 |
|
|
112 |
def Paint(self, *args, **parms): |
def Paint(self, *args, **parms): |
113 |
self._PaintBorder() |
if self.VISIBLE: |
114 |
self._PaintDropShadow() |
if self.BORDER: |
115 |
ScreenContainer.Paint(self,*args, **parms) |
self._PaintBorder() |
116 |
|
else: |
117 |
|
GDebug.printMesg(0,'PAINTING %s' % self) |
118 |
|
|
119 |
|
for l in range(self.H): |
120 |
|
self.SCREEN.PrintAt(self.Y+l, self.X, " " * self.W, self.COLOR) |
121 |
|
self._PaintDropShadow() |
122 |
|
ScreenContainer.Paint(self,*args, **parms) |
123 |
|
|
124 |
def Height(self): |
def Height(self): |
125 |
return self.R2- self._Y |
return self.R2- self._Y |