OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Closing an specific frame/window and SDK class diagram

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
josir
General User
General User


Joined: 25 Jul 2003
Posts: 19
Location: Rio de Janeiro, Brasil

PostPosted: Fri Aug 08, 2003 12:40 pm    Post subject: Closing an specific frame/window and SDK class diagram Reply with quote

Hi Folks,

two questions that will help me a lot:

1) Is there any class diagram or a similar resource where I can view the SDK class hierarchy ? It does not have to show all methods and attirbutes, just the hierarchy will be great.

2) How can I close a frame ? I tried (in Delphi but any language will be welcome).

Code:

  ServiceManager := CreateOleObject('com.sun.star.ServiceManager');
  StarDesktop := ServiceManager.createInstance('com.sun.star.frame.Desktop');
  First := StarDesktop.ActiveFrame;
  Document := StarDesktop.LoadComponentFromURL( sDocument, '_blank', 0, VarArrayCreate([0, - 1], varVariant));
  Window := Primeiro.GetContainerWindow;
  I stuck here...


Thanks in advance.
Josir
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Aug 08, 2003 1:34 pm    Post subject: Reply with quote

The SDK includes a Developer's Guide and an API reference.

The Developer's Guide includes various diagrams of the class interrelationships.

Can you call document.dispose() to close the window?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
josir
General User
General User


Joined: 25 Jul 2003
Posts: 19
Location: Rio de Janeiro, Brasil

PostPosted: Tue Aug 12, 2003 4:40 am    Post subject: Closing a frame/window Reply with quote

Hi Danny,
when I call Dispose, it works but when I close the OOffice framework, it halts with a Access Violation. I read the documentation and it says that only frame "owner" should call the dispose.

Probably, some listener or child object isnīt being disposed too and OOffice halts.

Does anybody have any suggestion or example ?

Thanks in advance,

Josir.
Back to top
View user's profile Send private message Send e-mail
josir
General User
General User


Joined: 25 Jul 2003
Posts: 19
Location: Rio de Janeiro, Brasil

PostPosted: Tue Aug 12, 2003 5:06 am    Post subject: Closing a frame/windows: SOLUTION Reply with quote

I just found the solution. Simple as that:

Code:
 
  ServiceManager := CreateOleObject('com.sun.star.ServiceManager');
  StarDesktop := ServiceManager.createInstance('com.sun.star.frame.Desktop');
  Document := StarDesktop.LoadComponentFromURL( sDocument, '_blank', 0, VarArrayCreate([0, - 1], varVariant));
   { This last command closes the new doc that OOffice always opens }
  StarDesktop.Frames.getbyIndex(0).Dispose;

Iīm used to work with Microsoft APIs and try to solve the problem by the worst path - that is the (un)logical path for that company.

I got to be more optimistic working on OOffice API - I start to find that itīs much more productive than the MSOffice API.

I just miss some code examples Sad

Thanks for the help Danny.
Josir
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group