Page 1 of 1

"onPushButtonMouseEnter" event not detected

Posted: 30 Sep 2013 15:00
by daveplummermd
Guys

I am trying to detect a mouse over a dialog push button.

I use the following:

Code: Select all

predicates     onPushButtonMouseEnter : window::mouseEnterListener. clauses     onPushButtonMouseEnter(_, _, _Flags):-         vpiCommonDialogs::note("entered"),         !.
Should this detect a mouse-over-button and fire the clause?

Thanks in advance

Dave

Posted: 1 Oct 2013 6:45
by Tonton Luc
Hi,

Maybe this code can help you :

Code: Select all

clauses     new(Parent) :-         dialog::new(Parent),         generatedInitialize(),         your_dialog_pushButton_ctl:setSubClassHandler(subEH,false) %add this line here         .   predicates     subEH : eHandler. clauses   subEH(Win,e_MouseMove(Pnt,_,_)) = _ :-     setText(toString(Pnt)).

Posted: 6 Oct 2013 2:51
by daveplummermd
Tonton

Thanks so much.

When code entered exactly as you outlined, the compiler complains that the return value for the eventhandler "subEH" is not fully bound.

Code: Select all

clauses     new(Parent) :-         dialog::new(Parent),         generatedInitialize(),         pushButton_ctl:setSubClassHandler(subEH,false) .     predicates     subEH : eHandler. clauses   subEH(Win,e_MouseMove(Pnt,_,_))=_:-     setText(toString(Pnt)).
The clause subEH must return a bound value of the type gui_native::lResult Can you advise?

Thanks in advance.

Dave

Posted: 7 Oct 2013 6:52
by Tonton Luc
Hi Dave,

Try this :

Code: Select all

clauses   subEH(Win,e_MouseMove(Pnt,_,_))=0:-     setText(toString(Pnt)).

Posted: 7 Oct 2013 9:31
by Thomas Linder Puls
The the size of domains lParam, wParam and lResult is 32bit on win32 and 64bit on x64. Therefore it is not as simple as it used to be.

The gui_api class contains a number of constants:

Code: Select all

constants     wNull : wParam = uncheckedConvert(wParam, nullHandle).     wFalse : wParam = wNull.     wTrue : wParam = uncheckedConvert(wParam, uncheckedConvert(handle, 1)).     wMinusOne : wParam = uncheckedConvert(wParam, uncheckedConvert(handle, -1)).     lNull : lParam = uncheckedConvert(lParam, nullHandle).     lFalse : lParam = lNull.     lTrue : lParam = uncheckedConvert(lParam, wTrue).     lMinusOne : lParam = uncheckedConvert(lParam, uncheckedConvert(handle, -1)).     rNull : lResult = uncheckedConvert(lResult, nullHandle).     rFalse : lResult = rNull.     rTrue : lResult = uncheckedConvert(lResult, wTrue).     rMinusOne : lResult = uncheckedConvert(lResult, uncheckedConvert(handle, -1)).     % @short Constant of type wParam/lParam/lResult.     % @end
Injection functions:

Code: Select all

predicates     mkW : (integer Integer) -> wParam WParam.     mkW : (unsigned Unsigned) -> wParam WParam.     mkL : (integer Integer) -> lParam LParam.     mkL : (unsigned Unsigned) -> lParam LParam.     mkR : (integer Unsigned) -> lResult LResult.     mkR : (unsigned Unsigned) -> lResult LResult.     % @short Make an wParam/lParam/lResult from an integer/unsigned.     % @end
And projection functions:

Code: Select all

predicates     getUnsigned : (unsignedNative WParam) -> unsigned Integer language prolog as "gui_api_getParam".     getUnsigned : (integerNative WParam) -> unsigned Integer language prolog as "gui_api_getParam".     getUnsigned : (wParam WParam) -> unsigned Unsigned language prolog as "gui_api_getParam".     getUnsigned : (lParam LParam) -> unsigned Unsigned language prolog as "gui_api_getParam".     getUnsigned : (lResult LResult) -> unsigned Unsigned language prolog as "gui_api_getParam".     getInteger : (unsignedNative WParam) -> integer Integer language prolog as "gui_api_getParam".     getInteger : (integerNative WParam) -> integer Integer language prolog as "gui_api_getParam".     getInteger : (wParam WParam) -> integer Integer language prolog as "gui_api_getParam".     getInteger : (lParam LParam) -> integer Integer language prolog as "gui_api_getParam".     getInteger : (lResult LResult) -> integer Integer language prolog as "gui_api_getParam".     % @short Convert a wParam/lParam/lResult to an unsigned/integer.     % @end
To assist with these domains. Pointers and pointer-represented values should simply be uncehckedConverted to/from the corresponding domain.

If you want to return 0 you can use gui_api::rNull.

Posted: 11 Oct 2013 14:40
by daveplummermd
Guys

Thanks for these very helpful replies. I always learn stuff beyond the scope of the initial question.

BTW...what is with all the "term paper" crap on the board.....can this be removed or otherwise cleaned up?

Thanks again

Dave P