On 8/8/05, Andrzej Wytyczak-Partyka <[EMAIL PROTECTED]> wrote:
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 :
Done. I had to use WeakImplHelper5 though ;-)
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...
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
This is half done, I had to leave TabParent as wDesc.Parent and later initialize it like above.
Done.
Done.
http://iapart.net/dav/soc/window_1st_working_RC2
That's it for now. Goodnight :-)
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 ;-)
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...
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.
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
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.
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.
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.
Done.
http://iapart.net/dav/soc/window_1st_working_RC2
That's it for now. Goodnight :-)
Andrzej.