SelRangeMessageHandler Class Reference

Intercepts messages for the SelRange. (Basically sits there and flushes the Selection's information cache whenever it thinks the selection cache has become invalid). More...

#include <range.h>

Inheritance diagram for SelRangeMessageHandler:

MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SelRangeMessageHandler ()
 Constructs a SelRangeMessageHandler, an object which, surprisingly, handles messages for its parent SelRange.

Protected Member Functions

MsgResult Message (Msg *Msg)
 Process messages sent to the SelRange.

Detailed Description

Intercepts messages for the SelRange. (Basically sits there and flushes the Selection's information cache whenever it thinks the selection cache has become invalid).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/04/94

Definition at line 496 of file range.h.


Constructor & Destructor Documentation

SelRangeMessageHandler::SelRangeMessageHandler  ) 
 

Constructs a SelRangeMessageHandler, an object which, surprisingly, handles messages for its parent SelRange.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/04/94
Parameters:
Message,: The message [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
MessageHandler

Definition at line 5565 of file range.cpp.


Member Function Documentation

MsgResult SelRangeMessageHandler::Message Msg Message  )  [protected, virtual]
 

Process messages sent to the SelRange.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/04/94
Parameters:
Message,: The message [INPUTS]
- [OUTPUTS]
Returns:
-
Note that a SelChangingMsg is only broadcast at the end of an operation which has changed the selection.

Returns:
Errors: -
See also:
MessageHandler
Taken out because when the selected spread changes, NodeRenderableInk::DeselectAll() is called which will generate a selection changed message if it needs to. Markn reporting on behalf of the Alpha release bug fixing team, 16/8/94 And now back to the studio

else if (MESSAGE_IS_A(Message, SpreadMsg)) { SpreadMsg* pSpreadMsg = (SpreadMsg*) Message;

switch (pSpreadMsg->Reason) { case (SpreadMsg::SELCHANGED) : GetApplication()->FindSelection()->Update(TRUE); break; } }

Reimplemented from MessageHandler.

Definition at line 5592 of file range.cpp.

05593 {
05594     SelRange* Sel = GetApplication()->FindSelection();
05595 
05596     if (MESSAGE_IS_A(Message, DocChangingMsg))
05597     {
05598         DocChangingMsg *Msg = (DocChangingMsg *) Message;
05599 
05600         // ***** Fix for Alpha release 15/8/94 Markn
05601         // Put a check in for ABOUTTODIE and KILLED doc messages because we only want to update
05602         // the selection once when the document dies (i.e. when ~Document() is called)
05603         // This solution makes hugh asumptions on the messages that are generated on document
05604         // destruction, and could go wrong in the future.
05605         // *****
05606         // Fixed again by Jason, 5/1/95
05607         // This ABSOLUTELY UNEQUIVOCALLY MUST flush the cache!
05608         // So if we don't want the msg broadcast, we just pass FALSE to Update() 
05609         // *****
05610         if (Sel != NULL)
05611         {
05612             if (Msg->State != DocChangingMsg::ABOUTTODIE &&
05613                 Msg->State != DocChangingMsg::KILLED )
05614             {
05615                 // Ensure selection cache is flushed.
05616                 // The TRUE param. makes this broadcast a SelChangingMsg to inform the world
05617                 
05618                 // But don't bother doing a flush if it's only a title-changed notification
05619                 if (Msg->State != DocChangingMsg::TITLECHANGED)
05620                     Sel->Update(TRUE);
05621             }
05622             else
05623             {
05624                 // Ensure the selection cache is flushed, but don't broadcast a msg!
05625                 Sel->Update(FALSE);
05626             }
05627         }
05628     }
05629     else if (MESSAGE_IS_A(Message, OpMsg))
05630     {
05631         if (((OpMsg*)Message)->MsgType == OpMsg::END)
05632         {
05633             // Make sure that any delayed message broadcast is now sent out.
05634             // This is used to allow Ops to make multiple changes to the selection,
05635             // yet only cause one SelChangingMsg broadcast (when they End).
05636             GetApplication()->FindSelection()->BroadcastAnyPendingMessages();
05637         }
05638     }
05639     else if (MESSAGE_IS_A(Message, ToolsCurrentAttrGroupChangedMsg) ||
05640              MESSAGE_IS_A(Message, CurrentAttrChangedMsg) ||
05641              MESSAGE_IS_A(Message, SelChangingMsg)
05642             )
05643     {
05644         // This convenient message gets sent out whenever a user needs to 
05645         // reflect a change in the common attributes. Usually the user will
05646         // call Range::FindCommonAttribute\s is receipt of this message.
05647         // The FindCommonAttribute fns return Current Attributes in certain
05648         // cases which is why the message is broadcast when there is a 
05649         // change in these as well.
05650         
05651         Sel->AttrsHaveChanged(); // The CommonAttributeCache is no longer valid. 
05652         BROADCAST_TO_ALL(CommonAttrsChangedMsg); 
05653     }
05654     /**********
05655         Taken out because when the selected spread changes, NodeRenderableInk::DeselectAll() is called
05656         which will generate a selection changed message if it needs to.
05657            Markn reporting on behalf of the Alpha release bug fixing team, 16/8/94
05658            And now back to the studio
05659 
05660     else if (MESSAGE_IS_A(Message, SpreadMsg))
05661     {
05662         SpreadMsg*  pSpreadMsg = (SpreadMsg*) Message;
05663 
05664         switch (pSpreadMsg->Reason)
05665         {
05666             case (SpreadMsg::SELCHANGED) :
05667                 GetApplication()->FindSelection()->Update(TRUE);
05668                 break;
05669         }
05670     }
05671     */
05672 
05673 
05674 
05675     return OK; 
05676 }      


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:52 2007 for Camelot by  doxygen 1.4.4