On Dec 29, 2009, at 3:08 PM, Sim Zacks wrote:
> I am testing out dabo for a project that I am working on.
> My table has a lot of fields and I do not want them all in one column,
> as is built by the DataClasses wizard.
>
> I tried to manually make 6 columns (3 fields per row) and put things
> where I wanted them but that was extremely
> tedious. I need the tabbing to work correctly, so I can't build 3 slots
> of a vertical sizer, I need to use a grid sizer.
>
> I looked at the cdxml file to see if i could just build it manually, but
> I didn't fully understand all the syntax.
>
> I'm looking for advice about the most practical way to build the kind of
> form I am looking for.
The cdxml file is simply XML whose element nesting matches the nesting
of objects in your design.
I can think of two ways to do what you need; I don't know which would
be faster/easier for you.
In either approach, I'd divide the form in two horizontally (with a
2-slot horizontal sizer): create the wizard-generated layout in the left half,
and the grid sizer you eventually want everything to be in on the right. Run
the wizard on the left half to create the controls and labels you want. Save.
The first approach is tedious but easier if you like working with GUI
tools. It would be to right-click/cut the first label on the wizard side, and
then right-click/paste it in the appropriate cell of the grid sizer on the
right side. Repeat with all the labels and controls until the right side is the
way you want it to be. Then go to the object tree and delete the left slot from
the main sizer, and you should be left with just the grid, with all the
controls laid out as you like.
The other approach is better if you prefer text editing. Open the cdxml
file in a text editor, and take a minute to identify the left and right halves;
now it's simply a matter of copying the controls from the left half to the
appropriate position in the right half. One catch is that you'll have to add
the appropriate 'rowColPos' attribute, as this is the value that determines the
position of the control in the grid sizer. Also, after you delete the lines for
the left half, you have to adjust the 'SlotCount' property of the containing
sizer to 1 instead of 2.
Neither way is simple, but they should work.
There is one other option, if you feel like hacking a bit. Open up
ClassDesigner.py in your ide directory, and go to line 3746: it should look
like this:
3744 if self.UseSizers:
3745 if useGrid:
3746 sz, pnl = self.addSizer("grid", pnl=pnl, rows=0, cols=2)
3747 else:
3748 sz, pnl = self.addSizer("box", orient="v", pnl=pnl, slots=0)
Change line 3746 to read:
3744 if self.UseSizers:
3745 if useGrid:
3746 sz, pnl = self.addSizer("grid", pnl=pnl, rows=0, cols=6)
3747 else:
3748 sz, pnl = self.addSizer("box", orient="v", pnl=pnl, slots=0)
Now run the wizard again. This time it will add controls to fill 6
columns in the grid sizer, instead of the default 2 columns. This should give
you the layout that you want. When you're done, be sure to change it back!
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]