[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/src/cursing/Button.py common/src/cu...
From: |
Jason Cater |
Subject: |
gnue common/src/cursing/Button.py common/src/cu... |
Date: |
Sun, 17 Nov 2002 17:53:29 -0500 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/11/17 17:53:28
Modified files:
common/src/cursing: Button.py ColorScheme.py ComboBox.py
Control.py Dialog.py Frame.py
GraphicObject.py GroupBox.py Label.py
MenuBar.py MenuItem.py ScreenContainer.py
StatusBar.py TextArea.py TextBox.py
VButton.py VScrollBar.py sio.py utility.py
common/utils : doc-xml-attrs-openoffice.py
forms : BUGS
forms/doc : Developers-Guide.sxw
forms/src : GFParser.py
Log message:
updated Forms Dev Guide to have new descriptions of attributes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Button.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/ColorScheme.py.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/ComboBox.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Control.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Dialog.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Frame.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/GraphicObject.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/GroupBox.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/Label.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/MenuBar.py.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/MenuItem.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/ScreenContainer.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/StatusBar.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/TextArea.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/TextBox.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/VButton.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/VScrollBar.py.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/sio.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/cursing/utility.py.diff?cvsroot=OldCVS&tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/utils/doc-xml-attrs-openoffice.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/BUGS.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/doc/Developers-Guide.sxw.diff?cvsroot=OldCVS&tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFParser.py.diff?cvsroot=OldCVS&tr1=1.82&tr2=1.83&r1=text&r2=text
Patches:
Index: gnue/common/src/cursing/Button.py
diff -c gnue/common/src/cursing/Button.py:1.9
gnue/common/src/cursing/Button.py:1.10
*** gnue/common/src/cursing/Button.py:1.9 Fri Nov 15 02:20:36 2002
--- gnue/common/src/cursing/Button.py Sun Nov 17 17:53:27 2002
***************
*** 55,63 ****
self.SetMethod("GOTFOCUS", None) # user event
self.SetMethod("SYSRUN", self.Run) # system event
self.EXITFORM = 0
! self.COLOR = sio.C_BUTTON
! self.FOCUSCOLOR = sio.C_BUTTON_FOCUS
! # self.SetColor(sio.C_BUTTON)
def Run(self, v1, v2, v3): # handle user actions
--- 55,61 ----
self.SetMethod("GOTFOCUS", None) # user event
self.SetMethod("SYSRUN", self.Run) # system event
self.EXITFORM = 0
! self.SetColor('BUTTON','BUTTON_FOCUS')
def Run(self, v1, v2, v3): # handle user actions
***************
*** 102,114 ****
if Container == None:
raise "No container!"
if HaveFocus:
! color = sio.C_BUTTON_FOCUS
! # self.SetColor(sio.C_BUTTON_FOCUS)
! # self.LoLight()
else:
! color = sio.C_BUTTON
! # self.SetColor(sio.C_BUTTON)
! # self.LoLight()
tROW, tCOL = self._ABSY, self._ABSX
tCaption = self.CAPTION
tW = self.W
--- 100,108 ----
if Container == None:
raise "No container!"
if HaveFocus:
! color = self.FOCUSCOLOR
else:
! color = self.COLOR
tROW, tCOL = self._ABSY, self._ABSX
tCaption = self.CAPTION
tW = self.W
***************
*** 127,133 ****
spaces += 1
tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)
! Container.PrintAt(tROW, tCOL, "<" + tCaption + ">",
curses.color_pair(color))
def GotFocus(self, Arg1, Arg2, Arg3):
self.FOCUS = 1
--- 121,127 ----
spaces += 1
tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)
! Container.PrintAt(tROW, tCOL, "<" + tCaption + ">", color)
def GotFocus(self, Arg1, Arg2, Arg3):
self.FOCUS = 1
Index: gnue/common/src/cursing/ColorScheme.py
diff -c gnue/common/src/cursing/ColorScheme.py:1.1
gnue/common/src/cursing/ColorScheme.py:1.2
*** gnue/common/src/cursing/ColorScheme.py:1.1 Fri Nov 15 02:20:37 2002
--- gnue/common/src/cursing/ColorScheme.py Sun Nov 17 17:53:27 2002
***************
*** 27,44 ****
#
import curses, sys
class ColorScheme:
def loadColors(self, text):
# temp
! import sio
#
! pair = 1
self._cache = {}
for raw in text.upper().split(';'):
attr, raw2 = raw.split('=')
try:
fgcolor, bgcolor = raw2.split(',')
--- 27,46 ----
#
import curses, sys
+ from gnue.common import GDebug
class ColorScheme:
def loadColors(self, text):
# temp
! #import sio
#
! pair = 2
self._cache = {}
for raw in text.upper().split(';'):
+ GDebug.printMesg(1,raw)
attr, raw2 = raw.split('=')
try:
fgcolor, bgcolor = raw2.split(',')
***************
*** 50,55 ****
--- 52,60 ----
if fgcols[0] in ('BLINK','BOLD','DIM','REVERSE','STANDOUT','UNDERLINE'):
mod = curses.__dict__['A_%s' % fgcols[0]]
fgcols.pop(0)
+ elif fgcols[0] == 'NONE':
+ mod = 0
+ fgcols.pop(0)
else:
mod = 0
***************
*** 68,131 ****
v = curses.color_pair(pair)
# Temp
! exec 'sio.C_%s = %s' % (attr,pr) in locals()
#
else:
pr = None
v = 0
! self.__dict__['%sCP_'%attr] = (mod, pr)
! self.__dict__['%sC_'%attr] = v | mod
pair += 1
class Monochrome (ColorScheme):
def __init__(self):
self.loadColors (
! 'BACKGROUND=DIM;'
'TITLEBAR=REVERSE;'
'MENUBAR=REVERSE;'
'MENUBAR_FOCUS=BOLD;'
! 'LABEL=REVERSE;'
! 'DIALOG=REVERSE'
'DIALOG_TITLE=REVERSE;'
! 'TEXTBOX_FOCUS=UNDERLINE;'
'TEXTBOX=BOLD;'
! 'BUTTON=DIM;'
! 'BUTTON_FOCUS=UNDERLINE;'
'SCROLL_BUTTON=REVERSE;'
'SCROLL_BUTTON_FOCUS=BOLD;'
'SCROLL_BACKGROUND=DIM;'
'SCROLL_SLIDER=REVERSE;'
'SCROLL_SLIDER_FOCUS=BOLD;'
'STATUSBAR=REVERSE;'
! 'STATUSBAR_FIELD=REVERSE' )
class Safe (ColorScheme):
def __init__(self):
self.loadColors (
! 'BACKGROUND=BLACK,WHITE;'
! 'TITLEBAR=BLACK,WHITE;'
! 'MENUBAR=BLACK,WHITE;'
! 'MENUBAR_FOCUS=BOLD-BLACK,WHITE;'
! 'LABEL=BLACK,WHITE;'
! 'DIALOG=BLACK,WHITE;'
! 'DIALOG_TITLE=BLACK,WHITE;'
! 'TEXTBOX_FOCUS=UNDERLINE+BLACK,WHITE;'
! 'TEXTBOX=BLACK,WHITE;'
! 'BUTTON=BLACK,WHITE;'
! 'BUTTON_FOCUS=BLACK,WHITE;'
! 'SCROLL_BUTTON=BLACK,WHITE;'
! 'SCROLL_BUTTON_FOCUS=BLACK,WHITE;'
! 'SCROLL_BACKGROUND=BLACK,WHITE;'
! 'SCROLL_SLIDER=BLACK,WHITE;'
! 'SCROLL_SLIDER_FOCUS=BLACK,WHITE;'
! 'STATUSBAR=BLACK,WHITE;'
! 'STATUSBAR_FIELD=BLACK,WHITE' )
!
! #Monochrome
! #DumbTerminal
class StandardWhiteOnBlue(ColorScheme):
--- 73,137 ----
v = curses.color_pair(pair)
# Temp
! ##exec 'sio.C_%s = %s' % (attr,pr) in locals()
#
else:
pr = None
v = 0
! self.__dict__['CP_%s'%attr] = (mod, pr)
! self.__dict__['C_%s'%attr] = v | mod
! GDebug.printMesg(1,'C_%s = %s' % (attr, v|mod))
!
pair += 1
class Monochrome (ColorScheme):
def __init__(self):
self.loadColors (
! 'BACKGROUND=NONE;'+
'TITLEBAR=REVERSE;'
'MENUBAR=REVERSE;'
'MENUBAR_FOCUS=BOLD;'
! 'LABEL=NORMAL;'
! 'DIALOG=NONE;'
'DIALOG_TITLE=REVERSE;'
! 'TEXTBOX_FOCUS=REVERSE;'
'TEXTBOX=BOLD;'
! 'BUTTON=BOLD;'
! 'BUTTON_FOCUS=REVERSE;'
'SCROLL_BUTTON=REVERSE;'
'SCROLL_BUTTON_FOCUS=BOLD;'
'SCROLL_BACKGROUND=DIM;'
'SCROLL_SLIDER=REVERSE;'
'SCROLL_SLIDER_FOCUS=BOLD;'
'STATUSBAR=REVERSE;'
! 'STATUSBAR_FIELD=REVERSE;'
! 'DROPSHADOW=REVERSE' )
class Safe (ColorScheme):
def __init__(self):
self.loadColors (
! 'BACKGROUND=NONE;'
! 'TITLEBAR=NONE;'
! 'MENUBAR=NONE;'
! 'MENUBAR_FOCUS=BOLD;'
! 'LABEL=NONE;'
! 'DIALOG=NONE;'
! 'DIALOG_TITLE=NONE;'
! 'TEXTBOX_FOCUS=UNDERLINE;'
! 'TEXTBOX=NONE;'
! 'BUTTON=NONE;'
! 'BUTTON_FOCUS=NONE;'
! 'SCROLL_BUTTON=NONE;'
! 'SCROLL_BUTTON_FOCUS=NONE;'
! 'SCROLL_BACKGROUND=NONE;'
! 'SCROLL_SLIDER=NONE;'
! 'SCROLL_SLIDER_FOCUS=NONE;'
! 'STATUSBAR=NONE;'
! 'STATUSBAR_FIELD=NONE;'
! 'DROPSHADOW=NONE' )
class StandardWhiteOnBlue(ColorScheme):
***************
*** 148,154 ****
'SCROLL_SLIDER=WHITE,BLUE;'
'SCROLL_SLIDER_FOCUS=BLACK,CYAN;'
'STATUSBAR=BLACK,WHITE;'
! 'STATUSBAR_FIELD=BLUE,WHITE' )
class WhiteOnRed(ColorScheme):
--- 154,161 ----
'SCROLL_SLIDER=WHITE,BLUE;'
'SCROLL_SLIDER_FOCUS=BLACK,CYAN;'
'STATUSBAR=BLACK,WHITE;'
! 'STATUSBAR_FIELD=BLUE,WHITE;'
! 'DROPSHADOW=RED,RED' )
class WhiteOnRed(ColorScheme):
***************
*** 171,182 ****
'SCROLL_SLIDER=WHITE,RED;'
'SCROLL_SLIDER_FOCUS=BLACK,CYAN;'
'STATUSBAR=RED,WHITE;'
! 'STATUSBAR_FIELD=RED,WHITE' )
#def test(scr):
! StandardWhiteOnBlue()
##WhiteOnRed()
! #curses.wrapper(test)
\ No newline at end of file
--- 178,190 ----
'SCROLL_SLIDER=WHITE,RED;'
'SCROLL_SLIDER_FOCUS=BLACK,CYAN;'
'STATUSBAR=RED,WHITE;'
! 'STATUSBAR_FIELD=RED,WHITE;'
! 'DROPSHADOW=WHITE,WHITE' )
#def test(scr):
! #StandardWhiteOnBlue()
##WhiteOnRed()
! #curses.wrapper(test)
Index: gnue/common/src/cursing/ComboBox.py
diff -c gnue/common/src/cursing/ComboBox.py:1.6
gnue/common/src/cursing/ComboBox.py:1.7
*** gnue/common/src/cursing/ComboBox.py:1.6 Sat Nov 16 10:20:21 2002
--- gnue/common/src/cursing/ComboBox.py Sun Nov 17 17:53:27 2002
***************
*** 31,45 ****
from Menu import Menu
from Button import Button
from Control import Control
! class ComboBox(Control):
! def __init__(self,Parent,BoxName, Y, X, W, **properties):
! apply(Control.__init__,(self,Parent,BoxName),properties)
self.PARENT = Parent
self.Y = Y
self.X = X
! self.W = W
! self.H = 2
menuName = (W-5) * ' '
self._menu = Menu(Parent,'cbm',Y,X+1,menuName)
self._button = Button(Parent,'cbbutt',Y,X+W-4,3,chr(tiDAW))
--- 31,48 ----
from Menu import Menu
from Button import Button
from Control import Control
+ from TextBox import TextBox
! class ComboBox(TextBox):
! def __init__(self,Parent,BoxName, Y, X, W, editable=0,**properties):
! TextBox.__init__(self, Parent, BoxName, Y, X, W-4)
self.PARENT = Parent
self.Y = Y
self.X = X
! self.W = W - 4
! self.H = 1
! self.EDITABLE = editable
!
menuName = (W-5) * ' '
self._menu = Menu(Parent,'cbm',Y,X+1,menuName)
self._button = Button(Parent,'cbbutt',Y,X+W-4,3,chr(tiDAW))
***************
*** 49,69 ****
self._menu.maxLengthFixed = 1
self._menu.maxLength = W - 4
self._chosen = None
! Parent.AddControl(self._menu)
Parent.AddControl(self._button)
! self.SetMethod("SYSPAINT", self.Paint)
! def Paint(self,v1,v2,v3):
! Screen = self.PARENT.Screen()
! Screen.AutoRefresh = 0
! self.SetColor(1)
! X = self._ABSX
! Y = self._ABSY
! W = self.W
! Screen.PrintAt(Y,X,chr(tiVLINE))
! Screen.PrintAt(Y,X+W-1,chr(tiVLINE))
! # Screen.PrintAt(Y+1,X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC))
! Screen.AutoRefresh = 1
def _Show(self,v1,v2,v3):
self._menu.ShowOff(None,None,None)
--- 52,75 ----
self._menu.maxLengthFixed = 1
self._menu.maxLength = W - 4
self._chosen = None
! self.VALUES = []
!
Parent.AddControl(self._button)
! ## Parent.AddControl(self._menu)
! # def Paint(self,v1,v2,v3):
! #
! # return
! # Screen = self.PARENT.Screen()
! # Screen.AutoRefresh = 0
! # self.SetColor(1)
! # X = self._ABSX
! # Y = self._ABSY
! # W = self.W
! ## Screen.PrintAt(Y,X,chr(tiVLINE))
! ## Screen.PrintAt(Y,X+W-1,chr(tiVLINE))
! ## Screen.PrintAt(Y+1,X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC))
! # Screen.AutoRefresh = 1
def _Show(self,v1,v2,v3):
self._menu.ShowOff(None,None,None)
***************
*** 77,91 ****
def AddItem(self,id,text):
self._menu.AddItem(id,text)
def Clear(self):
self._menu.Clear()
! def SetValue(self, value):
! GDebug.printMesg(0,'WARNING: SetValue called on a combo box... not yet
implemented')
!
! def GetValue(self):
! GDebug.printMesg(0,'WARNING: GetValue called on a combo box... not yet
implemented')
!
--- 83,97 ----
def AddItem(self,id,text):
self._menu.AddItem(id,text)
+ self.VALUES.append((id, text))
def Clear(self):
self._menu.Clear()
+ self.VALUES = []
! # def SetValue(self, value):
! # GDebug.printMesg(0,'WARNING: SetValue called on a combo box... not yet
implemented')
+ # def GetValue(self):
+ # GDebug.printMesg(0,'WARNING: GetValue called on a combo box... not yet
implemented')
Index: gnue/common/src/cursing/Control.py
diff -c gnue/common/src/cursing/Control.py:1.4
gnue/common/src/cursing/Control.py:1.5
*** gnue/common/src/cursing/Control.py:1.4 Thu Oct 10 21:46:06 2002
--- gnue/common/src/cursing/Control.py Sun Nov 17 17:53:27 2002
***************
*** 35,42 ****
apply (GraphicObject.__init__, (self, Parent.SCREEN),
properties)
self.NAME = CName
! self.FOCUSCOLOR = 2
! self.COLOR = 1
self.X = -1
self.Y = -1
self.VISIBLE = 1
--- 35,41 ----
apply (GraphicObject.__init__, (self, Parent.SCREEN),
properties)
self.NAME = CName
! self.SetColor('DIALOG','BACKGROUND')
self.X = -1
self.Y = -1
self.VISIBLE = 1
***************
*** 96,102 ****
def SetActiveState( self, state):
- """Wrapper for DeActivate -- which is non-intuitively named :)"""
self.DeActivate( state)
--- 95,100 ----
Index: gnue/common/src/cursing/Dialog.py
diff -c gnue/common/src/cursing/Dialog.py:1.8
gnue/common/src/cursing/Dialog.py:1.9
*** gnue/common/src/cursing/Dialog.py:1.8 Sat Nov 16 10:20:21 2002
--- gnue/common/src/cursing/Dialog.py Sun Nov 17 17:53:27 2002
***************
*** 76,82 ****
self.INSET = 0
self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow +
border*2)
! self.SetColor(sio.C_DIALOG)
def __del__(self):
pass
--- 76,82 ----
self.INSET = 0
self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow +
border*2)
! self.SetColor('DIALOG')
def __del__(self):
pass
***************
*** 105,125 ****
self.LoLight()
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2,
self._DialogWidth + 2, self.INSET, caption=self.CAPTION,
! captionColor=sio.C_DIALOG_TITLE)
def _PaintDropShadow(self):
if not self.DROPSHADOW:
return
- color = self.SCREEN.GetColor()
- self.SCREEN.SetColor(0)
-
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1,
! (self._DialogWidth + self.BORDER*2) * " ")
for i in range(1,self._DialogHeight + self.BORDER*2):
! self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ")
!
! self.SCREEN.SetColor(color)
def RunDialog(self):
self._PaintBorder()
--- 105,121 ----
self.LoLight()
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2,
self._DialogWidth + 2, self.INSET, caption=self.CAPTION,
! color = self.COLOR,
! captionColor=self.SCREEN.colors.C_DIALOG_TITLE)
def _PaintDropShadow(self):
if not self.DROPSHADOW:
return
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1,
! (self._DialogWidth + self.BORDER*2) * " ",
self.SCREEN.colors.C_DROPSHADOW)
for i in range(1,self._DialogHeight + self.BORDER*2):
! self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ",
self.SCREEN.colors.C_DROPSHADOW)
def RunDialog(self):
self._PaintBorder()
Index: gnue/common/src/cursing/Frame.py
diff -c gnue/common/src/cursing/Frame.py:1.9
gnue/common/src/cursing/Frame.py:1.10
*** gnue/common/src/cursing/Frame.py:1.9 Thu Nov 14 20:44:28 2002
--- gnue/common/src/cursing/Frame.py Sun Nov 17 17:53:27 2002
***************
*** 75,81 ****
self.INSET = 0
self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow +
border*2)
! self.SetColor(sio.C_DIALOG)
def __del__(self):
pass
--- 75,81 ----
self.INSET = 0
self.buffer = self.Screen().CaptureScreen(self.R1,
self.C1, self.R2 + dropshadow + border*2, self.C2 + dropshadow +
border*2)
! self.SetColor('DIALOG')
def __del__(self):
pass
***************
*** 95,115 ****
self.LoLight()
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2,
self._DialogWidth + 2, self.INSET, caption=self.CAPTION,
! captionColor=sio.C_DIALOG_TITLE)
def _PaintDropShadow(self):
if not self.DROPSHADOW:
return
! color = self.SCREEN.GetColor()
! self.SCREEN.SetColor(0)
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1,
! (self._DialogWidth + self.BORDER*2) * " ")
for i in range(1,self._DialogHeight + self.BORDER*2):
! self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ")
- self.SCREEN.SetColor(color)
def Paint(self, *args, **parms):
if self.VISIBLE:
--- 95,114 ----
self.LoLight()
_paintBorder( self, self._Y,self._X, self._DialogHeight + 2,
self._DialogWidth + 2, self.INSET, caption=self.CAPTION,
! color=self.SCREEN.colors.C_DIALOG,
! captionColor=self.SCREEN.colors.C_DIALOG_TITLE)
def _PaintDropShadow(self):
if not self.DROPSHADOW:
return
! color = self.SCREEN.colors.C_DROPSHADOW
self.SCREEN.PrintAt( self.R2 + self.BORDER*2, self.C1 + 1,
! (self._DialogWidth + self.BORDER*2) * " ", color)
for i in range(1,self._DialogHeight + self.BORDER*2):
! self.SCREEN.PrintAt( self.R1 + i, self.C2 + self.BORDER*2, " ", color)
def Paint(self, *args, **parms):
if self.VISIBLE:
Index: gnue/common/src/cursing/GraphicObject.py
diff -c gnue/common/src/cursing/GraphicObject.py:1.6
gnue/common/src/cursing/GraphicObject.py:1.7
*** gnue/common/src/cursing/GraphicObject.py:1.6 Fri Nov 15 02:20:37 2002
--- gnue/common/src/cursing/GraphicObject.py Sun Nov 17 17:53:27 2002
***************
*** 90,100 ****
return self.active
! def SetColor( self, LolightColor, HilightColor=None):
""
! self.LOLIGHT_COLOR =LolightColor
! if HilightColor:
! self.HILIGHT_COLOR = HilightColor
def LoLight (self):
--- 90,106 ----
return self.active
! def SetColor( self, color, focusColor=None):
""
! if type(color) == type(""):
! color = self.SCREEN.colors.__dict__['C_%s' % color]
! if focusColor == None:
! focusColor = color
! elif type(focusColor) == type(""):
! focusColor = self.SCREEN.colors.__dict__['C_%s' % focusColor]
!
! self.COLOR = color
! self.FOCUSCOLOR = focusColor
def LoLight (self):
Index: gnue/common/src/cursing/GroupBox.py
diff -c gnue/common/src/cursing/GroupBox.py:1.2
gnue/common/src/cursing/GroupBox.py:1.3
*** gnue/common/src/cursing/GroupBox.py:1.2 Thu Nov 7 11:37:03 2002
--- gnue/common/src/cursing/GroupBox.py Sun Nov 17 17:53:27 2002
***************
*** 40,49 ****
self.X = X
self.W = W
self.H = H
! self.TITLETEXT = Title
self.CANGETFOCUS = 0
! self.COLOR = sio.C_DIALOG
! self.SetColor(self.COLOR)
self.SetMethod("SYSPAINT", self.Paint)
def Paint(self,v1,v2,v3):
--- 40,48 ----
self.X = X
self.W = W
self.H = H
! self.CAPTION = Title
self.CANGETFOCUS = 0
! self.SetColor("DIALOG")
self.SetMethod("SYSPAINT", self.Paint)
def Paint(self,v1,v2,v3):
***************
*** 51,57 ****
X = self._ABSX
H = self.H
W = self.W
! _paintBorder(self, Y, X, H, W)
--- 50,56 ----
X = self._ABSX
H = self.H
W = self.W
! _paintBorder(self, Y, X, H, W, caption = self.CAPTION, color=self.COLOR)
Index: gnue/common/src/cursing/Label.py
diff -c gnue/common/src/cursing/Label.py:1.6
gnue/common/src/cursing/Label.py:1.7
*** gnue/common/src/cursing/Label.py:1.6 Thu Nov 7 11:37:03 2002
--- gnue/common/src/cursing/Label.py Sun Nov 17 17:53:27 2002
***************
*** 56,62 ****
self.SetMethod("SYSGOTFOCUS", None)
self.SetMethod("SYSLOSTFOCUS", None)
! self.SetColor(sio.C_LABEL)
self.SetText(Caption)
def SetText (self, Caption):
--- 56,62 ----
self.SetMethod("SYSGOTFOCUS", None)
self.SetMethod("SYSLOSTFOCUS", None)
! self.SetColor('LABEL')
self.SetText(Caption)
def SetText (self, Caption):
***************
*** 97,102 ****
Y = self._ABSY
X = self._ABSX
caption = self.CAPTION
! Container.PrintAt(Y,X,caption)
--- 97,102 ----
Y = self._ABSY
X = self._ABSX
caption = self.CAPTION
! Container.PrintAt(Y,X,caption, self.COLOR)
Index: gnue/common/src/cursing/MenuBar.py
diff -c gnue/common/src/cursing/MenuBar.py:1.7
gnue/common/src/cursing/MenuBar.py:1.8
*** gnue/common/src/cursing/MenuBar.py:1.7 Mon Nov 11 00:59:59 2002
--- gnue/common/src/cursing/MenuBar.py Sun Nov 17 17:53:27 2002
***************
*** 45,50 ****
--- 45,51 ----
self.STATUSBAR = None
self.STATUSBAR_INDEX = 0
self.Controls = []
+ self.SetColor('MENUBAR')
def NewMenu(self,Name,Caption):
newEntry = Menu(self.rootwin, Name, 0,0, Caption, self)
***************
*** 65,68 ****
--- 66,78 ----
menu.Y = self.Y
self.AddControl(menu)
+
+ # def Paint(self, HasFocus, v2, v3):
+ # Container = self.PARENT.Screen()
+ # color = self.COLOR
+ # Y = self._ABSY
+ # X = self._ABSX
+ # caption = self.CAPTION
+ # Container.PrintAt(Y,X," " * self.W, color)
+
Index: gnue/common/src/cursing/MenuItem.py
diff -c gnue/common/src/cursing/MenuItem.py:1.5
gnue/common/src/cursing/MenuItem.py:1.6
*** gnue/common/src/cursing/MenuItem.py:1.5 Fri Nov 15 02:20:37 2002
--- gnue/common/src/cursing/MenuItem.py Sun Nov 17 17:53:27 2002
***************
*** 37,42 ****
--- 37,43 ----
self.TITLE = DisplayName
self.DESCRIPTION = itemDescription
self.STATUSBARLINK = statusbarlink
+ self.SetColor('MENUBAR','MENUBAR_FOCUS')
def Run(self,v1,v2,v3):
Container = self.PARENT.Screen()
***************
*** 71,90 ****
Container = self.PARENT.Screen()
if self.active:
if HasFocus :
! # self.SetColor(2)
if self.STATUSBARLINK and self.STATUSBARLINK.STATUSBAR:
self.STATUSBARLINK.STATUSBAR.SetText(self.STATUSBARLINK.STATUSBAR_INDEX,
self.DESCRIPTION)
! # else:
! # self.SetColor(1)
! # else:
! # self.SetColor(4)
! # self.LoLight()
! Y = self.Y
! X = self.X
caption = self.CAPTION
! Container.PrintAt(Y,X,caption, hasfocus and sio.C_MENUBAR_FOCUS or
sio.C_MENUBAR)
! # if self.active :
! # self.SetColor(1)
! # self.LoLight()
--- 72,85 ----
Container = self.PARENT.Screen()
if self.active:
if HasFocus :
! color = self.FOCUSCOLOR
if self.STATUSBARLINK and self.STATUSBARLINK.STATUSBAR:
self.STATUSBARLINK.STATUSBAR.SetText(self.STATUSBARLINK.STATUSBAR_INDEX,
self.DESCRIPTION)
! else:
! color = self.COLOR
! Y = self._ABSY
! X = self._ABSX
caption = self.CAPTION
! Container.PrintAt(Y,X,caption, color)
Index: gnue/common/src/cursing/ScreenContainer.py
diff -c gnue/common/src/cursing/ScreenContainer.py:1.9
gnue/common/src/cursing/ScreenContainer.py:1.10
*** gnue/common/src/cursing/ScreenContainer.py:1.9 Thu Nov 14 20:44:28 2002
--- gnue/common/src/cursing/ScreenContainer.py Sun Nov 17 17:53:27 2002
***************
*** 68,74 ****
self.STARTPOINT = 0
self.breakUp = 0
! self.SetColor(sio.C_SCREEN)
self.nextCtl = None
self.eventX = -1
self.eventY = -1
--- 68,75 ----
self.STARTPOINT = 0
self.breakUp = 0
! ## GDebug.printMesg(1,dir (SIOInstance.colors))
! self.SetColor(SIOInstance.colors.C_BACKGROUND)
self.nextCtl = None
self.eventX = -1
self.eventY = -1
Index: gnue/common/src/cursing/StatusBar.py
diff -c gnue/common/src/cursing/StatusBar.py:1.4
gnue/common/src/cursing/StatusBar.py:1.5
*** gnue/common/src/cursing/StatusBar.py:1.4 Fri Nov 15 02:20:37 2002
--- gnue/common/src/cursing/StatusBar.py Sun Nov 17 17:53:27 2002
***************
*** 128,138 ****
X = self.FIELD_X[index] + self._ABSX - self.X
caption = string.ljust(caption[:size], size)
- GDebug.printMesg(1,'Visible, so adding %s' % caption)
Container = self.PARENT.Screen()
y,x = Container.GetYX()
self.HiLight
! Container.PrintAt(self._ABSY,X,caption,
curses.color_pair(sio.C_STATUSBAR_FIELD))
Container.GotoYX(y,x)
--- 128,137 ----
X = self.FIELD_X[index] + self._ABSX - self.X
caption = string.ljust(caption[:size], size)
Container = self.PARENT.Screen()
y,x = Container.GetYX()
self.HiLight
! Container.PrintAt(self._ABSY,X,caption,
Container.colors.C_STATUSBAR_FIELD)
Container.GotoYX(y,x)
***************
*** 148,154 ****
# self.LoLight()
Y = self._ABSY
! Container.PrintAt(Y,self._ABSX,self._EmptyStatusBar,
curses.color_pair(sio.C_STATUSBAR))
for index in range(self.NUM_FIELDS):
--- 147,153 ----
# self.LoLight()
Y = self._ABSY
! Container.PrintAt(Y,self._ABSX,self._EmptyStatusBar,
Container.colors.C_STATUSBAR)
for index in range(self.NUM_FIELDS):
***************
*** 156,164 ****
X = self.FIELD_X[index] + self._ABSX - self.X
caption = string.ljust(self.TEXT[index][:size], size)
! # Container.SetColor(sio.C_STATUSBAR_FIELD)
! Container.PrintAt(Y,X,caption,
curses.color_pair(sio.C_STATUSBAR_FIELD))#,
! # curses.color_pair(sio.C_STATUSBAR_FIELD))
self._visible = 1
--- 155,161 ----
X = self.FIELD_X[index] + self._ABSX - self.X
caption = string.ljust(self.TEXT[index][:size], size)
! Container.PrintAt(Y,X,caption, Container.colors.C_STATUSBAR_FIELD)
self._visible = 1
Index: gnue/common/src/cursing/TextArea.py
diff -c gnue/common/src/cursing/TextArea.py:1.5
gnue/common/src/cursing/TextArea.py:1.6
*** gnue/common/src/cursing/TextArea.py:1.5 Fri Nov 15 02:20:37 2002
--- gnue/common/src/cursing/TextArea.py Sun Nov 17 17:53:27 2002
***************
*** 65,71 ****
self.laststart = 0
self.EDITABLE = 1
! self.SetColor(sio.C_TEXTBOX)
def Run(self, v1, v2, v3):
Container = self.PARENT.Screen()
--- 65,71 ----
self.laststart = 0
self.EDITABLE = 1
! self.SetColor('TEXTBOX', 'TEXTBOX_FOCUS')
def Run(self, v1, v2, v3):
Container = self.PARENT.Screen()
***************
*** 173,191 ****
Visuals = line + ((W - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W-1] + ">"
! Container.PrintAt(self._ABSY+i, self._ABSX, Visuals)
Container.GotoYX(self._ABSY+i, self._ABSX+ Depth)
else:
if Depth >= W:
Visuals = "<" + Text[Depth - (W - 1):] + (((W - 1) - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W]
! Container.PrintAt(self._ABSY+i, self._ABSX, Visuals)
Container.GotoYX(self._ABSY+i, self._ABSX+ W)
i += 1
for j in range(self.H - i):
! Container.PrintAt(self._ABSY + i + j, self._ABSX, "_" * W)
def SetCursor(self, location):
--- 173,191 ----
Visuals = line + ((W - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W-1] + ">"
! Container.PrintAt(self._ABSY+i, self._ABSX, Visuals, self.FOCUS and
self.FOCUSCOLOR or self.COLOR)
Container.GotoYX(self._ABSY+i, self._ABSX+ Depth)
else:
if Depth >= W:
Visuals = "<" + Text[Depth - (W - 1):] + (((W - 1) - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W]
! Container.PrintAt(self._ABSY+i, self._ABSX, Visuals, self.FOCUS and
self.FOCUSCOLOR or self.COLOR)
Container.GotoYX(self._ABSY+i, self._ABSX+ W)
i += 1
for j in range(self.H - i):
! Container.PrintAt(self._ABSY + i + j, self._ABSX, "_" * W, self.FOCUS
and self.FOCUSCOLOR or self.COLOR)
def SetCursor(self, location):
***************
*** 197,209 ****
def LostFocus(self, v1, v2, v3):
curses.curs_set(0)
! self.SetColor(sio.C_TEXTBOX)
Container = self.PARENT.Screen()
if self.PARENT.VISIBLE:
self.Paint(0,0,0)
def GotFocus(self, v1, v2, v3):
! self.SetColor(sio.C_TEXTBOX_FOCUS)
Container = self.PARENT.Screen()
self.Paint(None, None, None)
Container.GotoYX(self._ABSY, self._ABSX+ self.DEPTH)
--- 197,209 ----
def LostFocus(self, v1, v2, v3):
curses.curs_set(0)
! self.SetColor('TEXTBOX')
Container = self.PARENT.Screen()
if self.PARENT.VISIBLE:
self.Paint(0,0,0)
def GotFocus(self, v1, v2, v3):
! self.SetColor('TEXTBOX_FOCUS')
Container = self.PARENT.Screen()
self.Paint(None, None, None)
Container.GotoYX(self._ABSY, self._ABSX+ self.DEPTH)
Index: gnue/common/src/cursing/TextBox.py
diff -c gnue/common/src/cursing/TextBox.py:1.10
gnue/common/src/cursing/TextBox.py:1.11
*** gnue/common/src/cursing/TextBox.py:1.10 Thu Nov 14 20:44:28 2002
--- gnue/common/src/cursing/TextBox.py Sun Nov 17 17:53:27 2002
***************
*** 64,70 ****
self.laststart = 0
self.EDITABLE = 1
! self.SetColor(sio.C_TEXTBOX)
def Run(self, v1, v2, v3):
Container = self.PARENT.Screen()
--- 64,70 ----
self.laststart = 0
self.EDITABLE = 1
! self.SetColor('TEXTBOX', 'TEXTBOX_FOCUS')
def Run(self, v1, v2, v3):
Container = self.PARENT.Screen()
***************
*** 166,174 ****
return 1
def Paint(self, v1, v2, v3):
! Container = self.PARENT.Screen()
TextLen = len(self.TEXT)
if self.PASSWORD:
Text = "*" * TextLen
else:
--- 166,178 ----
return 1
def Paint(self, v1, v2, v3):
! Container = self.PARENT.SCREEN
TextLen = len(self.TEXT)
+ if self.FOCUS:
+ color = self.FOCUSCOLOR
+ else:
+ color = self.COLOR
if self.PASSWORD:
Text = "*" * TextLen
else:
***************
*** 177,196 ****
W = self.W
Depth = self.DEPTH
Visuals = ''
- self.LoLight()
if TextLen <= W or Depth < W:
Visuals = Text + ((W - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W-1] + ">"
! Container.PrintAt(self._ABSY, self._ABSX, Visuals)
Container.GotoYX(self._ABSY, self._ABSX+ Depth)
else:
if Depth >= W:
Visuals = "<" + Text[Depth - (W - 1):] + (((W - 1) - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W]
! Container.PrintAt(self._ABSY, self._ABSX, Visuals)
Container.GotoYX(self._ABSY, self._ABSX+ W)
def SetCursor(self, location):
--- 181,199 ----
W = self.W
Depth = self.DEPTH
Visuals = ''
if TextLen <= W or Depth < W:
Visuals = Text + ((W - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W-1] + ">"
! Container.PrintAt(self._ABSY, self._ABSX, Visuals, color)
Container.GotoYX(self._ABSY, self._ABSX+ Depth)
else:
if Depth >= W:
Visuals = "<" + Text[Depth - (W - 1):] + (((W - 1) - TextLen) * "_")
if len(Visuals) > W:
Visuals = Visuals[:W]
! Container.PrintAt(self._ABSY, self._ABSX, Visuals, self.FOCUS and
self.FOCUSCOLOR or self.COLOR)
Container.GotoYX(self._ABSY, self._ABSX+ W)
def SetCursor(self, location):
***************
*** 201,214 ****
self.Paint(None, None, None)
def LostFocus(self, v1, v2, v3):
curses.curs_set(0)
- self.SetColor(sio.C_TEXTBOX)
- Container = self.PARENT.Screen()
if self.PARENT.VISIBLE:
self.Paint(0,0,0)
def GotFocus(self, v1, v2, v3):
! self.SetColor(sio.C_TEXTBOX_FOCUS)
Container = self.PARENT.Screen()
curses.curs_set(1)
Container.GotoYX(self._ABSY, self._ABSX+ self.DEPTH)
--- 204,216 ----
self.Paint(None, None, None)
def LostFocus(self, v1, v2, v3):
+ self.FOCUS = 0
curses.curs_set(0)
if self.PARENT.VISIBLE:
self.Paint(0,0,0)
def GotFocus(self, v1, v2, v3):
! self.FOCUS = 1
Container = self.PARENT.Screen()
curses.curs_set(1)
Container.GotoYX(self._ABSY, self._ABSX+ self.DEPTH)
Index: gnue/common/src/cursing/VButton.py
diff -c gnue/common/src/cursing/VButton.py:1.4
gnue/common/src/cursing/VButton.py:1.5
*** gnue/common/src/cursing/VButton.py:1.4 Thu Oct 10 21:46:06 2002
--- gnue/common/src/cursing/VButton.py Sun Nov 17 17:53:27 2002
***************
*** 39,46 ****
apply(Button.__init__, (self, Parent, ButtonName, Y, X, H,
Caption),properties)
self.W = 1
self.H = H
! self.COLOR = sio.C_SCROLL_BUTTON
! self.FOCUSCOLOR = sio.C_SCROLL_BUTTON_FOCUS
def Paint(self, HaveFocus, v2,v3):
--- 39,45 ----
apply(Button.__init__, (self, Parent, ButtonName, Y, X, H,
Caption),properties)
self.W = 1
self.H = H
! self.SetColor('SCROLL_BUTTON','SCROLL_BUTTON_FOCUS')
def Paint(self, HaveFocus, v2,v3):
***************
*** 48,59 ****
if Container == None:
raise "Container is Nothing in def Paint!"
if HaveFocus:
! self.SetColor(sio.C_SCROLL_BUTTON_FOCUS)
! self.HiLight()
else:
! self.SetColor(sio.C_SCROLL_BUTTON)
! self.LoLight()
! tROW, tCOL = self.Y, self.X
tCaption = self.CAPTION
tW = self.H
tAW = tW - 2
--- 47,56 ----
if Container == None:
raise "Container is Nothing in def Paint!"
if HaveFocus:
! color = self.FOCUSCOLOR
else:
! color = self.COLOR
! tROW, tCOL = self._ABSY, self._ABSX
tCaption = self.CAPTION
tW = self.H
tAW = tW - 2
***************
*** 73,78 ****
tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)
tCaption = tCaption
for i in range(0,len(tCaption)):
! Container.PutAt(tROW + i, tCOL, tCaption[i])
--- 70,75 ----
tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)
tCaption = tCaption
for i in range(0,len(tCaption)):
! Container.PutAt(tROW + i, tCOL, tCaption[i], color)
Index: gnue/common/src/cursing/VScrollBar.py
diff -c gnue/common/src/cursing/VScrollBar.py:1.5
gnue/common/src/cursing/VScrollBar.py:1.6
*** gnue/common/src/cursing/VScrollBar.py:1.5 Sat Nov 16 10:20:21 2002
--- gnue/common/src/cursing/VScrollBar.py Sun Nov 17 17:53:27 2002
***************
*** 60,66 ****
self.leftarrow = VButton(Parent,'leftarrow',Y,X,3,'^')
self.leftarrow.SetMethod("CLICK",self._Dec)
Parent.AddControl(self.leftarrow)
! self.COLOR = sio.C_SCROLL_BACKGROUND
def Init(self, Max):
self._max = Max
--- 60,66 ----
self.leftarrow = VButton(Parent,'leftarrow',Y,X,3,'^')
self.leftarrow.SetMethod("CLICK",self._Dec)
Parent.AddControl(self.leftarrow)
! self.SetColor('SCROLL_BACKGROUND')
def Init(self, Max):
self._max = Max
***************
*** 78,87 ****
Screen = self.PARENT.Screen()
Screen.AutoRefresh = 0
# clear the bar region in reverse standard-color
- self.SetColor(sio.C_SCROLL_BACKGROUND)
- # self.LoLight()
for i in range(0, int(self.WorkingArea)):
! Screen.PutAt( self.start + i,self._ABSX, '?') #, curses.A_REVERSE)
# correct position
if Pos >= (self.WorkingArea + self.start):
Pos = (self.start + self.WorkingArea)
--- 78,85 ----
Screen = self.PARENT.Screen()
Screen.AutoRefresh = 0
# clear the bar region in reverse standard-color
for i in range(0, int(self.WorkingArea)):
! Screen.PutAt( self.start + i,self._ABSX, '|',
Screen.colors.C_BACKGROUND)
# correct position
if Pos >= (self.WorkingArea + self.start):
Pos = (self.start + self.WorkingArea)
***************
*** 89,100 ****
Pos = self.start + self.UsedSpace
# draw the handle
if self.FOCUS:
! self.SetColor(sio.C_SCROLL_SLIDER_FOCUS)
else:
! self.SetColor(sio.C_SCROLL_SLIDER)
! #self.LoLight()
for i in range(0, self.UsedSpace):
! Screen.PutAt((self._ABSY + Pos - self.UsedSpace) + i,self._ABSX, 'x')#,
curses.A_REVERSE)
Screen.AutoRefresh = 1
Screen.Refresh()
--- 87,98 ----
Pos = self.start + self.UsedSpace
# draw the handle
if self.FOCUS:
! color = self.SCREEN.colors.C_SCROLL_SLIDER_FOCUS
else:
! color = self.SCREEN.colors.C_SCROLL_SLIDER
!
for i in range(0, self.UsedSpace):
! Screen.PutAt((self._ABSY + Pos - self.UsedSpace) + i,self._ABSX, '0',
color)
Screen.AutoRefresh = 1
Screen.Refresh()
Index: gnue/common/src/cursing/sio.py
diff -c gnue/common/src/cursing/sio.py:1.9 gnue/common/src/cursing/sio.py:1.10
*** gnue/common/src/cursing/sio.py:1.9 Fri Nov 15 18:18:28 2002
--- gnue/common/src/cursing/sio.py Sun Nov 17 17:53:27 2002
***************
*** 37,60 ****
from constants import *
import curses
! C_SCREEN = 2
! C_TITLEBAR = 3
! C_MENUBAR = 4
! C_MENUBAR_FOCUS = 5
! C_LABEL = 6
! C_DIALOG = 7
! C_DIALOG_TITLE = 8
! C_TEXTBOX_FOCUS = 9
! C_TEXTBOX = 10
! C_BUTTON = 11
! C_BUTTON_FOCUS = 12
! C_SCROLL_BUTTON = 13
! C_SCROLL_BUTTON_FOCUS = 14
! C_SCROLL_BACKGROUND = 15
! C_SCROLL_SLIDER = 16
! C_SCROLL_SLIDER_FOCUS = 17
! C_STATUSBAR = 10
! C_STATUSBAR_FIELD = 10 # 7
class sio:
"""
--- 37,60 ----
from constants import *
import curses
! #C_SCREEN = 2
! #C_TITLEBAR = 3
! #C_MENUBAR = 4
! #C_MENUBAR_FOCUS = 5
! #C_LABEL = 6
! #C_DIALOG = 7
! #C_DIALOG_TITLE = 8
! #C_TEXTBOX_FOCUS = 9
! #C_TEXTBOX = 10
! #C_BUTTON = 11
! #C_BUTTON_FOCUS = 12
! #C_SCROLL_BUTTON = 13
! #C_SCROLL_BUTTON_FOCUS = 14
! #C_SCROLL_BACKGROUND = 15
! #C_SCROLL_SLIDER = 16
! #C_SCROLL_SLIDER_FOCUS = 17
! #C_STATUSBAR = 10
! #C_STATUSBAR_FIELD = 10 # 7
class sio:
"""
***************
*** 88,102 ****
def BeginScreenAccess(self):
"""Initialize the screen and setup for action."""
! if self.s <> None:
! return
self.stdscr = curses.initscr()
self._NegotiateScreenSize()
self.s = curses.newwin(self.MAXROW+1, self.MAXCOL+1, 0, 0)
curses.noecho()
#curses.nonl() # disallows usage of <CR> as a selector.
curses.cbreak()
self.s.keypad(1)
# make the cursor very visible
#curses.curs_set(2) # throws an ERR, removing.
--- 88,107 ----
def BeginScreenAccess(self):
"""Initialize the screen and setup for action."""
! GDebug.printMesg(0,'initializing curses screen')
! #if self.s <> None:
! # return
! GDebug.printMesg(0,'initializing curses screen 1')
self.stdscr = curses.initscr()
self._NegotiateScreenSize()
+ GDebug.printMesg(0,'initializing curses screen 2')
self.s = curses.newwin(self.MAXROW+1, self.MAXCOL+1, 0, 0)
curses.noecho()
+ GDebug.printMesg(0,'initializing curses screen 3')
#curses.nonl() # disallows usage of <CR> as a selector.
curses.cbreak()
self.s.keypad(1)
+ GDebug.printMesg(0,'initializing curses screen 4')
# make the cursor very visible
#curses.curs_set(2) # throws an ERR, removing.
***************
*** 114,133 ****
tiLTEE : curses.ACS_LTEE,
tiRTEE : curses.ACS_RTEE,
tiBULL : curses.ACS_PLUS}
! try:
! # TODO: should really only do this if configuration
! # TODO: says yes, or on some other test.
! curses.start_color()
!
! import ColorScheme
!
! if curses.has_colors ():
! ## self.colors = ColorScheme.StandardBlueOnWhite()
! ## f = open('test','w')
! ## f.write('Color: %s\n' % C_SCREEN)
! ## f.close()
! ## #sys.exit()
! pass
# curses.init_pair(C_SCREEN, curses.COLOR_WHITE,curses.COLOR_BLUE)
# curses.init_pair(C_TITLEBAR, curses.COLOR_WHITE,curses.COLOR_BLUE)
--- 119,135 ----
tiLTEE : curses.ACS_LTEE,
tiRTEE : curses.ACS_RTEE,
tiBULL : curses.ACS_PLUS}
! GDebug.printMesg(0,'initializing curses screen 5')
!
! # TODO: should really only do this if configuration
! # TODO: says yes, or on some other test.
! curses.start_color()
!
! import ColorScheme
!
! if curses.has_colors():
! GDebug.printMesg(1,"Initializing StandardWhiteOnBlue colors")
! self.colors = ColorScheme.StandardWhiteOnBlue()
# curses.init_pair(C_SCREEN, curses.COLOR_WHITE,curses.COLOR_BLUE)
# curses.init_pair(C_TITLEBAR, curses.COLOR_WHITE,curses.COLOR_BLUE)
***************
*** 148,167 ****
# curses.init_pair(C_SCROLL_SLIDER_FOCUS, 0, curses.COLOR_CYAN)
## curses.init_pair(C_STATUSBAR, curses.COLOR_BLACK,
curses.COLOR_WHITE)
## curses.init_pair(C_STATUSBAR_FIELD, curses.COLOR_BLUE,
curses.COLOR_WHITE)
! else:
! f = open('test','w')
! f.write('NO COLORS!')
! f.close()
! self.colors = ColorScheme.Monochrome()
- except:
- pass
events = curses.mousemask(curses.BUTTON1_CLICKED)
! if events == 0:
! self.PrintAt(self.MAXROW, self.MAXCOL-8, 'no mouse.')
self.AutoRefresh = 1
self.Started = 1
--- 150,165 ----
# curses.init_pair(C_SCROLL_SLIDER_FOCUS, 0, curses.COLOR_CYAN)
## curses.init_pair(C_STATUSBAR, curses.COLOR_BLACK,
curses.COLOR_WHITE)
## curses.init_pair(C_STATUSBAR_FIELD, curses.COLOR_BLUE,
curses.COLOR_WHITE)
! else:
! GDebug.printMesg(1,"Initializing Monochrome colors")
! self.colors = ColorScheme.Monochrome()
events = curses.mousemask(curses.BUTTON1_CLICKED)
! # if events == 0:
! # self.PrintAt(self.MAXROW, self.MAXCOL-8, 'no mouse.')
self.AutoRefresh = 1
self.Started = 1
***************
*** 264,275 ****
def GotoYX(self, Row, Col):
- """
- """
- #self.s.addstr(Row, Column, "")
- # not really sure why s.addstr is being used when perhaps a 'move'
- # will suffice?
- #print "Row: %s, Col: %s" % (Row, Col)
self.s.move( Row, Col)
if self.AutoRefresh :
self.s.refresh()
--- 262,267 ----
***************
*** 277,288 ****
def GetYX(self):
return self.s.getyx()
! def Print(self, String, Mods = None):
! """
! """
! PrevMod = self.PrintMods
! if Mods != None:
! PrevMod |= Mods
refreshState = self.AutoRefresh
self.AutoRefresh = 0
--- 269,279 ----
def GetYX(self):
return self.s.getyx()
! def Print(self, String, Mods = 0):
! # PrevMod = self.PrintMods
! # if Mods != None:
! # PrevMod |= Mods
! PrevMod = Mods
refreshState = self.AutoRefresh
self.AutoRefresh = 0
***************
*** 316,321 ****
--- 307,314 ----
"""
"""
return
+
+
if curses.has_colors():
# TODO: should this be curses.color_pair(colorHi)?
#self.PrintMods = curses.color_pair(colorHi)
***************
*** 328,333 ****
--- 321,328 ----
"""
"""
return
+
+
if curses.has_colors():
self.PrintMods = curses.color_pair(colorLow)
else:
***************
*** 337,342 ****
--- 332,340 ----
def SetColor(self, ll, hl=None):
"""
"""
+ return
+
+
## if type(ll) == type( (0,) ):
## ll, hl = ll
***************
*** 349,358 ****
pass
def GetColor(self):
! return self.COLOR
! def PrintAt(self, Row, Col, String, Mods = None):
"""
"""
self.GotoYX(Row, Col)
--- 347,357 ----
pass
def GetColor(self):
! return 0
! #return self.COLOR
! def PrintAt(self, Row, Col, String, Mods = 0):
"""
"""
self.GotoYX(Row, Col)
***************
*** 362,372 ****
def Cls(self):
"""
"""
- self.SetColor(1)
self.AutoRefresh = 0
for row in range(0, self.MAXROW+1):
! self.PrintAt(row, 0, " " * self.MAXCOL)
! self.SetColor(1)
self.AutoRefresh = 1
--- 361,369 ----
def Cls(self):
"""
"""
self.AutoRefresh = 0
for row in range(0, self.MAXROW+1):
! self.PrintAt(row, 0, " " * self.MAXCOL, self.colors.C_BACKGROUND)
self.AutoRefresh = 1
Index: gnue/common/src/cursing/utility.py
diff -c gnue/common/src/cursing/utility.py:1.3
gnue/common/src/cursing/utility.py:1.4
*** gnue/common/src/cursing/utility.py:1.3 Thu Oct 10 21:46:06 2002
--- gnue/common/src/cursing/utility.py Sun Nov 17 17:53:27 2002
***************
*** 36,42 ****
from constants import *
def _paintBorder(dialog, Y, X, H, W, integrateUpper = 0,
! caption=None, captionColor=0):
""" draw a border with curses_graphics
"""
Screen = dialog.SCREEN
--- 36,42 ----
from constants import *
def _paintBorder(dialog, Y, X, H, W, integrateUpper = 0,
! caption=None, color=0, captionColor=0):
""" draw a border with curses_graphics
"""
Screen = dialog.SCREEN
***************
*** 52,76 ****
upperLC = tiUTEE
# first line
! Screen.PrintAt( Y,X, chr(upperLC) + (W-2) * chr(tiHLINE) + chr(upperRC))
if caption:
! Screen.PrintAt (Y,X + 2, " ") #chr(tiRTEE) + " ")
! 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)
# "body"
for i in range(Y+1,Y+H-1):
! Screen.PrintAt(i,X, chr(tiVLINE) + (W-2)*' ' + chr(tiVLINE))
# last line
! Screen.PrintAt( Y+H-1, X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC))
# add title-text ?
if dialog.HasProperty("TITLETEXT"):
--- 52,71 ----
upperLC = tiUTEE
# first line
! Screen.PrintAt( Y,X, chr(upperLC) + (W-2) * chr(tiHLINE) + chr(upperRC),
color)
if caption:
! Screen.PrintAt (Y,X + 2, " %s " % caption, captionColor or color)
# "body"
for i in range(Y+1,Y+H-1):
! Screen.PrintAt(i,X, chr(tiVLINE) + (W-2)*' ' + chr(tiVLINE), color)
# last line
! Screen.PrintAt( Y+H-1, X, chr(tiLLC) + (W-2) * chr(tiHLINE) + chr(tiLRC),
color)
# add title-text ?
if dialog.HasProperty("TITLETEXT"):
Index: gnue/common/utils/doc-xml-attrs-openoffice.py
diff -c gnue/common/utils/doc-xml-attrs-openoffice.py:1.2
gnue/common/utils/doc-xml-attrs-openoffice.py:1.3
*** gnue/common/utils/doc-xml-attrs-openoffice.py:1.2 Tue Nov 5 21:03:43 2002
--- gnue/common/utils/doc-xml-attrs-openoffice.py Sun Nov 17 17:53:27 2002
***************
*** 31,36 ****
--- 31,38 ----
import sys, string
sys.path.insert(0,'../../../gnue/.cvsdevelbase')
+ import re
+
from xml.sax.saxutils import escape
from gnue.common import GParser, GTypecast
***************
*** 213,220 ****
ename = element
! edescr = escape(self.xmlElements[element].get('Description',''))
! if not edescr:
edescr = '<text:span text:style-name="Placeholder" >No description
provided</text:span>'
--- 215,222 ----
ename = element
! edescr =
addTextFormatting(escape(self.xmlElements[element].get('Description','')))
! if not edescr or edescr == 'TODO':
edescr = '<text:span text:style-name="Placeholder" >No description
provided</text:span>'
***************
*** 285,301 ****
if deprecated:
continue
! adescr = escape(self.xmlElements[element]['Attributes'][att].get(
! 'Description',''))
! if not adescr:
adescr = '<text:span text:style-name="Placeholder" >No
description provided</text:span>'
datatype = self.xmlElements[element]['Attributes'][att].get(
'Typecast',GTypecast.text)
if datatype in (GTypecast.number, GTypecast.integer,
GTypecast.whole):
! atype = '<text:span text:style-name="Emphasis"
>numeric</text:span>'
else:
atype = '<text:span text:style-name="Emphasis" >text</text:span>'
--- 287,303 ----
if deprecated:
continue
! adescr =
addTextFormatting(escape(self.xmlElements[element]['Attributes'][att].get(
! 'Description','')))
! if not adescr or adescr == 'TODO':
adescr = '<text:span text:style-name="Placeholder" >No
description provided</text:span>'
datatype = self.xmlElements[element]['Attributes'][att].get(
'Typecast',GTypecast.text)
if datatype in (GTypecast.number, GTypecast.integer,
GTypecast.whole):
! atype = '<text:span text:style-name="Emphasis"
>number</text:span>'
else:
atype = '<text:span text:style-name="Emphasis" >text</text:span>'
***************
*** 330,335 ****
--- 332,343 ----
attributeTable += attributeTableFooter
self.processedTags[element] = elementBody % locals()
+
+
+ def addTextFormatting(text):
+ sourcebegin = '<text:span text:style-name="Source Text" >'
+ sourceend = '</text:span>'
+ return re.sub(r'\{(.+?)\}',sourcebegin + '\\1' + sourceend, text)
###############################################################################
Index: gnue/forms/BUGS
diff -c gnue/forms/BUGS:1.7 gnue/forms/BUGS:1.8
*** gnue/forms/BUGS:1.7 Fri Nov 15 15:08:55 2002
--- gnue/forms/BUGS Sun Nov 17 17:53:27 2002
***************
*** 9,16 ****
tab key presses in dropdowns on Win32 are not correct (wx issue)
! curses driver issues
! shift-tab not working
! mouse click == fail to shell window w/o error
! if you resize your xterm window
! buttons don't trigger
--- 9,19 ----
tab key presses in dropdowns on Win32 are not correct (wx issue)
! curses driver issues:
! * shift-tab does not work
! * mouse click --> exit to shell window w/o error
! * If running in an xterm window, resizing the window will crash forms
! * buttons don't fire
! * menubar does not work
! * combo boxes do not list values
! * notebook tabs have not been implemented
Index: gnue/forms/doc/Developers-Guide.sxw
Index: gnue/forms/src/GFParser.py
diff -c gnue/forms/src/GFParser.py:1.82 gnue/forms/src/GFParser.py:1.83
*** gnue/forms/src/GFParser.py:1.82 Sun Nov 17 14:44:09 2002
--- gnue/forms/src/GFParser.py Sun Nov 17 17:53:27 2002
***************
*** 94,100 ****
'bottom': {},
'top': {} },
'Default': "",
! 'Description': 'Allows a form to convert it\'s pages as
notebook tabs. Allowed values are left, right, bottom, top.' },
'width': {
'Typecast': GTypecast.whole,
'Default': 40,
--- 94,100 ----
'bottom': {},
'top': {} },
'Default': "",
! 'Description': 'Allows a form to convert it\'s pages as
notebook tabs. Allowed values are {left}, {right}, {bottom}, {top}.' },
'width': {
'Typecast': GTypecast.whole,
'Default': 40,
***************
*** 183,189 ****
'datasource': {
'References': (('datasource','name'),),
'Typecast': GTypecast.name,
! 'Description': 'The name of a datasource (defined in by a
_<datasource>_ tag.) that provides this block with it\'s data.' } },
'ParentTags': ('page',),
'Description': 'TODO' },
--- 183,191 ----
'datasource': {
'References': (('datasource','name'),),
'Typecast': GTypecast.name,
! 'Description': 'The name of a datasource (defined in by a '
! '{<datasource>} tag.) that provides this block '
! 'with it\'s data.' } },
'ParentTags': ('page',),
'Description': 'TODO' },
***************
*** 205,214 ****
'right': {},
'center': {} },
'Default': "left",
! 'Description': 'The justification of the label. Can be one of
the following: _left_, _right_, or _center_. Requires that the _width_
attribute be set.'},
'width': {
'Typecast': GTypecast.whole,
! 'Description': 'The width of the label in text columns.
Defaults to the width of the text. Only really usefull when used with the
justification attribute.' },
'rows': {
'Typecast': GTypecast.whole,
'Description': 'Overrides the rows setting defined at the
block level. ' },
--- 207,220 ----
'right': {},
'center': {} },
'Default': "left",
! 'Description': 'The justification of the label. Can be one of '
! 'the following: {left}, {right}, or {center}. '
! 'Requires that the {width} attribute be set.'},
'width': {
'Typecast': GTypecast.whole,
! 'Description': 'The width of the label in text columns. '
! 'Defaults to the width of the text. Only really
'
! 'useful when used with the {alignment}
attribute.' },
'rows': {
'Typecast': GTypecast.whole,
'Description': 'Overrides the rows setting defined at the
block level. ' },
***************
*** 218,224 ****
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget . Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
--- 224,230 ----
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget. Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
***************
*** 304,314 ****
'label': {} },
'Default': 'default',
'Description': 'The style of entry widget requested. Currently
'
! 'either _text_, _label_, _checkbox_, or
_dropdown_. To '
! 'use _dropdown_ you are required to use both
the '
! '_fk_source_, _fk_key_, and _fk_description_ '
! 'attributes. The _label_ style implies the '
! '_readonly_ attribute.' },
'case': {
'Typecast': GTypecast.name,
'ValueSet': {
--- 310,320 ----
'label': {} },
'Default': 'default',
'Description': 'The style of entry widget requested. Currently
'
! 'either {text}, {label}, {checkbox}, or
{dropdown}. To '
! 'use {dropdown} you are required to use both
the '
! '{fk_source}, {fk_key}, and {fk_description} '
! 'attributes. The {label} style implies the '
! '{readonly} attribute.' },
'case': {
'Typecast': GTypecast.name,
'ValueSet': {
***************
*** 325,331 ****
'date': {} },
'Default': 'text',
'Description': 'The type of data the entry widget will accept.
'
! 'Possible values are _text_, _number_,
_date_.'},
'formatmask': {
'Typecast': GTypecast.text,
'Description': 'TODO' },
--- 331,337 ----
'date': {} },
'Default': 'text',
'Description': 'The type of data the entry widget will accept.
'
! 'Possible values are {text}, {number},
{date}.'},
'formatmask': {
'Typecast': GTypecast.text,
'Description': 'TODO' },
***************
*** 377,384 ****
'Typecast': GTypecast.text,
'Description': 'When set, whatever value the user enters for '
'the query mask is rewritten with % between '
! 'each character. Thus _example_ would be '
! 'queried as _%e%x%a%m%p%l%e%_' },
'ignoreCaseOnQuery': {
'Typecast': GTypecast.boolean,
'Default': 0,
--- 383,390 ----
'Typecast': GTypecast.text,
'Description': 'When set, whatever value the user enters for '
'the query mask is rewritten with % between '
! 'each character. Thus {example} would be '
! 'queried as {%e%x%a%m%p%l%e%}' },
'ignoreCaseOnQuery': {
'Typecast': GTypecast.boolean,
'Default': 0,
***************
*** 430,436 ****
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget . Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
--- 436,442 ----
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget. Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
***************
*** 462,468 ****
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget . Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
--- 468,474 ----
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget. Based upon leftmost column of screen being 0. ' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
***************
*** 498,504 ****
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget . Based upon leftmost column of screen being 0.' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,
--- 504,510 ----
'x': {
'Required': 1,
'Typecast': GTypecast.whole,
! 'Description': 'The text column starting position of the
widget. Based upon leftmost column of screen being 0.' },
'y': {
'Required': 1,
'Typecast': GTypecast.whole,