Exemplo n.º 1
0
        public TableView()
        {
            InitializeComponent();
            sfx = FormUtils.GetDpiScale(CreateGraphics());
            InitializeComponent2();
            scaleFactorComboBox.SelectedIndex = 3;
            tableView = new CompoundScrollableControl {
                Dock = DockStyle.Fill, Margin = new Padding(0)
            };
            tableViewWf                   = new TableViewControlModel(this);
            tableView.Client              = tableViewWf;
            tableViewWf.SelectionChanged += (sender, args) => {
                SelectionChanged?.Invoke(sender, args);
                SetCounts();
            };
            mainPanel.Controls.Add(tableView);
            textButton.Click           += TextButton_OnClick;
            selectionAgentButton.Click += SelectionAgentButton_OnClick;
            KeyDown   += (sender, args) => tableView.Focus();
            auxTextBox = new TextBox {
                Dock = DockStyle.Fill, Padding = new Padding(0), Multiline = true, ReadOnly = true
            };
            scaleFactorComboBox.SelectedIndexChanged += (sender, args) => {
                switch (scaleFactorComboBox.SelectedIndex)
                {
                case 0:
                    tableViewWf.UserSf = 0.25f;
                    break;

                case 1:
                    tableViewWf.UserSf = 0.5f;
                    break;

                case 2:
                    tableViewWf.UserSf = 0.7f;
                    break;

                case 3:
                    tableViewWf.UserSf = 1f;
                    break;

                case 4:
                    tableViewWf.UserSf = 1.5f;
                    break;

                case 5:
                    tableViewWf.UserSf = 2f;
                    break;

                case 6:
                    tableViewWf.UserSf = 4f;
                    break;
                }
                tableViewWf.UpdateScaling();
                tableView.Invalidate(true);
            };
        }
Exemplo n.º 2
0
 public TableView()
 {
     InitializeComponent();
     tableView = new CompoundScrollableControl{Dock = DockStyle.Fill, Margin = new Padding(0)};
     tableViewWf = new TableViewControlModel();
     tableView.Client = tableViewWf;
     tableViewWf.SelectionChanged += (sender, args) =>{
         SelectionChanged?.Invoke(sender, args);
         long c = tableViewWf.SelectedCount;
         long t = tableViewWf.RowCount;
         selectedLabel.Text = c > 0 && MultiSelect ? "" + StringUtils.WithDecimalSeparators(c) + " selected" : "";
         itemsLabel.Text = "" + StringUtils.WithDecimalSeparators(t) + " item" + (t == 1 ? "" : "s");
     };
     mainPanel.Controls.Add(tableView);
     textButton.Click += TextButton_OnClick;
     selectionAgentButton.Click += SelectionAgentButton_OnClick;
     KeyDown += (sender, args) => tableView.Focus();
     auxTextBox = new TextBox{Dock = DockStyle.Fill, Padding = new Padding(0), Multiline = true, ReadOnly = true};
 }
Exemplo n.º 3
0
 public TableView()
 {
     InitializeComponent();
     tableView = new CompoundScrollableControl {
         Dock = DockStyle.Fill, Margin = new Padding(0)
     };
     tableViewWf                   = new TableViewControlModel();
     tableView.Client              = tableViewWf;
     tableViewWf.SelectionChanged += (sender, args) => {
         SelectionChanged?.Invoke(sender, args);
         long c = tableViewWf.SelectedCount;
         long t = tableViewWf.RowCount;
         selectedLabel.Text = c > 0 && MultiSelect ? "" + StringUtils.WithDecimalSeparators(c) + " selected" : "";
         itemsLabel.Text    = "" + StringUtils.WithDecimalSeparators(t) + " item" + (t == 1 ? "" : "s");
     };
     mainPanel.Controls.Add(tableView);
     textButton.Click           += TextButton_OnClick;
     selectionAgentButton.Click += SelectionAgentButton_OnClick;
     KeyDown   += (sender, args) => tableView.Focus();
     auxTextBox = new TextBox {
         Dock = DockStyle.Fill, Padding = new Padding(0), Multiline = true, ReadOnly = true
     };
 }
 internal ScrollableControlColumnHeaderView(CompoundScrollableControl main)
     : base(main)
 {
 }
 internal ScrollableControlRowSpacerView(CompoundScrollableControl main)
     : base(main)
 {
 }
 internal ScrollableControlMainView(CompoundScrollableControl main)
     : base(main)
 {
 }
 internal ScrollableControlCornerView(CompoundScrollableControl main)
     : base(main)
 {
 }
 public ScrollableControlMiddleCornerView(CompoundScrollableControl main)
     : base(main)
 {
 }