Hello Andrzej !
Hi !
> I decided to stay with XAWindow for usage with TabListener, but I
> implemented XWindowListener inside my class. It looks like putting a
> TabListener to the same class will make it a bit crowded with methods of
> similar names...
OK ... at least it's a design decision made by you. As I've already
mentioned ... why not ! .-)
I was thinking it over and over and hasitating between the option of adding a new interface or implementing an existing one, but I thought that things are a bit clearer this way. Maybe there is some third alternative that would satisfy both needs, I don't know :/
OK - Correct now.
Small hint: You should correct the flags for creating the child window a
little bit. They dont need realy a border ... nor the must be moveable
and so on.
Right, another messy part here ;-)
> Done. The createSingleFactory fix came out really helpful.
> Test basic now looks like this :
> Sub Main
>
> taskcreator = createUnoService("foo.AWindow")
> msgbox taskcreator.dbg_supportedInterfaces
>
> frame = taskcreator.createInstance()
> msgbox frame.dbg_supportedInterfaces
>
> frame.getContainerWindow().setVisible(TRUE)
>
> frame1 = taskcreator.createInstance()
> frame1.getContainerWindow ().setVisible(TRUE)
> End Sub
>
Works now. But you retrieve the ParentWindow everytimes a new frame
should be created. That's not neccessary. You can cache it. It's the
same TabControl providing the same TabParentWindow everytimes you are
asking for it.
OK
And further you register yourself as ResizeListener more
then ones on this ParentWindow. That's not needed (and by the way
dangerous) too. Why ?
mess++ I guess ;)
Your reference exists inside such listener
container more then once (if call addListener() more then once). And you
will be called back more then once .-)
Means: N times disposing() ... N times activate() ... and so on .-)
There is little mistake. Now you dont create two child windows ... but
you create two frames ... why ?
mess++ and also a little confusion from my part I think. I was trying to figure out at which point the main window gets created - I understood later that it's being created somehow by the TabControl, not by me. That said, I don't really remember why hasn't it been thrown out yet ;-)
Please have a look on the attached PDF file. There I've tried to show
you the relations between the involved objects.
Your method "createInstanceWithContext() has to create 1 frame
initialized with 1 child window only. Please remove xFrameParent completly.
OK
Further there is no need to create more then one ResizeListener.
This listener must forward resize events from 1 ParentWindow to X
ChildWindows. There is no need to forward resizes from the ChildWindows
back to e.g. the ParentWindow.
this is done to see if the children are switched properly, as you can see the children have a different implementation of XWindowListener, the only thing it does is broadcast a message
that an event has been trigerred on the child.
>
> c)
> Every new created child window should get the right size initialy.
> Means: instead of using a default, you should use the actual
> size of the
> parent window. Otherwhise you open "small documents" inside big
> windows.
> And only the first move or resize of the parent window will
> bring the
> right size to the tab window.
>
>
> Yes, I left that like this on purpose - to see that both windows are
> properly handled
> by the component. It'll be corrected.
Another little problem.
Every new created tab should be activated automaticly. Currently the new
document is shown ... but the old "tab button" is active.
I had to forget about this, I had it in mind.
I miss the menu handling and closing the frames ...
I'm working on it :-)
But this version is nearly the "Finish" of our last non optional step !
wow, I didn't think it would be *that* simple :-)
I have some more remarks on my code, I'm not sure about a couple of things.
* What's the policy for exceptions ? I'd say that if I throw any exceptions inside my class, which are not related to sam interface implementation directly, I mean they're not mandatory, but added by me, those exceptions should be caught by my class too, so there are no unhandle ones, right?
* About the mutex locks. I don't think that I understand this properly, and I like to clean this thing up. You said that whenever I call any outside services I should unlock, and I should use only copies of ref counted objects to do so. This pretty much means, that I should lock only when doing something with a class member, like, say, m_xActiveID = 5; right ?
* Finally, I'm not sure about the childWindows parent, I mean the one setup in the windowDescriptor (wDesc) specifically, is it OK to put the TabControlParentWindow there ?
Regards
Andreas
Regards,
Andrzej