From ca21652be83eaf113040094be61ba01fd946536b Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 6 Dec 2010 13:37:38 +0200 Subject: [PATCH] Added a nice icon for preferences dialog --- gui/mainFrame.py | 2 +- gui/mainMenuBar.py | 8 +++++--- gui/preferenceDialog.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index f9e84e294..07c47d071 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -296,7 +296,7 @@ class MainFrame(wx.Frame): # Backup fits self.Bind(wx.EVT_MENU, self.backupToXml, id=menuBar.backupFitsId) # Preference dialog - self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id=wx.ID_PREFERENCES) + self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id = menuBar.preferencesId) #Clipboard exports self.Bind(wx.EVT_MENU, self.exportToClipboard, id=wx.ID_COPY) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index ea677c744..93e97c9e4 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -30,6 +30,7 @@ class MainMenuBar(wx.MenuBar): self.damagePatternEditorId = wx.NewId() self.graphFrameId = wx.NewId() self.backupFitsId = wx.NewId() + self.preferencesId = wx.NewId() self.mainFrame = gui.mainFrame.MainFrame.getInstance() @@ -78,10 +79,11 @@ class MainMenuBar(wx.MenuBar): graphFrameItem = wx.MenuItem(windowMenu, self.graphFrameId, "Graphs\tCTRL+G") graphFrameItem.SetBitmap(bitmapLoader.getBitmap("graphs_small", "icons")) -# graphFrameItem.Enable(gui.graphFrame.enabled) windowMenu.AppendItem(graphFrameItem) - - windowMenu.Append(wx.ID_PREFERENCES) + preferencesItem = wx.MenuItem(windowMenu, self.preferencesId, "Preferences\tCTRL+P") + preferencesItem.SetBitmap(bitmapLoader.getBitmap("preferences_small", "icons")) + windowMenu.AppendItem(preferencesItem) +# graphFrameItem.Enable(gui.graphFrame.enabled) # Help menu helpMenu = wx.Menu() diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index 614fc7568..63be6f369 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -19,12 +19,15 @@ import wx from gui.preferenceView import PreferenceView +import bitmapLoader + class PreferenceDialog(wx.Dialog): 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.IconFromBitmap(bitmapLoader.getBitmap("preferences_small", "icons")) + self.SetIcon(i) mainSizer = wx.BoxSizer(wx.VERTICAL) self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT)