예제 #1
0
    def Init(self, text):

        #self._Fonts["normal"] = fonts["veramono12"]

        l = Label()
        l._PosX = 10
        l.SetCanvasHWND(self._Parent._CanvasHWND)

        l.Init(text, self._Fonts["normal"])
        self._Labels["Text"] = l

        add_icon = IconItem()
        add_icon._ImgSurf = MyIconPool.GiveIconSurface("add")
        add_icon._CanvasHWND = self._CanvasHWND
        add_icon._Parent = self
        add_icon.Init(0, 0, MyIconPool.Width("add"), MyIconPool.Height("add"),
                      0)

        ware_icon = IconItem()
        ware_icon._ImgSurf = MyIconPool.GiveIconSurface("ware")
        ware_icon._CanvasHWND = self._CanvasHWND
        ware_icon._Parent = self
        ware_icon.Init(0, 0, MyIconPool.Width("ware"),
                       MyIconPool.Height("ware"), 0)

        app_icon = IconItem()
        app_icon._ImgSurf = MyIconPool.GiveIconSurface("app")
        app_icon._CanvasHWND = self._CanvasHWND
        app_icon._Parent = self
        app_icon.Init(0, 0, MyIconPool.Width("app"), MyIconPool.Height("app"),
                      0)

        appdling_icon = IconItem()
        appdling_icon._ImgSurf = MyIconPool.GiveIconSurface("appdling")
        appdling_icon._CanvasHWND = self._CanvasHWND
        appdling_icon._Parent = self
        appdling_icon.Init(0, 0, MyIconPool.Width("appdling"),
                           MyIconPool.Height("appdling"), 0)

        blackheart_icon = IconItem()
        blackheart_icon._ImgSurf = MyIconPool.GiveIconSurface("blackheart")
        blackheart_icon._Width = MyIconPool.Width("blackheart")
        blackheart_icon._Height = MyIconPool.Height("blackheart")
        blackheart_icon._CanvasHWND = self._CanvasHWND
        blackheart_icon._Parent = self

        self._Icons["add"] = add_icon
        self._Icons["ware"] = ware_icon
        self._Icons["app"] = app_icon
        self._Icons["appdling"] = appdling_icon
        self._Icons["blackheart"] = blackheart_icon
예제 #2
0
    def Init(self):
        self._PosX = self._Index * self._Screen._Width
        self._Width = self._Screen._Width
        self._Height = self._Screen._Height

        self._CanvasHWND = self._Screen._CanvasHWND

        self._BGpng = IconItem()
        self._BGpng._ImgSurf = MyIconPool.GiveIconSurface(self._BG)
        self._BGpng._MyType = ICON_TYPES["STAT"]
        self._BGpng._Parent = self
        #print( MyIconPool.Width(self._BG),MyIconPool.Height(self._BG) )
        self._BGpng.Adjust(0, 0, MyIconPool.Width(self._BG),
                           MyIconPool.Height(self._BG), 0)

        self._Board = Textbulletinboard()

        self._Board._PosX = 4
        self._Board._PosY = 100
        self._Board._Width = self._Width - 4 * 2
        self._Board._Height = 200
        self._Board._CanvasHWND = self._CanvasHWND
        self._Board._Align = "Center"
        self._Board._RowPitch = 28
        self._Board.Init()

        if self._Leader != None and self._Leader._ComPkgInfo != None:
            if "NotFoundMsg" in self._Leader._ComPkgInfo:
                d = []
                for i, v in enumerate(self._Leader._ComPkgInfo["NotFoundMsg"]):
                    Color = None
                    Font = None
                    Bold = False
                    Und = False
                    Txt = ""
                    parts = v.split("|")
                    if len(parts) > 0:
                        Txt = parts[0]

                    if len(parts) == 2:
                        if parts[1] != "None":
                            Color = MySkinManager.GiveColor(parts[1])
                    elif len(parts) == 3:
                        if parts[1] != "None":
                            Color = MySkinManager.GiveColor(parts[1])
                        if parts[2] != "None":
                            Font = MyLangManager.TrFont(parts[2])
                    elif len(parts) == 4:
                        if parts[1] != "None":
                            Color = MySkinManager.GiveColor(parts[1])
                        if parts[2] != "None":
                            Font = MyLangManager.TrFont(parts[2])
                        if parts[3] == "True":
                            Bold = True
                    elif len(parts) == 5:
                        if parts[1] != "None":
                            Color = MySkinManager.GiveColor(parts[1])
                        if parts[2] != "None":
                            Font = MyLangManager.TrFont(parts[2])
                        if parts[3] == "True":
                            Bold = True
                        if parts[4] == "True":
                            Und = True

                    a = Text(Txt, Color, Font, Bold, Und)
                    d = d + a.Words()

                self._Board.SetAndBlitText(d)