Permalink
Browse files

fix import issues

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@40 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
1 parent d39b819 commit 306ef68f7522bf06cdb85dbddbf5da6b7fc1c218 lkcl committed Oct 17, 2008
Showing with 4,623 additions and 4,311 deletions.
  1. +4 −4 examples/gridtest/GridTest.py
  2. +1 −1 examples/kitchensink/Buttons.py
  3. +1 −1 examples/kitchensink/Frames.py
  4. +1 −1 examples/kitchensink/Images.py
  5. +5 −2 examples/kitchensink/Info.py
  6. +3 −3 examples/kitchensink/KitchenSink.py
  7. +2 −2 examples/kitchensink/Layouts.py
  8. +1 −1 examples/kitchensink/Lists.py
  9. +1 −1 examples/kitchensink/Logger.py
  10. +3 −3 examples/kitchensink/Menus.py
  11. +2 −2 examples/kitchensink/Popups.py
  12. +3 −3 examples/kitchensink/Sink.py
  13. +3 −1 examples/kitchensink/SinkList.py
  14. +3 −2 examples/kitchensink/Tables.py
  15. +1 −1 examples/kitchensink/Tabs.py
  16. +1 −1 examples/kitchensink/Text.py
  17. +1 −1 examples/kitchensink/Trees.py
  18. +41 −7 examples/tabpanelwidget/Tabs.py
  19. BIN examples/tabpanelwidget/public/.Tabs.css.swo
  20. BIN examples/tabpanelwidget/public/.Tabs.css.swp
  21. +178 −0 examples/tabpanelwidget/public/Tabs.css
  22. BIN examples/tabpanelwidget/public/images/corner_dialog_bottomleft.png
  23. BIN examples/tabpanelwidget/public/images/corner_dialog_bottomleft_black.png
  24. BIN examples/tabpanelwidget/public/images/corner_dialog_bottomright.png
  25. BIN examples/tabpanelwidget/public/images/corner_dialog_bottomright_black.png
  26. BIN examples/tabpanelwidget/public/images/corner_dialog_edge.png
  27. BIN examples/tabpanelwidget/public/images/corner_dialog_edge_black.png
  28. BIN examples/tabpanelwidget/public/images/corner_dialog_topleft.png
  29. BIN examples/tabpanelwidget/public/images/corner_dialog_topleft_black.png
  30. BIN examples/tabpanelwidget/public/images/corner_dialog_topright.png
  31. BIN examples/tabpanelwidget/public/images/corner_dialog_topright_black.png
  32. 0 examples/tabpanelwidget/public/images/f
  33. +4 −3 library/Window.py
  34. +4,341 −4,231 library/ui.py
  35. +23 −40 library/ui.py.orig
@@ -1,7 +1,7 @@
-from ui import Button, RootPanel
-from ui import Label, Grid, CellFormatter, RowFormatter
-from ui import HTMLTable, CheckBox
-import Window
+from pyjamas.ui import Button, RootPanel
+from pyjamas.ui import Label, Grid, CellFormatter, RowFormatter
+from pyjamas.ui import HTMLTable, CheckBox
+from pyjamas import Window
class GridTest:
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import Button, CheckBox, VerticalPanel, HorizontalPanel, RadioButton
+from pyjamas.ui import Button, CheckBox, VerticalPanel, HorizontalPanel, RadioButton
class Buttons(Sink):
def __init__(self):
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import Frame
+from pyjamas.ui import Frame
class Frames(Sink):
def __init__(self):
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import DockPanel, Image, VerticalPanel, HasAlignment, HTML
+from pyjamas.ui import DockPanel, Image, VerticalPanel, HasAlignment, HTML
class Images(Sink):
def __init__(self):
@@ -1,8 +1,11 @@
from Sink import Sink, SinkInfo
-from ui import HTML
+from pyjamas.ui import HTML
class Info(Sink):
def __init__(self):
+
+ Sink.__init__(self)
+
text="<div class='infoProse'>This is the Kitchen Sink sample. "
text+="It demonstrates many of the widgets in the Google Web Toolkit."
text+="<p>This sample also demonstrates something else really useful in GWT: "
@@ -19,4 +22,4 @@ def onShow(self):
def init():
- return SinkInfo("Info", "Introduction to the Kitchen Sink.", Info)
+ return SinkInfo("Info", "Introduction to the Kitchen Sink.", Info)
@@ -1,7 +1,7 @@
from pyjamas.ui import Button, RootPanel, HTML, DockPanel, HasAlignment, Hyperlink, VerticalPanel
from pyjamas import Window
from SinkList import SinkList
-from History import History
+from pyjamas.History import History
import Info
import Buttons
import Layouts
@@ -64,10 +64,10 @@ def show(self, info, affectHistory):
if info == self.curInfo: return
self.curInfo = info
- Logger.write("showing " + info.getName())
+ #Logger.write("showing " + info.getName())
if self.curSink <> None:
self.curSink.onHide()
- Logger.write("removing " + self.curSink)
+ #Logger.write("removing " + self.curSink)
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
@@ -1,7 +1,7 @@
from Sink import Sink, SinkInfo
-from ui import Button, CheckBox, VerticalPanel, HorizontalPanel, HTML, DockPanel, HasAlignment, FlowPanel, HTMLPanel, MenuBar, MenuItem, ScrollPanel
+from pyjamas.ui import Button, CheckBox, VerticalPanel, HorizontalPanel, HTML, DockPanel, HasAlignment, FlowPanel, HTMLPanel, MenuBar, MenuItem, ScrollPanel
from Logger import Logger
-import DOM
+from pyjamas import DOM
class Layouts(Sink):
def __init__(self):
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import ListBox, HorizontalPanel, VerticalPanel, HasAlignment, Label, Widget
+from pyjamas.ui import ListBox, HorizontalPanel, VerticalPanel, HasAlignment, Label, Widget
class Lists(Sink):
def __init__(self):
@@ -1,4 +1,4 @@
-from ui import Grid
+from pyjamas.ui import Grid
class Logger(Grid):
instances = []
@@ -1,6 +1,6 @@
from Sink import Sink, SinkInfo
-from ui import MenuBar, MenuItem
-import Window
+from pyjamas.ui import MenuBar, MenuItem
+from pyjamas import Window
class Menus(Sink):
def __init__(self):
@@ -42,4 +42,4 @@ def onShow(self):
def init():
- return SinkInfo("Menus", "The GWT <code>MenuBar</code> class makes it easy to build menus, including cascading sub-menus.", Menus)
+ return SinkInfo("Menus", "The GWT <code>MenuBar</code> class makes it easy to build menus, including cascading sub-menus.", Menus)
@@ -1,6 +1,6 @@
from Sink import Sink, SinkInfo
-from ui import Button, VerticalPanel, PopupPanel, ListBox, HTML, DockPanel, DialogBox, Frame, HasAlignment
-import DOM
+from pyjamas.ui import Button, VerticalPanel, PopupPanel, ListBox, HTML, DockPanel, DialogBox, Frame, HasAlignment
+from pyjamas import DOM
class Popups(Sink):
def __init__(self):
@@ -1,8 +1,8 @@
-from ui import Composite
+from pyjamas.ui import Composite
class Sink(Composite):
def __init__(self):
- pass
+ Composite.__init__(self)
def onHide(self):
pass
@@ -21,7 +21,7 @@ def __init__(self, name, desc, object_type):
self.instance=None
def createInstance(self):
- if self.object_type.__new__:
+ if hasattr(self.object_type, "__new__"):
return self.object_type.__new__()
return self.object_type()
@@ -1,8 +1,10 @@
-from ui import Composite, VerticalPanel, Hyperlink
+from pyjamas.ui import Composite, VerticalPanel, Hyperlink
from Logger import Logger
class SinkList(Composite):
def __init__(self):
+ Composite.__init__(self)
+
self.vp_list=VerticalPanel()
self.sinks=[]
self.selectedSink=-1
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import Grid, FlexTable, HasHorizontalAlignment, Image
+from pyjamas.ui import Grid, FlexTable, HasHorizontalAlignment, Image
class Tables(Sink):
def __init__(self):
@@ -31,4 +31,5 @@ def onShow(self):
def init():
text="The <code>FlexTable</code> widget doubles as a tabular data formatter and a panel. In this example, you'll see that there is an outer table with four cells, two of which contain nested components."
- return SinkInfo("Tables", text, Tables)
+ return SinkInfo("Tables", text, Tables)
+
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import TabPanel, HasAlignment, Image, VerticalPanel
+from pyjamas.ui import TabPanel, HasAlignment, Image, VerticalPanel
class Tabs(Sink):
def __init__(self):
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import Button, HorizontalPanel, HTML, PasswordTextBox, TextArea, TextBox, TextBoxBase, VerticalPanel, Widget
+from pyjamas.ui import Button, HorizontalPanel, HTML, PasswordTextBox, TextArea, TextBox, TextBoxBase, VerticalPanel, Widget
class Text(Sink):
def __init__(self):
@@ -1,5 +1,5 @@
from Sink import Sink, SinkInfo
-from ui import Tree, TreeItem
+from pyjamas.ui import Tree, TreeItem
class Trees(Sink):
def __init__(self):
@@ -1,22 +1,56 @@
-from ui import TabPanel, HasAlignment, Image, VerticalPanel, RootPanel
+from pyjamas.ui import TabPanel, HasAlignment, Image, VerticalPanel, RootPanel
+from pyjamas.ui import HorizontalPanel, HTML, Composite
+#from pyjamas.ui import DecoratorPanel
+from pyjamas.ui import MouseListener, Event
+from pyjamas import Window
+from pyjamas.decoratorpanel import DecoratedTabPanel, DecoratorPanel
+
+#class PrettyTab(DecoratorPanel):
+class PrettyTab(Composite):
+
+ def __init__(self, text, imageUrl):
+
+ DecoratorPanel.__init__(self, DecoratorPanel.DECORATE_ALL)
+
+ p = HorizontalPanel()
+ p.setSpacing(3)
+ self.img = Image(imageUrl)
+ self.txt = HTML(text)
+ p.add(self.img)
+ p.add(self.txt)
+
+ self.add(p)
+
+ def addClickListener(self, listener):
+
+ self.img.addClickListener(listener)
+ self.txt.addClickListener(listener)
class Tabs:
def onModuleLoad(self):
- red = Image("images/user_red.png")
- red.setStyleName('gwt-TabBarItem')
- self.fTabs = TabPanel()
- self.fTabs.add(self.createImage("rembrandt/JohannesElison.jpg"), red)
- self.fTabs.add(self.createImage("rembrandt/SelfPortrait1640.jpg"), "1640")
+ #red = PrettyTab("1638", "images/user_red.png")
+ #red.setStyleName('gwt-TabBarItem')
+
+ #green = PrettyTab("1640", "images/user_green.png")
+ #red.setStyleName('gwt-TabBarItem')
+ red = "1638"
+ green = "1640"
+
+ self.fTabs = DecoratedTabPanel()
+ self.fTabs.add(self.createImage("rembrandt/JohannesElison.jpg"), red, True)
+ self.fTabs.add(self.createImage("rembrandt/SelfPortrait1640.jpg"), green, True)
self.fTabs.add(self.createImage("rembrandt/LaMarcheNocturne.jpg"), "1642")
self.fTabs.add(self.createImage("rembrandt/TheReturnOfTheProdigalSon.jpg"), "1662")
self.fTabs.selectTab(0)
self.fTabs.setWidth("100%")
self.fTabs.setHeight("100%")
- RootPanel().add(self.fTabs)
+ dp = DecoratorPanel()
+ dp.add(self.fTabs)
+ RootPanel().add(dp)
def createImage(self, imageUrl):
image = Image(imageUrl)
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 306ef68

Please sign in to comment.