本文整理汇总了Python中gui.bitmap_loader.BitmapLoader.getImage方法的典型用法代码示例。如果您正苦于以下问题:Python BitmapLoader.getImage方法的具体用法?Python BitmapLoader.getImage怎么用?Python BitmapLoader.getImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.bitmap_loader.BitmapLoader
的用法示例。
在下文中一共展示了BitmapLoader.getImage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnCreate
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def OnCreate(self, event):
tab_name = self.tctrl.GetValue()
tab_icon = BitmapLoader.getImage("ship_small", "gui")
self.notebook.AddPage(
title=tab_name,
image=tab_icon if self.icon_check.GetValue() else None,
closeable=self.close_check.GetValue())
示例2: updateTab
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def updateTab(self):
sFit = Fit.getInstance()
fit = sFit.getFit(self.getActiveFit(), basic=True)
bitmap = BitmapLoader.getImage("race_%s_small" % fit.ship.item.race, "gui")
text = "%s: %s" % (fit.ship.item.name, fit.name)
pageIndex = self.parent.GetPageIndex(self)
if pageIndex is not None:
self.parent.SetPageTextIcon(pageIndex, text, bitmap)
示例3: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def __init__(self, parent):
TogglePanel.__init__(self, parent, force_layout=1)
self.SetLabel("Additions")
pane = self.GetContentPanel()
baseSizer = wx.BoxSizer(wx.HORIZONTAL)
pane.SetSizer(baseSizer)
self.notebook = ChromeNotebook(pane, False)
self.notebook.SetMinSize((-1, 1000))
baseSizer.Add(self.notebook, 1, wx.EXPAND)
droneImg = BitmapLoader.getImage("drone_small", "gui")
fighterImg = BitmapLoader.getImage("fighter_small", "gui")
implantImg = BitmapLoader.getImage("implant_small", "gui")
boosterImg = BitmapLoader.getImage("booster_small", "gui")
projectedImg = BitmapLoader.getImage("projected_small", "gui")
gangImg = BitmapLoader.getImage("fleet_fc_small", "gui")
cargoImg = BitmapLoader.getImage("cargo_small", "gui")
notesImg = BitmapLoader.getImage("skill_small", "gui")
self.drone = DroneView(self.notebook)
self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False)
self.fighter = FighterView(self.notebook)
self.notebook.AddPage(self.fighter, "Fighters", image=fighterImg, closeable=False)
self.cargo = CargoView(self.notebook)
self.notebook.AddPage(self.cargo, "Cargo", image=cargoImg, closeable=False)
self.implant = ImplantView(self.notebook)
self.notebook.AddPage(self.implant, "Implants", image=implantImg, closeable=False)
self.booster = BoosterView(self.notebook)
self.notebook.AddPage(self.booster, "Boosters", image=boosterImg, closeable=False)
self.projectedPage = ProjectedView(self.notebook)
self.notebook.AddPage(self.projectedPage, "Projected", image=projectedImg, closeable=False)
self.gangPage = CommandView(self.notebook)
self.notebook.AddPage(self.gangPage, "Command", image=gangImg, closeable=False)
self.notes = NotesView(self.notebook)
self.notebook.AddPage(self.notes, "Notes", image=notesImg, closeable=False)
self.notebook.SetSelection(0)
示例4: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def __init__(self):
"""Renders the add tab button"""
self.add_img = BitmapLoader.getImage("ctabadd", "gui")
self.width = self.add_img.GetWidth()
self.height = self.add_img.GetHeight()
self.region = None
self.tbmp = wx.Bitmap(self.add_img)
self.add_bitmap = None
self.position = (0, 0)
self.highlighted = False
self.InitRenderer()
示例5: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def __init__(self, parent, size=(-1, 24)):
SFItem.SFBrowserItem.__init__(self, parent, size=size)
self.rewBmpH = BitmapLoader.getBitmap("frewind_small", "gui")
self.forwBmp = BitmapLoader.getBitmap("fforward_small", "gui")
self.searchBmpH = BitmapLoader.getBitmap("fsearch_small", "gui")
self.newBmpH = BitmapLoader.getBitmap("fit_add_small", "gui")
self.resetBmpH = BitmapLoader.getBitmap("freset_small", "gui")
self.switchBmpH = BitmapLoader.getBitmap("fit_switch_view_mode_small", "gui")
self.recentBmpH = BitmapLoader.getBitmap("frecent_small", "gui")
switchImg = BitmapLoader.getImage("fit_switch_view_mode_small", "gui")
switchImg = switchImg.AdjustChannels(1, 1, 1, 0.4)
self.switchBmpD = wx.Bitmap(switchImg)
recentImg = BitmapLoader.getImage("frecent_small", "gui")
recentImg = recentImg.AdjustChannels(1, 1, 1, 0.4)
self.recentBmpD = wx.Bitmap(recentImg)
self.resetBmp = self.AdjustChannels(self.resetBmpH)
self.rewBmp = self.AdjustChannels(self.rewBmpH)
self.searchBmp = self.AdjustChannels(self.searchBmpH)
self.switchBmp = self.AdjustChannels(self.switchBmpH)
self.recentBmp = self.AdjustChannels(self.recentBmpH)
self.newBmp = self.AdjustChannels(self.newBmpH)
self.toolbar.AddButton(self.resetBmp, "Ship groups", clickCallback=self.OnHistoryReset,
hoverBitmap=self.resetBmpH)
self.toolbar.AddButton(self.rewBmp, "Back", clickCallback=self.OnHistoryBack, hoverBitmap=self.rewBmpH)
self.btnNew = self.toolbar.AddButton(self.newBmp, "New fitting", clickCallback=self.OnNewFitting,
hoverBitmap=self.newBmpH, show=False)
self.btnSwitch = self.toolbar.AddButton(self.switchBmpD, "Hide empty ship groups",
clickCallback=self.ToggleEmptyGroupsView, hoverBitmap=self.switchBmpH,
show=False)
self.btnRecent = self.toolbar.AddButton(self.recentBmpD, "Recent Fits",
clickCallback=self.ToggleRecentShips, hoverBitmap=self.recentBmpH,
show=True)
modifier = "CTRL" if 'wxMac' not in wx.PlatformInfo else "CMD"
self.toolbar.AddButton(self.searchBmp, "Search fittings ({}+F)".format(modifier), clickCallback=self.ToggleSearchBox,
hoverBitmap=self.searchBmpH)
self.padding = 4
self.lastSearch = ""
self.recentSearches = [] # not used?
self.inSearch = False
self.fontSmall = wx.Font(fonts.SMALL, wx.SWISS, wx.NORMAL, wx.NORMAL)
w, h = size
self.BrowserSearchBox = wx.TextCtrl(self, wx.ID_ANY, "", wx.DefaultPosition,
(-1, h - 2 if 'wxGTK' in wx.PlatformInfo else -1),
(wx.BORDER_NONE if 'wxGTK' in wx.PlatformInfo else 0))
self.BrowserSearchBox.Show(False)
# self.BrowserSearchBox.Bind(wx.EVT_TEXT_ENTER, self.OnBrowserSearchBoxEnter)
# self.BrowserSearchBox.Bind(wx.EVT_KILL_FOCUS, self.OnBrowserSearchBoxLostFocus)
self.BrowserSearchBox.Bind(wx.EVT_KEY_DOWN, self.OnBrowserSearchBoxEsc)
self.BrowserSearchBox.Bind(wx.EVT_TEXT, self.OnScheduleSearch)
self.SetMinSize(size)
self.shipBrowser = self.Parent
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.Bind(wx.EVT_SIZE, self.OnResize)
示例6: __init__
# 需要导入模块: from gui.bitmap_loader import BitmapLoader [as 别名]
# 或者: from gui.bitmap_loader.BitmapLoader import getImage [as 别名]
def __init__(self, title="pyfa"):
pyfalog.debug("Initialize MainFrame")
self.title = title
wx.Frame.__init__(self, None, wx.ID_ANY, self.title)
self.supress_left_up = False
MainFrame.__instance = self
# Load stored settings (width/height/maximized..)
self.LoadMainFrameAttribs()
self.disableOverrideEditor = disableOverrideEditor
# Fix for msw (have the frame background color match panel color
if 'wxMSW' in wx.PlatformInfo:
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
# Load and set the icon for pyfa main window
i = wx.Icon(BitmapLoader.getBitmap("pyfa", "gui"))
self.SetIcon(i)
# Create the layout and windows
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
self.browser_fitting_split = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
self.fitting_additions_split = wx.SplitterWindow(self.browser_fitting_split, style=wx.SP_LIVE_UPDATE)
mainSizer.Add(self.browser_fitting_split, 1, wx.EXPAND | wx.LEFT, 2)
self.fitMultiSwitch = MultiSwitch(self.fitting_additions_split)
self.additionsPane = AdditionsPane(self.fitting_additions_split)
self.notebookBrowsers = ChromeNotebook(self.browser_fitting_split, False)
marketImg = BitmapLoader.getImage("market_small", "gui")
shipBrowserImg = BitmapLoader.getImage("ship_small", "gui")
self.marketBrowser = MarketBrowser(self.notebookBrowsers)
self.notebookBrowsers.AddPage(self.marketBrowser, "Market", image=marketImg, closeable=False)
self.marketBrowser.splitter.SetSashPosition(self.marketHeight)
self.shipBrowser = ShipBrowser(self.notebookBrowsers)
self.notebookBrowsers.AddPage(self.shipBrowser, "Fittings", image=shipBrowserImg, closeable=False)
self.notebookBrowsers.SetSelection(1)
self.browser_fitting_split.SplitVertically(self.notebookBrowsers, self.fitting_additions_split)
self.browser_fitting_split.SetMinimumPaneSize(204)
self.browser_fitting_split.SetSashPosition(self.browserWidth)
self.fitting_additions_split.SplitHorizontally(self.fitMultiSwitch, self.additionsPane, -200)
self.fitting_additions_split.SetMinimumPaneSize(200)
self.fitting_additions_split.SetSashPosition(self.fittingHeight)
self.fitting_additions_split.SetSashGravity(1.0)
cstatsSizer = wx.BoxSizer(wx.VERTICAL)
self.charSelection = CharacterSelection(self)
cstatsSizer.Add(self.charSelection, 0, wx.EXPAND)
# @todo pheonix: fix all stats stuff
self.statsPane = StatsPane(self)
cstatsSizer.Add(self.statsPane, 0, wx.EXPAND)
mainSizer.Add(cstatsSizer, 0, wx.EXPAND)
self.SetSizer(mainSizer)
# Add menu
self.addPageId = wx.NewId()
self.closePageId = wx.NewId()
self.widgetInspectMenuID = wx.NewId()
self.SetMenuBar(MainMenuBar(self))
self.registerMenu()
# Internal vars to keep track of other windows (graphing/stats)
self.graphFrame = None
self.statsWnds = []
self.activeStatsWnd = None
self.Bind(wx.EVT_CLOSE, self.OnClose)
# Show ourselves
self.Show()
self.LoadPreviousOpenFits()
# Check for updates
self.sUpdate = Update.getInstance()
self.sUpdate.CheckUpdate(self.ShowUpdateBox)
self.Bind(GE.EVT_SSO_LOGIN, self.onSSOLogin)
self.Bind(GE.EVT_SSO_LOGGING_IN, self.ShowSsoLogin)