def OpenChat(self): self.SetSize(self.CHAT_WINDOW_WIDTH, 25) chat.SetBoardState(self.chatID, chat.BOARD_STATE_EDIT) self.boardState = chat.BOARD_STATE_EDIT (x, y, width, height) = self.GetRect() (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y) else: chat.SetPosition(self.chatID, x + 10, y) chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100) if self.IsShow(): self.btnChatSizing.Show() self.Refresh() self.btnSendWhisper.SetPosition(self.GetWidth() - 50, 2) self.btnSendWhisper.Show() self.btnChatLog.SetPosition(self.GetWidth() - 25, 2) self.btnChatLog.Show() self.chatInputSet.Open() self.chatInputSet.SetTop() self.SetTop()
def OnRender(self): (x, y, width, height) = self.GetRect() if localeInfo.IsARABIC(): grp.SetColor(0x77000000) grp.RenderBar(x + 2, y + 45, 13, height - 45) grp.SetColor(0x77000000) grp.RenderBar(x, y, width, height) grp.SetColor(0x77000000) grp.RenderBox(x, y, width - 2, height) grp.SetColor(0x77000000) grp.RenderBox(x + 1, y + 1, width - 2, height) grp.SetColor(0xff989898) grp.RenderLine(x + width - 13, y + height - 1, 11, -11) grp.RenderLine(x + width - 9, y + height - 1, 7, -7) grp.RenderLine(x + width - 5, y + height - 1, 3, -3) else: grp.SetColor(0x77000000) grp.RenderBar(x + width - 15, y + 45, 13, height - 45) grp.SetColor(0x77000000) grp.RenderBar(x, y, width, height) grp.SetColor(0x77000000) grp.RenderBox(x, y, width - 2, height) grp.SetColor(0x77000000) grp.RenderBox(x + 1, y + 1, width - 2, height) grp.SetColor(0xff989898) grp.RenderLine(x + width - 13, y + height - 1, 11, -11) grp.RenderLine(x + width - 9, y + height - 1, 7, -7) grp.RenderLine(x + width - 5, y + height - 1, 3, -3) ##### chat.ArrangeShowingChat(self.chatID) if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y + height - 25) else: chat.SetPosition(self.chatID, x + 10, y + height - 25) chat.SetHeight(self.chatID, height - 45 - 25) chat.Update(self.chatID) chat.Render(self.chatID)
def RefreshBoardEditState(self): (x, y, width, height) = self.GetRect() (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() self.xBar = x self.yBar = btnY self.widthBar = width self.heightBar = y - btnY + self.EDIT_LINE_HEIGHT self.curHeightBar = self.heightBar if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y) else: chat.SetPosition(self.chatID, x + 10, y) chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT) chat.ArrangeShowingChat(self.chatID) if btnY > y: self.btnChatSizing.SetPosition(btnX, y) self.heightBar = self.EDIT_LINE_HEIGHT
def RefreshBoardViewState(self): (x, y, width, height) = self.GetRect() (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() textAreaHeight = self.visibleLineCount * chat.GetLineStep(self.chatID) if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y + self.EDIT_LINE_HEIGHT) else: chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT) chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100) if self.boardState == chat.BOARD_STATE_EDIT: textAreaHeight += 45 elif self.visibleLineCount != 0: textAreaHeight += 10 + 10 self.xBar = x self.yBar = y + self.EDIT_LINE_HEIGHT - textAreaHeight self.widthBar = width self.heightBar = textAreaHeight self.scrollBar.Hide()