Re: [BLACKBOX] How to 'embed'

From: Campbell, Robert (SELEX GALILEO, UK) <robert.d.campbell{([at]})nowhere.xy>
Date: Wed, 19 Oct 2011 12:10:23 +0100


Doug
 
I attach my example... It seems to be very similar to yours.
 
I simplied the Restore this morning; thanks for your tips.
 
 
My example also demonstrates CopyFrom, Externalize, Internalize.
 
 
My HandleCtrlMsg ia a little different to yours. It does not use ForwardCtrlMsg as the Oms documentation advises to avoid that.
It also says that after ForwardCtrlMsg "focus must be set to NIL", which you do not do.
 
Just as an example my HandleCtrlMsg changes the mouse curser when it is over an embedded View. It sets the last such View as Focus.
 
 
However I am not saying mine is a 'correct' solution either. It works well enough for embedded Command Buttons (try the example), but
it definately does not handle focussing well enough for embedded Edit Fields. Work in progress!
 
 
Regards
 
Robert
 



  _____

From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
Sent: 19 October 2011 01:04
 
 Summary of How to 'embed'

 ...
 
 To handle control messages sent to the hostView in general I do not have a solution. ..
 
   But to handle track messages I do. My HandleCtrlMsg handler looks like.

    PROCEDURE (hostView: HostView) HandleCtrlMsg* (f: Frame; VAR msg: CtrlMessage; VAR focus: View);
        VAR g: Frame;
    BEGIN
        WITH msg: Controllers.TrackMsg DO
            g := Views.FrameAt(f, msg.x, msg.y);
            IF (g # NIL) THEN Views.ForwardCtrlMsg(g, msg) END
        ELSE
        END
    END HandleCtrlMsg;
    
 This works very nicely and is rapid. The subView under the mouse when the mouse is clicked
receives the track message. I had initially used the viewList to send the general msg to all
subViews but that was extremely inefficient and slow since repeated control messages
are continuously being sent to the hostView. The Views.FrameAt procedure seems to be
efficient at determing the sub view.

I

SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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








Received on Wed Oct 19 2011 - 13:10:23 UTC

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