From: Adit P. <apa...@ba...> - 2004-05-02 20:21:46
|
I was tinkering around with the code and realized that on the Mac, that some of the standard menus aren't in the right places (i.e, About and Preferences). I wrote some additional code that fixes the About menu position and removes the separator bar if it is run on a Mac. I also tried doing the Preferences, but for the life of me, I couldn't get it to work on this code. I hacked up another Python script that just sets up menus and added the Mac specific code there and it worked perfectly. For some reason the Preferences setting does not work with the BitPim code. Anyways, I think if this code is added, it would make the Mac build feel more conforming with the OS. Attached is my diff. If anyone wants my test code, please let me know and I can send it. I am currently trying to work on exporting the phonebook to a CSV. If it is not necessary, please let me know. Thanks for the good work :) Index: gui.py =================================================================== RCS file: /cvsroot/bitpim/bitpim/gui.py,v retrieving revision 1.124 diff -u -r1.124 gui.py --- gui.py 1 May 2004 07:57:49 -0000 1.124 +++ gui.py 2 May 2004 19:41:21 -0000 @@ -407,7 +407,11 @@ menu.AppendSeparator() menu.Append(guihelper.ID_FV_ICONS, "View as Images", "Show items as images") menu.Append(guihelper.ID_FV_LIST, "View As List", "Show items as a report") - menu.AppendSeparator() + if guihelper.IsMac(): + wx.App_SetMacPreferencesMenuItemId(guihelper.ID_EDITSETTINGS) + print wx.App_GetMacPreferencesMenuItemId() + else: + menu.AppendSeparator() menu.Append(guihelper.ID_EDITSETTINGS, "&Settings", "Edit settings") menuBar.Append(menu, "&Edit"); @@ -427,10 +431,20 @@ menu=wx.Menu() - menu.Append(guihelper.ID_HELPHELP, "&Help", "Help for the panel you are looking at") + if guihelper.IsMac(): + menu.Append(guihelper.ID_HELPHELP, "&BitPim Help", "Help for the panel you are looking at") + menu.AppendSeparator() + else: + menu.Append(guihelper.ID_HELPHELP, "&Help", "Help for the panel you are looking at") menu.Append(guihelper.ID_HELPTOUR, "&Tour", "Tour of BitPim") menu.Append(guihelper.ID_HELPCONTENTS, "&Contents", "Table of contents for the online help") - menu.AppendSeparator() + if guihelper.IsMac(): + wx.App_SetMacAboutMenuItemId(guihelper.ID_HELPABOUT) + wx.App_SetMacHelpMenuTitleName("&Help") + wx.App_SetMacExitMenuItemId(guihelper.ID_FILEEXIT) + #print wx.App_GetMacAboutMenuItemId() + else: + menu.AppendSeparator() menu.Append(guihelper.ID_HELPABOUT, "&About", "Display program information") menuBar.Append(menu, "&Help"); |