Example #1
0
 public override void GetFillColour(MHRoot pResult)
 {
     if (m_FillColour.ColIndex >= 0)
     {
         pResult.SetVariableValue(new MHUnion(m_FillColour.ColIndex));
     }
     else
     {
         pResult.SetVariableValue(new MHUnion(m_FillColour.ColStr));
     }
 }
Example #2
0
 // Returns the index on the stack or -1 if it's not there.
 public int FindOnStack(MHRoot pVis)
 {
     for (int i = 0; i < m_DisplayStack.Size; i++)
     {
         if (m_DisplayStack.GetAt(i).Equals(pVis))
         {
             return(i);
         }
     }
     return(-1); // Not there
 }
Example #3
0
        // This isn't an MHEG action as such but is used as part of the implementation of "Clone"
        public override void MakeClone(MHRoot pTarget, MHRoot pRef, MHEngine engine)
        {
            MHIngredient pClone = pTarget.Clone(engine);                      // Clone it.

            pClone.ObjectIdentifier.GroupId.Copy(m_ObjectIdentifier.GroupId); // Group id is the same as this.
            pClone.ObjectIdentifier.ObjectNo = ++m_nLastId;                   // Create a new object id.
            m_Items.Append(pClone);
            // Set the object reference result to the newly constructed ref.
            pRef.SetVariableValue(new MHUnion(pClone.ObjectIdentifier));
            pClone.Preparation(engine); // Prepare the clone.
        }
Example #4
0
        public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pObj)
        {
            // We need to get the group (scene or application) that contains the target.
            MHObjectRef groupRef = new MHObjectRef();

            groupRef.GroupId.Copy(pTarget.ObjectIdentifier.GroupId);
            groupRef.ObjectNo = 0; // The group always has object ref zero.
            MHRoot pGroup = engine.FindObject(groupRef);

            // Get the group to make the clone and add it to its ingredients.
            pGroup.MakeClone(pTarget, pObj, engine);
        }
Example #5
0
 public override void GetLineColour(MHRoot pResult)
 {
     // Returns the palette index as an integer if it is an index or the colour as a string if not.
     if (m_LineColour.ColIndex >= 0)
     {
         pResult.SetVariableValue(new MHUnion(m_LineColour.ColIndex));
     }
     else
     {
         pResult.SetVariableValue(new MHUnion(m_LineColour.ColStr));
     }
 }
Example #6
0
        public override void Perform(MHEngine engine)
        {
            // This is a special case.  If the object does not exist we set the result to false.
            MHObjectRef target = new MHObjectRef();

            m_Target.GetValue(target, engine); // Get the target
            MHRoot pObject = engine.FindObject(target, false);
            bool   fResult = false;            // Default result.

            if (pObject == null)
            {
                fResult = pObject.AvailabilityStatus;
            }
            engine.FindObject(m_ResultVar).SetVariableValue(new MHUnion(fResult));
        }
Example #7
0
 public override MHRoot FindByObjectNo(int n)
 {
     if (n == m_ObjectIdentifier.ObjectNo)
     {
         return(this);
     }
     for (int i = m_Items.Size; i > 0; i--)
     {
         MHRoot pResult = m_Items.GetAt(i - 1).FindByObjectNo(n);
         if (pResult != null)
         {
             return(pResult);
         }
     }
     return(null);
 }
Example #8
0
 public override void DelItem(MHRoot pItem, MHEngine engine)
 {
     // See if the item is already there and ignore this if it is.
     for (int i = 0; i < (int)m_ItemList.Count; i++)
     {
         if (m_ItemList[i].Visible == pItem)
         { // Found it - remove it from the list and reset the posn.
             m_ItemList.RemoveAt(i);
             pItem.ResetPosition();
             if (i + 1 < m_nFirstItem && m_nFirstItem > 1)
             {
                 m_nFirstItem--;
             }
             return;
         }
     }
 }
Example #9
0
        public override void Perform(MHEngine engine)
        {
            MHUnion targetVal = new MHUnion();
            // Find the target and get its current value.  The target can be an indirect reference.
            MHObjectRef parm = new MHObjectRef();

            m_Target.GetValue(parm, engine);
            MHRoot pTarget = engine.FindObject(parm);

            pTarget.GetVariableValue(targetVal, engine);
            targetVal.CheckType(MHUnion.U_String);
            // Get the string to append.
            MHOctetString toAppend = new MHOctetString();

            m_Operand.GetValue(toAppend, engine);
            targetVal.String.Append(toAppend);   // Add it on the end
            pTarget.SetVariableValue(targetVal); // Set the target to the result.
        }
Example #10
0
        public override void Perform(MHEngine engine)
        {
            MHUnion targetVal = new MHUnion();
            // Find the target and get its current value.  The target can be an indirect reference.
            MHObjectRef parm = new MHObjectRef();

            m_Target.GetValue(parm, engine);
            MHRoot pTarget = engine.FindObject(parm);

            pTarget.GetVariableValue(targetVal, engine);
            targetVal.CheckType(MHUnion.U_Int);
            // Get the value of the operand.
            int nOperand = m_Operand.GetValue(engine);

            // Set the value of targetVal to the new value and store it.
            targetVal.Int = DoOp(targetVal.Int, nOperand);
            pTarget.SetVariableValue(targetVal);
        }
Example #11
0
 public override void Preparation(MHEngine engine)
 {
     base.Preparation(engine);
     for (int i = 0; i < m_TokenGrpItems.Size; i++)
     {
         // Find the item and add it to the list if it isn't already there.
         MHRoot pItem  = engine.FindObject(m_TokenGrpItems.GetAt(i).Object);
         bool   bFound = false;
         foreach (MHListItem p in m_ItemList)
         {
             if (p.Visible == pItem)
             {
                 bFound = true;
             }
         }
         if (!bFound)
         {
             m_ItemList.Add(new MHListItem(pItem));
         }
     }
 }
Example #12
0
        public override void GetCellItem(int nCell, MHObjectRef itemDest, MHEngine engine)
        {
            if (nCell < 1)
            {
                nCell = 1;            // First cell
            }
            if (nCell > m_Positions.Size)
            {
                nCell = m_Positions.Size;                           // Last cell.
            }
            int nVisIndex = nCell + m_nFirstItem - 2;

            if (nVisIndex >= 0 && nVisIndex < (int)m_ItemList.Count)
            {
                MHRoot pVis = m_ItemList[nVisIndex].Visible;
                engine.FindObject(itemDest).SetVariableValue(new MHUnion(pVis.ObjectIdentifier));
            }
            else
            {
                engine.FindObject(itemDest).SetVariableValue(new MHUnion(MHObjectRef.Null));
            }
        }
Example #13
0
 public override void AddItem(int nIndex, MHRoot pItem, MHEngine engine)
 {
     // See if the item is already there and ignore this if it is.
     foreach (MHListItem p in m_ItemList)
     {
         if (p.Visible == pItem)
         {
             return;
         }
     }
     // Ignore this if the index is out of range
     if (nIndex < 1 || nIndex > (int)m_ItemList.Count + 1)
     {
         return;
     }
     // Insert it at the appropriate position (MHEG indexes count from 1).
     m_ItemList.Insert(nIndex - 1, new MHListItem(pItem));
     if (nIndex <= m_nFirstItem && m_nFirstItem < (int)m_ItemList.Count)
     {
         m_nFirstItem++;
     }
     Update(engine); // Apply the update behaviour
 }
Example #14
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pObj)
 {
     pTarget.PutBefore(pObj, engine);
 }
Example #15
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg)
 {
     pTarget.ScrollItems(nArg, engine);
 }
Example #16
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg)
 {
     Target(engine).DeselectItem(nArg, engine);
 }
Example #17
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pArg)
 {
     pTarget.GetTextData(pArg, engine);
 }
Example #18
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pArg)
 {
     pTarget.GetFillColour(pArg);
 }
Example #19
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg1, int nArg2)
 {
     pTarget.ScaleVideo(nArg1, nArg2, engine);
 }
Example #20
0
 public abstract void CallAction(MHEngine engine, MHRoot pTarget, int nArg1, int nArg2);
Example #21
0
 public override void GetLineWidth(MHRoot pResult)
 {
     pResult.SetVariableValue(new MHUnion(m_nLineWidth));
 }
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg1, int nArg2)
 {
     pTarget.SetVideoDecodeOffset(nArg1, nArg2, engine);
 }
Example #23
0
 public override void GetLineStyle(MHRoot pResult)
 {
     pResult.SetVariableValue(new MHUnion(m_LineStyle));
 }
Example #24
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg)
 {
     pTarget.SetFirstItem(nArg, engine);
 }
Example #25
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg1, int nArg2, int nArg3, int nArg4)
 {
     pTarget.DrawLine(nArg1, nArg2, nArg3, nArg4, engine);
 }
Example #26
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pArg1, MHRoot pArg2)
 {
     pTarget.GetPosition(pArg1, pArg2);
 }
Example #27
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, MHRoot pArg)
 {
     pTarget.GetListSize(pArg, engine);
 }
Example #28
0
 public override void PutBehind(MHRoot pRef, MHEngine engine)
 {
     base.PutBehind(pRef, engine);
     Clear();
 }
Example #29
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg)
 {
     pTarget.SetLineStyle(nArg, engine);
 }
Example #30
0
 public override void CallAction(MHEngine engine, MHRoot pTarget, int nArg)
 {
     pTarget.MoveTo(nArg, engine);
 }