# Path: AOR/AttributeString.py
# class AttributeString(str):
#     def __init__(self, s):
#         str.__init__(self, s)
#         # If this object is initialised with an AttributeString,
#         # copy the attributes as well
#         if isinstance(s, AttributeString):
#             self.lPrefix  = s.GetPrefixAttributes()[:]
#             self.lPostfix = s.GetPostfixAttributes()[:]
#         else:
#             self.lPrefix  = []
#             self.lPostfix = []
#     # --------------------------------------------------------------------------
#     # Creates a new attribute string which has the same pre- and postfix
#     # attributes, but a new string.
#     def sCreateCopy(self, s):
#         new = AttributeString(s)
#         new.SetPrefixAttributes(self.GetPrefixAttributes())
#         new.SetPostfixAttributes(self.GetPostfixAttributes())
#         return new
#     # --------------------------------------------------------------------------
#     # Splits an AttributeString into two strings, the first one containing
#     # all prefix attributes, the second one all postfix ones. The parameter
#     # n specified the number of character to for the first string.
#     def tSplitString(self, n):
#         s1 = AttributeString(self[0:n])
#         s2 = AttributeString(self[n: ])
#         s1.SetPrefixAttributes(self.GetPrefixAttributes())
#         s2.SetPostfixAttributes(self.GetPostfixAttributes())
#         return s1,s2
#     # --------------------------------------------------------------------------
#     def SetPrefixAttributes(self,  l) : self.lPrefix = l[:]
#     # --------------------------------------------------------------------------
#     def SetPostfixAttributes(self, l) : self.lPostfix = l[:]
#     # --------------------------------------------------------------------------
#     def AppendPrefix(self,  o):
#         if type(o)==ListType:
#             self.lPrefix.extend(o)
#         else:
#             self.lPrefix.append(o)
#     # --------------------------------------------------------------------------
#     def AppendPostfix(self, o):
#         if type(o)==ListType:
#             self.lPostfix.extend(o)
#         else:
#             self.lPostfix.append(o)
#     # --------------------------------------------------------------------------
#     def GetPrefixAttributes(self ): return self.lPrefix
#     # --------------------------------------------------------------------------
#     def GetPostfixAttributes(self): return self.lPostfix
#     # --------------------------------------------------------------------------
#     def GetString(self): return str.__str__(self)
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def upper(self):
#         return self.sCreateCopy(str.__str__(self).upper())
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def lower(self):
#         return self.sCreateCopy(str.__str__(self).lower())
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def capitalize(self):
#         return self.sCreateCopy(str.__str__(self).capitalize())
#     # --------------------------------------------------------------------------
#     #def ToList(self, stylesheet, l): return l.append(str.__str__(self))
#     def ToList(self, stylesheet, l): return l.append(self)
#     # --------------------------------------------------------------------------
#     #def __repr__(self): return str.__str__(self)
#     # Debug: output an attribute string with all attributes
#     def __repr__(self):
#         return "%s-%s-%s"%(`self.lPrefix`,str.__str__(self),`self.lPostfix`)


import string
    import sys
from types               import StringType
from AOR.AttributeString import AttributeString
        sLine = "+%s+"%("-"*(self.nWidth+2))
        if self.nHeight==1:
            l     = [sLine]+["\|"]
            lPosX = [1,     0]
            lPosY = [0,     1]
            dx    = 3
        else:
            l     = [sLine]+["|"]*(self.nHeight-2)+["\ |","\|"]
            lPosX = [2]    +[2  ]*(self.nHeight-2)+[0    ,1   ]
            lPosY = range(self.nHeight+1)
            dx    = 4

        self.MoveDown(1)
        self.MoveRight(dx)
        self.lElements = l     + self.lElements
        self.lPosX     = lPosX + self.lPosX
        self.lPosY     = lPosY + self.lPosY
        if self.nHeight>1:
            self.lElements.append("|")
            self.lPosX.append(self.nWidth+5)
            self.lPosY.append(1)
        self.nHeight   = self.nHeight   + 1
        self.nWidth    = self.nWidth    + dx + 2

# ==============================================================================
# A layout object that can display an abs-value: |x|
class Abs2d(Layout2d):
    def __init__(self, o=None):
        Layout2d.__init__(self)
        if o:

# Path: AOR/AttributeString.py
# class AttributeString(str):
#     def __init__(self, s):
#         str.__init__(self, s)
#         # If this object is initialised with an AttributeString,
#         # copy the attributes as well
#         if isinstance(s, AttributeString):
#             self.lPrefix  = s.GetPrefixAttributes()[:]
#             self.lPostfix = s.GetPostfixAttributes()[:]
#         else:
#             self.lPrefix  = []
#             self.lPostfix = []
#     # --------------------------------------------------------------------------
#     # Creates a new attribute string which has the same pre- and postfix
#     # attributes, but a new string.
#     def sCreateCopy(self, s):
#         new = AttributeString(s)
#         new.SetPrefixAttributes(self.GetPrefixAttributes())
#         new.SetPostfixAttributes(self.GetPostfixAttributes())
#         return new
#     # --------------------------------------------------------------------------
#     # Splits an AttributeString into two strings, the first one containing
#     # all prefix attributes, the second one all postfix ones. The parameter
#     # n specified the number of character to for the first string.
#     def tSplitString(self, n):
#         s1 = AttributeString(self[0:n])
#         s2 = AttributeString(self[n: ])
#         s1.SetPrefixAttributes(self.GetPrefixAttributes())
#         s2.SetPostfixAttributes(self.GetPostfixAttributes())
#         return s1,s2
#     # --------------------------------------------------------------------------
#     def SetPrefixAttributes(self,  l) : self.lPrefix = l[:]
#     # --------------------------------------------------------------------------
#     def SetPostfixAttributes(self, l) : self.lPostfix = l[:]
#     # --------------------------------------------------------------------------
#     def AppendPrefix(self,  o):
#         if type(o)==ListType:
#             self.lPrefix.extend(o)
#         else:
#             self.lPrefix.append(o)
#     # --------------------------------------------------------------------------
#     def AppendPostfix(self, o):
#         if type(o)==ListType:
#             self.lPostfix.extend(o)
#         else:
#             self.lPostfix.append(o)
#     # --------------------------------------------------------------------------
#     def GetPrefixAttributes(self ): return self.lPrefix
#     # --------------------------------------------------------------------------
#     def GetPostfixAttributes(self): return self.lPostfix
#     # --------------------------------------------------------------------------
#     def GetString(self): return str.__str__(self)
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def upper(self):
#         return self.sCreateCopy(str.__str__(self).upper())
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def lower(self):
#         return self.sCreateCopy(str.__str__(self).lower())
#     # --------------------------------------------------------------------------
#     # We have to overwrite this method so that a new AttributeString is
#     # returned!
#     def capitalize(self):
#         return self.sCreateCopy(str.__str__(self).capitalize())
#     # --------------------------------------------------------------------------
#     #def ToList(self, stylesheet, l): return l.append(str.__str__(self))
#     def ToList(self, stylesheet, l): return l.append(self)
#     # --------------------------------------------------------------------------
#     #def __repr__(self): return str.__str__(self)
#     # Debug: output an attribute string with all attributes
#     def __repr__(self):
#         return "%s-%s-%s"%(`self.lPrefix`,str.__str__(self),`self.lPostfix`)


# Path: Stylesheets/new/Layout2d.py
import string
    import sys
from types               import StringType
from AOR.AttributeString import AttributeString

        sLine = "+%s+"%("-"*(self.nWidth+2))
        if self.nHeight==1:
            l     = [sLine]+["\|"]
            lPosX = [1,     0]
            lPosY = [0,     1]
            dx    = 3
        else:
            l     = [sLine]+["|"]*(self.nHeight-2)+["\ |","\|"]
            lPosX = [2]    +[2  ]*(self.nHeight-2)+[0    ,1   ]
            lPosY = range(self.nHeight+1)
            dx    = 4

        self.MoveDown(1)
        self.MoveRight(dx)
        self.lElements = l     + self.lElements
        self.lPosX     = lPosX + self.lPosX
        self.lPosY     = lPosY + self.lPosY
        if self.nHeight>1:
            self.lElements.append("|")
            self.lPosX.append(self.nWidth+5)
            self.lPosY.append(1)
        self.nHeight   = self.nHeight   + 1
        self.nWidth    = self.nWidth    + dx + 2

# ==============================================================================
# A layout object that can display an abs-value: |x|
class Abs2d(Layout2d):
    def __init__(self, o=None):
        Layout2d.__init__(self)
        if o:

            self.append(o)