5 + from the basic editor:
7 <?xml version="1.0" encoding="UTF-8"?>
8 <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
9 <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="204" dlg:top="148" dlg:width="136" dlg:height="115" dlg:closeable="true" dlg:moveable="true">
11 <dlg:button dlg:id="OkButtonName" dlg:tab-index="0" dlg:left="86" dlg:top="92" dlg:width="44" dlg:height="19" dlg:value="OkButtonLabel"/>
12 <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="1" dlg:left="4" dlg:top="7" dlg:width="68" dlg:height="41">
13 <dlg:title dlg:value="FrameControl1"/>
15 <dlg:scrollbar dlg:id="ScrollBar1" dlg:tab-index="2" dlg:left="82" dlg:top="10" dlg:width="45" dlg:height="24"/>
16 <dlg:scrollbar dlg:id="ScrollBar2" dlg:tab-index="3" dlg:left="107" dlg:top="43" dlg:width="21" dlg:height="37" dlg:align="vertical"/>
17 <dlg:timefield dlg:id="TimeField1" dlg:tab-index="4" dlg:left="4" dlg:top="92" dlg:width="28" dlg:height="19"/>
18 <dlg:text dlg:id="Label1" dlg:tab-index="5" dlg:left="22" dlg:top="61" dlg:width="44" dlg:height="15" dlg:value="Label1"/>
22 + code to read this & generate UIs is in:
23 + DTD: xmlscript/dtd/dialog.dtd
24 + xmlscript/source/xmldlg_imexp/imp_share.hxx, line 674
25 + xmlscript/source/misc/unoservices.cxx
26 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx (?)
27 "com.sun.star.comp.xmlscript.XMLBasicImporter"
28 + the dialog piece seems separate ?
29 "importDialogModel" ...
30 + cf. the interesting test code ...
33 ../unxlngi6.pro/bin/imexp /opt/OOInstall ./test.xml
34 + generates & renders a dialog ...
36 + This code has ~all we need to get a simple impl.
37 + compatibility wrappers [!]
39 // first create model:
40 Reference< container::XNameContainer > xModel( xContext->getServiceManager()->createInstanceWithContext(
41 OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), xContext ), UNO_QUERY );
42 // NB. xmldlg_addfunc.cxx not xmldlg_import.cxx [!?] ;-)
43 ::xmlscript::importDialogModel( ::xmlscript::createInputStream( bytes ),
46 // second create view of model:
47 Reference< awt::XControl > xDlg( xMSF->createInstance(
48 OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), UNO_QUERY );
49 xDlg->setModel( Reference< awt::XControlModel >::query( xModel ) );
51 // third - associate toolkit / peer ...
52 Reference< awt::XToolkit> xToolkit( xMSF->createInstance(
53 OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.ExtToolkit" ) ) ), UNO_QUERY );
54 xDlg->createPeer( xToolkit, 0 );
56 // fourth - execute [ nasty ... ]
57 Reference< awt::XDialog > xD( xDlg, UNO_QUERY );
61 ** Basic dialog editor:
63 + basctl/source/dlged/dlged.cxx
65 + basctl/source/basicide/basobj3.cxx
66 + basctl/source/basicide/basides3.cxx
67 + BasicIDEShell:CreateDlgWin ...
71 + createPeer - when called is always passed
72 the toplevel [ it seems ... ]
73 + we need to pass a container instead ...
74 + or have some separate hint / method ?
75 + or call the 'setChild' inside the model
76 construction bits ? [!?]
78 UnoControlContainer::addingControl:
79 + only caller to 'setContext'
80 + sets the 'Parent' for peers ...
82 Dialog is an UnoControlContainer ...
85 + perhaps just what we need ... [!]
86 + our VBox should be one ...
88 + Other things: tab widgets are 'UnoControlContainers' ...
89 + finally remembered: xml foo ...
93 + FIXME: it -seems- that we don't store
94 much hierarchy in the model [ any ? ]
95 + UnoControlModel -> ?
97 + UnoControlDialogModel - has an XNameContainer ...
98 + but ... only the UnoControl-Dialog-Model has this ...
101 + Wow - even the percieved hierarchy:
102 + 'exportDialogModel'
103 + achieved by 'getElementNames'
104 -> flat set of names ... [urgh]
106 + So - we need to add more structure:
107 + XNameContainers ...
108 + that we insert into [!?]
109 + we also need to retain order for packing.
111 + need a list of sillies to reverse / revert (?) ...
114 + kill bogus nesting eg. radiogroup ...
115 [ have a group/tag instead - or hierarchical names ? ]
116 + ditto for 'titledbox' ...
117 + menulists - seem rather unrelated / bogus anyway.
118 + Add into toplevel & child ...
120 + copy Dialog bits into unocontrolcontainer.cxx ...
121 + re-using unocontrolcontainer ...
125 + we need property introspection on the awt widgets:
126 + but they have no property interfaces [!] -
127 interestingly the UnoControl's don't either
128 only the UnoControlModel foo ...
131 + source/helper/property.cxx
132 + has all the type information ...
133 + but no information on what properties are
134 valid for a type ... - implicit in the UnoControlModel's
136 + ImplGetPropertyInfos ...
138 + add to vclxwindow.cxx:
139 + inc/toolkit/helper/property.hxx
140 + 'getProperties' static ...
142 ** It seems that things like UnoControlComboBoxModel are missing
143 some derived properties: EchoChar (etc.)
144 UnoControlDateFieldModel - missing ... EchoChar too (?) - deliberate ?
145 + query these ... [!?]
147 layout container - start child 'combobox'
148 missing property 46 (EchoChar)
149 missing property 48 (HardLineBreaks)
150 missing property 12 (HScroll)
151 missing property 104 (LineEndFormat)
152 missing property 10 (MultiLine)
153 missing property 13 (VScroll)
155 + add regression test:
156 + count number of properties ...
160 add 'XPropertySetInfo' to VCLXWindow:
161 + trivial to implement :-)
162 + hook it to Ricardo's parser ... [!] :-)
165 + xmldlg_import.cxx -
166 + xml_helper/xml_impctx.cxx - foo ...
170 + hard-code container hooks into the xmlscript/ parser ...
171 + create a layout object in toolkit/
172 + populate it with good things ...
174 + coupling to toolkit - widget instantiation: how ...
177 + has a 'hook function' for 'fnSvtCreateWindow'
178 for SVT widgets :-) [ grotesque ;-]
179 + [ wow - fetched by dlopen! ;-]
181 + A little app - a-la solver: using awt (?)
182 + XMessageBoxFactory ...
185 + ** how does the xml code generate these guys ? **
187 + what APIs does the xmlimporter use ? not 'createWindow' seemingly.
189 + existing xml import uses: property bag a -lot-:
190 Reference< beans::XPropertySet > xProps(
191 _pImport->_xDialogModel, UNO_QUERY_THROW );
192 * we do _xDialogModel->insertByName (new any<XControlModel>())
193 + to build hierarchy ( cf. ~ControlImportContext )
196 css::uno::Reference< css::container::XNameContainer > _xDialogModel;
198 Reference< container::XNameContainer > xModel( xContext->getServiceManager()->createInstanceWithContext(
199 OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), xContext ), UNO_QUERY );
201 toolkit/source/controls/dialogcontrol.cxx
202 + UnoControlButtonModel (eg.)
203 + service 'UnoControlModel' ...
205 + poke at 'titledbox' or 'radiogroup' to see how containment works there ...
206 + how will child widget properties work ?
207 + bug with a 'vbox' inside a 'titledbox' ...
208 + titledbox - acts as a container (interesting)
209 - offsetting child positions
210 + how will pseudo-containers eg. "radiogroup" cope ?
212 + propose new syntax: [ with child properties a-la glade ]:
214 <hbox id="baa" flange="true">
215 <child padding="0" expand="false" fill="false">
216 <radio id="foo" value="..."/>
218 <radio id="foo" value="..."/>
221 + if 'child' element omitted - default properties used ...
222 + if multiple elements in same 'child' set: all have the same props.