Hello Andrzej !


On 8/8/05, *Andrzej Wytyczak-Partyka* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    OK, I'm trying to get those done right now, but have some questions.


Mostly self-answered already ;-)
This was one of theese days when I find doing over thinking.
It took me the whole day to think through your directions
and I still didn't really get it when I started writing. And then
most of the things came out to be self-explanatory.
So :

        Dont derive your class directly from an interface if you use the
        template cppu::WeakImplHelperX<>. Please adapt the list of interface
        already used within this template.
        E.g.
        class YourClass : public ::cppu::WeakImplHelper1< XInterface1 >
        class YourClass : public ::cppu::WeakImplHelper2< XInterface1,
        XInterface2 > and so on.
        And further dont implement the methods of XInterface/XTypeProvider
        directly on your class, if you use WeakImplHelper! Because this
        template
        does it already for you. And it's not a good idea to have two
        ref count
        variables at the same object.


Done. I had to use WeakImplHelper5 though ;-)

OK.


        b)

        You use a special interface XAWindow to forward resizes of the
        parent
        window to the child tab windows. Why not .-) But there is an
        easier way.
        You can add yourself (means your cMyWindow instance) as listener
        on the
        parent window. Then you have to implement the XWindowListener
        interface
        directly. So XAWindow is an indirection ...


So I guess I'll drop the XAWindow inheritance totally ;-)

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 ! .-)

        Question: Why do you create two tabs everytime ?
        It's not needed. You should create only one tab per
        createInstanceWithContext() request.


    Yes, that's the confusing part. It's garbage that stayed in the
    code from the very first XWindow tests. It's for creating tabs
    and corresponding windows for demo purposes and should be
    moved to the basic code.

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.

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. And further you register yourself as ResizeListener more then ones on this ParentWindow. That's not needed (and by the way dangerous) too. Why ? 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 .-)

        You can implement a OneInstance service instance of a MultiService.
        Patch your component_getFactory() method. Instead of using the cppu
        helper method cppu::createSingleFactory() ... you should use
        cppu::createOneInstanceFactory().


        a)
        Please initialize every new created frame with the right window.
        The
        parent window of the tab control isnt the right one.

        E.g.
        XWindow xNewChild = xToolkit->create(...xParentWindow...);
        XFrame  xNewFrame = xSMGR->createInstance("css.frame.Frame");
xNewFrame->initialize(xNewChild);

OK

This is half done, I had to leave TabParent as wDesc.Parent and later initialize it like above.

There is little mistake. Now you dont create two child windows ... but you create two frames ... why ? 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.

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.


        b)
        Every new created (and intialized) frame must be added to the
        desktop
        container. Otherwhise our search mechanism for frames inside the
        office
        will be damaged. And it's needed e.g. to locate already loaded
        documents
        instead of opening it twice.

        E.g.
        XFramesSupplier xSupp(xDesktop, UNO_QUERY);
        XFrames xContainer = xSupp->getFrames();
        xContainer->append(xNewFrame);
        xNewFrame->setCreator(xDesktop);


OK

Done.

OK.


        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.


Done.

http://iapart.net/dav/soc/window_1st_working_RC2

That's it for now. Goodnight :-)

Andrzej.

I miss the menu handling and closing the frames ...
But this version is nearly the "Finish" of our last non optional step !

Regards
Andreas

Attachment: concept_02.pdf
Description: Adobe PDF document

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to