/usr/share/pyshared/PythonCard/components/staticbox.py is in python-pythoncard 0.8.2-3.
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 | """
__version__ = "$Revision: 1.12 $"
__date__ = "$Date: 2004/05/13 02:40:24 $"
"""
import wx
from PythonCard import event, widget
class StaticBoxSpec(widget.WidgetSpec):
def __init__(self):
attributes = {
'label' : { 'presence' : 'optional', 'default' : '' },
'size' : { 'presence' : 'optional', 'default' : [ 50, 50 ] },
}
widget.WidgetSpec.__init__( self, 'StaticBox', 'Widget', [], attributes )
class StaticBox(widget.Widget, wx.StaticBox):
"""
A static box is just a box which may be used to group
controls. The box may have a label.
"""
_spec = StaticBoxSpec()
def __init__( self, aParent, aResource ) :
wx.StaticBox.__init__(
self,
aParent,
widget.makeNewId(aResource.id),
aResource.label,
aResource.position,
aResource.size,
style = wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_SIBLINGS,
name = aResource.name
)
widget.Widget.__init__( self, aParent, aResource )
self._bindEvents(event.WIDGET_EVENTS)
"""
# KEA 2002-03-25
# this works, but is too much of a hack, wxWindows needs to be fixed
def _setPosition(self, position):
self.Move(position)
size = self.GetSize()
self.SetSize((size[0], size[1] - 1))
self.SetSize(size)
"""
label = property(wx.StaticBox.GetLabel, wx.StaticBox.SetLabel)
import sys
from PythonCard import registry
registry.Registry.getInstance().register(sys.modules[__name__].StaticBox)
|