Mercurial > traipse_dev
comparison orpg/main.py @ 60:3b2cfa13b610 ornery-dev
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
Fix to three broken nodes. Update Manager is no longer a top window, has an
icon and now has a place on the task bar (panel).
author | sirebral |
---|---|
date | Wed, 12 Aug 2009 20:54:46 -0500 |
parents | 5aff3ef1ae46 |
children | f3d8101211c4 |
comparison
equal
deleted
inserted
replaced
59:5aff3ef1ae46 | 60:3b2cfa13b610 |
---|---|
406 def OnMB_WindowsMenu(self, event): | 406 def OnMB_WindowsMenu(self, event): |
407 self.log.log("Enter orpgFrame->OnMB_WindowsMenu(self, event)", ORPG_DEBUG) | 407 self.log.log("Enter orpgFrame->OnMB_WindowsMenu(self, event)", ORPG_DEBUG) |
408 menuid = event.GetId() | 408 menuid = event.GetId() |
409 name = self.mainwindows[menuid] | 409 name = self.mainwindows[menuid] |
410 if name == 'Alias Lib': | 410 if name == 'Alias Lib': |
411 if self.aliaslib.IsShown() == True: self.aliaslib.Hide() | 411 if self.aliaslib.IsShown(): self.aliaslib.Hide() |
412 else: self.aliaslib.Show() | 412 else: self.aliaslib.Show() |
413 else: | 413 else: |
414 if self._mgr.GetPane(name).IsShown() == True: self._mgr.GetPane(name).Hide() | 414 if self._mgr.GetPane(name).IsShown(): self._mgr.GetPane(name).Hide() |
415 else: self._mgr.GetPane(name).Show() | 415 else: self._mgr.GetPane(name).Show() |
416 self._mgr.Update() | 416 self._mgr.Update() |
417 self.log.log("Exit orpgFrame->OnMB_WindowsMenu(self, event)", ORPG_DEBUG) | 417 self.log.log("Exit orpgFrame->OnMB_WindowsMenu(self, event)", ORPG_DEBUG) |
418 | 418 |
419 #OpenRPG Menu | 419 #OpenRPG Menu |
618 filename = orpg.dirpath.dir_struct["user"] + "layout.xml" | 618 filename = orpg.dirpath.dir_struct["user"] + "layout.xml" |
619 temp_file = open(filename) | 619 temp_file = open(filename) |
620 txt = temp_file.read() | 620 txt = temp_file.read() |
621 xml_dom = self.xml.parseXml(txt)._get_documentElement() | 621 xml_dom = self.xml.parseXml(txt)._get_documentElement() |
622 temp_file.close() | 622 temp_file.close() |
623 self.windowsmenu = wx.Menu() | |
624 self.mainwindows = {} | |
623 | 625 |
624 #Plugins Window | 626 #Plugins Window |
625 self.pluginsFrame = pluginUI.PluginFrame(self) | 627 self.pluginsFrame = pluginUI.PluginFrame(self) |
626 open_rpg.add_component("plugins", self.get_activeplugins()) | 628 open_rpg.add_component("plugins", self.get_activeplugins()) |
627 open_rpg.add_component("startplugs", self.get_startplugins()) | 629 open_rpg.add_component("startplugs", self.get_startplugins()) |
628 self.windowsmenu = wx.Menu() | |
629 self.mainwindows = {} | |
630 self.log.log("Menu Created", ORPG_DEBUG) | 630 self.log.log("Menu Created", ORPG_DEBUG) |
631 h = int(xml_dom.getAttribute("height")) | 631 h = int(xml_dom.getAttribute("height")) |
632 w = int(xml_dom.getAttribute("width")) | 632 w = int(xml_dom.getAttribute("width")) |
633 posx = int(xml_dom.getAttribute("posx")) | 633 posx = int(xml_dom.getAttribute("posx")) |
634 posy = int(xml_dom.getAttribute("posy")) | 634 posy = int(xml_dom.getAttribute("posy")) |
651 | 651 |
652 # Sound Manager | 652 # Sound Manager |
653 self.sound_player = orpg.tools.orpg_sound.orpgSound(self) | 653 self.sound_player = orpg.tools.orpg_sound.orpgSound(self) |
654 open_rpg.add_component("sound", self.sound_player) | 654 open_rpg.add_component("sound", self.sound_player) |
655 wndinfo = AUI.AuiPaneInfo() | 655 wndinfo = AUI.AuiPaneInfo() |
656 menuid = wx.NewId() | |
657 self.mainwindows[menuid] = "Sound Control Toolbar" | |
656 wndinfo.DestroyOnClose(False) | 658 wndinfo.DestroyOnClose(False) |
657 wndinfo.Name("Sound Control Toolbar") | 659 wndinfo.Name("Sound Control Toolbar") |
658 wndinfo.Caption("Sound Control Toolbar") | 660 wndinfo.Caption("Sound Control Toolbar") |
659 wndinfo.Float() | 661 wndinfo.Float() |
660 wndinfo.ToolbarPane() | 662 wndinfo.ToolbarPane() |
664 for c in children: self.build_window(c, self) | 666 for c in children: self.build_window(c, self) |
665 | 667 |
666 # status window | 668 # status window |
667 self.status = status_bar(self) | 669 self.status = status_bar(self) |
668 wndinfo = AUI.AuiPaneInfo() | 670 wndinfo = AUI.AuiPaneInfo() |
671 menuid = wx.NewId() | |
672 self.mainwindows[menuid] = "Status Window" | |
669 wndinfo.DestroyOnClose(False) | 673 wndinfo.DestroyOnClose(False) |
670 wndinfo.Name("Status Window") | 674 wndinfo.Name("Status Window") |
671 wndinfo.Caption("Status Window") | 675 wndinfo.Caption("Status Window") |
672 wndinfo.Float() | 676 wndinfo.Float() |
673 wndinfo.ToolbarPane() | 677 wndinfo.ToolbarPane() |
676 self.log.log("Status Window Created", ORPG_DEBUG) | 680 self.log.log("Status Window Created", ORPG_DEBUG) |
677 | 681 |
678 # Create and show the floating dice toolbar | 682 # Create and show the floating dice toolbar |
679 self.dieToolBar = orpg.tools.toolBars.DiceToolBar(self, callBack = self.chat.ParsePost) | 683 self.dieToolBar = orpg.tools.toolBars.DiceToolBar(self, callBack = self.chat.ParsePost) |
680 wndinfo = AUI.AuiPaneInfo() | 684 wndinfo = AUI.AuiPaneInfo() |
685 menuid = wx.NewId() | |
686 self.mainwindows[menuid] = "Dice Tool Bar" | |
681 wndinfo.DestroyOnClose(False) | 687 wndinfo.DestroyOnClose(False) |
682 wndinfo.Name("Dice Tool Bar") | 688 wndinfo.Name("Dice Tool Bar") |
683 wndinfo.Caption("Dice Tool Bar") | 689 wndinfo.Caption("Dice Tool Bar") |
684 wndinfo.Float() | 690 wndinfo.Float() |
685 wndinfo.ToolbarPane() | 691 wndinfo.ToolbarPane() |
688 self.log.log("Dice Tool Bar Created", ORPG_DEBUG) | 694 self.log.log("Dice Tool Bar Created", ORPG_DEBUG) |
689 | 695 |
690 #Create the Map tool bar | 696 #Create the Map tool bar |
691 self.mapToolBar = orpg.tools.toolBars.MapToolBar(self, callBack = self.map.MapBar) | 697 self.mapToolBar = orpg.tools.toolBars.MapToolBar(self, callBack = self.map.MapBar) |
692 wndinfo = AUI.AuiPaneInfo() | 698 wndinfo = AUI.AuiPaneInfo() |
699 menuid = wx.NewId() | |
700 self.mainwindows[menuid] = "Map Tool Bar" | |
693 wndinfo.DestroyOnClose(False) | 701 wndinfo.DestroyOnClose(False) |
694 wndinfo.Name("Map Tool Bar") | 702 wndinfo.Name("Map Tool Bar") |
695 wndinfo.Caption("Map Tool Bar") | 703 wndinfo.Caption("Map Tool Bar") |
696 wndinfo.Float() | 704 wndinfo.Float() |
697 wndinfo.ToolbarPane() | 705 wndinfo.ToolbarPane() |
832 return temp_wnd | 840 return temp_wnd |
833 | 841 |
834 def onPaneClose(self, evt): | 842 def onPaneClose(self, evt): |
835 self.log.log("Enter orpgFrame->onPaneClose()", ORPG_DEBUG) | 843 self.log.log("Enter orpgFrame->onPaneClose()", ORPG_DEBUG) |
836 pane = evt.GetPane() | 844 pane = evt.GetPane() |
837 for wndid, wname in self.mainwindows.iteritems(): | 845 #Arbitrary If ELIF fix. Items had incorrect ID's set. Finding correct ID will fix it for the iteration. |
838 if pane.name == wname: self.windowsmenu.Check(wndid, False); break | 846 #Adding ID also fixed docking. Go figure. |
847 if pane.name == 'Sound Control Toolbar': self.mainmenu.SetMenuState('ToolsSoundToolbar', False) | |
848 elif pane.name == 'Status Window': self.mainmenu.SetMenuState('ToolsStatusBar', False) | |
849 elif pane.name == 'Dice Tool Bar': self.mainmenu.SetMenuState('ToolsDiceBar', False) | |
850 elif pane.name == 'Map Tool Bar': self.mainmenu.SetMenuState('ToolsMapBar', False) | |
851 else: | |
852 for wndid, wname in self.mainwindows.iteritems(): | |
853 #print pane.name, wname, wndid | |
854 if pane.name == wname: self.windowsmenu.Check(wndid, False); break | |
839 evt.Skip() | 855 evt.Skip() |
840 self._mgr.Update() | 856 self._mgr.Update() |
841 self.log.log("Exit orpgFrame->onPaneClose()", ORPG_DEBUG) | 857 self.log.log("Exit orpgFrame->onPaneClose()", ORPG_DEBUG) |
842 | 858 |
843 def saveLayout(self): | 859 def saveLayout(self): |