Hi,
Carsten Driesner ha scritto:
[...]
>> Third (and last for now): com.sun.star.awt.UnoControlContainer and
>> com.sun.star.awt.UnoControlContainerModel go beyond my understanding,
>> although I've been using them so far this way
>>
>> - instantiate both at the global service manager
>> - set the model at the control
>> - add the control to a parent XControlContainer
>>
>> It turns out that the model can be instantiated at the dialog model's
>> XMultiServiceManager (obviously just because it supports
>> UnoControlModel), and then be inserted by name in the dialog model's
>> XNameContainer.
>> But when the control model is instantiated this way, there is no control
>> at all: XControlContainer::getControl() at the UnoControlDialog returns
>> null.
> The control is the "view" of the control model. If you insert a model
> there is no view. The view will be created on demand when you call
> execute() at XDialog.
In my test, the result is a null reference, before and after the
execute() call:
---------------------------------------------
REM ***** BASIC *****
Sub Main
oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
oCCM =
oDlg.Model.createInstance("com.sun.star.awt.UnoControlContainerModel")
With oCCM
.PositionX = 10
.PositionY = 10
.Width = 45
.Height = 14
End With
oDlg.Model.insertByName("CC", oCCM)
'test before execute
Print IsNull(oDlg.getControl("CC"))
oDlg.execute
'test after execute
Print IsNull(oDlg.getControl("CC"))
End Sub
---------------------------------------------
Trying the same test with ordinary controls (controls that are listed in
the dialog-model service manager) you will obtain a valid reference to
the control-view in both cases (before and after the execute() call)
Ciao
Paolo M
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]