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

Documentation for OO Basic access to controls and methods

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


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 3:55 am    Post subject: Documentation for OO Basic access to controls and methods Reply with quote

I'm porting (well, re-writing really) an MS Access application to Open Office. I'm using the Postgresql SDBC having already imported my Access database and tables into Postgresql.

So far I've got the database connection up and running and have the datasource set up so I can see the data in Open Office. I've created a couple of forms too and have explored the forms design, I'm doing this in Writer rather than Calc at the moment.

What I want to do now is start adding some OpenOffice Basic code to attach to buttons and to events associated with some of the fields in my forms.

I can't find any reference documentation for the object names and methods used to access the controls on the forms. I need to have some sort of overview of the object hierarchy and also information about the methods used to access control values etc.

Where can I find this information?
_________________
--
Chris Green
Back to top
View user's profile Send private message Send e-mail
Vanished
General User
General User


Joined: 21 Jan 2005
Posts: 9

PostPosted: Thu Jan 27, 2005 5:44 am    Post subject: Reply with quote

I think this http://www.pitonyak.org/oo.php could help you.

Greetings
Vanished
Back to top
View user's profile Send private message
chrisisbd
General User
General User


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 5:54 am    Post subject: Reply with quote

No it doesn't I'm afraid, I found that site pretty early on in my searches.

It has quite a few examples of Basic/macros code for doing things in text documents and such but nothing (that I could find anyway) on the objects and methods that refer to controls (and other objects) on forms used to access a database.
_________________
--
Chris Green
Back to top
View user's profile Send private message Send e-mail
Vanished
General User
General User


Joined: 21 Jan 2005
Posts: 9

PostPosted: Thu Jan 27, 2005 6:14 am    Post subject: Reply with quote

You read chapter 8 of his macrodocument? http://www.pitonyak.org/AndrewMacro.sxw
Also chapter 3 (inspecting objects), 4 (dispatcher) and 11 (handlers and listeners) may be interesting.

Perhaps one of the following links can help you:
http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html
http://documentation.openoffice.org/HOW_TO/various_topics/How_to_use_basic_macros.sxw
http://api.openoffice.org/basic/man/tutorial/tutorial.pdf
http://www.openoffice.org/nonav/issues/showattachment.cgi/15705/VbaStarBasicXref.sxw
http://www.ooomacros.org/

Greetings
Vanished
Back to top
View user's profile Send private message
chrisisbd
General User
General User


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 7:13 am    Post subject: Reply with quote

> You read chapter 8 of his macrodocument? http://www.pitonyak.org/AndrewMacro.sxw

No, because I haven't yet worked out how to get .sxw documents to be viewable when loaded by my browser. I'll download it and take a look though, thanks.

I think I've looked at all the other links you suggest but I will check thtough them again.

I really have searched quite hard before asking this question, both on the openoffice.org site and more generally using Google and it seems to me there is a bit of a hole in the documentation (though I'm willing to be persuaded otherwise).

There's good (even very good) reference documentation etc. for the Java API and there's lots of stuff for 'ordinary' macros used to automate things in Writer and Calc. The Help in OpenOffice itself covers the syntax and fundamentals of OOo Basic well, down to documenting the 'system functions' well. But, as I've said, I can't find any really serious stuff about using the methods of the controls and other objects.

Even something that showed how to derive the OOo Basic function names and parameters from the Java API methods would be a place to start. (I presume what I'm looking for does depend directly on the Java API)
[/quote]
_________________
--
Chris Green
Back to top
View user's profile Send private message Send e-mail
Vanished
General User
General User


Joined: 21 Jan 2005
Posts: 9

PostPosted: Thu Jan 27, 2005 8:03 am    Post subject: Reply with quote

Hmmm, maybe this is what you are searching for:

http://api.openoffice.org/docs/common/ref/index-files/index-1.html

Greetings
Vanished
Back to top
View user's profile Send private message
chrisisbd
General User
General User


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 8:37 am    Post subject: Reply with quote

Yes, perfect, except that I don't know how those (presumably Java) methods relate to the ones I want to use from OOo Basic.
_________________
--
Chris Green
Back to top
View user's profile Send private message Send e-mail
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Thu Jan 27, 2005 10:12 am    Post subject: Reply with quote

Official information can only be found in the SDK, which contains the idl reference and the Developer's Guide.
See in the Developer's Guide : chapter 13 (on Forms but not specific to Basic).
Basic programming is much simpler than Java programming, but it's not easy to explain how to translate from Java to Basic. Briefly, you have to suppress lots of lines !
For a good start on Basic and API see also StarOffice 7 Software Basic Programmer's Guide.Chapter Forms gives some info but not all you may need.

Quote:
> You read chapter 8 of his macrodocument? http://www.pitonyak.org/AndrewMacro.sxw

No, because I haven't yet worked out how to get .sxw documents to be viewable when loaded by my browser.

Well, you will have to install OpenOffice.org to read it and to create/run OOo Basic... Laughing
________
Bernard
Back to top
View user's profile Send private message Visit poster's website
chrisisbd
General User
General User


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 10:57 am    Post subject: Reply with quote

Yes, I have the SDK and the 'official information' but without ANY guide on how the Java methods map onto OOo Basic methods (like what are the NAMES of the Basic methods?) one can't get anywhere really.

The fundamentals of Basic programming are very well described in the Help, for writing things that don't reference objects that's fine but without some sort of documentation of the objects and their methods one is completely stuck when trying to do anything with controls etc.

As I said at the beginning I have installed OOo and have connected it to my database and have a form set up.

To give an example of what I want to do:-

I have fields on my form which contain the Total cost, the VAT and the ExVAT cost of an item. I want to be able to enter the Total amount and calculate (with certain limitations) the VAT and ExVat amounts and put them in their respective fields. I do exactly this in the MSAccess database I'm trying to port. To do this I need to execute some code on the 'On Exit' event of the Total control. I can see how to attach the code, that's OK but what I don't know how to do is get the value from the Total, nor do I know how to set the values of the VAT and ExVat controls.

I need to know how to access the Control Objects in the code and I need to know the methods to get and set values in the Control Objects. Obviously there are other things I want to do as well but I can't even find out what these (rather trivial) methods are called. I suppose I could guess but that would be rather laborious to say the least.
_________________
--
Chris Green
Back to top
View user's profile Send private message Send e-mail
chrisisbd
General User
General User


Joined: 27 Jan 2005
Posts: 15
Location: UK

PostPosted: Thu Jan 27, 2005 11:51 am    Post subject: Reply with quote

As a further example of what I'm after, in the OOo Basic Help system I found the following example:-

Add an Entry to a ListBox
Sub AddEntry
BasicLibraries.LoadLibrary("Tools")
oDialog1 = LoadDialog("Standard", "Dialog1")
REM adds a new entry to the ListBox
oDialog1Model = oDialog1.Model
oListBox = oDialog1.GetControl("ListBox1")
dim iCount as integer
iCount = oListbox.ItemCount
oListbox.additem("New Item" & iCount,0)
end sub

What I'm after is documentation on things like LoadLibrary(), GetControl(),
_________________
--
Chris Green
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