本文整理汇总了Python中gui.bitmap_loader.BitmapLoader.getBitmap方法的典型用法代码示例。如果您正苦于以下问题:Python BitmapLoader.getBitmap方法的具体用法?Python BitmapLoader.getBitmap怎么用?Python BitmapLoader.getBitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.bitmap_loader.BitmapLoader
的用法示例。
在下文中一共展示了BitmapLoader.getBitmap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SetupImageList
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def SetupImageList(self):
self.imageList.RemoveAll()
self.blank_icon = self.imageList.Add(BitmapLoader.getBitmap("transparent16x16", "gui"))
self.unknown_icon = self.imageList.Add(BitmapLoader.getBitmap("0", "icons"))
self.paramList.AssignImageList(self.imageList)
示例2: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent, **kwargs):
PFSearchBox.__init__(self, parent, **kwargs)
cancelBitmap = BitmapLoader.getBitmap("fit_delete_small", "gui")
searchBitmap = BitmapLoader.getBitmap("fsearch_small", "gui")
self.SetSearchBitmap(searchBitmap)
self.SetCancelBitmap(cancelBitmap)
self.ShowSearchButton()
self.ShowCancelButton()
示例3: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
wx.Panel.__init__(self, parent)
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
self.SetSizer(mainSizer)
mainSizer.Add(wx.StaticText(self, wx.ID_ANY, "Character: "), 0, wx.CENTER | wx.RIGHT | wx.LEFT, 3)
# cache current selection to fall back in case we choose to open char editor
self.charCache = None
self.charChoice = wx.Choice(self)
mainSizer.Add(self.charChoice, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.LEFT, 3)
self.refreshCharacterList()
self.cleanSkills = BitmapLoader.getBitmap("skill_big", "gui")
self.redSkills = BitmapLoader.getBitmap("skillRed_big", "gui")
self.greenSkills = BitmapLoader.getBitmap("skillGreen_big", "gui")
self.refresh = BitmapLoader.getBitmap("refresh", "gui")
self.needsSkills = False
self.btnRefresh = wx.BitmapButton(self, wx.ID_ANY, self.refresh)
size = self.btnRefresh.GetSize()
self.btnRefresh.SetMinSize(size)
self.btnRefresh.SetMaxSize(size)
self.btnRefresh.SetToolTip("Refresh API")
self.btnRefresh.Bind(wx.EVT_BUTTON, self.refreshApi)
self.btnRefresh.Enable(False)
mainSizer.Add(self.btnRefresh, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.LEFT, 2)
self.skillReqsStaticBitmap = wx.StaticBitmap(self)
self.skillReqsStaticBitmap.SetBitmap(self.cleanSkills)
mainSizer.Add(self.skillReqsStaticBitmap, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.LEFT, 3)
self.skillReqsStaticBitmap.Bind(wx.EVT_RIGHT_UP, self.OnContextMenu)
self.Bind(wx.EVT_CHOICE, self.charChanged)
self.mainFrame.Bind(GE.CHAR_LIST_UPDATED, self.refreshCharacterList)
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
self.SetMinSize(wx.Size(25, -1))
self.toggleRefreshButton()
self.charChoice.Enable(False)
示例4: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent, stuff, item):
wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL)
# itemId is set by the parent.
self.romanNb = ["0", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"]
self.skillIdHistory = []
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.reqTree = wx.TreeCtrl(self, style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT | wx.NO_BORDER)
mainSizer.Add(self.reqTree, 1, wx.ALL | wx.EXPAND, 0)
self.SetSizer(mainSizer)
self.root = self.reqTree.AddRoot("WINRARZOR")
self.reqTree.SetItemData(self.root, None)
self.imageList = wx.ImageList(16, 16)
self.reqTree.SetImageList(self.imageList)
skillBookId = self.imageList.Add(BitmapLoader.getBitmap("skill_small", "gui"))
self.getFullSkillTree(item, self.root, skillBookId)
self.reqTree.ExpandAll()
self.Layout()
示例5: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent, categoryID, fittingInfo, size=(0, 16)):
SFBrowserItem.__init__(self, parent, size=size)
if categoryID:
self.shipBmp = BitmapLoader.getBitmap("ship_small", "gui")
else:
self.shipBmp = wx.Bitmap(16, 16)
self.dropShadowBitmap = drawUtils.CreateDropShadowBitmap(self.shipBmp, 0.2)
self.categoryID = categoryID
self.fittingInfo = fittingInfo
self.shipBrowser = self.Parent.Parent
self.padding = 4
self.fontBig = wx.Font(fonts.BIG, wx.SWISS, wx.NORMAL, wx.NORMAL)
self.animTimerId = wx.NewId()
self.animTimer = wx.Timer(self, self.animTimerId)
self.animStep = 0
self.animPeriod = 10
self.animDuration = 100
self.Bind(wx.EVT_TIMER, self.OnTimer)
# =====================================================================
# Disabled - it will be added as an option to Preferences
self.animCount = 0
示例6: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent, entityName):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, style=wx.TAB_TRAVERSAL)
self.entityName = entityName
self.validator = None
self.navSizer = wx.BoxSizer(wx.HORIZONTAL)
self.choices = []
self.choices.sort(key=lambda p: p.name)
self.entityChoices = wx.Choice(self, choices=[p.name for p in self.choices])
self.navSizer.Add(self.entityChoices, 1, wx.ALL, 5)
buttons = (("new", wx.ART_NEW, self.OnNew),
("rename", BitmapLoader.getBitmap("rename", "gui"), self.OnRename),
("copy", wx.ART_COPY, self.OnCopy),
("delete", wx.ART_DELETE, self.OnDelete))
size = None
for name, art, func in buttons:
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON) if name != "rename" else art
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
if size is None:
size = btn.GetSize()
btn.SetMinSize(size)
btn.SetMaxSize(size)
btn.SetToolTip("{} {}".format(name.capitalize(), self.entityName))
btn.Bind(wx.EVT_BUTTON, func)
setattr(self, "btn%s" % name.capitalize(), btn)
self.navSizer.Add(btn, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 2)
self.SetSizer(self.navSizer)
self.Layout()
self.refreshEntityList()
示例7: addMarketViewImage
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def addMarketViewImage(self, iconFile):
if iconFile is None:
return -1
bitmap = BitmapLoader.getBitmap(iconFile, "icons")
if bitmap is None:
return -1
else:
return self.availableImplantsImageList.Add(bitmap)
示例8: RebuildRaces
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def RebuildRaces(self, races):
self.raceBmps = []
for race in races:
if race:
self.raceBmps.append(BitmapLoader.getBitmap("race_%s_small" % race, "gui"))
self.raceNames = races
self.CalcButtonsBarPos()
self.Refresh()
示例9: GetImageIndex
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def GetImageIndex(self, *loaderArgs):
id_ = self.map.get(loaderArgs)
if id_ is None:
bitmap = BitmapLoader.getBitmap(*loaderArgs)
if bitmap is None:
return -1
id_ = self.map[loaderArgs] = wx.ImageList.Add(self, bitmap)
return id_
示例10: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, fittingView, params):
ViewColumn.__init__(self, fittingView)
self.mask = wx.LIST_MASK_IMAGE
Attribute.getInstance().getAttributeInfo("capacitorNeed")
self.imageId = fittingView.imageList.GetImageIndex("capacitorRecharge_small", "gui")
self.bitmap = BitmapLoader.getBitmap("capacitorRecharge_small", "gui")
示例11: getIcons
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def getIcons(self):
icons = {}
sAttr = Attribute.getInstance()
for key, attrName in self.propertyAttributeMap.items():
iconFile = sAttr.getAttributeInfo(attrName).iconID
bitmap = BitmapLoader.getBitmap(iconFile, "icons")
if bitmap:
icons[key] = bitmap
return icons
示例12: updateGraphWidgets
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def updateGraphWidgets(self):
view = self.getView()
view.clearCache()
self.graphSubselSizer.Clear()
self.inputsSizer.Clear()
for child in self.graphCtrlPanel.Children:
if child is not self.showY0Cb:
child.Destroy()
self.fields.clear()
# Setup view options
self.selectedYRbMap.clear()
if len(view.yDefs) > 1:
i = 0
for yAlias, yDef in view.yDefs.items():
if i == 0:
rdo = wx.RadioButton(self.graphCtrlPanel, wx.ID_ANY, yDef.switchLabel, style=wx.RB_GROUP)
else:
rdo = wx.RadioButton(self.graphCtrlPanel, wx.ID_ANY, yDef.switchLabel)
rdo.Bind(wx.EVT_RADIOBUTTON, self.OnYTypeUpdate)
if i == (self.selectedY or 0):
rdo.SetValue(True)
self.graphSubselSizer.Add(rdo, 0, wx.ALL | wx.EXPAND, 0)
self.selectedYRbMap[yDef.switchLabel] = i
i += 1
# Setup inputs
for fieldHandle, fieldDef in (('x', view.xDef), *view.extraInputs.items()):
textBox = wx.TextCtrl(self.graphCtrlPanel, wx.ID_ANY, style=0)
self.fields[fieldHandle] = textBox
textBox.Bind(wx.EVT_TEXT, self.onFieldChanged)
self.inputsSizer.Add(textBox, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
if fieldDef.inputDefault is not None:
inputDefault = fieldDef.inputDefault
if not isinstance(inputDefault, str):
inputDefault = ("%f" % inputDefault).rstrip("0")
if inputDefault[-1:] == ".":
inputDefault += "0"
textBox.ChangeValue(inputDefault)
imgLabelSizer = wx.BoxSizer(wx.HORIZONTAL)
if fieldDef.inputIconID:
icon = BitmapLoader.getBitmap(fieldDef.inputIconID, "icons")
if icon is not None:
static = wx.StaticBitmap(self.graphCtrlPanel)
static.SetBitmap(icon)
imgLabelSizer.Add(static, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 1)
imgLabelSizer.Add(wx.StaticText(self.graphCtrlPanel, wx.ID_ANY, fieldDef.inputLabel), 0,
wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
self.inputsSizer.Add(imgLabelSizer, 0, wx.ALIGN_CENTER_VERTICAL)
self.Layout()
self.draw()
示例13: addCharge
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def addCharge(self, menu, charge):
id_ = ContextMenuCombined.nextID()
name = charge.name if charge is not None else "Empty"
self.chargeIds[id_] = charge
item = wx.MenuItem(menu, id_, name)
menu.Bind(wx.EVT_MENU, self.handleAmmoSwitch, item)
item.charge = charge
if charge is not None and charge.iconID is not None:
bitmap = BitmapLoader.getBitmap(charge.iconID, "icons")
if bitmap is not None:
item.SetBitmap(bitmap)
return item
示例14: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)
self.SetTitle("pyfa - Preferences")
i = wx.Icon(BitmapLoader.getBitmap("preferences_small", "gui"))
self.SetIcon(i)
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT)
self.listview = self.listbook.GetListView()
# self.listview.SetMinSize((500, -1))
# self.listview.SetSize((500, -1))
self.imageList = wx.ImageList(32, 32)
self.listbook.AssignImageList(self.imageList)
mainSizer.Add(self.listbook, 1, wx.EXPAND | wx.TOP | wx.BOTTOM | wx.LEFT, 5)
self.m_staticline2 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline2, 0, wx.EXPAND, 5)
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
btnSizer.AddStretchSpacer()
self.btnOK = wx.Button(self, wx.ID_ANY, "OK", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnOK, 0, wx.ALL, 5)
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
self.SetSizer(mainSizer)
self.Centre(wx.BOTH)
for prefView in PreferenceView.views:
page = wx.ScrolledWindow(self.listbook)
page.SetScrollRate(15, 15)
bmp = prefView.getImage()
if bmp:
imgID = self.imageList.Add(bmp)
else:
imgID = -1
prefView.populatePanel(page)
self.listbook.AddPage(page, prefView.title, imageId=imgID)
bestFit = self.GetBestVirtualSize()
width = max(bestFit[0], 800 if "wxGTK" in wx.PlatformInfo else 650)
height = max(bestFit[1], 550)
self.SetSize(width, height)
self.Layout()
self.btnOK.Bind(wx.EVT_BUTTON, self.OnBtnOK)
self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)
示例15: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getBitmap [as 别名]
def __init__(self, fittingView, params=None):
if params is None:
params = {"showIcon": True, "displayName": False}
ViewColumn.__init__(self, fittingView)
if params["showIcon"]:
self.imageId = fittingView.imageList.GetImageIndex("column_misc", "gui")
self.bitmap = BitmapLoader.getBitmap("column_misc", "gui")
self.mask = wx.LIST_MASK_IMAGE
else:
self.imageId = -1
if params["displayName"] or self.imageId == -1:
self.columnText = "Misc data"
self.mask |= wx.LIST_MASK_TEXT
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.fittingView = fittingView