|
From: Kevin A. <al...@se...> - 2002-01-04 22:15:25
|
I've added an example of using multiple windows to the resourceEditor. I
created a positionSize.rsrc.py file and added a PositionSize class to
resourceEditor.py. The class has an openBackground handler to setup a
wxFlexGridSizer, but that's about it.
The window is initialized with:
rsrc = res.ResourceFile('positionSize.rsrc.py').getResource()
self.positionSizeWindow = PositionSize(self.stack,
self,
rsrc,
rsrc.stack.backgrounds[0])
# override resource position
self.positionSizeWindow.SetPosition((425, 5))
# deleting the menubar may not be clean
self.positionSizeWindow.SetMenuBar(wx.NULL)
self.positionSizeWindow.Show()
And the actual work is done by a revised version of the old setToolTip
method
def setToolTip(self, target):
# in case the user closed the window
self.positionSizeWindow.Show()
self.positionSizeWindow.components.fldName.text = str(target.name)
self.positionSizeWindow.components.fldPosition.text =
str(target.position)
self.positionSizeWindow.components.fldSize.text = str(target.size)
So now as the mouse enters a component and during drag and resize
operations, the Position & Size window will show the component name and its
current position and size as the mouse is moved.
ka
|