comparison orpg/orpg_windows.py @ 66:c54768cffbd4 ornery-dev

Traipse Dev 'OpenRPG' {090818-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: *Unstable* This is the first wave of Code Refinement updates. Includes new material from Core Beta; new debugger material (partially implemented), beginnings of switch to etree, TerminalWriter, and a little more. open_rpg has been renamed to component; functioning now as component.get(), component.add(), component.delete(). This version has known bugs, specifically with the gametree and nodes. I think the XML files where not removed during testing of Core and switching back.
author sirebral
date Tue, 18 Aug 2009 06:33:37 -0500
parents 551cd440acce
children c5bc2abaf7f8
comparison
equal deleted inserted replaced
65:4840657c23c5 66:c54768cffbd4
30 30
31 from orpg.orpg_wx import * 31 from orpg.orpg_wx import *
32 from orpg.orpgCore import * 32 from orpg.orpgCore import *
33 import orpg.tools.rgbhex 33 import orpg.tools.rgbhex
34 import orpg.orpg_xml 34 import orpg.orpg_xml
35 import orpg.dirpath 35 from orpg.dirpath import dir_struct
36 from orpg.tools.metamenus import MenuEx 36 from orpg.tools.metamenus import MenuEx
37 37
38 class img_helper: 38 class img_helper:
39 def __init__(self): 39 def __init__(self):
40 pass 40 pass
69 class orpgTabberWnd(FNB.FlatNotebook): 69 class orpgTabberWnd(FNB.FlatNotebook):
70 def __init__(self, parent, closeable=False, size=wx.DefaultSize, style = False): 70 def __init__(self, parent, closeable=False, size=wx.DefaultSize, style = False):
71 nbstyle = FNB.FNB_HIDE_ON_SINGLE_TAB|FNB.FNB_BACKGROUND_GRADIENT 71 nbstyle = FNB.FNB_HIDE_ON_SINGLE_TAB|FNB.FNB_BACKGROUND_GRADIENT
72 FNB.FlatNotebook.__init__(self, parent, -1, size=size, style=nbstyle) 72 FNB.FlatNotebook.__init__(self, parent, -1, size=size, style=nbstyle)
73 rgbcovert = orpg.tools.rgbhex.RGBHex() 73 rgbcovert = orpg.tools.rgbhex.RGBHex()
74 self.log = open_rpg.get_component("log") 74 self.log = component.get("log")
75 self.log.log("Enter orpgTabberWnd", ORPG_DEBUG) 75 self.log.log("Enter orpgTabberWnd", ORPG_DEBUG)
76 self.settings = open_rpg.get_component("settings") 76 self.settings = component.get("settings")
77 tabtheme = self.settings.get_setting('TabTheme') 77 tabtheme = self.settings.get_setting('TabTheme')
78 tabtext = self.settings.get_setting('TabTextColor') 78 tabtext = self.settings.get_setting('TabTextColor')
79 (tred, tgreen, tblue) = rgbcovert.rgb_tuple(tabtext) 79 (tred, tgreen, tblue) = rgbcovert.rgb_tuple(tabtext)
80 tabbedwindows = open_rpg.get_component("tabbedWindows") 80 tabbedwindows = component.get("tabbedWindows")
81 tabbedwindows.append(self) 81 tabbedwindows.append(self)
82 open_rpg.add_component("tabbedWindows", tabbedwindows) 82 component.add("tabbedWindows", tabbedwindows)
83 83
84 theme_dict = {'slanted&aqua': FNB.FNB_VC8, 'slanted&bw': FNB.FNB_VC8, 'flat&aqua': FNB.FNB_FANCY_TABS, 84 theme_dict = {'slanted&aqua': FNB.FNB_VC8, 'slanted&bw': FNB.FNB_VC8, 'flat&aqua': FNB.FNB_FANCY_TABS,
85 'flat&bw': FNB.FNB_FANCY_TABS, 'customflat': FNB.FNB_FANCY_TABS, 'customslant': FNB.FNB_VC8, 85 'flat&bw': FNB.FNB_FANCY_TABS, 'customflat': FNB.FNB_FANCY_TABS, 'customslant': FNB.FNB_VC8,
86 'slanted&colorful': FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS, 'slant&colorful': FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS} 86 'slanted&colorful': FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS, 'slant&colorful': FNB.FNB_VC8|FNB.FNB_COLORFUL_TABS}
87 nbstyle |= theme_dict[tabtheme] 87 nbstyle |= theme_dict[tabtheme]
147 147
148 def OnLinkClicked( self, ref ): 148 def OnLinkClicked( self, ref ):
149 "Open an external browser to resolve our About box links!!!" 149 "Open an external browser to resolve our About box links!!!"
150 href = ref.GetHref() 150 href = ref.GetHref()
151 webbrowser.open( href ) 151 webbrowser.open( href )
152 152 """
153 # This class extends wxSplitterWindow to add an auto expand behavior. The idea is that the sash 153 This class extends wxSplitterWindow to add an auto expand behavior. The idea is that the sash
154 # determines the ratio of the two windows, while the mouse position determines which 154 determines the ratio of the two windows, while the mouse position determines which
155 # side will get the larger share of the screen real estate. It is used instead of regular 155 side will get the larger share of the screen real estate. It is used instead of regular
156 # wxSplitterWindows if the EnableSplittersAutoExpand setting doesn't evaluate as False. 156 wxSplitterWindows if the EnableSplittersAutoExpand setting doesn't evaluate as False.
157 # 157
158 # Note: To be truly functional, some way of passing EVT_MOTION events to this class, even when the 158 Note: To be truly functional, some way of passing EVT_MOTION events to this class, even when the
159 # event takes place over child windows needs to be accomplished. Once this is accomplished, 159 event takes place over child windows needs to be accomplished. Once this is accomplished,
160 # however, the class should work as written. 160 however, the class should work as written.
161 """
161 class orpgFocusSplitterWindow(wx.SplitterWindow): 162 class orpgFocusSplitterWindow(wx.SplitterWindow):
162 163
163 def __init__(self,parent,id = -1,AutoExpand = 1,point = wx.DefaultPosition,size = wx.DefaultSize,style=wx.SP_3D,name="splitterWindow"): 164 def __init__(self,parent,id = -1,AutoExpand = 1,point = wx.DefaultPosition,size = wx.DefaultSize,style=wx.SP_3D,name="splitterWindow"):
164 wx.SplitterWindow.__init__(self,parent,id,point,size,style,name) 165 wx.SplitterWindow.__init__(self,parent,id,point,size,style,name)
165 self.auto = AutoExpand 166 self.auto = AutoExpand
253 self.DIE6 = wx.NewId() 254 self.DIE6 = wx.NewId()
254 self.DIE4 = wx.NewId() 255 self.DIE4 = wx.NewId()
255 self.DIE2 = wx.NewId() 256 self.DIE2 = wx.NewId()
256 self.DIE = wx.NewId() 257 self.DIE = wx.NewId()
257 self.sizer = wx.BoxSizer(wx.HORIZONTAL) 258 self.sizer = wx.BoxSizer(wx.HORIZONTAL)
258 gif = wx.Image(orpg.dirpath.dir_struct["icon"]+"bold.gif", wx.BITMAP_TYPE_GIF) 259 gif = wx.Image(dir_struct["icon"]+"bold.gif", wx.BITMAP_TYPE_GIF)
259 self.sizer.Add(wx.BitmapButton(self, self.BOLD, gif.ConvertToBitmap()), 0, wx.EXPAND) 260 self.sizer.Add(wx.BitmapButton(self, self.BOLD, gif.ConvertToBitmap()), 0, wx.EXPAND)
260 gif = wx.Image(orpg.dirpath.dir_struct["icon"]+"italic.gif", wx.BITMAP_TYPE_GIF) 261 gif = wx.Image(dir_struct["icon"]+"italic.gif", wx.BITMAP_TYPE_GIF)
261 self.sizer.Add(wx.BitmapButton(self, self.ITALIC, gif.ConvertToBitmap()), 0, wx.EXPAND) 262 self.sizer.Add(wx.BitmapButton(self, self.ITALIC, gif.ConvertToBitmap()), 0, wx.EXPAND)
262 gif = wx.Image(orpg.dirpath.dir_struct["icon"]+"underlined.gif", wx.BITMAP_TYPE_GIF) 263 gif = wx.Image(dir_struct["icon"]+"underlined.gif", wx.BITMAP_TYPE_GIF)
263 self.sizer.Add(wx.BitmapButton(self, self.UNDER, gif.ConvertToBitmap()), 0, wx.EXPAND) 264 self.sizer.Add(wx.BitmapButton(self, self.UNDER, gif.ConvertToBitmap()), 0, wx.EXPAND)
264 self.color_button = wx.Button(self, self.COLOR, "C",wx.Point(0,0),wx.Size(22,0)) 265 self.color_button = wx.Button(self, self.COLOR, "C",wx.Point(0,0),wx.Size(22,0))
265 self.color_button.SetBackgroundColour(wx.BLACK) 266 self.color_button.SetBackgroundColour(wx.BLACK)
266 self.color_button.SetForegroundColour(wx.WHITE) 267 self.color_button.SetForegroundColour(wx.WHITE)
267 self.sizer.Add(self.color_button, 0, wx.EXPAND) 268 self.sizer.Add(self.color_button, 0, wx.EXPAND)