Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TitleBar(Window):
- BLOCK_WIDTH = 77
- BLOCK_HEIGHT = 36
- def __init__(self):
- Window.__init__(self)
- self.AddFlag("attach")
- def __del__(self):
- Window.__del__(self)
- def MakeTitleBar(self, width, color):
- ## ???? Color?? ??????? ???? ????
- width = max(64, width)
- imgLeft = ImageBox()
- imgCenter = ExpandedImageBox()
- imgRight = ImageBox()
- imgLeft.AddFlag("not_pick")
- imgCenter.AddFlag("not_pick")
- imgRight.AddFlag("not_pick")
- imgLeft.SetParent(self)
- imgCenter.SetParent(self)
- imgRight.SetParent(self)
- if localeInfo.IsARABIC():
- imgLeft.LoadImage("locale/ae/ui/pattern/titlebar_left.tga")
- imgCenter.LoadImage("locale/ae/ui/pattern/titlebar_center.tga")
- imgRight.LoadImage("locale/ae/ui/pattern/titlebar_right.tga")
- else:
- imgLeft.LoadImage("d:/ymir work/ui/pattern/titlebar_left.tga")
- imgCenter.LoadImage("d:/ymir work/ui/pattern/titlebar_center.tga")
- imgRight.LoadImage("d:/ymir work/ui/pattern/titlebar_right.tga")
- imgLeft.Show()
- imgCenter.Show()
- imgRight.Show()
- btnClose = Button()
- btnClose.SetParent(self)
- btnClose.SetUpVisual("interface/ui/close_01.tga")
- btnClose.SetOverVisual("interface/ui/close_02.tga")
- btnClose.SetDownVisual("interface/ui/close_03.tga")
- btnClose.SetToolTipText(localeInfo.UI_CLOSE, 0, -23)
- btnClose.Show()
- self.imgLeft = imgLeft
- self.imgCenter = imgCenter
- self.imgRight = imgRight
- self.btnClose = btnClose
- self.SetWidth(width)
- def SetWidth(self, width):
- self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.BLOCK_WIDTH*2) - 84) / 84, 0.0)
- self.imgCenter.SetPosition(self.BLOCK_WIDTH, 0)
- self.imgRight.SetPosition(width - self.BLOCK_WIDTH, 0)
- if localeInfo.IsARABIC():
- self.btnClose.SetPosition(3, 3)
- else:
- self.btnClose.SetPosition(width - self.btnClose.GetWidth() - 25, 10)
- self.SetSize(width, self.BLOCK_HEIGHT)
- def SetCloseEvent(self, event):
- self.btnClose.SetEvent(event)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement