~toolpart/+junk/pythoncard

« back to all changes in this revision

Viewing changes to tools/resourceEditor/modules/multiComponents.py

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-03-04 23:55:10 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100304235510-3v6lbhzwrgm0pcca
Tags: 0.8.2-1
* QA upload.
* New upstream release
* debian/control
  - set maintainer to QA group
  - set Homepage field, removing the URL from packages description
  - bump versioned b-d-i on python-support, to properly support Python module
  - replace b-d on python-all-dev with python-all, since building only
    arch:all packages
  - replace Source-Version substvar with source:Version
  - add ${misc:Depends} to binary packages Depends
* debian/watch
  - updated to use the SourceForge redirector; thanks to Raphael Geissert for
    the report and to Dario Minnucci for the patch; Closes: #449904
* debian/{pythoncard-doc, python-pythoncard}.install
  - use wildcards instead of site-packages to fix build with python 2.6;
    thanks to Ilya Barygin for the report and patch; Closes: #572332
* debian/pythoncard-doc.doc-base
  - set section to Programmin/Python
* debian/pythoncard-tools.menu
  - set menu main section to Applications
* debian/pythoncard-tools.postinst
  - removed, needed only to update the menu, but it's now created by debhelper

Show diffs side-by-side

added added

removed removed

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