Example #1
0
 def UpdateLabel(self, new=0):
     label = uix.GetItemLabel(self.rec, self.sr.node, new)
     if self.sr.node.viewMode in ('list', 'details'):
         self.sr.label.text = label
         return
     self.sr.label.text = label
     quantity = uix.GetItemQty(self.sr.node, 'ss')
     if self.rec.singleton or self.rec.typeID in (const.typeBookmark, ):
         if self.sr.qtypar:
             self.sr.qtypar.Close()
             self.sr.qtypar = None
         return
     if not self.sr.qtypar:
         self.sr.qtypar = uiprimitives.Container(parent=self,
                                                 idx=0,
                                                 name='qtypar',
                                                 pos=(0, 53, 32, 11),
                                                 align=uiconst.TOPRIGHT,
                                                 state=uiconst.UI_DISABLED,
                                                 bgColor=(0, 0, 0, 0.95))
         self.sr.quantity_label = uicontrols.Label(parent=self.sr.qtypar,
                                                   left=2,
                                                   maxLines=1,
                                                   fontsize=9)
     self.sr.quantity_label.text = quantity
Example #2
0
 def OnMouseEnter(self, *args):
     if uicore.uilib.leftbtn:
         return
     SE_BaseClassCore.OnMouseEnter(self, *args)
     self.sr.hint = ''
     if getattr(self, 'rec', None):
         TryGhostFitItemOnMouseAction(self.rec)
     if self.sr.node and self.sr.node.viewMode == 'icons':
         self.sr.hint = '%s%s' % (
             [uix.GetItemQty(self.sr.node, 'ln') + ' - ', ''][bool(
                 self.rec.singleton)],
             uix.GetItemName(self.sr.node.item, self.sr.node))
Example #3
0
 def OnMouseEnter(self, *args):
     if uicore.uilib.leftbtn:
         return
     SE_BaseClassCore.OnMouseEnter(self, *args)
     self.sr.hint = ''
     wnd = FittingWindow.GetIfOpen()
     if wnd is not None:
         if getattr(self, 'rec', None):
             wnd.HiliteFitting(self.rec)
     if self.sr.node and self.sr.node.viewMode == 'icons':
         self.sr.hint = '%s%s' % (
             [uix.GetItemQty(self.sr.node, 'ln') + ' - ', ''][bool(
                 self.rec.singleton)],
             uix.GetItemName(self.sr.node.item, self.sr.node))
Example #4
0
 def OnMouseEnter(self, *args):
     if uicore.uilib.leftbtn:
         return
     self.sr.hint = ''
     wnd = form.FittingWindow.GetIfOpen()
     if wnd is not None:
         if getattr(self, 'rec', None):
             wnd.HiliteFitting(self.rec)
     if self.sr.node:
         if self.sr.node.viewMode == 'icons':
             self.sr.hint = '%s%s' % (
                 [uix.GetItemQty(self.sr.node, 'ln') + ' - ', ''][bool(
                     self.rec.singleton)],
                 uix.GetItemName(self.sr.node.item, self.sr.node))
         else:
             eve.Message('ListEntryEnter')
         self.ShowHilited()
Example #5
0
 def GetHint(self, *args):
     ret = uix.GetItemName(self.sr.node.item, self.sr.node)
     if self.rec.stacksize > 1:
         quantity = uix.GetItemQty(self.sr.node, 'ln')
         ret = localization.GetByLabel('UI/Inventory/QuantityAndName',
                                       quantity=quantity,
                                       name=ret)
     marketPrice = util.GetAveragePrice(self.rec)
     if marketPrice is None:
         marketPriceStr = localization.GetByLabel(
             'UI/Inventory/PriceUnavailable')
     else:
         marketPriceStr = util.FmtISKAndRound(marketPrice)
     ret += '<br>' + localization.GetByLabel(
         'UI/Inventory/ItemEstimatedPrice', estPrice=marketPriceStr)
     if self.rec.stacksize > 1 and marketPrice:
         ret += '<br>' + localization.GetByLabel(
             'UI/Inventory/ItemEstimatedPriceStack',
             estPrice=util.FmtISKAndRound(marketPrice * self.rec.stacksize))
     return ret