class TextLine(Window):
def __init__(self):
Window.__init__(self)
self.max = 0
self.SetFontName(localeInfo.UI_DEF_FONT)
def __del__(self):
Window.__del__(self)
def RegisterWindow(self, layer):
self.hWnd = wndMgr.RegisterTextLine(self, layer)
def SetMax(self, max):
wndMgr.SetMax(self.hWnd, max)
def SetLimitWidth(self, width):
wndMgr.SetLimitWidth(self.hWnd, width)
def SetMultiLine(self):
wndMgr.SetMultiLine(self.hWnd, True)
def SetHorizontalAlignArabic(self):
wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_ARABIC)
def SetHorizontalAlignLeft(self):
wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_LEFT)
def SetHorizontalAlignRight(self):
wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_RIGHT)
def SetHorizontalAlignCenter(self):
wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER)
def SetVerticalAlignTop(self):
wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_TOP)
def SetVerticalAlignBottom(self):
wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_BOTTOM)
def SetVerticalAlignCenter(self):
wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_CENTER)
def SetSecret(self, Value=True):
wndMgr.SetSecret(self.hWnd, Value)
def SetOutline(self, Value=True):
wndMgr.SetOutline(self.hWnd, Value)
def SetFeather(self, value=True):
wndMgr.SetFeather(self.hWnd, value)
def SetFontName(self, fontName):
wndMgr.SetFontName(self.hWnd, fontName)
def SetDefaultFontName(self):
wndMgr.SetFontName(self.hWnd, localeInfo.UI_DEF_FONT)
def SetFontColor(self, red, green, blue):
wndMgr.SetFontColor(self.hWnd, red, green, blue)
def SetPackedFontColor(self, color):
wndMgr.SetFontColor(self.hWnd, color)
def SetText(self, text):
wndMgr.SetText(self.hWnd, text)
def GetTextLineCount(self):
return wndMgr.GetTextLineCount(self.hWnd)
def DisableEnterToken(self):
wndMgr.DisableEnterToken(self.hWnd)
def SetLineHeight(self, Height):
wndMgr.SetLineHeight(self.hWnd, Height)
def GetLineHeight(self):
return wndMgr.GetLineHeight(self.hWnd)
def GetText(self):
return wndMgr.GetText(self.hWnd)
def GetTextSize(self):
return wndMgr.GetTextSize(self.hWnd)
def GetTextWidth(self):
w, h = self.GetTextSize()
return w
def GetTextHeight(self):
w, h = self.GetTextSize()
return h
def AdjustSize(self):
x, y = self.GetTextSize()
wndMgr.SetWindowSize(self.hWnd, x, y)
def GetRight(self):
return self.GetLeft() + self.GetTextWidth()
def GetBottom(self):
return self.GetTop() + self.GetTextHeight()
def SetCenter(self):
wndMgr.SetWindowPosition(self.hWnd, self.GetLeft() - self.GetTextWidth()/2, self.GetTop())
def SetAllAlign(self):
wndMgr.SetHorizontalAlign(self.hWnd, wndMgr.TEXT_HORIZONTAL_ALIGN_CENTER)
wndMgr.SetVerticalAlign(self.hWnd, wndMgr.TEXT_VERTICAL_ALIGN_CENTER)
self.SetHorizontalAlignCenter()
self.SetVerticalAlignCenter()
self.SetWindowHorizontalAlignCenter()
self.SetWindowVerticalAlignCenter()