1* Obsolete notes ... 2 3** Form XML format: 4 5 + from the basic editor: 6 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"> 10 <dlg:bulletinboard> 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"/> 14 </dlg:titledbox> 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"/> 19 </dlg:bulletinboard> 20</dlg:window> 21 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 ... 31 + cd xmlscript/test 32 dmake 33 ../unxlngi6.pro/bin/imexp /opt/OOInstall ./test.xml 34 + generates & renders a dialog ... 35 36 + This code has ~all we need to get a simple impl. 37 + compatibility wrappers [!] 38 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 ), 44 xModel, xContext ); 45 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 ) ); 50 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 ); 55 56 // fourth - execute [ nasty ... ] 57 Reference< awt::XDialog > xD( xDlg, UNO_QUERY ); 58 xD->execute(); 59 60 61** Basic dialog editor: 62 63 + basctl/source/dlged/dlged.cxx 64 + dialog editor (?) 65 + basctl/source/basicide/basobj3.cxx 66 + basctl/source/basicide/basides3.cxx 67 + BasicIDEShell:CreateDlgWin ... 68 69 70** FIXME: 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 ? [!?] 77 78UnoControlContainer::addingControl: 79 + only caller to 'setContext' 80 + sets the 'Parent' for peers ... 81 82Dialog is an UnoControlContainer ... 83 + hmm ... 84 + 'XControlContainer' 85 + perhaps just what we need ... [!] 86 + our VBox should be one ... 87 88 + Other things: tab widgets are 'UnoControlContainers' ... 89 + finally remembered: xml foo ... 90 + 91 92 93 + FIXME: it -seems- that we don't store 94 much hierarchy in the model [ any ? ] 95 + UnoControlModel -> ? 96 97 + UnoControlDialogModel - has an XNameContainer ... 98 + but ... only the UnoControl-Dialog-Model has this ... 99 100 101 + Wow - even the percieved hierarchy: 102 + 'exportDialogModel' 103 + achieved by 'getElementNames' 104 -> flat set of names ... [urgh] 105 106 + So - we need to add more structure: 107 + XNameContainers ... 108 + that we insert into [!?] 109 + we also need to retain order for packing. 110 111 + need a list of sillies to reverse / revert (?) ... 112 113 + back-compat: 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 ... 119 120 + copy Dialog bits into unocontrolcontainer.cxx ... 121 + re-using unocontrolcontainer ... 122 123 124** FIXME: 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 ... 129 + unocontrols.cxx: 130 Uno 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 135 code ... 136 + ImplGetPropertyInfos ... 137 138 + add to vclxwindow.cxx: 139 + inc/toolkit/helper/property.hxx 140 + 'getProperties' static ... 141 142** It seems that things like UnoControlComboBoxModel are missing 143 some derived properties: EchoChar (etc.) 144 UnoControlDateFieldModel - missing ... EchoChar too (?) - deliberate ? 145 + query these ... [!?] 146 147layout 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) 154 155 + add regression test: 156 + count number of properties ... 157 158 159TODO: 160 add 'XPropertySetInfo' to VCLXWindow: 161 + trivial to implement :-) 162 + hook it to Ricardo's parser ... [!] :-) 163 164* xmlscript 165 + xmldlg_import.cxx - 166 + xml_helper/xml_impctx.cxx - foo ... 167 168 169* plan: 170 + hard-code container hooks into the xmlscript/ parser ... 171 + create a layout object in toolkit/ 172 + populate it with good things ... 173 174 + coupling to toolkit - widget instantiation: how ... 175 + ComponentInfos 176 + vclxtoolkit.cxx: 177 + has a 'hook function' for 'fnSvtCreateWindow' 178 for SVT widgets :-) [ grotesque ;-] 179 + [ wow - fetched by dlopen! ;-] 180 181 + A little app - a-la solver: using awt (?) 182 + XMessageBoxFactory ... 183 + XToolkit: 184 + CreateWindow ... 185 + ** how does the xml code generate these guys ? ** 186 187 + what APIs does the xmlimporter use ? not 'createWindow' seemingly. 188 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 ) 194 195 DialogImport: 196 css::uno::Reference< css::container::XNameContainer > _xDialogModel; 197 198 Reference< container::XNameContainer > xModel( xContext->getServiceManager()->createInstanceWithContext( 199 OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ), xContext ), UNO_QUERY ); 200 201 toolkit/source/controls/dialogcontrol.cxx 202 + UnoControlButtonModel (eg.) 203 + service 'UnoControlModel' ... 204 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 ? 211 212 + propose new syntax: [ with child properties a-la glade ]: 213 214 <hbox id="baa" flange="true"> 215 <child padding="0" expand="false" fill="false"> 216 <radio id="foo" value="..."/> 217 </child> 218 <radio id="foo" value="..."/> 219 </hbox> 220 221 + if 'child' element omitted - default properties used ... 222 + if multiple elements in same 'child' set: all have the same props. 223 224 225