Ok, I did "it" - I think.
here is what it is:
0 create db:
create table TableChar10 (
kTableChar10_pk int auto_increment primary key,
xFid1 Char(10) ) ;
1. run AW, make app:
2. run CD, make .cdxml and preview it (this creates CLASSTEXT.py - yay!)
3. open PagEditTablechar10.py, open CLASSTEXT.py
4a. remove the field specific stuff generated by AZ,
4b. insert field specific stuff generated by CD.
5. add 2 lines of this=that to get vars synked up.
Run app, edit data using new code. yay!
Closest thing to a problem is the 20ish lines in the console:
Dabo Error Log: ... Nested sizer missing its ControllingSizer
And the fact that I pushed lunch off till 4.
Below is the results of #4. now I eat.
Carl K
# PagEditTablechar10.py
# -*- coding: utf-8 -*-
import dabo
from PagEditBase import PagEditBase
class PagEditTablechar10(PagEditBase):
def initProperties(self):
self.super()
def createItems(self):
# The base class in datanav will create a default layout based
on the
# fieldspecs, if available. You can override or augment that
here.
self.super()
mainSizer = self.Sizer
gs = dabo.ui.dGridSizer(vgap=5, maxCols=3)
## ## Field TableChar10.xFid1
## label = self.addObject(dabo.ui.dLabel, NameBase="lblxFid1",
## Caption="xFid1")
## objectRef = self.addObject(dabo.ui.dTextBox, Caption="xFid1",
## NameBase="xFid1", DataSource="TableChar10",
## DataField="xFid1")
## gs.append(label, alignment=("top", "right") )
## gs.append(objectRef, "expand")
## gs.append( (25, 1) )
# cdxml shim code
currSizer = gs
currParent = self
# cdxml unaltered code start
obj = dabo.ui.dSizer(Orientation='Vertical')
if currSizer:
currSizer.append(obj)
currSizer.setItemProps(obj, {})
currSizer = obj
if not currParent.Sizer:
currParent.Sizer = obj
obj = dabo.ui.dGridSizer(HGap=5, VGap=5)
if currSizer:
currSizer.append(obj)
currSizer.setItemProps(obj, {'BorderSides': ['All'],
'Proportion': 1,
'HAlign': 'Left', 'VAlign': 'Top', 'Border': 10, 'Expand': True})
currSizer = obj
if not currParent.Sizer:
currParent.Sizer = obj
obj = dabo.ui.dLabel(currParent, attProperties={u'Caption':
u'xFid1'})
if currSizer:
currSizer.append(obj, row=0, col=0)
currSizer.setItemProps(obj, {'RowSpan': 1, 'RowExpand':
False, 'ColSpan': 1,
'Proportion': 0, 'HAlign': 'Right', 'ColExpand': False, 'VAlign': 'Middle',
'Expand': False})
obj = dabo.ui.dTextBox(currParent,
attProperties={u'DataSource':
u'TableChar10', u'DataField': u'xFid1'})
if currSizer:
currSizer.append(obj, row=0, col=1)
currSizer.setItemProps(obj, {'RowSpan': 1, 'RowExpand':
False, 'ColSpan': 1,
'Proportion': 0, 'HAlign': 'Left', 'ColExpand': True, 'VAlign': 'Middle',
'Expand': True})
# cdxml code end
gs.setColExpand(True, 1)
mainSizer.insert(0, gs, "expand", 1, border=20)
# AdI have d top and bottom margins
mainSizer.insert( 0, (-1, 10), 0)
mainSizer.append( (-1, 20), 0)
self.Sizer.layout()
self.itemsCreated = True
if __name__ == "__main__":
# magic code that should instantiate this,
# but I could never figure it out.
# eof PagEditTablechar10.py
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev