[Anygui-checkins] CVS: anygui/lib/anygui Defaults.py,1.28,1.29 Applications.py,1.25,1.26
Brought to you by:
mlh
From: Robin B. <rgb...@us...> - 2002-11-16 17:50:06
|
Update of /cvsroot/anygui/anygui/lib/anygui In directory usw-pr-cvs1:/tmp/cvs-serv5990 Modified Files: Defaults.py Applications.py Log Message: Added Defaults.Application Index: Defaults.py =================================================================== RCS file: /cvsroot/anygui/anygui/lib/anygui/Defaults.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** Defaults.py 16 Nov 2002 16:44:59 -0000 1.28 --- Defaults.py 16 Nov 2002 17:50:02 -0000 1.29 *************** *** 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 ! } --- 1,252 ---- ! """ ! 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 Application: ! state = {} ! ! 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: Applications.py =================================================================== RCS file: /cvsroot/anygui/anygui/lib/anygui/Applications.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** Applications.py 16 Nov 2002 16:44:59 -0000 1.25 --- Applications.py 16 Nov 2002 17:50:03 -0000 1.26 *************** *** 5,9 **** import anygui ! class AbstractApplication(Attrib): _running = 0 --- 5,9 ---- import anygui ! class AbstractApplication(Attrib,anygui.Defaults.Application): _running = 0 |