Esempio n. 1
0
 private void eventsList_SelectedValueChanged(object sender, EventArgs e)
 {
     if (eventsList.SelectedIndex > 0 && !TickUpdate)
     {
         GUIUpdate = true;
         ComboEvent evt = (ComboEvent)eventsList.SelectedItem;
         //mContainer.Time = evt.GlobalStartTime;
         timeLabel.Text   = "Time: " + Math.Round((double)mPlugin.Time / 1000.0, 2);
         timeSlider.Value = mPlugin.Time;
         UserControl panel = evt.ControlPanel;
         if (mCurrentPanel != panel)
         {
             if (mCurrentPanel != null)
             {
                 mCurrentPanel.Visible = false;
             }
             mCurrentPanel         = panel;
             mCurrentPanel.Visible = true;
         }
         GUIUpdate = false;
     }
     else if (!TickUpdate && mCurrentPanel != startPanel)
     {
         if (mCurrentPanel != null)
         {
             mCurrentPanel.Visible = false;
         }
         mCurrentPanel         = startPanel;
         mCurrentPanel.Visible = true;
         timeSlider.Value      = 0;
     }
 }
Esempio n. 2
0
        public void Init(FlythroughPlugin plugin)
        {
            mPlugin = plugin;

            mTickListener = new Action <int>(mContainer_Tick);

            mPlugin.LengthChange      += mContainer_LengthChange;
            mPlugin.UnPaused          += mContainer_UnPaused;
            mPlugin.OnPaused          += mContainer_OnPaused;
            mPlugin.SequenceFinished  += mContainer_SequenceFinished;
            mPlugin.FlythroughLoaded  += mContainer_FlythroughLoaded;
            mPlugin.FlythroughLoading += mContainer_FlythroughLoading;

            synchBoxCheck.Checked = mPlugin.SynchStreams;

            Disposed      += new EventHandler(FlythroughPanel_Disposed);
            HandleCreated += new EventHandler(FlythroughPanel_HandleCreated);

            autoStepCheck.Checked = mPlugin.AutoStep;
            loopCheck.Checked     = mPlugin.Loop;
            speedLabel.Text       = "Speed: " + mPlugin.Speed;
            //speedScroll.Value = (float) mPlugin.Speed;

            mStartEvt      = new ComboEvent(mPlugin);
            mStartEvt.Name = "Begin";
            eventsList.Items.Add(mStartEvt);
            mCurrentPanel = startPanel;
        }
Esempio n. 3
0
        private void addToolStripMenuItem_Click(object sender, EventArgs args)
        {
            ComboEvent evt = new ComboEvent(mPlugin);

            mPlugin.AddEvent(evt);
            AddEventToGUI(evt);
        }
Esempio n. 4
0
        /** wait notify from Form **/
        private void ComboForm_SelectedItemEvent(object sender, ComboEvent e)
        {
            if (e.Type == EventType.SELECTED)
            {
                DataRow drow = e.Row;
                this.counter = e.SelectedRow;
                if (this.displayIndex < drow.Table.Columns.Count && this.displayIndex >= 0)
                {
                    this.Text = drow[this.displayIndex].ToString();
                }
                else
                {
                    this.Text = drow[this.display].ToString();
                }

                if (this.SelectedRowHandler != null)
                {
                    this.SelectedRowHandler(this, e.Row);
                }
            }
            else if (e.Type == EventType.FORM_HIDED)
            {
                //this.FindForm().Refresh();
                SendKeys.Send("{ESC}");
            }
        }
Esempio n. 5
0
 private void removeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (eventsList.SelectedIndex > 0)
     {
         ComboEvent evt = (ComboEvent)eventsList.SelectedItem;
         mPlugin.RemoveEvent(evt);
         eventsList.Items.Remove(evt);
         eventPanel.Controls.Remove(evt.ControlPanel);
     }
 }
Esempio n. 6
0
 //Auto Complete
 protected override void OnKeyPress(KeyPressEventArgs e)
 {
     if (!Char.IsControl(e.KeyChar))
     {
         String strFind = this.Text.Substring(0, this.SelectionStart) + e.KeyChar;
         int    index   = -1;
         if (ComboFormMode.NORMAL == this.Mode)
         {
             if (false == this.DroppedDown)
             {
                 this.DroppedDown = true;
             }
             index = this.FindStringExact(strFind);
             if (-1 == index)
             {
                 index = this.FindString(strFind);
             }
             if (-1 == index)
             {
                 return;
             }
             if (index != -1)
             {
                 this.SelectedIndex = index;
             }
             //Add By Boonlert F. 11/12/2005
             if (!_isValidating)
             {
                 this.SelectionStart  = strFind.Length;
                 this.SelectionLength = this.Text.Length - strFind.Length;
             }
             e.Handled = true;
         }
         else
         {
             this.Text = this.comboForm.SearchString(strFind, this.DisplayIndex, ref index);
             if (!_isValidating)
             {
                 this.SelectionStart = strFind.Length;
                 if (this.Text.Length - strFind.Length > 0)
                 {
                     this.SelectionLength = this.Text.Length - strFind.Length;
                 }
             }
             e.Handled = true;
         }
         //debug by Mr.Fuangwith Sopharath @ 05/06/2006
         if (index != -1)
         {
             ComboEvent cbe = new ComboEvent(this.table.Rows[index], index, EventType.SELECTED);
             ComboForm_SelectedItemEvent(this, cbe);
         }
     }
     base.OnKeyPress(e);
 }//end key_Press
Esempio n. 7
0
 private void _scoreHandler_OnComboChange(object sender, ComboEvent e)
 {
     if (e.CurrentCombo <= 1)
     {
         _textCombo.text = "";
     }
     else
     {
         _textCombo.text = "x" + ((int)e.CurrentCombo).ToString();
     }
 }
Esempio n. 8
0
        /** use arrow key for show data **/
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (ComboFormMode.NORMAL != this.Mode)
            {
                if (this.table.Rows.Count > 0)
                {
                    //debug by Mr.Fuangwith Sopharath @ 05/06/2006
                    if (e.KeyData == Keys.Down && this.counter < this.table.Rows.Count - 1)
                    {
                        this.counter++;
                    }
                    else if (e.KeyData == Keys.Up && this.counter > 0)
                    {
                        this.counter--;
                    }
                    if (e.KeyData == Keys.Down || e.KeyData == Keys.Up)
                    {
                        if (0 <= this.counter && this.counter < this.table.Rows.Count)
                        {
                            ComboEvent cbe = new ComboEvent(this.table.Rows[this.counter], this.counter, EventType.SELECTED);
                            ComboForm_SelectedItemEvent(this, cbe);
                        }
                    }
                }
                if (e.KeyData == Keys.Enter)
                {
                    this.counter = 0;
                    SendKeys.Send("{ESC}");
                }
            }

            //Add By Boonlert F. 28/07/2005
            IntPtr pHandle = Parent.FindForm().Handle;

            SendMessage(pHandle, WM_KEYDOWN, new IntPtr((int)e.KeyCode), IntPtr.Zero);

            //End Add

            //Add By Boonlert F. 11/12/2005
            _isValidating = false;

            base.OnKeyDown(e);
        }
Esempio n. 9
0
        public ComboPanel(ComboEvent evt)
            : this()
        {
            mEvent = evt;

            //mPositionTimeChanged = new Action<FlythroughEvent<Vector3>, int>(positionEvt_TimeChanged);
            //mOrientationTimeChanged = new Action<FlythroughEvent<Rotation>, int>(orientationEvt_TimeChanged);
            mPositionEvtChanged    += new Action <FlythroughEvent <Vector3>, FlythroughEvent <Vector3> >(Positions_CurrentEventChange);
            mOrientationEvtChanged += new Action <FlythroughEvent <Rotation>, FlythroughEvent <Rotation> >(Orientations_CurrentEventChange);

            evt.PositionOrderChanged    += new Action <FlythroughEvent <Vector3> >(evt_PositionOrderChanged);
            evt.OrientationOrderChanged += new Action <FlythroughEvent <Rotation> >(evt_OrientationOrderChanged);

            foreach (var e in mEvent.Positions)
            {
                AddEvent(e, positionsList, positionPanel);
            }
            foreach (var e in mEvent.Orientations)
            {
                AddEvent(e, orientationsList, orientationPanel);
            }
        }
        public void Init(FlythroughPlugin plugin)
        {
            mPlugin = plugin;

            mTickListener = new Action<int>(mContainer_Tick);

            mPlugin.LengthChange += mContainer_LengthChange;
            mPlugin.UnPaused += mContainer_UnPaused;
            mPlugin.OnPaused += mContainer_OnPaused;
            mPlugin.SequenceFinished += mContainer_SequenceFinished;
            mPlugin.FlythroughLoaded += mContainer_FlythroughLoaded;
            mPlugin.FlythroughLoading += mContainer_FlythroughLoading;

            synchBoxCheck.Checked = mPlugin.SynchStreams;

            Disposed += new EventHandler(FlythroughPanel_Disposed);
            HandleCreated += new EventHandler(FlythroughPanel_HandleCreated);

            autoStepCheck.Checked = mPlugin.AutoStep;
            loopCheck.Checked = mPlugin.Loop;
            speedLabel.Text = "Speed: " + mPlugin.Speed;
            //speedScroll.Value = (float) mPlugin.Speed;

            mStartEvt = new ComboEvent(mPlugin);
            mStartEvt.Name = "Begin";
            eventsList.Items.Add(mStartEvt);
            mCurrentPanel = startPanel;
        }
 private void addToolStripMenuItem_Click(object sender, EventArgs args)
 {
     ComboEvent evt = new ComboEvent(mPlugin);
     mPlugin.AddEvent(evt);
     AddEventToGUI(evt);
 }
 internal void RemoveEvent(ComboEvent evt)
 {
     mEvents.RemoveEvent(evt);
     mEvents[0].StartValue = Start;
 }
 public void MoveUp(ComboEvent evt)
 {
     mEvents.MoveUp(evt);
     if (evt.SequenceStartTime == 0)
         evt.StartValue = Start;
 }
        /// <summary>
        /// Initialise the flythrough transition an xml file.
        /// </summary>
        /// <param name="file">The file to load as a flythrough.</param>
        public void Load(string file)
        {
            if (!File.Exists(file)) {
                Logger.Warn("Unable to load " + file + ". Ignoring load request.");
                return;
            }

            if (FlythroughLoading != null)
                FlythroughLoading();

            mEvents = new EventSequence<Camera>();
            mEvents.LengthChange += new Action<EventSequence<Camera>, int>(mEvents_LengthChange);

            XmlDocument doc = new XmlDocument();
            doc.Load(file);
            int start = 0;
            XmlNode root = doc.GetElementsByTagName("Events")[0];

            XmlAttribute startPositionAttr = root.Attributes["StartPosition"];
            XmlAttribute startPitchAttr = root.Attributes["StartPitch"];
            XmlAttribute startYawAttr = root.Attributes["StartYaw"];
            Vector3 startPos = mCore.Position;
            double startPitch = mCore.Orientation.Pitch;
            double startYaw = mCore.Orientation.Yaw;
            if (startPositionAttr != null) Vector3.TryParse(startPositionAttr.Value, out startPos);
            if (startPitchAttr != null) double.TryParse(startPitchAttr.Value, out startPitch);
            if (startYawAttr != null) double.TryParse(startYawAttr.Value, out startYaw);
            Start = new Camera(startPos, new Rotation(startPitch, startYaw));

            foreach (XmlNode node in root.ChildNodes) {
                if (node is XmlElement) {
                    ComboEvent evt = new ComboEvent(this);
                    evt.Load(node);
                    mEvents.AddEvent(evt);
                    start = evt.SequenceStartTime + evt.Length;
                }
            }

            mCore.Update(Start.Position, Vector3.Zero, Start.Orientation, Rotation.Zero);

            if (FlythroughLoaded != null)
                FlythroughLoaded();
        }