#732 ooDialog - some event connection methods incorrect

Mark Miesfeld
ooDialog (58)
Mark Miesfeld

In ooDialog you can connect a Windows event to a method in a ooRexx dialog class. When the Windows event happens, the method in the dialog is invoked.

Several of the internal methods related to this are allowing the empty string to be used as the method name. This of course doesn't work. In addition, in the doc the railroad track diagram for some of the methods indicates that the method name is optional, although the text itself doesn't indicate that. The method name can not be optional.


  • Rick McGuire
    Rick McGuire

    I'm not sure I understand all of the specifics here, but a "" string IS a valid ooRexx method name.

  • Mark Miesfeld
    Mark Miesfeld

    Hmmm, ... well thanks Rick. You're right in assuming I had not considered that.

    I don't think this was the intent here, because in the implementing C code they checked for the empty string and rejected it. Returned an error code and did not connect the event to a method a name of "".

    The original code:

    if (!prog.strlength) return 0;

    In the couple of methods where the doc seems to indicate that the method name argument is optional, the code does not check that it is ommitted, it just uses the argument name. So in those cases, the method invoked would be the argument name. Which in one case would be msgToRise and in another case msgToRaise. Since this isn't documented, it would take a pretty savy user to understand what method they are suppossed to implement.

    And, there is a related bug, which I didn't spell out - trying not to be too wordy. When a dialog template is created from parsing a .rc script file, the user can specify to automatically connect buttons to a method. Using the CONNECTBUTTONS option. The code essentially goes:

    if connectbuttons then self~connectButton(id, methodname)
    else self~connectButton(id)

    I just don't think that is intentional, because the else statement would just return an error code.

    I'll put some more thought into what changes I make. <grin>

  • Mark Miesfeld
    Mark Miesfeld


    As far as the empty string goes for a method name, the C code that implements the invocation of the ooRexx method, would just generate an error. You'd end up with something similar to:

    interpret '(234459, 89223)'

    the way the code is.

    So, all in all, I think this was just a mistake in implementation, not something intentional.

    Although, I'm glad you reminded me that "" is a valid method name, hopefully it will sink in. Because it seems to me you reminded me of that in the past. <grin>

  • Mark Miesfeld
    Mark Miesfeld

    This fix will be in the next major release of ooDialog, but not in the ooRexx 4.1.0 release.

  • Mark Miesfeld
    Mark Miesfeld

    This fix will appear in the next major release of ooDialog, it will not be included in an ooRexx bug fix release



Cancel   Add attachments