Responding to Changes in Parameters

When the position target weight parameter is changed for the Position Constraint controller, the list box must be redrawn. To do this the Position Constraint controller implements ReferenceMaker::NotifyRefDependent(). The message parameters passed into this method is the specific message which needs to be handled. The hTarget parameter is a pointer to the reference target that sent the message. The reference maker uses this handle to know specifically which reference target sent the message.

Example

RefResult PosConstPosition::NotifyRefChanged(
  Interval iv, RefTargetHandle hTarg, PartID& partID, RefMessage msg)
 {
   switch (msg)
   {
     case REFMSG_CHANGE:
      if (hTarg == pblock) {
         ParamID changing_param = pblock->LastNotifyParamID();
         switch (changing_param)
         {
          case position_target_weight:
            RedrawListbox(GetCOREInterface()->GetTime());
            break;
          default:
            pos_const_paramblk.InvalidateUI(changing_param);
            break;
         }
         ivalid.SetEmpty();
       }
      break;
 
     case REFMSG_OBJECT_CACHE_DUMPED:    
       return REF_STOP;
      break;
     }
   return REF_SUCCEED;
   }
};