Re: [BLACKBOX] [...] limiting integer values in interactor field

From: [at]} <Gunnar>
Date: Fri, 15 Jan 2010 08:06:51 +0100


Robert,

thank you for the hint! The documentation alone may be precise, but a
simple example like yours usually is very helpful for me.

The essential parts of the user interface now look like this: see below
(attached is an exetable version if you want to test it's handling)

I have only two minor concerns:
- you may not directly call attActionObj.Do in order to flush the last
event, because it's "implement-only exported". On the other hand I do
not really mind repeating ONE line of code.
- This form of the user interface is not intended for people, who type
at very low speed. Btw: what is the English term for "one finger search
system" if it circles above the keyboard like an eagle?

Apart from that, I like it. :-)

best wishes
gunnar



TYPE
    CocCharacter* = EXTENSIBLE RECORD
        St_ko_ma_ge_er_Gr_in_Bi*: ARRAY 8 OF INTEGER; (* 5x3W6; 2x2W6+6;
1x3W6+3 *)
[...]
    END;
    attNotifierAction = POINTER TO RECORD( Services.Action )
        n, to: INTEGER;
    END;

VAR
    iact*: CocCharacterUi; (* interactor field *)
    attActionObj*: attNotifierAction;

PROCEDURE checkAndCompute( n, to: INTEGER );
[ ... ]
END checkAndCompute;


PROCEDURE ( self: attNotifierAction ) Do-;
BEGIN
    checkAndCompute( self.n, self.to );
    self := NIL;
END Do;


PROCEDURE attNotifier*( n, op, from, to: INTEGER );
BEGIN
    IF op=Dialog.changed THEN
        IF attActionObj # NIL THEN
            Services.RemoveAction( attActionObj );
            IF attActionObj.n#n THEN
                (* first execute last stored action for others fields *)
                checkAndCompute( attActionObj.n, attActionObj.to );
            END;
        END;
        NEW( attActionObj );
        attActionObj.n := n;
        attActionObj.to := to;
        Services.DoLater (attActionObj, Services.Ticks () +
Services.resolution)
    END;
END attNotifier;






Robert schrieb:
> On 12/01/2010 17:08, Bernhardt, Gunnar wrote:
>> Folks,
>>
>> thank you for the feedback on this one!
>
>> {([at]})nowhere.xy
>> calculations) with Services.Action might just be easy enough for me
>> to give it a try. :-)
>
>
> I attach below an example from one of my Modules:
>
>
> TYPE
> Notifier = POINTER TO RECORD (Services.Action)
> from, to : INTEGER
> END;
>
> PROCEDURE Notify* (op, from, to : INTEGER);
> BEGIN
> IF op = Dialog.changed THEN
> ...
> Dialog.Update (dlg)
> END
> END Notify;
>
> PROCEDURE NotifyLater* (op, from, to : INTEGER);
> BEGIN
> IF op = Dialog.changed THEN
> Services.RemoveAction (notifier);
> notifier.from := from;
> notifier.to := to;
> Services.DoLater (notifier, Services.Ticks () +
> Services.resolution)
> END
> END NotifyLater;
>
> PROCEDURE (notifier : Notifier) Do;
> BEGIN
> Notify (Dialog.changed, notifier.from, notifier.to)
> END Do;
>
>
> Regards
>
> Robert
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
>



----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy






Received on Fri Jan 15 2010 - 08:06:51 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:36 UTC