XCOMP triggering an OK event

Bastiaan Olij bastiaan at basenlily.me
Fri Jan 23 18:24:47 EST 2015


Hey Michael,

I really wish that TigerLogic would document these things much better.
All I'm trying to do is create an alternative looking push button but
one that support OK button and Cancel Button button modes.

Thanks (and to others who also reacted), I will try out a few of these
options :)

Cheers,

Bas

On 23/01/2015 8:57 pm, Michael Monschau wrote:
> Hi Bastiaan,
>
> You could try ECOSendEvent with (-24) as the event number. The minus indicates an internal default event. The event number I got from calculating #1 with the pEventCode for the evOk.
>
> One issue will be that you can only send an event to the control’s $event method, so if you do not handle it in the control it will end up in the windows $control method not the $event method where the evOk is typically coded. 
>
> Alternatively, you could use the EXTfldval approach to call the windows $event method with the first parameter as the event parameter for example:
> str255 s(QTEXT(“$cinst.$event(24)"));
> EXTfldval fvalCalc, fvalResult;
> qret e = fval.setCalculation( eci.mInstLocp, ctyCalculation, s.cString(), s.length());
> qbool ok = fval.evalCalculation( fvalResult, eci.mInstLocp );
>
> Of course the problem with any of this will be that it will only call your event handling. There is no internal default behaviour attached to it, i.e. it may not exit an enter data. Normally, these in-build events go through specific routes that create internal default behaviour events/actions. There is no way of accessing/triggering those if sending the event alone does not do it. 
>
> However, if your xcomp implements a control, try sending the -24 to your own $event control and make sure you pass it onto the next handler (Default if you do not implement it in your control’s $event) and see what happens. If your xcomp does not implement a window control your only option may be to use evalCalculation(), unless you can get hold of the windows HWND ($framehwnd) so you can do a direct call to the windows $event method by calling ECOsendEvent( window’s $framehwnd, ….)
>
> Let me know how you get on.
>
> Regards,
> Michael
>
> Michael Monschau (Director)
> Brainy Data Limited
>
> Reply To: michael at brainydata.co.uk
> Phone: +44 (0)870 474 0708
> Web: www.brainydata.co.uk the home of Omnis Components and Developer Services
>
>
>
>
>
>
>> On 22 Jan 2015, at 04:31, Lou Picciano <LouPicciano at comcast.net> wrote:
>>
>> Hello Bastiaan! 
>>
>> A genius* recently reminded me one can use the EXTfldval functions setCalculation() and evalCalculation() to get at any Omnis notation. This may give me a way forward in what I'm trying here. 
>>
>> *Mike Monschau - Thanks, Mike! 
>>
>> Lou Picciano 
>>
>> ----- Original Message -----
>>
>> From: "Bastiaan Olij" <bastiaan at basenlily.me> 
>> To: "OmnisList" <omnisdev-en at lists.omnis-dev.com> 
>> Sent: Wednesday, January 21, 2015 10:57:49 PM 
>> Subject: XCOMP triggering an OK event 
>>
>> Hey All, 
>>
>> I was wondering if anyone knew of a way to queue an OK or Cancel event 
>> from within an XCOMP? ECOSendEvent seems to only works for events you 
>> define yourself. 
>>
>> Cheers, 
>>
>> Bas 
>>
>> _____________________________________________________________ 
>> Manage your list subscriptions at http://lists.omnis-dev.com 
>>
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>
>


-- 
Kindest Regards,

Bastiaan Olij
e-mail: bastiaan at basenlily.me
web: http://www.basenlily.me
Skype: Mux213
http://www.linkedin.com/in/bastiaanolij




More information about the omnisdev-en mailing list