[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef/src GFObjects.py GFTrigger.py UIbase...
From: |
Jason Cater |
Subject: |
gnue/gnuef/src GFObjects.py GFTrigger.py UIbase... |
Date: |
Sun, 10 Jun 2001 22:16:27 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/06/10 22:16:27
Modified files:
gnuef/src : GFObjects.py GFTrigger.py UIbase.py UIcurses.py
UIpyncurses.py UIwxpython.py
Log message:
Minor changes for GFDesigner
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects.py.diff?cvsroot=OldCVS&tr1=1.93&tr2=1.94&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFTrigger.py.diff?cvsroot=OldCVS&tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/UIbase.py.diff?cvsroot=OldCVS&tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/UIcurses.py.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/UIpyncurses.py.diff?cvsroot=OldCVS&tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/UIwxpython.py.diff?cvsroot=OldCVS&tr1=1.92&tr2=1.93&r1=text&r2=text
Patches:
Index: gnue/gnuef/src/GFObjects.py
diff -u gnue/gnuef/src/GFObjects.py:1.93 gnue/gnuef/src/GFObjects.py:1.94
--- gnue/gnuef/src/GFObjects.py:1.93 Thu Jun 7 18:36:52 2001
+++ gnue/gnuef/src/GFObjects.py Sun Jun 10 22:16:27 2001
@@ -202,11 +202,15 @@
# GFOption
#
class GFOption(GObj):
- def __init__(self, parent=None):
+ def __init__(self, parent=None, name="", value=None):
GObj.__init__(self, parent)
self._type = "GFOption"
- self.name = ""
+ self.name = name
self._value = ""
+ if value != None:
+ from gnue.common.GParser import GContent
+ self._value = value
+ GContent(self, value)
############################################################
Index: gnue/gnuef/src/GFTrigger.py
diff -u gnue/gnuef/src/GFTrigger.py:1.30 gnue/gnuef/src/GFTrigger.py:1.31
--- gnue/gnuef/src/GFTrigger.py:1.30 Sun Jun 10 15:41:43 2001
+++ gnue/gnuef/src/GFTrigger.py Sun Jun 10 22:16:27 2001
@@ -176,6 +176,11 @@
def dummyFunction(self, myself):
print "Trigger not implemented"
+ def getDescription(self):
+ if self.type == 'NAMED':
+ return self.name
+ else:
+ return VALIDTRIGGERS[self.type]
#
# Helper class for building the namespace for python triggers. All access
Index: gnue/gnuef/src/UIbase.py
diff -u gnue/gnuef/src/UIbase.py:1.37 gnue/gnuef/src/UIbase.py:1.38
--- gnue/gnuef/src/UIbase.py:1.37 Tue May 15 08:13:21 2001
+++ gnue/gnuef/src/UIbase.py Sun Jun 10 22:16:27 2001
@@ -68,13 +68,7 @@
global UI
UI = __import__(self.getModule(), globals(), locals(), ['UIAbout'])
- self.widgets = {'GFLabel' : UI.UILabel,
- 'GFBox' : UI.UIBox,
- 'GFPage' : UI.UIPage,
- 'GFForm' : UI.UIForm,
- 'GFEntry' : UI.UIEntry,
- 'GFButton' : UI.UIButton,
- 'GFScrollBar' : UI.UIScrollBar}
+ self.widgets = UI.WIDGETS
self._loginHandler = None
@@ -356,7 +350,7 @@
#
class UIWidget:
- def __init__(self, object, container, textWidth, textHeight, widgetWidth,
widgetHeight, interface):
+ def __init__(self, object, container, textWidth, textHeight, widgetWidth,
widgetHeight, interface, initialize=1):
self.widgets = []
if not hasattr(object,'visibleCount'):
@@ -378,10 +372,10 @@
if not object.hidden:
for spacer in range(int(object.visibleCount)):
- newWidget = self.createWidget(object, container, textWidth,
textHeight, widgetWidth, widgetHeight, interface, spacer)
+ newWidget = self.createWidget(object, container, textWidth,
textHeight, widgetWidth, widgetHeight, interface, spacer, initialize)
self.widgets.append(newWidget)
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight, interface, spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight, interface, spacer,initialize=1):
GDebug.printMesg(1,"UI doesn't support %s" % self.__class__)
Index: gnue/gnuef/src/UIcurses.py
diff -u gnue/gnuef/src/UIcurses.py:1.8 gnue/gnuef/src/UIcurses.py:1.9
--- gnue/gnuef/src/UIcurses.py:1.8 Mon May 14 13:04:20 2001
+++ gnue/gnuef/src/UIcurses.py Sun Jun 10 22:16:27 2001
@@ -929,3 +929,12 @@
elif 0: #(focus, NCChoice):
pass
+
+WIDGETS = {'GFLabel' : UILabel,
+ 'GFBox' : UIBox,
+ 'GFPage' : UIPage,
+ 'GFForm' : UIForm,
+ 'GFEntry' : UIEntry,
+ 'GFButton' : UIButton,
+ 'GFScrollBar' : UIScrollBar}
+
Index: gnue/gnuef/src/UIpyncurses.py
diff -u gnue/gnuef/src/UIpyncurses.py:1.18 gnue/gnuef/src/UIpyncurses.py:1.19
--- gnue/gnuef/src/UIpyncurses.py:1.18 Mon May 14 13:04:20 2001
+++ gnue/gnuef/src/UIpyncurses.py Sun Jun 10 22:16:27 2001
@@ -617,3 +617,12 @@
self.move(y,x)
self.refresh()
+
+WIDGETS = {'GFLabel' : UILabel,
+ 'GFBox' : UIBox,
+ 'GFPage' : UIPage,
+ 'GFForm' : UIForm,
+ 'GFEntry' : UIEntry,
+ 'GFButton' : UIButton,
+ 'GFScrollBar' : UIScrollBar}
+
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.92 gnue/gnuef/src/UIwxpython.py:1.93
--- gnue/gnuef/src/UIwxpython.py:1.92 Wed Jun 6 18:46:53 2001
+++ gnue/gnuef/src/UIwxpython.py Sun Jun 10 22:16:27 2001
@@ -756,7 +756,7 @@
# Widget set specific function that creates a single instance of a label
#
class UILabel(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
style = wxALIGN_LEFT|wxST_NO_AUTORESIZE
if hasattr(object,'alignment'):
@@ -778,7 +778,7 @@
# Widget set specific function that creates a single instance of a border box
#
class UIBox(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
newWidget = wxStaticBox(container,-1,str(object.label),
wxPoint(int(object.x)*int(widgetWidth)+(int(widgetWidth)/2),
(int(object.y)+spacer)*int(widgetHeight)+(int(widgetHeight)/2)),
@@ -794,7 +794,7 @@
# to navigate multiple records
#
class UIScrollBar(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
newWidget =wxScrollBar(container,-1,
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight)),
@@ -807,7 +807,7 @@
# Widget set specific function that creates a single instance of a button
#
class UIButton(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
newWidget = wxButton(container,-1,str(object.label),
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight))
@@ -823,7 +823,7 @@
# Widget set specific function that creates a single instance of a page
#
class UIPage(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
newWidget = wxPanel(container, -1,wxDefaultPosition,container.GetSize())
newWidget.Show(FALSE)
@@ -838,7 +838,7 @@
# Widget set specific function that creates a single instance of a data entry
widget
#
class UIEntry(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
if hasattr(object,'style'):
style = object.style
else:
@@ -846,10 +846,11 @@
if style == 'dropdown':
choices = []
- values = object.allowedValues()
- for key in values.keys():
- choices.append(values[key])
- choices.sort()
+ if initialize:
+ values = object.allowedValues()
+ for key in values.keys():
+ choices.append(values[key])
+ choices.sort()
newWidget = wxComboBox(container, -1, "",
wxPoint(int(object.x)*int(widgetWidth),
@@ -898,7 +899,7 @@
# Widget set specific function that creates a single instance of a Form widget
#
class UIForm(UIWidget, UIHelper):
- def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer):
+ def createWidget(self, object, container, textWidth, textHeight,
widgetWidth, widgetHeight,interface,spacer,initialize=1):
newWidget = wxPanel(interface.mainWindow.panel,-1, wxDefaultPosition)
EVT_CLOSE(interface.mainWindow,interface.closeTrap)
@@ -956,4 +957,14 @@
return val
except KeyboardInterrupt:
raise GLoginHandler.UserCanceledLogin
+
+
+
+WIDGETS = {'GFLabel' : UILabel,
+ 'GFBox' : UIBox,
+ 'GFPage' : UIPage,
+ 'GFForm' : UIForm,
+ 'GFEntry' : UIEntry,
+ 'GFButton' : UIButton,
+ 'GFScrollBar' : UIScrollBar}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnuef/src GFObjects.py GFTrigger.py UIbase...,
Jason Cater <=