On Sat, Feb 9, 2013 at 4:32 AM, Staffan Tylen <staffan.ty...@gmail.com>wrote:


> From reading the documentation my understanding is that it should be
> sufficient to do something like this:
>
>   self~addUserMsg("onKeyUp", "0x0101")
>
> in the initDialog. It gives return code 0 (documented as success) but the
> onKeyUp method doesn't seem to get invoked when I fiddle with the control
> key. Unless you have some ideas Madou I guess Mark will tell us off soon. :)
> But the theory looked promising I must say ...
>

The theory is promising and will work for some situations.  The reason it
will not work here, or at least not for what you want is that key down / up
messages are only sent to the window with the keyboard focus.  The dialog
window itself almost never has the key board focus.  It is the individual
dialog control windows that have the keyboard focus.

When you use addUserMsg() you are connecting window messages that are sent
to the dialog window with a method in your Rexx object. If the window
message you are trying to connect is never sent to the dialog window, you
Rexx method will never be invoked.  The case here.

To contrast this consider the column click event of the list-view.  When
you click on a column header in a list-view, the mouse click is sent by the
operating system to the Header control.  The header control then sends a
notification message to the list-view.  The list-view then sends a
notification message of the click to its parent window, which is the dialog
window.

In reality, when you connect the column click event, you are not connecting
the actual click event.   You are connecting the event notification that
the list-view is sending to the dialog window.  The list-view notification
that is sent to its parent includes information with it.  One of the bits
of information is the index of the column clicked.

None of the information in that notification includes the key state at the
time of the click.

Another reason why the addUserMsg() is not always useful, is that most of
the time, what you really want is the information that is sent along with
the notification.  Simply knowing that the event happened is useful some
times, not always.

Take the column click notification.  Knowing the click happened would be
useful.  But it is really the index of the column clicked that is helpful
here.  That index is encoded in the message sent to the dialog window, and
to get that index to the Rexx object there has to be code in the ooDialog
framework to decode it and transform it into a Rexx object to send to the
method.

If there wasn't that transforming code for the column click notification,
if there was no specific connect column click, you could use the
addUserMsg() method to connect the event.  But you would only receive two
arguments.  One would be the resource ID of the list-view, the other would
be a number that would be meaningless to you and useful for nothing.

--
Mark Miesfeld
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to