public void setKeyframe(float frame)
        {
            CodeBehind.ShapeEditor.ShapeEdSeqSlider    ShapeEdSeqSlider    = "ShapeEdSeqSlider";
            CodeBehind.ShapeEditor.ShapeEdThreadSlider ShapeEdThreadSlider = "ShapeEdThreadSlider";
            CodeBehind.ShapeEditor ShapeEditor = "ShapeEditor";
            CodeBehind.ShapeEditor.ShapeEdShapeView    ShapeEdShapeView    = "ShapeEdShapeView";
            CodeBehind.ShapeEditor.ShapeEdThreadWindow ShapeEdThreadWindow = "ShapeEdThreadWindow";
            GuiPopUpMenuCtrl transitionTo = ShapeEdThreadWindow.FOT("transitionTo");

            ShapeEdSeqSlider.setValue(frame, true);
            if (transitionTo.getText() == "synched position")
            {
                ShapeEdThreadSlider.setValue(frame, true);
            }

            // Update the position of the active thread => if outside the in/out range,
            // need to switch to the proxy sequence
            if (!this.usingProxySeq)
            {
                if ((frame < this.seqStartFrame) || (frame > this.seqEndFrame))
                {
                    this.usingProxySeq = true;
                    string proxyName = ShapeEditor.getProxyName(ShapeEdShapeView.getThreadSequence());
                    ShapeEdShapeView.setThreadSequence(proxyName, 0, 0, false);
                }
            }

            ShapeEdShapeView["threadPos"] = this.keyframeToThreadPos(frame).AsString();
        }
        public int getTimelineBitmapPos(int val, int width)
        {
            CodeBehind.ShapeEditor.ShapeEdSeqSlider ShapeEdSeqSlider = "ShapeEdSeqSlider";

            int frameCount = Util.getWord(ShapeEdSeqSlider["range"], 1).AsInt();
            int pos_x      = Util.getWord(ShapeEdSeqSlider.getPosition().AsString(), 0).AsInt();
            int len_x      = Util.getWord(ShapeEdSeqSlider.getExtent().AsString(), 0).AsInt() - width;

            return(pos_x + ((len_x * val / frameCount)));
        }
        public void setNoProxySequence()
        {
            CodeBehind.ShapeEditor.ShapeEdShapeView ShapeEdShapeView = "ShapeEdShapeView";
            CodeBehind.ShapeEditor ShapeEditor = "ShapeEditor";
            CodeBehind.ShapeEditor.ShapeEdSeqSlider ShapeEdSeqSlider = "ShapeEdSeqSlider";

            // no need to use the proxy sequence during playback
            if (this.usingProxySeq)
            {
                this.usingProxySeq = false;
                string seqName = ShapeEditor.getUnproxyName(ShapeEdShapeView.getThreadSequence());
                ShapeEdShapeView.setThreadSequence(seqName, 0, 0, false);
                ShapeEdShapeView["threadPos"] = this.keyframeToThreadPos(ShapeEdSeqSlider.getValue()).AsString();
            }
        }
        public float keyframeToThreadPos(float frame)
        {
            CodeBehind.ShapeEditor.ShapeEdSeqSlider ShapeEdSeqSlider = "ShapeEdSeqSlider";
            float start, end;

            if (this.usingProxySeq)
            {
                start = Util.getWord(ShapeEdSeqSlider["range"], 0).AsFloat();
                end   = Util.getWord(ShapeEdSeqSlider["range"], 1).AsFloat();
            }
            else
            {
                start = this.seqStartFrame;
                end   = this.seqEndFrame;
            }

            return((frame - start) / (end - start));
        }
        public float threadPosToKeyframe(float pos)
        {
            CodeBehind.ShapeEditor.ShapeEdSeqSlider ShapeEdSeqSlider = "ShapeEdSeqSlider";
            float start, end;

            if (this.usingProxySeq)
            {
                start = Util.getWord(ShapeEdSeqSlider["range"], 0).AsFloat();
                end   = Util.getWord(ShapeEdSeqSlider["range"], 1).AsFloat();
            }
            else
            {
                start = this.seqStartFrame;
                end   = this.seqEndFrame;
            }

            return(start + (end - start) * pos);
        }