diff --git a/gui/bitmapLoader.py b/gui/bitmapLoader.py index 6f0b446f7..1ac3c25c5 100644 --- a/gui/bitmapLoader.py +++ b/gui/bitmapLoader.py @@ -21,8 +21,11 @@ import os.path import config import wx -def getBitmap(name, parent): - bitmap = wx.StaticBitmap(parent) +def getStaticBitmap(name, parent): + static = wx.StaticBitmap(parent) + static.SetBitmap(getBitmap(name)) + return static + +def getBitmap(name): path = os.path.join(config.path, "icons", name + ".png") - bitmap.SetBitmap(wx.Image(path).ConvertToBitmap()) - return bitmap + return wx.Image(path).ConvertToBitmap() diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 6ead50bfe..c9674fc18 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -18,6 +18,7 @@ #=============================================================================== import wx +import bitmapLoader class MainMenuBar(wx.MenuBar): def __init__(self): @@ -30,28 +31,36 @@ class MainMenuBar(wx.MenuBar): fileMenu.Append(wx.ID_OPEN, "&Import", "Import a fit into pyfa.") fileMenu.Append(wx.ID_SAVEAS, "&Export", "Export the fit to another format.") fileMenu.AppendSeparator() - fileMenu.Append(wx.ID_EXIT,"E&xit"," Terminate the program.") + fileMenu.Append(wx.ID_EXIT) # Edit menu editMenu = wx.Menu() self.Append(editMenu, "&Edit") - editMenu.Append(wx.ID_UNDO, "&Undo", "Undo the last action on this fit.") - editMenu.Append(wx.ID_REDO, "&Redo", "Redo the last undone action.") - editMenu.Append(wx.ID_UNDELETE, "Un&delete", "Recover the last deleted fit, if any.") + editMenu.Append(wx.ID_UNDO) + editMenu.Append(wx.ID_REDO) + editMenu.Append(wx.ID_UNDELETE) # Fit menu fitMenu = wx.Menu() self.Append(fitMenu, "F&it") - fitMenu.Append(wx.ID_NEW, "&New", "Create a new fit.").GetBitmap() - fitMenu.Append(wx.ID_EDIT, "&Rename", "Rename this fit.").GetBitmap() - fitMenu.Append(wx.ID_COPY, "&Copy", "Copy this fit.").GetBitmap() - fitMenu.Append(wx.ID_DELETE, "&Delete", "Delete this fit.").GetBitmap() + fitMenu.Append(wx.ID_NEW) + fitMenu.Append(wx.ID_EDIT, "&Rename", "Rename this fit.") + fitMenu.Append(wx.ID_COPY) + fitMenu.Append(wx.ID_DELETE) + + # Character menu + charMenu = wx.Menu() + self.Append(charMenu, "&Character") + + charEditItem = wx.MenuItem(charMenu, wx.ID_ANY, "Character Editor") + charEditItem.SetBitmap(bitmapLoader.getBitmap("character")) + charMenu.AppendItem(charEditItem) # Help menu helpMenu = wx.Menu() self.Append(helpMenu, "&Help") - helpMenu.Append(wx.ID_ABOUT, "&About", "About this program") + helpMenu.Append(wx.ID_ABOUT) helpMenu.Append(wx.ID_HELP, "User manual", "User manual") diff --git a/gui/mainToolBar.py b/gui/mainToolBar.py index ca3795f68..e129af298 100644 --- a/gui/mainToolBar.py +++ b/gui/mainToolBar.py @@ -24,7 +24,7 @@ class MainToolBar(wx.ToolBar): def __init__(self, parent): wx.ToolBar.__init__(self, parent, wx.ID_ANY) - self.AddControl(bitmapLoader.getBitmap("ships", self)) + self.AddControl(bitmapLoader.getStaticBitmap("ship", self)) self.AddLabelTool(wx.ID_NEW, "New fit", wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR)) self.AddLabelTool(wx.ID_COPY, "Copy fit", wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR)) self.AddLabelTool(wx.ID_DELETE, "Delete fit", wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR)) diff --git a/icons/character.png b/icons/character.png new file mode 100644 index 000000000..0603d5073 Binary files /dev/null and b/icons/character.png differ diff --git a/icons/ships.png b/icons/ship.png similarity index 100% rename from icons/ships.png rename to icons/ship.png