Mercurial > traipse_dev
comparison orpg/mapper/base_handler.py @ 14:0b8b7e3ed78d traipse_dev
Adding fixes from OpenRPG 1.8.0
Includes GUI patch for Linux users, init2 plugin, cherrypy XML refrence
Completely removes approot from the startup process and creates a software
cleanup process as well.
author | sirebral |
---|---|
date | Mon, 20 Jul 2009 21:25:13 -0500 |
parents | 4385a7d0efd1 |
children | 78407d627cba |
comparison
equal
deleted
inserted
replaced
13:3add6bbc3a56 | 14:0b8b7e3ed78d |
---|---|
40 self.map_frame = self.canvas.frame | 40 self.map_frame = self.canvas.frame |
41 self.top_frame = self.canvas.frame.top_frame | 41 self.top_frame = self.canvas.frame.top_frame |
42 self.chat = open_rpg.get_component("chat") | 42 self.chat = open_rpg.get_component("chat") |
43 self.build_ctrls() | 43 self.build_ctrls() |
44 self.build_menu() | 44 self.build_menu() |
45 self.Bind(wx.EVT_SIZE, self.on_size) | 45 #self.Bind(wx.EVT_SIZE, self.on_size) |
46 self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_dclick) | 46 self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_dclick) |
47 | 47 |
48 """ | |
48 def on_size(self,evt): | 49 def on_size(self,evt): |
49 s = self.GetClientSizeTuple() | 50 s = self.GetClientSizeTuple() |
50 self.basesizer.SetDimension(0,0,s[0],s[1]) | 51 self.basesizer.SetDimension(0,0,s[0],s[1]) |
52 """ | |
51 | 53 |
52 def build_ctrls(self): | 54 def build_ctrls(self): |
53 self.basesizer = wx.BoxSizer(wx.HORIZONTAL) | 55 self.basesizer = wx.BoxSizer(wx.HORIZONTAL) |
54 self.sizer = wx.BoxSizer(wx.HORIZONTAL) | 56 self.sizer = wx.BoxSizer(wx.HORIZONTAL) |
55 self.buttonsizer = wx.BoxSizer(wx.HORIZONTAL) | 57 self.buttonsizer = wx.BoxSizer(wx.HORIZONTAL) |
57 self.zoom_in_button = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'zoom_in.gif', "Zoom in from x1.0", wx.ID_ANY ) | 59 self.zoom_in_button = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'zoom_in.gif', "Zoom in from x1.0", wx.ID_ANY ) |
58 self.zoom_out_button = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'zoom_out.gif', "Zoom out from x1.0", wx.ID_ANY ) | 60 self.zoom_out_button = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'zoom_out.gif', "Zoom out from x1.0", wx.ID_ANY ) |
59 props = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'compass.gif', 'Edit map properties', wx.ID_ANY ) | 61 props = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'compass.gif', 'Edit map properties', wx.ID_ANY ) |
60 mapopen = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'open.bmp', 'Load a map', wx.ID_ANY, '#c0c0c0', wx.BITMAP_TYPE_BMP ) | 62 mapopen = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'open.bmp', 'Load a map', wx.ID_ANY, '#c0c0c0', wx.BITMAP_TYPE_BMP ) |
61 mapsave = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'save.bmp', 'Save the map', wx.ID_ANY, '#c0c0c0', wx.BITMAP_TYPE_BMP ) | 63 mapsave = createMaskedButton( self, orpg.dirpath.dir_struct["icon"]+'save.bmp', 'Save the map', wx.ID_ANY, '#c0c0c0', wx.BITMAP_TYPE_BMP ) |
64 | |
65 """ | |
62 self.buttonsizer.Add(self.zoom_in_button, 0, wx.EXPAND ) | 66 self.buttonsizer.Add(self.zoom_in_button, 0, wx.EXPAND ) |
63 self.buttonsizer.Add(self.zoom_out_button, 0, wx.EXPAND ) | 67 self.buttonsizer.Add(self.zoom_out_button, 0, wx.EXPAND ) |
64 self.buttonsizer.Add(props, 0, wx.EXPAND ) | 68 self.buttonsizer.Add(props, 0, wx.EXPAND ) |
65 self.buttonsizer.Add(mapopen, 0, wx.EXPAND ) | 69 self.buttonsizer.Add(mapopen, 0, wx.EXPAND ) |
66 self.buttonsizer.Add(mapsave, 0, wx.EXPAND ) | 70 self.buttonsizer.Add(mapsave, 0, wx.EXPAND ) |
71 """ | |
72 | |
73 self.buttonsizer.Add(self.zoom_in_button, 0, wx.ALIGN_CENTER ) | |
74 self.buttonsizer.Add(self.zoom_out_button, 0, wx.ALIGN_CENTER ) | |
75 self.buttonsizer.Add(props, 0, wx.ALIGN_CENTER ) | |
76 self.buttonsizer.Add(mapopen, 0, wx.ALIGN_CENTER ) | |
77 self.buttonsizer.Add(mapsave, 0, wx.ALIGN_CENTER ) | |
78 | |
79 """ | |
67 self.SetSizer(self.basesizer) | 80 self.SetSizer(self.basesizer) |
68 self.SetAutoLayout(True) | 81 self.SetAutoLayout(True) |
69 self.Fit() | 82 self.Fit() |
83 """ | |
84 | |
85 self.basesizer.Add((3, 0)) | |
70 self.basesizer.Add( self.sizer, 1, wx.EXPAND) | 86 self.basesizer.Add( self.sizer, 1, wx.EXPAND) |
71 self.basesizer.Add( self.buttonsizer, 0, wx.ALIGN_RIGHT) | 87 |
88 #self.basesizer.Add( self.buttonsizer, 0, wx.ALIGN_RIGHT) | |
89 | |
90 self.basesizer.Add((12, 0)) | |
91 self.basesizer.Add( self.buttonsizer, 0, wx.EXPAND | wx.ALIGN_RIGHT) | |
92 self.basesizer.Add((3, 0)) | |
93 | |
72 self.Bind(wx.EVT_BUTTON, self.canvas.on_zoom_in, self.zoom_in_button) | 94 self.Bind(wx.EVT_BUTTON, self.canvas.on_zoom_in, self.zoom_in_button) |
73 self.Bind(wx.EVT_BUTTON, self.canvas.on_zoom_out, self.zoom_out_button) | 95 self.Bind(wx.EVT_BUTTON, self.canvas.on_zoom_out, self.zoom_out_button) |
74 self.Bind(wx.EVT_BUTTON, self.map_frame.on_open, mapopen) | 96 self.Bind(wx.EVT_BUTTON, self.map_frame.on_open, mapopen) |
75 self.Bind(wx.EVT_BUTTON, self.map_frame.on_save, mapsave) | 97 self.Bind(wx.EVT_BUTTON, self.map_frame.on_save, mapsave) |
76 self.Bind(wx.EVT_BUTTON, self.canvas.on_prop, props) | 98 self.Bind(wx.EVT_BUTTON, self.canvas.on_prop, props) |
99 | |
100 self.SetSizer(self.basesizer) | |
77 | 101 |
78 def build_menu(self,label = "Map"): | 102 def build_menu(self,label = "Map"): |
79 "Menu is built based on the type of grid (rectangle or hex) we have in use." | 103 "Menu is built based on the type of grid (rectangle or hex) we have in use." |
80 # do main menu | 104 # do main menu |
81 main_menu = wx.Menu(label) # create a menu resource | 105 main_menu = wx.Menu(label) # create a menu resource |