Exemple #1
0
        private PropertyPageListView CreateCheckedListBox(string[] values, bool[] selected, string tooltip = null, int height = 200)
        {
            var columns = new[]
            {
                new ColumnDesc("A", 0.0f, ColumnType.CheckBox),
                new ColumnDesc("B", 1.0f, ColumnType.Label)
            };

            var list = new PropertyPageListView(columns);
            var data = new object[values.Length, 2];

            for (int i = 0; i < values.Length; i++)
            {
                data[i, 0] = selected != null ? selected[i] : true;
                data[i, 1] = values[i];
            }

            list.UpdateData(data);

            list.Font          = font;
            list.Height        = DpiScaling.ScaleForDialog(height);
            list.HeaderStyle   = ColumnHeaderStyle.None;
            list.ValueChanged += CheckedListBox_ValueChanged;
            toolTip.SetToolTip(list, SplitLongTooltip(tooltip));

            return(list);
        }
Exemple #2
0
        private PropertyPageListView CreateListView(ColumnDesc[] columnDescs, object[,] data, int height = 300)
        {
            var list = new PropertyPageListView(columnDescs);

            if (data != null)
            {
                list.UpdateData(data);
            }

            list.Font              = font;
            list.Height            = DpiScaling.ScaleForDialog(height);
            list.MouseDoubleClick += ListView_MouseDoubleClick;
            list.MouseDown        += ListView_MouseDown;
            list.ButtonPressed    += ListView_ButtonPressed;
            list.ValueChanged     += ListView_ValueChanged;

            return(list);
        }