On Sunday 13 July 2008, Christoph Jopp wrote:
> Hi Hal,
>
> don't know if this helps you much, but you can register an event
> handler in the dialog editor.
> Just right click on a control and look for the tab named 'events'
> (don't know if its the exact name in an english version).
> There you can choose an event for this control and either write the
> macro url by hand in the text-box or choose the macro by browsing via
> the button on the right.

D'oh!

Okay, I win the spaced-out for the day award.  I had the Properties 
Window not at full size so until I scrolled up I didn't see the Events 
tab at the top -- missed it completely.

I see it.  If I had seen it earlier, that would have made life much 
easier.

For a macro language, OOo Basic has an amazing amount of stuff.  It's so 
darned hard to pick up on a lot of this.  It reminds me of when I had 
no clue what OOP was and had to teach myself Java.  I learned Perl in, 
literally, 2-3 hours, but it took me 3 weeks to understand OOP and 
learn Java.

> There are also methods to register handlers via code, but I think
> it's easier in the dialog editor.

Okay.  It's in the editor, that's enough for me.  It's quick, it's easy, 
and I don't have to play the dual-editor game where I make changes in 
one editor then have to update the version in the text editor as well.

Thanks!

Hal

> bye
> Christoph
>
> Hal Vaughan schrieb:
> > On Sunday 13 July 2008, Oliver Brinzing wrote:
> >> Hi Hal,
> >>
> >>> I want to do a few things with a dialog from Basic other than
> >>> just get the values of some controls.
> >>
> >> maybe this helps:
> >
> > Okay, so to create an event handler for a control in a dialog, I
> > have to do it in the XML for the dialog itself, is that right?  It
> > looks like there's no way to do that from the dialog editor so I
> > have to load the IDL file in a text editor on my own to edit it.
> >
> > Is there some way, from Basic, to give a control an event handler? 
> > Or does it have to be done in the IDL file for the dialog itself?
> >
> > This helps a lot, now if there's an easier way to attach a handler
> > than having to edit the IDL by hand every time I make a change in
> > the Dialog Editor.
> >
> > Thanks!
> >
> >
> > Hal
> >
> >> REM  *****  BASIC  *****
> >> Dim oDialog
> >>
> >> Sub Main
> >>    oDialog =
> >> CreateUnoDialog(GlobalScope.DialogLibraries.Standard.Dialog1)
> >> oDialog.Execute()
> >> End Sub
> >>
> >> Sub TextModified
> >>    oDialog.getControl("Label1").setText(oDialog.getControl("TextFiel
> >>d1" ).getText()) End Sub
> >>
> >> Sub OK
> >>    MsgBox "OK"
> >>    oDialog.EndExecute()
> >> End Sub
> >>
> >> Sub Cancel
> >>    MsgBox "Cancel..."
> >>    oDialog.EndExecute()
> >> End Sub
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument
> >> 1.0//EN" "dialog.dtd"> <dlg:window
> >> xmlns:dlg="http://openoffice.org/2000/dialog";
> >> xmlns:script="http://openoffice.org/2000/script"; dlg:id="Dialog1"
> >> dlg:left="183" dlg:top="58" dlg:width="220" dlg:height="169"
> >> dlg:closeable="true" dlg:moveable="true"> <dlg:bulletinboard>
> >>    <dlg:button dlg:id="CancelBTN" dlg:tab-index="0" dlg:left="60"
> >> dlg:top="134" dlg:width="55" dlg:height="23" dlg:value="Cancel">
> >>     <script:event script:event-name="on-performaction"
> >> script:macro-name="vnd.sun.star.script:Standard.Module1.Cancel?lan
> >>gua ge=Basic&amp;location=application" script:language="Script"/>
> >> </dlg:button>
> >>    <dlg:button dlg:id="OKBTN" dlg:tab-index="1" dlg:left="137"
> >> dlg:top="134" dlg:width="64" dlg:height="21" dlg:value="OK">
> >>     <script:event script:event-name="on-performaction"
> >> script:macro-name="vnd.sun.star.script:Standard.Module1.OK?languag
> >>e=B asic&amp;location=application" script:language="Script"/>
> >> </dlg:button>
> >>    <dlg:textfield dlg:id="TextField1" dlg:tab-index="2"
> >> dlg:left="60" dlg:top="63" dlg:width="73" dlg:height="23">
> >>     <script:event script:event-name="on-textchange"
> >> script:macro-name="vnd.sun.star.script:Standard.Module1.TextModifi
> >>ed? language=Basic&amp;location=application"
> >> script:language="Script"/> </dlg:textfield>
> >>    <dlg:text dlg:id="Label1" dlg:tab-index="3" dlg:left="58"
> >> dlg:top="17" dlg:width="77" dlg:height="18" dlg:value="Label1"/>
> >>   </dlg:bulletinboard>
> >> </dlg:window>
> >>
> >>
> >> OIliver
> >
> > -------------------------------------------------------------------
> >-- To unsubscribe, e-mail: [EMAIL PROTECTED] For
> > additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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

Reply via email to