[Anygui-checkins] CVS: anygui/lib/anygui Applications.py,1.24,1.25 Defaults.py,1.27,1.28 Frames.py,1
Brought to you by:
mlh
From: Dallas T. J. <pan...@us...> - 2002-11-16 16:45:02
|
Update of /cvsroot/anygui/anygui/lib/anygui In directory usw-pr-cvs1:/tmp/cvs-serv9861/lib/anygui Modified Files: Applications.py Defaults.py Frames.py Log Message: things are looking pretty good now. i decided to just make the file selection ('open') a callback via link & send. the client has to specify the link, of course. we still need to figure out a way to fix tkinter's focus deal. Index: Applications.py =================================================================== RCS file: /cvsroot/anygui/anygui/lib/anygui/Applications.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** Applications.py 13 Nov 2002 17:19:22 -0000 1.24 --- Applications.py 16 Nov 2002 16:44:59 -0000 1.25 *************** *** 8,14 **** _running = 0 ! _name = "Anygui App" ! _version = "0" ! def __init__(self, **kwds): Attrib.__init__(self) --- 8,14 ---- _running = 0 ! _name = 'Anygui App' ! _version = '0' ! def __init__(self, **kwds): Attrib.__init__(self) *************** *** 40,44 **** for w in flatten(win): self._windows.append(w) ! w.container = self w.wrapper.prod() --- 40,44 ---- for w in flatten(win): self._windows.append(w) ! w.container = self w.wrapper.prod() *************** *** 48,52 **** self.internalRemove() except: pass ! # FIXME: Temporary(?) fix to cover problem in mswgui _wndproc # FIXME: Destroy the window? --- 48,52 ---- self.internalRemove() except: pass ! # FIXME: Temporary(?) fix to cover problem in mswgui _wndproc # FIXME: Destroy the window? *************** *** 94,96 **** def quit(self): ! raise UnimplementedMethod, (self, "quit") --- 94,96 ---- def quit(self): ! raise UnimplementedMethod, (self, 'quit') Index: Defaults.py =================================================================== RCS file: /cvsroot/anygui/anygui/lib/anygui/Defaults.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** Defaults.py 16 Nov 2002 12:47:13 -0000 1.27 --- Defaults.py 16 Nov 2002 16:44:59 -0000 1.28 *************** *** 1,251 **** ! """ ! Defaults for the anygui package. ! ! Each class in module Defaults provides default attributes for the ! widget of the same name, plus an attribute named explicit_attributes ! that lists the attributes which need to be set explicitly per instance ! (currently, the latter defaults to "all defaulted attributes"). ! """ ! ! # FIXME: Change the default mechanism (i.e. state = {...}) ! ! # For the Frame.place method: ! ! direction = 'right' ! space = 10 ! ! #def _list_attributes(klass): ! # klass.explicit_attributes = klass.__dict__.keys() ! ! class Button: ! _defaultEvent = 'click' ! state = { ! 'text': 'Button', ! 'x': 0, ! 'y': 0, ! 'width': 80, ! 'height': 30, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1 ! } ! ! class Frame: ! state = { ! 'text': 'Frame', # Hardly needed... ! 'x': 0, ! 'y': 0, ! 'width': 400, ! 'height': 300, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1 ! } ! ! class Window: ! state = { ! 'text': 'Window', ! 'x': 30, ! 'y': 30, ! 'width': 400, ! 'height': 300, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1, ! 'title': 'Untitled' ! } ! ! class Label: ! state = { ! 'text': 'Label', ! 'x': 0, ! 'y': 0, ! 'width': 100, ! 'height': 15, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1, ! } ! ! class TextField: ! _defaultEvent = 'enterkey' ! state = { ! 'text' : '', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 25, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'editable' : 1, ! 'selection' : (0, 0), ! } ! ! # FIXME: Should be improved -- base new placement on top window etc. ! ! winX, winY = 0, 0 ! def shift_window(): ! global winX, winY ! winX += 30 ! winX %= 360 ! winY += 30 ! winY %= 360 ! ! class Canvas: ! state = { ! 'text' : 'Canvas', # Hardly needed..., ! 'x' : 0, ! 'y' : 0, ! 'width' : 400, ! 'height' : 300, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! } ! ! class CheckBox: ! _defaultEvent = 'click' ! state = { ! 'text' : 'CheckBox', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 15, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'on' : 0, ! } ! ! class ListBox: ! _defaultEvent = 'select' ! state = { ! 'text' : 'ListBox', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 100, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'items' : (), ! 'selection' : 0, ! } class ComboBox: _defaultEvent = 'select' ! state = { ! 'text' : 'ComboBox', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 15, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'items' : (), ! 'selection' : 0, ! 'lbxHeight' : 100, ! 'cbxHeight' : 22, ! 'btnWidth' : 18, ! } ! ! class RadioButton: ! _defaultEvent = 'click' ! state = { ! 'text' : 'RadioButton', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 15, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'on' : 0, ! 'group' : None, ! } ! ! class RadioGroup: ! _defaultEvent = 'select' ! state = { ! 'items' : None, ! 'value' : None, ! } ! ! class TextArea: ! state = { ! 'text' : '', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 100, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'editable' : 1, ! 'selection' : (0, 0), ! } ! ! class MenuBar: ! state = { ! 'contents' : [], ! 'enabled': 1 ! } ! ! class Menu: ! _defaultEvent = 'click' ! state = { ! 'contents' : [], ! 'enabled': 1 ! } ! ! class MenuCommand: ! _defaultEvent = 'click' ! state = { ! 'enabled': 1 ! } ! ! class MenuCheck: ! _defaultEvent = 'click' ! state = { ! 'enabled': 1 ! } ! ! class MenuSeparator: ! state = { ! 'enabled': 1 ! } --- 1,249 ---- ! """ ! Defaults for the anygui package. ! ! Each class in module Defaults provides default attributes for the ! widget of the same name, plus an attribute named explicit_attributes ! that lists the attributes which need to be set explicitly per instance ! (currently, the latter defaults to "all defaulted attributes"). ! """ ! ! # FIXME: Change the default mechanism (i.e. state = {...}) ! ! # For the Frame.place method: ! ! direction = 'right' ! space = 10 ! ! #def _list_attributes(klass): ! # klass.explicit_attributes = klass.__dict__.keys() ! ! class Button: ! _defaultEvent = 'click' ! state = { ! 'text': 'Button', ! 'x': 0, ! 'y': 0, ! 'width': 80, ! 'height': 30, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1 ! } ! ! class Frame: ! state = { ! 'text': 'Frame', # Hardly needed... ! 'x': 0, ! 'y': 0, ! 'width': 400, ! 'height': 300, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1 ! } ! ! class Window: ! state = { ! 'text': 'Window', ! 'x': 30, ! 'y': 30, ! 'width': 400, ! 'height': 300, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1, ! 'title': 'Untitled' ! } ! ! class Label: ! state = { ! 'text': 'Label', ! 'x': 0, ! 'y': 0, ! 'width': 100, ! 'height': 15, ! 'hmove': 0, ! 'vmove': 0, ! 'hstretch': 0, ! 'vstretch': 0, ! 'visible': 1, ! 'enabled': 1, ! } ! ! class TextField: ! _defaultEvent = 'enterkey' ! state = { ! 'text' : '', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 25, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'editable' : 1, ! 'selection' : (0, 0), ! } ! ! # FIXME: Should be improved -- base new placement on top window etc. ! ! winX, winY = 0, 0 ! def shift_window(): ! global winX, winY ! winX += 30 ! winX %= 360 ! winY += 30 ! winY %= 360 ! ! class Canvas: ! state = { ! 'text' : 'Canvas', # Hardly needed..., ! 'x' : 0, ! 'y' : 0, ! 'width' : 400, ! 'height' : 300, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! } ! ! class CheckBox: ! _defaultEvent = 'click' ! state = { ! 'text' : 'CheckBox', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 15, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'on' : 0, ! } ! ! class ListBox: ! _defaultEvent = 'select' ! state = { ! 'text' : 'ListBox', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 100, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'items' : (), ! 'selection' : 0, ! } class ComboBox: _defaultEvent = 'select' ! state = { ! 'text' : '', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 22, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'items' : (), ! 'selection' : 0, ! 'lbxHeight' : 100, ! } ! ! class RadioButton: ! _defaultEvent = 'click' ! state = { ! 'text' : 'RadioButton', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 15, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'on' : 0, ! 'group' : None, ! } ! ! class RadioGroup: ! _defaultEvent = 'select' ! state = { ! 'items' : None, ! 'value' : None, ! } ! ! class TextArea: ! state = { ! 'text' : '', ! 'x' : 0, ! 'y' : 0, ! 'width' : 100, ! 'height' : 100, ! 'hmove' : 0, ! 'vmove' : 0, ! 'hstretch' : 0, ! 'vstretch' : 0, ! 'visible' : 1, ! 'enabled' : 1, ! 'editable' : 1, ! 'selection' : (0, 0), ! } ! ! class MenuBar: ! state = { ! 'contents' : [], ! 'enabled': 1 ! } ! ! class Menu: ! _defaultEvent = 'click' ! state = { ! 'contents' : [], ! 'enabled': 1 ! } ! ! class MenuCommand: ! _defaultEvent = 'click' ! state = { ! 'enabled': 1 ! } ! ! class MenuCheck: ! _defaultEvent = 'click' ! state = { ! 'enabled': 1 ! } ! ! class MenuSeparator: ! state = { ! 'enabled': 1 ! } Index: Frames.py =================================================================== RCS file: /cvsroot/anygui/anygui/lib/anygui/Frames.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** Frames.py 13 Nov 2002 17:19:22 -0000 1.35 --- Frames.py 16 Nov 2002 16:44:59 -0000 1.36 *************** *** 1,3 **** ! import sys from anygui.Components import Component from types import TupleType, InstanceType, IntType, ListType --- 1,3 ---- ! import traceback from anygui.Components import Component from types import TupleType, InstanceType, IntType, ListType *************** *** 17,21 **** def wrapperFactory(self): return backendModule().FrameWrapper(self) ! def add(self,items,options=None,**kws): """ --- 17,21 ---- def wrapperFactory(self): return backendModule().FrameWrapper(self) ! def add(self,items,options=None,**kws): """ *************** *** 73,77 **** pass except: ! print "Layout error, please contact Anygui team:",sys.exc_info() pass --- 73,78 ---- pass except: ! print "Layout error, please contact Anygui team:" ! traceback.print_exc() pass |