Exemple #1
0
    public PanelTasks()
    {
        //this.UiaSetName("Tasks panel"); //no UIA element for Panel. Use this in the future if this panel will be : UserControl.

        _tv = new KTreeView {
            Name = "Tasks_list"
        };
        this.Children.Add(_tv);
    }
Exemple #2
0
    public PanelOutline()
    {
        //this.UiaSetName("Outline panel");

        _tv = new KTreeView {
            Name = "Outline_list", SingleClickActivate = true, HotTrack = true
        };
        _tv.ItemClick += (_, e) => { if (e.MouseButton == System.Windows.Input.MouseButton.Right)
                                     {
                                         _ContextMenu();
                                     }
        };
        _tv.ContextMenuOpening += (_, _) => _ContextMenu();         //right-click in empty space
        this.Children.Add(_tv);
    }
Exemple #3
0
    ///// <summary>
    ///// The child list control.
    ///// </summary>
    //public KTreeView Control => _tv;

    public CiPopupList(CiCompletion compl)
    {
        _compl = compl;

        _tv = new KTreeView {
            ItemMarginLeft = 20,
            //HotTrack = true, //no
            CustomDraw = new _CustomDraw(this),
            //test = true
        };
        _tv.ItemActivated  += _tv_ItemActivated;
        _tv.SelectedSingle += _tv_SelectedSingle;

        _tb = new StackPanel {
            Background = SystemColors.ControlBrush
        };

        var cstyle = Application.Current.FindResource(ToolBar.CheckBoxStyleKey) as Style;
        var bstyle = Application.Current.FindResource(ToolBar.ButtonStyleKey) as Style;

        var kindNames = CiUtil.ItemKindNames;

        _kindButtons = new CheckBox[kindNames.Length];
        for (int i = 0; i < kindNames.Length; i++)
        {
            _AddButton(_kindButtons[i] = new CheckBox(), kindNames[i], CiComplItem.ImageResource((CiItemKind)i));
            _kindButtons[i].Click     += _KindButton_Click;
        }

        _tb.Children.Add(new Separator());

        _AddButton(_groupButton = new CheckBox(), "Group by namespace or inheritance", "resources/ci/groupby.xaml");
        _groupButton.Click     += _GroupButton_Click;
        if (App.Settings.ci_complGroup)
        {
            _groupButton.IsChecked = true;
        }

        //var options = new Button();
        //options.Click += _Options_Click;
        //_AddButton(options, "Options", "resources/images/settingsgroup_16x.xaml");

        void _AddButton(ButtonBase b, string text, string image)
        {
            b.Style   = (b is CheckBox) ? cstyle : bstyle;
            b.Content = ResourceUtil.GetWpfImageElement(image);
            b.ToolTip = text;
            AutomationProperties.SetName(b, text);
            b.Focusable = false;             //would close popup
            _tb.Children.Add(b);
        }

        _panel = new DockPanel {
            Background = SystemColors.WindowBrush
        };
        DockPanel.SetDock(_tb, Dock.Left);
        _panel.Children.Add(_tb);
        _panel.Children.Add(_tv);
        _popup = new KPopup {
            Size       = (300, 360),
            Content    = _panel,
            CloseHides = true,
            Name       = "Ci.Completion",
            WindowName = "Au completion list",
        };

        _textPopup = new CiPopupText(CiPopupText.UsedBy.PopupList);
        _tpTimer   = new timer(_ShowTextPopup);
    }