Andre Poenitz wrote: > On Thu, Mar 06, 2003 at 01:20:00PM +0000, Angus Leeming wrote: >> > Hm.. what's the relation between Controlers and Views? 1:1, 1:n >> > or something different? >> >> Each dialog has one controller and one view. > > Can one View view different Controlers?
Not often. However FormText is used by both the Label and Index dialogs. FormText thinks that it's controller is ControlCommand. In fact, the controllers are ControlIndex and ControlLabel (which derive from ControlCommand). > Can one View view different controler types? > Is the Controler type determined by the View type? No. Try this: class Dialog contains a Controller and a View. The gross functionality of the dialog is handled by Dialog. Stuff like: if (!kernel().buffer()) && controller().isBufferDependent()) view().hide(); Here controller() and view() are of type Dialog::Controller and Dialog::View. Thay are base classes containing only what Dialog needs to perform these gross manipulations. An individual Controller will specialise Dialog::Controller's pure virtual methods, eg ControlCommand::dispatch() will stringify InsetControlParams and pass it to lyxfunc::dispatch(LFUN_INSET_APPLY, data) This same individual Controller will also provide access to the local store of params() that are to be modified by the View and provide any utility methods that the View might need. Thus ViewCitation needs to know about ControlCitation rather tahn just Dialog::Controller. Do things become clearer? -- Angus