Re: New win32lib and XML
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jan 06, 2004
- 369 views
On Tue, 6 Jan 2004 09:02:14 +1100, Derek Parnell <ddparnell at bigpond.com> wrote: >I'm already ahead of you. In the next win32lib, it would be possible to define >a window and its controls in a text file. This can then be used at run time to >instantiate the actual Windows controls. Its syntax is a bit but more compact >than XML. Your example above would look something like ... > > window, caption={Dialog Example} at={0,0} size={320,200} > > flags={new,ws_popup,ws_clipsiblings,ws_caption,ws_sysmenu,ws_ex_dlgmodalframe} > font={Comic Sans MS,10} > > label,caption={Static Text Example}, at{32,29}, size={70,11} > > editbox, name=1000, at={32,76}, size={78,14} > > icon, at={32,96}, size={32,32}, picture=xyzzy.ico > > button, caption={&OK}, at={86,179}, size={50,14} > > button, caption={&Cancel}, at={183,179}, size={50,14} > Nice. How about applying a font or other attribute to more than one control? Where's the design? > >Let's say you create these lines in a file called 'MyDialog.form', then your >app would read ... > >-------- > createForm( "file=MyDialog.form" ) > > global procedure Activate_Dialog_Example(integer self, integer event, > sequence parms) > . . . > end procedure > > global procedure Click_OK(integer self, integer event, sequence parms) hmm. What if I have several xxxDialog.form files, and several button, caption={&OK} ...? Or do you mean that in the absence of a name attribute, and/or provided the caption is unique, and/or Click_OK is expected to use getParent or similar to figure stuff out? >Am I getting close? Very. Regards, Pete