Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index



On 06/30/2013 04:06 PM, David M. Karr wrote:
Using OpenOffice/LibreOffice I've been building a small database with a form. I'm now at the point where I have two fields (radio button pair and date field) that are somewhat connected. When I set the radio button to "No", I should set the date field to null, and when I set the date field to non-null, I should set the radio button to "Yes".

It looks like I'll have to venture into macros to do this. Could someone point me to specific current resources and hints that will help me achieve this?

From a language point of view, I'd prefer to write Java macros, but I can see the possibility that that might not be ideal for this situation. Is it practical to write macros in Groovy? Otherwise, I suppose I'll have to use the default, which appears to be a variant of Basic.

From what little I can tell about how macros are used, it looks like macros are not parameterized. You just get the ability to call a macro on an event. I would think it would be very useful to be able to write a macro that is intended to take parameters, like "trigger value", "target field", and "target value", and that could be reused in any situation where a new particular value for a field needs to cause a particular value to be set on another field.


I expect that the event handler that you would write will have a single parameter, which can be used to access the control used to call your handler. In the case of a button handler, you can then know which button was used to call it. This allows one handler for the radio buttons and then you can get the control and from that the control name, and know what is happening. From there, I expect that you will need to infer things such as the field name of interest.

If you only want a yes/no value, why not use a check box instead?

I have no particular comments on using any language that is not Basic other than to say that the Basic language is probably easier to use because many of the details are encapsulated away for you.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.