On Oct 7, 2005, at 9:28 PM, Carl Karsten wrote:
I think I get it. I definatly get it enough to get back to my IDE
musings.
So the above would be saved as nested XML,
Yes. Here's a sample of the current 'state of the art' for the
Designer:
<dForm Width="584" Height="703" Caption="Dabo Designer"
designerClass="DesForm" BackColor="(221, 221, 221)" ShowCaption="True">
<dSizer Orientation="Vertical" BorderBottom="False"
BorderLeft="False" designerClass="LayoutSizer" BorderRight="False"
SlotCount="1" BorderTop="False" Border="0">
<dPanel Visible="True" sizerInfo="{'Border': 0, 'Halign':
'Left', 'Proportion': 1, 'Expand': True, 'Valign': 'Top'}"
designerClass="LayoutPanel" BackColor="(173, 216, 230)">
<dSizer Orientation="Vertical" BorderBottom="True"
BorderLeft="True" designerClass="LayoutSizer" BorderRight="True"
SlotCount="3" BorderTop="True" Border="1">
<dPanel Visible="True" sizerInfo="{'Border': 1,
'Halign': 'Left', 'Proportion': 1, 'Expand': True, 'Valign': 'Top'}"
designerClass="LayoutPanel" BackColor="(210, 180, 140)">
<dSizer Orientation="Horizontal"
BorderBottom="True" BorderLeft="True" designerClass="LayoutSizer"
BorderRight="True" SlotCount="4" BorderTop="True" Border="1">
<dLabel FontBold="False" Name="dLabel"
FontFace="Lucida Grande" sizerInfo="{'Border': 1, 'Halign': 'Left',
'Proportion': 1, 'Expand': True, 'Valign': 'Top'}" Caption="Label"
ForeColor="(0, 0, 0)" FontSize="13" BackColor="(221, 221, 221)"
designerClass="controlMix" FontItalic="False" ToolTipText=""></dLabel>
<dTextBox FontBold="False" Name="dTextBox"
sizerInfo="{'Border': 1, 'Halign': 'Left', 'Proportion': 1, 'Expand':
True, 'Valign': 'Top'}" Value="" ForeColor="(0, 0, 0)" DataSource=""
FontSize="13" DataField="" BackColor="(221, 221, 221)"
designerClass="controlMix" FontFace="Lucida Grande"
FontItalic="False" ToolTipText=""></dTextBox>
<dButton FontBold="False" Name="dButton"
FontFace="Lucida Grande" sizerInfo="{'Border': 1, 'Halign': 'Left',
'Proportion': 1, 'Expand': True, 'Valign': 'Top'}" Caption="Button"
ForeColor="(0, 0, 0)" FontSize="13" BackColor="(221, 221, 221)"
designerClass="controlMix" FontItalic="False" ToolTipText=""></dButton>
<dButton FontBold="False" Name="dButton1"
FontFace="Lucida Grande" sizerInfo="{'Border': 1, 'Halign': 'Left',
'Proportion': 1, 'Expand': False, 'Valign': 'Top'}" Caption="Button"
ForeColor="(0, 0, 0)" FontSize="13" BackColor="(221, 221, 221)"
designerClass="controlMix" FontItalic="False" ToolTipText=""></dButton>
</dSizer>
</dPanel>
</dSizer>
</dPanel>
</dSizer>
</dForm>
Right now it's a bit verbose since we don't have anything to
filter out default values.
and then at run time some sort of nested object that "looks" like
this:
vsz
+-addr1
+-addr2
\-hsz
+-city
+-st
\-zip
Yes, pretty much. One thing that can be confusing is that a
sizer is not an actual container; it's separate from the actual
objects themselves. They are simply rules that have object references
attached to them. In this example, all of the fields are contained by
the form, but the form has a layout method that iterates through its
sizers and arranges the controls accordingly.
In some sort of lisp like notation:
( addr1, addr2, ( city, st, zip ) )
Or in pointer values:
( 1, vsz, null )
( 2, addr1, 1 )
( 3, addr2, 1 )
( 4, hsz, 1 )
( 5, city, 4 )
( 6, st, 4 )
( 7, zip, 4 )
(lots more properties are stored, but im ignoring them to keep the
"pictures" simple.)
So somehow this structure is in memory, and then something can
render into what we see on the screen.
How close am I?
You are conceptually pretty close; the only difference is that a
sizer is not a container; it's a rule. The actual form hierarchy is
form
+-addr1
+-addr2
+-city
+-st
+-zip
Without sizers, they'd all be jumbled up on top of each other.
The form has a Sizer property that contains its main sizer (in this
case, the vertical sizer), and when its layout() method is invoked,
tells this sizer to determine where its contents go. It in turn calls
any nested sizers, gets their size and position, and so on.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users