public void UpdateKeyViews()
        {
            nint row = TableView.RowForView(this);

            if (row <= 0)
            {
                return;
            }

            NSView view;
            PropertyEditorControl ctrl = null;

            do
            {
                row--;
                view = TableView.GetView(0, row, makeIfNecessary: false);
                ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl;
            } while (row > 0 && ctrl == null);

            if (ctrl != null)
            {
                ctrl.LastKeyView.NextKeyView = FirstKeyView;
                ctrl.UpdateKeyViews();
            }
            else if (row == 0 && view is PanelHeaderEditorControl header)
            {
                header.SetNextKeyView(FirstKeyView);
            }
        }
        public void OnNextResponderRequested(bool reverse)
        {
            if (TableView != null)
            {
                var modifier = reverse ? -1 : 1;

                nint row = TableView.RowForView(this) + modifier;

                NSView view;
                PropertyEditorControl ctrl = null;

                var rowCount = TableView.RowCount;
                for (; reverse?row > 0 : row < rowCount; row += modifier)
                {
                    view = TableView.GetView(0, row, makeIfNecessary: false);
                    if (view is PropertyEditorControl pec)                       // This is to include the CategoryContainer
                    {
                        ctrl = pec;
                    }
                    else
                    {
                        ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl;
                    }

                    if (ctrl?.viewModel != null && !ctrl.viewModel.IsInputEnabled)
                    {
                        ctrl = null;
                    }

                    if (ctrl != null)
                    {
                        var targetView = reverse ? ctrl.LastKeyView : ctrl.FirstKeyView;
                        Window?.MakeFirstResponder(targetView);
                        return;
                    }
                    else if (row == 0 && view is PanelHeaderEditorControl header)
                    {
                        Window?.MakeFirstResponder(header);
                        return;
                    }
                }
            }
        }
Example #3
0
        public void UpdateKeyViews(bool backward = true, bool forward = true)
        {
            if (TableRow < 0)
            {
                return;
            }

            PropertyEditorControl ctrl = null;

            //FIXME: don't hardcode column
            if (backward && TableRow > 0 && (ctrl = TableView.GetView(1, TableRow - 1, false) as PropertyEditorControl) != null)
            {
                ctrl.LastKeyView.NextKeyView = FirstKeyView;
                ctrl.UpdateKeyViews(forward: false);
            }

            //FIXME: don't hardcode column
            if (forward && TableRow < TableView.RowCount - 1 && (ctrl = TableView.GetView(1, TableRow + 1, false) as PropertyEditorControl) != null)
            {
                LastKeyView.NextKeyView = ctrl.FirstKeyView;
                ctrl.UpdateKeyViews(backward: false);
            }
        }
 public ProxyResponder(PropertyEditorControl editorControl, ProxyRowType rowType)
 {
     this.rowType       = rowType;
     this.editorControl = new WeakReference <PropertyEditorControl> (editorControl);
 }