<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>pyjamas-webkit/doc/controls02/ControlDemo.html</filename>
    </added>
    <added>
      <filename>pyjamas-webkit/doc/controls02/ControlDemo.py</filename>
    </added>
    <added>
      <filename>pyjamas-webkit/doc/controls02/README.txt</filename>
    </added>
    <added>
      <filename>pyjamas-webkit/doc/controls02/build.sh</filename>
    </added>
    <added>
      <filename>pyjamas-webkit/doc/controls_tutorial02.html</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,8 +4,16 @@ from lxml import etree
 broken_html = open(&quot;examples/helloworld/Hello.html&quot;).read()
 
 doc = etree.HTML(broken_html)
-print doc, doc.attrib, dir(doc), dir(doc[0])
-print etree.tostring(doc)
-print doc.find('body')
-print doc.makeelement.__doc__
-print dir(etree)
+#print doc, doc.attrib, dir(doc), dir(doc[0])
+#print etree.tostring(doc)
+b = doc.find('body')
+#b.__reduce__ = lambda x:x
+b.__reduce__
+#print doc.makeelement.__doc__
+#print dir(etree)
+
+import pickle
+
+s = pickle.dumps(doc)
+
+print s</diff>
      <filename>pyjamas-web/f.py</filename>
    </modified>
    <modified>
      <diff>@@ -4,4 +4,4 @@ gendocs:
 	python gendocs.py
 
 upload:
-	rsync -HPavz *.html api controls shell.sf.net:/home/groups/p/py/pyjd/htdocs/
+	rsync -rlvz *.html api controls lkcl,pyjd@web.sf.net:htdocs/</diff>
      <filename>pyjamas-webkit/doc/Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -59,7 +59,12 @@ from pyjamas.ui import FocusWidget
     and setHeight().  We &lt;i&gt;do&lt;/i&gt; however want to pass in the slider's
     minimum, maximum and default values, and we may also want to keep
     track of who might be interested to know that the slider's value
-    has changed:
+    has changed.  This is an important point to emphasise: your widgets
+    should not impose &quot;look&quot; onto users - that should, ideally be
+    defined through CSS: your Widget Class API should be about 
+    &quot;function&quot; rather than &quot;form&quot;.  So - the constructor for the
+    widget has minimum, maximum and default values &lt;i&gt;not&lt;/i&gt; width
+    and height.
 &lt;/p&gt;
 &lt;pre class=&quot;code&quot;&gt;
 class VerticalDemoSlider(FocusWidget):</diff>
      <filename>pyjamas-webkit/doc/controls_tutorial.html</filename>
    </modified>
    <modified>
      <diff>@@ -54,6 +54,34 @@ def pathdirs():
             normdirs.append(normdir)
     return dirs
 
+def markup_code(doc):
+    code = []
+    res = []
+    code_found = 0
+    for line in doc.split('\n'):
+        try:
+            marker = line.index('&gt;&gt;&gt;')
+        except:
+            marker = -1
+        if marker &gt;= 0:
+            if not code_found:
+                code_found = 1
+                res.append(&quot;&lt;div style='border: 1px solid; padding: 5px;'&gt;&quot;)
+
+            c = line[marker+4:]
+            res.append(c)
+            code.append(c)
+        else:
+            if code_found:
+                res.append(&quot;&lt;/div&gt;&quot;)
+                code_found = 0
+            res.append(line)
+    
+    if code_found:
+        res.append(&quot;&lt;/div&gt;&quot;)
+
+    return '\n'.join(code), '\n'.join(res)
+
 def getdoc(object):
     &quot;&quot;&quot;Get the doc string or comments for an object.&quot;&quot;&quot;
     result = inspect.getdoc(object) or inspect.getcomments(object)
@@ -1035,7 +1063,6 @@ class ClassDoc(Composite):
         elif modules:
             self.modules = map(lambda (key, value), s=self: s.modulelink(value),
                                modules)
-        self.classes = None
         if classes:
             classlist = map(lambda (key, value): value, classes)
             self.classes = \
@@ -1117,6 +1144,9 @@ class ClassDoc(Composite):
                     push(self._docdescriptor(name, value, mod))
             return attrs
 
+        if name == 'AbsolutePanel':
+            print &quot;document&quot;, object, name
+
         def spilldata(msg, attrs, predicate):
             ok, attrs = _split_list(attrs, predicate)
             if ok:
@@ -1201,7 +1231,11 @@ class ClassDoc(Composite):
             for base in bases:
                 parents.append(self.classlink(base, object.__module__))
             title = title + '(%s)' % join(parents, ', ')
-        doc = self.markup(getdoc(object), self.preformat, funcs, classes, mdict)
+        doc = getdoc(object)
+        code, doc = markup_code(doc)
+        if code:
+            print &quot;code for %s:\n%s&quot; % (name, code)
+        doc = self.markup(doc, self.preformat, funcs, classes, mdict)
         doc = doc and '&lt;tt&gt;%s&lt;br&gt;&amp;nbsp;&lt;/tt&gt;' % doc
 
         return self.section(title, '#000000', '#ffc8d8', contents, 3, doc)
@@ -1484,6 +1518,7 @@ class TextDoc(Doc):
             title = title + '(%s)' % join(parents, ', ')
 
         doc = getdoc(object)
+        doc = self.markup(doc, self.preformat, fdict, cdict)
         contents = doc and [doc + '\n'] or []
         push = contents.append
 </diff>
      <filename>pyjamas-webkit/pydoc.py</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 &quot;&quot;&quot;
 
 from pyjamas import DOM
-from pyjamas.ui import FocusWidget
+from pyjamas.ui import FocusWidget, MouseListener, Event
 
 class VerticalDemoSlider(FocusWidget):
 
@@ -74,4 +74,43 @@ class VerticalDemoSlider(FocusWidget):
     def removeControlValueListener(self, listener):
         self.valuechange_listeners.remove(listener)
 
+class VerticalDemoSlider2(VerticalDemoSlider):
+
+    def __init__(self, min_value, max_value, start_value=None):
+
+        VerticalDemoSlider.__init__(self, min_value, max_value, start_value)
+        self.mouseListeners = []
+        self.addMouseListener(self)
+        self.sinkEvents(Event.MOUSEEVENTS)
+        self.dragging = False
+
+    def addMouseListener(self, listener):
+        self.mouseListeners.append(listener)
+
+    def removeMouseListener(self, listener):
+        self.mouseListeners.remove(listener)
+
+    def onBrowserEvent(self, event):
+        type = DOM.eventGetType(event)
+        if type == &quot;mousedown&quot; or type == &quot;mouseup&quot; or type == &quot;mousemove&quot; or type == &quot;mouseover&quot; or type == &quot;mouseout&quot;:
+            MouseListener().fireMouseEvent(self.mouseListeners, self, event)
+
+    def onMouseMove(self, sender, x, y):
+        if not self.dragging:
+            return
+        self.moveSlider(y)
+        
+    def onMouseDown(self, sender, x, y):
+        self.dragging = True
+        DOM.setCapture(self.getElement())
+        self.moveSlider(y)
+
+    def onMouseUp(self, sender, x, y):
+        self.dragging = False
+        DOM.releaseCapture(self.getElement())
+
+    def onMouseEnter(self, sender):
+        pass
+    def onMouseLeave(self, sender):
+        pass
 </diff>
      <filename>pyjamas-webkit/pyjamas/Controls.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>pyjamas-webkit/examples/controls/ControlDemo.html</filename>
    </removed>
    <removed>
      <filename>pyjamas-webkit/examples/controls/ControlDemo.py</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>107ee09fe0b811e88ce517ac2cfaaa58fea0a29a</id>
    </parent>
  </parents>
  <author>
    <name>lkcl</name>
    <email>lkcl@lkcl.net</email>
  </author>
  <url>http://github.com/lkcl/pyjamas-desktop/commit/1fa8592328c6b9815cbf01c35407021964c4c8c2</url>
  <id>1fa8592328c6b9815cbf01c35407021964c4c8c2</id>
  <committed-date>2008-10-03T07:03:06-07:00</committed-date>
  <authored-date>2008-10-03T07:03:06-07:00</authored-date>
  <message>add readme</message>
  <tree>72f215181688031a196e1df2ca75225da6d6d212</tree>
  <committer>
    <name>lkcl</name>
    <email>lkcl@lkcl.net</email>
  </committer>
</commit>
