importlara eklenir import nano_interface daha sonra ise class Board aratılır üstüne class SpecialEditLine(EditLine): __placeHolderFontColor = 200 def __init__(self): EditLine.__init__(self) self.useIME = TRUE self.CanClick = TRUE self.input = ImageBox() self.input.Show() self.placeHolder = TextLine() self.placeHolder.SetFontColor(self.__placeHolderFontColor, self.__placeHolderFontColor, self.__placeHolderFontColor) self.placeHolder.Hide() self.__ShowPlaceHolder() def inputStatus(self, status = 1): if status == 1: self.input.LoadImage(nano_interface.PATCH + "input/input_normal.png") elif status == 2: self.input.LoadImage(nano_interface.PATCH + "input/input_active.png") def SetParent(self, parent): self.input.SetParent(parent) self.placeHolder.SetParent(self.input) EditLine.SetParent(self, parent) def SetSize(self, width, height): EditLine.SetSize(self, width, height) self.placeHolder.SetSize(width, height) def SetPosition(self, x, y): EditLine.SetPosition(self, x+10, y+9) self.input.SetPosition(x, y) self.placeHolder.SetPosition(10, 9) def OnSetFocus(self): EditLine.OnSetFocus(self) self.__HidePlaceHolder() def OnKillFocus(self): EditLine.OnKillFocus(self) if self.GetText() == "": self.__ShowPlaceHolder() else: self.__HidePlaceHolder() def SetSecret(self, value=TRUE): EditLine.SetSecret(self) self.__secret = value def __ShowPlaceHolder(self): # EditLine.Hide(self) self.inputStatus(1) self.placeHolder.Show() def __HidePlaceHolder(self): # EditLine.Show(self) self.inputStatus(2) self.placeHolder.Hide() def SetPlaceHolderText(self, text): self.placeHolder.SetText(text) self.__ShowPlaceHolder() def HidePlace(self): self.__HidePlaceHolder() def SetPlaceHolderTextColor(self, color): self.placeHolder.SetPackedFontColor(color) def __del__(self): EditLine.__del__(self) class TextLink(Window): ## COLORS NORMAL_COLOR = 0xffc8aa51 OVER_COLOR = 0xffe6d0a2 DOWN_COLOR = 0xffefe4cd def __init__(self): Window.__init__(self) self.eventFunc = None self.eventArgs = None self.text = TextLine() self.text.SetParent(self) self.text.SetPackedFontColor(self.NORMAL_COLOR) self.text.Show() self.underline = TextLine() self.underline.SetParent(self) self.underline.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def __del__(self): Window.__del__(self) def SetText(self, text): self.text.SetText(text) self.text.SetFontName("Tahoma Bold:13") self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1]) self.underline.SetPosition(-20, self.text.GetTextSize()[1]) self.underline.SetWindowHorizontalAlignCenter() self.underline.SetSize(self.text.GetTextSize()[0], 0) def OnMouseOverIn(self): self.text.SetPackedFontColor(self.OVER_COLOR) self.underline.Show() def OnMouseOverOut(self): self.text.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def OnMouseLeftButtonDown(self): self.text.SetPackedFontColor(self.DOWN_COLOR) self.underline.SetPackedFontColor(self.DOWN_COLOR) self.underline.Show() def OnMouseLeftButtonUp(self): if self.eventFunc: apply(self.eventFunc, self.eventArgs) self.OnMouseOverOut() def SetEvent(self, event, *args): self.eventFunc = event self.eventArgs = args class TextLinkLogin(Window): ## COLORS NORMAL_COLOR = 0xff03969b OVER_COLOR = 0xffcdfadd DOWN_COLOR = 0xffadfafa def __init__(self): Window.__init__(self) self.eventFunc = None self.eventArgs = None self.text = TextLine() self.text.SetParent(self) self.text.SetFontName("Tahoma Bold:13") self.text.SetPackedFontColor(self.NORMAL_COLOR) self.text.Show() self.underline = TextLine() self.underline.SetParent(self) self.underline.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def __del__(self): Window.__del__(self) def SetText(self, text): self.text.SetText(text) self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1]) self.underline.SetPosition(-20, self.text.GetTextSize()[1]) self.underline.SetWindowHorizontalAlignCenter() self.underline.SetSize(self.text.GetTextSize()[0], 0) def OnMouseOverIn(self): self.text.SetPackedFontColor(self.OVER_COLOR) self.underline.Show() def OnMouseOverOut(self): self.text.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def OnMouseLeftButtonDown(self): self.text.SetPackedFontColor(self.DOWN_COLOR) self.underline.SetPackedFontColor(self.DOWN_COLOR) self.underline.Show() def OnMouseLeftButtonUp(self): if self.eventFunc: apply(self.eventFunc, self.eventArgs) self.OnMouseOverOut() def SetEvent(self, event, *args): self.eventFunc = event self.eventArgs = args class SpecialBoard(ImageBox): timeToFade = 0.100 interval = 0.1 fadeIn = 0 fadeOut = 0 currentTime = 0 intervallEndTime = 0 currentAlphaValue = 0 def __init__(self): ImageBox.__init__(self) def __del__(self): ImageBox.__del__(self) def LoadImage(self, imageName): ImageBox.LoadImage(self, imageName) self.SetAlpha(0.0) def SetAlpha(self, alpha): self.currentAlphaValue = alpha ImageBox.SetAlpha(self, alpha) def OnUpdate(self): self.currentTime = time.clock() if self.fadeIn == 1 or self.fadeOut == 1: if self.currentAlphaValue < 1.0 and self.currentAlphaValue >= 0.0: if self.currentTime >= self.intervallEndTime: newAlphaValue = self.currentAlphaValue if self.fadeIn == 1: newAlphaValue += self.interval else: newAlphaValue -= self.interval self.SetAlpha(newAlphaValue) self.intervallEndTime = self.currentTime + self.timeToFade else: self.fadeIn = self.fadeOut = 0 def FadeIn(self): self.Show() self.SetAlpha(0.0) self.fadeOut = 0 self.intervallEndTime = self.currentTime + self.timeToFade self.fadeIn = 1 def FadeOut(self): self.Show() self.SetAlpha(1.0) self.fadeIn = 0 self.intervallEndTime = self.currentTime + self.timeToFade self.fadeOut = 1 def fadeProgressFinished(self): if self.fadeIn == 0 and self.fadeOut == 0: return 1 else: return 0 def SAFE_SetEvent(self, func, *args): self.eventFunc = __mem_func__(func) self.eventArgs = args def SetEvent(self, func, *args): self.eventFunc = func self.eventArgs = args class NewImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.eventDict={} self.argDict={} self.isButtonStyle = FALSE self.isDown = FALSE self.renderData = {} self.SetWindowName("NONAME_ImageBox") def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name=imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def LoadImageNew(self, addName): imageName = self.name[:self.name.rfind(".")] + str(addName) + self.name[self.name.rfind("."):] self.LoadImage(imageName) def ResetImageNew(self, resetName): imageName = self.name[:self.name.rfind(resetName)] + self.name[self.name.rfind(resetName) + len(resetName):] self.LoadImage(imageName) def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def OnMouseLeftButtonDown(self): self.isDown = TRUE if self.isButtonStyle: self.__SetRenderData("color", SELECT_COLOR) if self.eventDict.has_key("MOUSE_LEFT_DOWN"): apply(self.eventDict["MOUSE_LEFT_DOWN"], self.argDict["MOUSE_LEFT_DOWN"]) def OnMouseLeftButtonUp(self): self.isDown = FALSE self.__ResetRenderData() if self.IsIn(): if self.isButtonStyle: self.__SetRenderData("color", HALF_WHITE_COLOR) if self.eventDict.has_key("MOUSE_LEFT_UP"): apply(self.eventDict["MOUSE_LEFT_UP"], self.argDict["MOUSE_LEFT_UP"]) def OnMouseOverIn(self): if self.isButtonStyle: if self.isDown == FALSE: self.__SetRenderData("color", HALF_WHITE_COLOR) else: self.__SetRenderData("color", SELECT_COLOR) if self.eventDict.has_key("MOUSE_OVER_IN"): apply(self.eventDict["MOUSE_OVER_IN"], self.argDict["MOUSE_OVER_IN"]) def OnMouseOverOut(self): if self.isButtonStyle: if self.isDown == FALSE: self.__ResetRenderData() if self.eventDict.has_key("MOUSE_OVER_OUT"): apply(self.eventDict["MOUSE_OVER_OUT"], self.argDict["MOUSE_OVER_OUT"]) def SAFE_SetStringEvent(self, event, func, *args): self.eventDict[event]=__mem_func__(func) self.argDict[event]=args def ClearStringEvent(self, event): if self.eventDict.has_key(event): del self.eventDict[event] del self.argDict[event] def SetButtonStyle(self, isButtonStyle): self.isButtonStyle = isButtonStyle if self.isButtonStyle == FALSE: self.__ResetRenderData() def __ResetRenderData(self): self.renderData = {"render" : False} def __SetRenderData(self, key, val): self.renderData["render"] = True self.renderData[key] = val def __GetRenderData(self, key): return self.renderData.get(key, False) def OnRender(self): if self.eventDict.has_key("RENDER"): apply(self.eventDict["RENDER"], self.argDict["RENDER"]) def OnAfterRender(self): if not self.__GetRenderData("render"): return x, y, width, height = self.GetRect() grp.SetColor(self.__GetRenderData("color")) grp.RenderBar(x, y, width, height) class NanoLoginBoard(Window): CORNER_WIDTH = 32 CORNER_HEIGHT = 32 LINE_WIDTH = 128 LINE_HEIGHT = 128 LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self): Window.__init__(self) self.MakeBoard() self.MakeBase() def MakeBoard(self): self.Line_left = ExpandedImageBox() self.Line_left.AddFlag("not_pick") self.Line_left.LoadImage(nano_interface.PATCH + "board_login/bar_left.png") self.Line_left.SetParent(self) self.Line_left.SetPosition(0, 0) self.Line_left.Show() self.Line_left.SetPosition(10, self.CORNER_HEIGHT) def MakeBase(self): self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage(nano_interface.PATCH + "board_login/fill.png") self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Line_left.SetRenderingRect(0, 0, 0, verticalShowingPercentage) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) class Nano_Board(Window): CORNER_WIDTH = 32 CORNER_HEIGHT = 32 LINE_WIDTH = 128 LINE_HEIGHT = 128 LT = 0 LB = 1 RT = 2 RB = 3 L = 0 R = 1 T = 2 B = 3 def __init__(self): Window.__init__(self) self.MakeBoard(nano_interface.PATCH + "common/board/Corner_", nano_interface.PATCH + "common/board/bar_") self.MakeBase() def MakeBoard(self, cornerPath, linePath): CornerFileNames = [ cornerPath+dir+".png" for dir in ("LeftTop", "LeftBottom", "RightTop", "RightBottom", ) ] LineFileNames = [ linePath+dir+".png" for dir in ("Left", "Right", "Top", "Bottom", ) ] self.Corners = [] for fileName in CornerFileNames: Corner = ExpandedImageBox() Corner.AddFlag("not_pick") Corner.LoadImage(fileName) Corner.SetParent(self) Corner.SetPosition(0, 0) Corner.Show() self.Corners.append(Corner) self.Lines = [] for fileName in LineFileNames: Line = ExpandedImageBox() Line.AddFlag("not_pick") Line.LoadImage(fileName) Line.SetParent(self) Line.SetPosition(0, 0) Line.Show() self.Lines.append(Line) self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT) self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0) def MakeBase(self): self.Base = ExpandedImageBox() self.Base.AddFlag("not_pick") self.Base.LoadImage(nano_interface.PATCH + "common/board/fill.png") self.Base.SetParent(self) self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Base.Show() def __del__(self): Window.__del__(self) def SetSize(self, width, height): width = max(self.CORNER_WIDTH*2, width) height = max(self.CORNER_HEIGHT*2, height) Window.SetSize(self, width, height) self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT) self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0) self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT) self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT) self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT) verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage) self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0) if self.Base: self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage) class nano_horizontal(Window): BLOCK_WIDTH = 32 BLOCK_HEIGHT = 17 def __init__(self): Window.__init__(self) self.AddFlag("attach") def __del__(self): Window.__del__(self) def Create(self, width): width = max(96, width) imgLeft = ImageBox() imgLeft.SetParent(self) imgLeft.AddFlag("not_pick") imgLeft.LoadImage(nano_interface.PATCH + "horizontal_bar/horizontal_bar_left.png") imgLeft.Show() imgCenter = ExpandedImageBox() imgCenter.SetParent(self) imgCenter.AddFlag("not_pick") imgCenter.LoadImage(nano_interface.PATCH + "horizontal_bar/horizontal_bar_middle.png") imgCenter.Show() imgRight = ImageBox() imgRight.SetParent(self) imgRight.AddFlag("not_pick") imgRight.LoadImage(nano_interface.PATCH + "horizontal_bar/horizontal_bar_right.png") imgRight.Show() self.imgLeft = imgLeft self.imgCenter = imgCenter self.imgRight = imgRight self.SetWidth(width) def SetWidth(self, width): self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2) - self.BLOCK_WIDTH) / self.BLOCK_WIDTH, 0.0) self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0) self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0) self.SetSize(width, self.BLOCK_HEIGHT) class Nano_ImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.eventDict={} self.argDict={} self.isButtonStyle = FALSE self.isDown = FALSE self.renderData = {} self.SetWindowName("NONAME_ImageBox") def __del__(self): Window.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name=imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def LoadImageNew(self, addName): imageName = self.name[:self.name.rfind(".")] + str(addName) + self.name[self.name.rfind("."):] self.LoadImage(imageName) def ResetImageNew(self, resetName): imageName = self.name[:self.name.rfind(resetName)] + self.name[self.name.rfind(resetName) + len(resetName):] self.LoadImage(imageName) def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def OnMouseLeftButtonDown(self): self.isDown = TRUE if self.isButtonStyle: self.__SetRenderData("color", SELECT_COLOR) if self.eventDict.has_key("MOUSE_LEFT_DOWN"): apply(self.eventDict["MOUSE_LEFT_DOWN"], self.argDict["MOUSE_LEFT_DOWN"]) def OnMouseLeftButtonUp(self): self.isDown = FALSE self.__ResetRenderData() if self.IsIn(): if self.isButtonStyle: self.__SetRenderData("color", HALF_WHITE_COLOR) if self.eventDict.has_key("MOUSE_LEFT_UP"): apply(self.eventDict["MOUSE_LEFT_UP"], self.argDict["MOUSE_LEFT_UP"]) def OnMouseOverIn(self): if self.isButtonStyle: if self.isDown == FALSE: self.__SetRenderData("color", HALF_WHITE_COLOR) else: self.__SetRenderData("color", SELECT_COLOR) if self.eventDict.has_key("MOUSE_OVER_IN"): apply(self.eventDict["MOUSE_OVER_IN"], self.argDict["MOUSE_OVER_IN"]) def OnMouseOverOut(self): if self.isButtonStyle: if self.isDown == FALSE: self.__ResetRenderData() if self.eventDict.has_key("MOUSE_OVER_OUT"): apply(self.eventDict["MOUSE_OVER_OUT"], self.argDict["MOUSE_OVER_OUT"]) def SAFE_SetStringEvent(self, event, func, *args): self.eventDict[event]=__mem_func__(func) self.argDict[event]=args # def SetEvent(self, func): # self.eventDict=__mem_func__(func) def SetEvent(self, event): self.event = event def ClearStringEvent(self, event): if self.eventDict.has_key(event): del self.eventDict[event] del self.argDict[event] def SetButtonStyle(self, isButtonStyle): self.isButtonStyle = isButtonStyle if self.isButtonStyle == FALSE: self.__ResetRenderData() def __ResetRenderData(self): self.renderData = {"render" : False} def __SetRenderData(self, key, val): self.renderData["render"] = True self.renderData[key] = val def __GetRenderData(self, key): return self.renderData.get(key, False) def OnRender(self): if self.eventDict.has_key("RENDER"): apply(self.eventDict["RENDER"], self.argDict["RENDER"]) def OnAfterRender(self): if not self.__GetRenderData("render"): return x, y, width, height = self.GetRect() grp.SetColor(self.__GetRenderData("color")) grp.RenderBar(x, y, width, height) class ExpandedImageBoxVertical(ImageBox): def __init__(self, layer = "UI"): ImageBox.__init__(self, layer) def __del__(self): ImageBox.__del__(self) def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterExpandedImageBox(self, layer) def SetScale(self, xScale, yScale): wndMgr.SetScale(self.hWnd, xScale, yScale) def SetOrigin(self, x, y): wndMgr.SetOrigin(self.hWnd, x, y) def SetRotation(self, rotation): wndMgr.SetRotation(self.hWnd, rotation) def SetRenderingMode(self, mode): wndMgr.SetRenderingMode(self.hWnd, mode) # [0.0, 1.0] ?????? ????? ?????? ????? ???. def SetRenderingRect(self, left, top, right, bottom): wndMgr.SetRenderingRect(self.hWnd, left, top, right, bottom) def SetPercentage(self, curValue, maxValue): if maxValue: self.SetRenderingRect(0.0, -1.0 + float(curValue) / float(maxValue), 0.0, 0.0) else: self.SetRenderingRect(0.0, 0.0, 0.0, 0.0) def GetWidth(self): return wndMgr.GetWindowWidth(self.hWnd) def GetHeight(self): return wndMgr.GetWindowHeight(self.hWnd) bu verdiğim kodlar eklenir. elif type'lerin herhangi birisinin üstüne bu kodlar eklenir elif Type == "nano_login_board": parent.Children[Index] = NanoLoginBoard() parent.Children[Index].SetParent(parent) self.LoadElementBoard(parent.Children[Index], ElementValue, parent) elif Type == "nano_text_link": parent.Children[Index] = TextLink() parent.Children[Index].SetParent(parent) self.LoadElementTextLink(parent.Children[Index], ElementValue, parent) elif Type == "nano_text_link_login": parent.Children[Index] = TextLinkLogin() parent.Children[Index].SetParent(parent) self.LoadElementTextLink(parent.Children[Index], ElementValue, parent) elif Type == "nano_horizontal": parent.Children[Index] = nano_horizontal() parent.Children[Index].SetParent(parent) self.LoadElementHorizontalBar(parent.Children[Index], ElementValue, parent) elif Type == "special_editline": parent.Children[Index] = SpecialEditLine() parent.Children[Index].SetParent(parent) #self.LoadSpecialEditLine(parent.Children[Index], ElementValue, parent) self.LoadElementEditLine(parent.Children[Index], ElementValue, parent) elif Type == "board_nano": parent.Children[Index] = Nano_Board() parent.Children[Index].SetParent(parent) self.LoadElementBoard(parent.Children[Index], ElementValue, parent) elif Type == "nano_expanded_image": parent.Children[Index] = ExpandedImageBoxVertical() parent.Children[Index].SetParent(parent) self.LoadElementExpandedImage(parent.Children[Index], ElementValue, parent) elif Type == "nano_image": parent.Children[Index] = Nano_ImageBox() parent.Children[Index].SetParent(parent) self.LoadElementImage(parent.Children[Index], ElementValue, parent) Aratılır : def LoadElementEditLine(self, window, value, parentWindow): üstüne eklenir def LoadSpecialEditLine(self, window, value, parentWindow): if FALSE == self.CheckKeyList(value["name"], value, self.EDIT_LINE_KEY_LIST): return FALSE if value.has_key("secret_flag"): window.SetSecret(value["secret_flag"]) if value.has_key("with_codepage"): if value["with_codepage"]: window.bCodePage = TRUE if value.has_key("only_number"): if value["only_number"]: window.SetNumberMode() if value.has_key("enable_codepage"): window.SetIMEFlag(value["enable_codepage"]) if value.has_key("enable_ime"): window.SetIMEFlag(value["enable_ime"]) if value.has_key("limit_width"): window.SetLimitWidth(value["limit_width"]) if value.has_key("color_holder"): window.SetPlaceHolderTextColor(value["color"]) if TRUE == value.has_key("text_holder"): window.SetPlaceHolderText(value["color"]) if value.has_key("multi_line"): if value["multi_line"]: window.SetMultiLine() window.SetMax(int(value["input_limit"])) window.SetSize(int(value["width"]), int(value["height"])) self.LoadElementText(window, value, parentWindow) return TRUE def LoadElementTextLink(self, window, value, parentWindow): if value.has_key("fontsize"): fontSize = value["fontsize"] if "LARGE" == fontSize: window.SetFontName(localeInfo.UI_DEF_FONT_LARGE) elif value.has_key("fontname"): fontName = value["fontname"] window.SetFontName(fontName) if value.has_key("text_horizontal_align"): if "left" == value["text_horizontal_align"]: window.SetHorizontalAlignLeft() elif "center" == value["text_horizontal_align"]: window.SetHorizontalAlignCenter() elif "right" == value["text_horizontal_align"]: window.SetHorizontalAlignRight() if value.has_key("text_vertical_align"): if "top" == value["text_vertical_align"]: window.SetVerticalAlignTop() elif "center" == value["text_vertical_align"]: window.SetVerticalAlignCenter() elif "bottom" == value["text_vertical_align"]: window.SetVerticalAlignBottom() if value.has_key("all_align"): window.SetHorizontalAlignCenter() window.SetVerticalAlignCenter() window.SetWindowHorizontalAlignCenter() window.SetWindowVerticalAlignCenter() if value.has_key("color"): window.SetPackedFontColor(value["color"]) if TRUE == value.has_key("text"): window.SetText(value["text"]) self.LoadDefaultData(window, value, parentWindow) return TRUE