From 07aa2fbf6325b6836fee6ffe191e0e971d670714 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 20 Aug 2010 14:15:55 +0200 Subject: [PATCH] Add 4 buttons to the ship browser --- gui/shipBrowser.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 471d4a2a9..c7c56290a 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -1,6 +1,7 @@ import wx import controller import bitmapLoader +import gui.mainFrame class ShipBrowser(wx.Panel): def __init__(self, parent): @@ -9,6 +10,9 @@ class ShipBrowser(wx.Panel): vbox = wx.BoxSizer(wx.VERTICAL) self.SetSizer(vbox) + self.shipMenu = ShipMenu(self) + vbox.Add(self.shipMenu, 0, wx.EXPAND) + self.shipView = ShipView(self) vbox.Add(self.shipView, 1, wx.EXPAND) @@ -76,3 +80,18 @@ class ShipView(wx.TreeCtrl): return c else: return cmp(self.GetItemText(treeId1), self.GetItemText(treeId2)) + +class ShipMenu(wx.Panel): + def __init__(self, parent): + wx.Panel.__init__(self, parent) + self.parent = parent + + sizer = wx.BoxSizer(wx.HORIZONTAL) + self.SetSizer(sizer) + + for name, art in (("new", wx.ART_NEW), ("rename", wx.ART_FIND_AND_REPLACE), ("copy", wx.ART_COPY), ("delete", wx.ART_DELETE)): + btn = wx.BitmapButton(self, wx.ID_ANY, wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)) + setattr(self, name, btn) + btn.Enable(False) + btn.SetToolTipString("%s fit." % name.capitalize()) + sizer.Add(btn)