comparison orpg/tools/toolBars.py @ 18:97265586402b ornery-orc

Traipse 'OpenRPG' {090827-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: Update Manager is now in version 0.8. While not every button works, users can now browse the different revisions and their different changesets. The code has been refined some with feature from Core added to it. A Crash report is now created if the users software crashes. Update Manager has been moved to the Traipse Suite menu item, and a Debug Console as been added as well.
author sirebral
date Thu, 27 Aug 2009 01:04:43 -0500
parents 211ac836b6a0
children ff154cf3350c
comparison
equal deleted inserted replaced
17:265b987cce4f 18:97265586402b
31 ## 31 ##
32 ## Module Loading 32 ## Module Loading
33 ## 33 ##
34 from inputValidator import * 34 from inputValidator import *
35 import string 35 import string
36 import orpg.dirpath 36 from orpg.dirpath import dir_struct
37 37
38 # DICE stuff 38 # DICE stuff
39 TB_IDC_D4 = wx.NewId() 39 TB_IDC_D4 = wx.NewId()
40 TB_IDC_D6 = wx.NewId() 40 TB_IDC_D6 = wx.NewId()
41 TB_IDC_D8 = wx.NewId() 41 TB_IDC_D8 = wx.NewId()
54 """This is where all of the map related tools belong for quick reference.""" 54 """This is where all of the map related tools belong for quick reference."""
55 def __init__( self, parent, id=-1, title="Map Tool Bar", size= wx.Size(300, 45), callBack=None ): 55 def __init__( self, parent, id=-1, title="Map Tool Bar", size= wx.Size(300, 45), callBack=None ):
56 wx.Panel.__init__(self, parent, id, size=size) 56 wx.Panel.__init__(self, parent, id, size=size)
57 self.callback = callBack 57 self.callback = callBack
58 self.mapmode = 1 58 self.mapmode = 1
59 self.modeicons = [orpg.dirpath.dir_struct["icon"]+"move.gif", 59 self.modeicons = [dir_struct["icon"]+"move.gif",
60 orpg.dirpath.dir_struct["icon"]+"draw.gif", 60 dir_struct["icon"]+"draw.gif",
61 orpg.dirpath.dir_struct["icon"]+"tape.gif"] 61 dir_struct["icon"]+"tape.gif"]
62 # Make a sizer for everything to belong to 62 # Make a sizer for everything to belong to
63 self.sizer = wx.BoxSizer( wx.HORIZONTAL ) 63 self.sizer = wx.BoxSizer( wx.HORIZONTAL )
64 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"move.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 64 bm = wx.Image(dir_struct["icon"]+"move.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
65 self.butt = wx.BitmapButton( self, TB_MAP_MODE, bm ) 65 self.butt = wx.BitmapButton( self, TB_MAP_MODE, bm )
66 self.sizer.Add( self.butt,0, wx.ALIGN_CENTER ) 66 self.sizer.Add( self.butt,0, wx.ALIGN_CENTER )
67 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_MAP_MODE) 67 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_MAP_MODE)
68 # Build the toolbar now 68 # Build the toolbar now
69 # Stubbed, but nothing here yet! 69 # Stubbed, but nothing here yet!
96 self.sizer = wx.BoxSizer( wx.HORIZONTAL ) 96 self.sizer = wx.BoxSizer( wx.HORIZONTAL )
97 # Build the toolbar now 97 # Build the toolbar now
98 self.numDieText = wx.TextCtrl( self, TB_IDC_NUMDICE, "1", size= wx.Size(50, 25), 98 self.numDieText = wx.TextCtrl( self, TB_IDC_NUMDICE, "1", size= wx.Size(50, 25),
99 validator=MathOnlyValidator() ) 99 validator=MathOnlyValidator() )
100 self.sizer.Add( self.numDieText, 1, wx.EXPAND | wx.ALIGN_LEFT ) 100 self.sizer.Add( self.numDieText, 1, wx.EXPAND | wx.ALIGN_LEFT )
101 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d4.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 101 bm = wx.Image(dir_struct["icon"]+"b_d4.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
102 butt = wx.BitmapButton( self, TB_IDC_D4, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 102 butt = wx.BitmapButton( self, TB_IDC_D4, bm, size=(bm.GetWidth(), bm.GetHeight()) )
103 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 103 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
104 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D4) 104 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D4)
105 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d6.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 105 bm = wx.Image(dir_struct["icon"]+"b_d6.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
106 butt = wx.BitmapButton( self, TB_IDC_D6, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 106 butt = wx.BitmapButton( self, TB_IDC_D6, bm, size=(bm.GetWidth(), bm.GetHeight()) )
107 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 107 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
108 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D6) 108 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D6)
109 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d8.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 109 bm = wx.Image(dir_struct["icon"]+"b_d8.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
110 butt = wx.BitmapButton( self, TB_IDC_D8, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 110 butt = wx.BitmapButton( self, TB_IDC_D8, bm, size=(bm.GetWidth(), bm.GetHeight()) )
111 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 111 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
112 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D8) 112 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D8)
113 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d10.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 113 bm = wx.Image(dir_struct["icon"]+"b_d10.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
114 butt = wx.BitmapButton( self, TB_IDC_D10, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 114 butt = wx.BitmapButton( self, TB_IDC_D10, bm, size=(bm.GetWidth(), bm.GetHeight()) )
115 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 115 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
116 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D10) 116 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D10)
117 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d12.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 117 bm = wx.Image(dir_struct["icon"]+"b_d12.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
118 butt = wx.BitmapButton( self, TB_IDC_D12, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 118 butt = wx.BitmapButton( self, TB_IDC_D12, bm, size=(bm.GetWidth(), bm.GetHeight()) )
119 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 119 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
120 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D12) 120 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D12)
121 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d20.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 121 bm = wx.Image(dir_struct["icon"]+"b_d20.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
122 butt = wx.BitmapButton( self, TB_IDC_D20, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 122 butt = wx.BitmapButton( self, TB_IDC_D20, bm, size=(bm.GetWidth(), bm.GetHeight()) )
123 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 123 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
124 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D20) 124 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D20)
125 bm = wx.Image(orpg.dirpath.dir_struct["icon"]+"b_d100.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap() 125 bm = wx.Image(dir_struct["icon"]+"b_d100.gif", wx.BITMAP_TYPE_GIF).ConvertToBitmap()
126 butt = wx.BitmapButton( self, TB_IDC_D100, bm, size=(bm.GetWidth(), bm.GetHeight()) ) 126 butt = wx.BitmapButton( self, TB_IDC_D100, bm, size=(bm.GetWidth(), bm.GetHeight()) )
127 self.sizer.Add( butt, 0, wx.ALIGN_CENTER ) 127 self.sizer.Add( butt, 0, wx.ALIGN_CENTER )
128 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D100) 128 self.Bind(wx.EVT_BUTTON, self.onToolBarClick, id=TB_IDC_D100)
129 # Add our other text control to the sizer 129 # Add our other text control to the sizer
130 self.dieModText = wx.TextCtrl( self, TB_IDC_MODS, "+0", size= wx.Size(50, 25), 130 self.dieModText = wx.TextCtrl( self, TB_IDC_MODS, "+0", size= wx.Size(50, 25),