Update of /cvsroot/openrpg/openrpg1/orpg/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8180/orpg/tools
Modified Files:
ButtonPanel.py rgbhex.py
Log Message:
New Map Multi Selection Added
Changed Some buttons to have a Right click menu to switch between the Object Types
Index: rgbhex.py
===================================================================
RCS file: /cvsroot/openrpg/openrpg1/orpg/tools/rgbhex.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rgbhex.py 4 Nov 2006 21:24:22 -0000 1.9
--- rgbhex.py 19 Feb 2007 16:33:20 -0000 1.10
***************
*** 26,30 ****
# Description: rgb to hex utility
! import orpg.orpg_windows
--- 26,30 ----
# Description: rgb to hex utility
! from orpg.orpg_wx import *
***************
*** 91,99 ****
return s
! def do_hex_color_dlg(self,parent):
! data = orpg.orpg_windows.wx.ColourData()
! data.SetChooseFull(1)
! dlg = orpg.orpg_windows.wx.ColourDialog(parent, data)
! if dlg.ShowModal() == orpg.orpg_windows.wx.ID_OK:
data = dlg.GetColourData()
(red,green,blue) = data.GetColour().Get()
--- 91,99 ----
return s
! def do_hex_color_dlg(self, parent):
! data = wx.ColourData()
! data.SetChooseFull(True)
! dlg = wx.ColourDialog(parent, data)
! if dlg.ShowModal() == wx.ID_OK:
data = dlg.GetColourData()
(red,green,blue) = data.GetColour().Get()
Index: ButtonPanel.py
===================================================================
RCS file: /cvsroot/openrpg/openrpg1/orpg/tools/ButtonPanel.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ButtonPanel.py 15 Feb 2007 15:12:07 -0000 1.1
--- ButtonPanel.py 19 Feb 2007 16:33:20 -0000 1.2
***************
*** 974,977 ****
--- 974,978 ----
self._shortHelp = shortHelp
self._longHelp = longHelp
+ self._menu = None
disabledbmp = GrayOut(bmp)
***************
*** 1225,1228 ****
--- 1226,1234 ----
return self._longHelp
+ def GetMenu(self):
+ return self._menu
+
+ def SetMenu(self, Menu):
+ self._menu = Menu
Bitmap = property(GetBitmap, SetBitmap)
***************
*** 1286,1289 ****
--- 1292,1296 ----
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
+ self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
***************
*** 1813,1816 ****
--- 1820,1833 ----
self._currentButton = tabId
+ def OnRightDown(self, event):
+ """ Handles the wx.EVT_RIGHT_DOWN event for ButtonPanel. """
+
+ tabId, hit = self.HitTest(event.GetPosition())
+
+ if hit == BP_HT_BUTTON:
+ btn = self._vButtons[tabId]
+ if btn.IsEnabled() and btn.GetMenu() != None:
+ self.PopupMenu(btn.GetMenu())
+
def OnLeftUp(self, event):
|