/usr/lib/python2.7/dist-packages/PythonCard/tools/resourceEditor/modules/multiComponents.py is in python-pythoncard 0.8.2-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #!/usr/bin/python
"""
__version__ = "$Revision: 1.1 $"
__date__ = "$Date: 2005/07/27 21:49:41 $"
"""
from PythonCard import dialog, font, model, registry, util
from PythonCard.event import ChangeListener
import resourceOutput
import time
import os
import string
import wx
class MultiComponents(model.Background, ChangeListener):
def on_initialize(self, event):
self._parent = self.GetParent()
self._comp = self._parent.components
self._updatingComponent = 0
##self.components.addChangeEventListener(self)
self._comp.addChangeEventListener(self)
#self.displayComponents(self.components)
self.displayComponents(self._comp)
self.visible = True
def on_componentSendBack_command(self, event):
print "no re-layering yet"
return
self._parent.on_componentSendBack_command(event)
def on_componentMoveBack_command(self, event):
print "no re-layering yet"
return
self._parent.on_componentMoveBack_command(event)
def on_componentMoveForward_command(self, event):
print "no re-layering yet"
return
self._parent.on_componentMoveForward_command(event)
def on_componentBringFront_command(self, event):
print "no re-layering yet"
return
self._parent.on_componentBringFront_command(event)
def addWidgetToComponentList(self, widget):
wName = widget.name
wClass = widget.__class__.__name__
self.components.wComponentList.Append(wName + " : " + wClass)
# KEA 2002-02-23
# need to redo the logic below to avoid asserts in hybrid
# versions of wxPython, but also be cleaner
def deleteWidgetFromComponentList(self, wName, wClass):
i = self.components.wComponentList.GetSelection()
j = self.components.wComponentList.FindString(wName + " : " + wClass)
if i == -1 or i != j:
if j != -1:
self.components.wComponentList.Delete(j)
else:
if j > 0:
self.components.wComponentList.SetSelection(j - 1)
if j != -1:
self.components.wComponentList.Delete(j)
if self.components.wComponentList.GetSelection() == -1:
self.setValidProps("")
else:
wName, wClass = self.components.wComponentList.stringSelection.split(" : ")
# deselect the name from properties list
self.setValidProps(wClass)
self.displayProperties(wName, wClass)
def changed(self, event):
print "multi changed", self._parent.multipleSelected, self._parent.multipleComponents
def clearComponentList(self):
self.components.wComponentList.Clear()
self.statusBar.text = ''
def displayComponents(self, components):
self.components.wComponentList.Freeze()
self.components.wComponentList.Clear()
self._comp = components
for c in components.order:
#print "display", c, self._parent.isSizingHandle(c)
if c not in self._parent.sizingHandleNames and not self._parent.isSizingHandle(c):
self.addWidgetToComponentList(components[c])
self.components.wComponentList.Thaw()
self.components.wComponentList.Refresh()
self.components.wComponentList.Update()
def on_close(self, event):
self.visible = False
parent = self.GetParent()
parent.menuBar.setChecked('menuViewPropertyEditor', 0)
|