예제 #1
0
        public void LoadPoses()
        {
            Ctrls.Clear();
            categories.Clear();
            int count = CategDropDownButton.DropDownItems.Count;

            while (count > 5)
            {
                count--;
                CategDropDownButton.DropDownItems.RemoveAt(count);
            }

            foreach (TK_Action action in library.Actions)
            {
                ActionCtrl ctrl = new ActionCtrl(this, action);
                ctrl.MouseClick       += new MouseEventHandler(ctrl_MouseClick);
                ctrl.MouseDoubleClick += new MouseEventHandler(ctrl_MouseDoubleClick);
                Ctrls.Add(ctrl);

                if (!categories.ContainsKey(action.Category))
                {
                    ToolStripMenuItem item = CategDropDownButton.DropDownItems.Add(action.Category) as ToolStripMenuItem;
                    item.CheckOnClick    = true;
                    item.Checked         = true;
                    item.CheckedChanged += new EventHandler(item_CheckedChanged);
                    categories.Add(action.Category, true);
                }
            }

            SortControls();
            ResetVisibilities();
            UpdateDisplays();
            SetDisplayStates();
        }
예제 #2
0
        internal void Select(ActionCtrl actionCtrl)
        {
            DeselectAll();
            actionCtrl.Selected = true;
            selectedActionCtrls.Add(actionCtrl);

            propertyGrid1.SelectedObjects = _editor.SetActions(selectedActionCtrls).ToArray();
        }
예제 #3
0
        void ctrl_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ActionCtrl actionCtrl = sender as ActionCtrl;

            if (actionCtrl.Action.Type != ActionTypes.Pose)
            {
                library.ShowSequence(actionCtrl.Action);
            }
        }
예제 #4
0
        internal void RemoveFromSelection(ActionCtrl actionCtrl)
        {
            if (actionCtrl.Selected)
            {
                actionCtrl.Selected = false;
                selectedActionCtrls.Remove(actionCtrl);
            }

            propertyGrid1.SelectedObjects = _editor.SetActions(selectedActionCtrls).ToArray();
        }
예제 #5
0
        internal void AddToSelection(ActionCtrl actionCtrl)
        {
            if (!actionCtrl.Selected)
            {
                actionCtrl.Selected = true;
                selectedActionCtrls.Add(actionCtrl);
            }

            propertyGrid1.SelectedObjects = _editor.SetActions(selectedActionCtrls).ToArray();
        }
예제 #6
0
        internal void ToggleSelection(ActionCtrl actionCtrl)
        {
            if (!actionCtrl.Selected)
            {
                actionCtrl.Selected = true;
                selectedActionCtrls.Add(actionCtrl);
            }
            else
            {
                actionCtrl.Selected = false;
                selectedActionCtrls.Remove(actionCtrl);
            }

            propertyGrid1.SelectedObjects = _editor.SetActions(selectedActionCtrls).ToArray();
        }