[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnuef src/GFForm.py src/UIwxpython.py samp...
From: |
James Thompson |
Subject: |
gnue/gnuef src/GFForm.py src/UIwxpython.py samp... |
Date: |
Fri, 08 Dec 2000 17:02:50 -0800 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 00/12/08 17:02:49
Modified files:
gnuef/src : GFForm.py UIwxpython.py
Added files:
gnuef/samples/tests: placement.gfd
Log message:
Added a little spacer support for char based placement
CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/samples/tests/placement.gfd.diff?r1=NONE&r2=1.1
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFForm.py.diff?r1=1.46&r2=1.47
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.37&r2=1.38
Patches:
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.46 gnue/gnuef/src/GFForm.py:1.47
--- gnue/gnuef/src/GFForm.py:1.46 Fri Dec 8 13:49:58 2000
+++ gnue/gnuef/src/GFForm.py Fri Dec 8 17:02:49 2000
@@ -77,6 +77,9 @@
self.blockList = []
+ self.borderPercentage = 10
+ self.textPercentage = 7.5
+
def run(self, URL):
# Create a parser
parser = saxexts.make_parser()
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.37 gnue/gnuef/src/UIwxpython.py:1.38
--- gnue/gnuef/src/UIwxpython.py:1.37 Fri Dec 8 13:49:58 2000
+++ gnue/gnuef/src/UIwxpython.py Fri Dec 8 17:02:49 2000
@@ -48,17 +48,19 @@
'exitApplication': self.exitApplication
})
-# self.widgetConstructor = {
-# 'GFLabel':
-# """wxStaticText(container, -1,
str(object.text),
-#
wxDLG_PNT(container,wxPoint(int(self.charWidth)*int(object.x),
-# int(self.charHeight)*int(object.y))),
-# wxDefaultSize)"""
-# }
+## self.widgetConstructor = {
+## 'GFLabel':
+## """wxStaticText(container, -1,
str(object.text),
+##
wxPoint(int(object.x)*int(self.charWidth*self.borderPercentage),
+##
(int(object.y)+spacer)*int(self.charHeight*self.borderPercentage)),
+## wxDefaultSize)"""
+## }
+
self.widgetConstructor = {
'GFLabel':
- """wxStaticText(container, -1, str(object.text),
-
wxPoint(int(self.charWidth)*int(object.x),int(self.charHeight)*int(object.y)),
+ """wxStaticText(container, -1, str(object.text),
+ wxPoint(int(object.x)*int(self.widgetWidth),
+
(int(object.y)+spacer)*int(self.widgetHeight)),
wxDefaultSize)"""
}
@@ -410,10 +412,17 @@
wxDefaultPosition, wxSize(int(self.form.width),
int(self.form.height)))
self.charWidth = self.frame.GetCharWidth()
self.charHeight = self.frame.GetCharHeight()
- print "Font width is ", self.charWidth
- print "Font height is ", self.charHeight
+
+ self.borderPercentage = (20.0 / 100.0)+1
+ self.textPercentage = (7.5 / 100.0)+1
+ self.widgetWidth = self.charWidth * self.borderPercentage
+ self.widgetHeight = self.charHeight * self.borderPercentage
+ self.textWidth = self.charWidth * self.textPercentage
+ self.textHeight = self.charHeight * self.textPercentage
+
+
self.statusBar = self.frame.CreateStatusBar()
self.statusBar.SetFieldsCount(4)
self.statusBar.SetStatusWidths([-1,100,50,100])
@@ -540,22 +549,22 @@
values = object.allowedValues()
for key in values.keys():
choices.append(values[key])
-
+
newWidget = wxComboBox(container, -1, "",
- wxPoint(int(self.charWidth)*int(object.x),
-
int(self.charHeight)*(int(object.y)+spacer)),
- wxSize(int(object.width)*int(self.charWidth),
- int(object.height)*int(self.charHeight)),
+ wxPoint(int(object.x)*int(self.widgetWidth),
+
(int(object.y)+spacer)*int(self.widgetHeight)),
+ wxSize(int(object.width)*int(self.textWidth),
+ int(object.height)*int(self.textHeight)),
choices, wxCB_READONLY)
newWidget.SetValue("")
EVT_CHAR(newWidget, self.uiEventTrap)
EVT_COMBOBOX(newWidget, newWidget.GetId(), self.uiEventTrap)
else:
newWidget = wxTextCtrl(container, -1, object.value,
- wxPoint(int(self.charWidth)*int(object.x),
-
int(self.charHeight)*(int(object.y)+spacer)),
- wxSize(int(object.width)*int(self.charWidth),
- int(object.height)*int(self.charHeight)))
+ wxPoint(int(object.x)*int(self.widgetWidth),
+
(int(object.y)+spacer)*int(self.widgetHeight)),
+ wxSize(int(object.width)*int(self.textWidth),
+ int(object.height)*int(self.textHeight)))
EVT_CHAR(newWidget, self.uiEventTrap)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnuef src/GFForm.py src/UIwxpython.py samp...,
James Thompson <=