Add a character editor menu entry. Change some stuff around

This commit is contained in:
cncfanatics
2010-08-12 17:49:49 +02:00
parent 263bb9ae7c
commit f7132e9385
5 changed files with 26 additions and 14 deletions

View File

@@ -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()

View File

@@ -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")

View File

@@ -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))

BIN
icons/character.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB