Exemple #1
0
        private void AssertAdditionalElements()
        {
            GridControl.Columns[0].GroupIndex = 0;
            UpdateLayoutAndDoEvents();
            MouseActions.MouseMove(View.GetRowElementByRowHandle(-1), View.GetRowElementByRowHandle(-1).ActualWidth / 2, View.GetRowElementByRowHandle(-1).ActualHeight / 2);
            Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
            Assert.AreEqual("-1 (group row)", GetHitInfoNameTextControl(2).TextValue);
            Assert.AreEqual(null, GetHitInfoNameTextControl(3).TextValue);

            MouseActions.MouseMove(LayoutHelper.FindElement(View.GetRowElementByRowHandle(-1), element => (string)element.GetValue(System.Windows.Controls.TextBlock.TextProperty) == "ID: 10248"), 5, 5);
            Assert.AreEqual(5, HitTestModule.hitIfoItemsControl.Items.Count);
            Assert.AreEqual("GroupValue", GetHitInfoNameTextControl(4).NameValue);
            Assert.AreEqual("OrderID: 10248", GetHitInfoNameTextControl(4).TextValue);

            MouseActions.MouseMove(LayoutHelper.FindElement(View.GetRowElementByRowHandle(-1), element => (string)element.GetValue(System.Windows.Controls.TextBlock.TextProperty) == "Count=3"), 5, 5);
            Assert.AreEqual(5, HitTestModule.hitIfoItemsControl.Items.Count);
            Assert.AreEqual("GroupSummary", GetHitInfoNameTextControl(4).NameValue);
            Assert.AreEqual("Count=3", GetHitInfoNameTextControl(4).TextValue);

            GridControl.ClearGrouping();
            UpdateLayoutAndDoEvents();
            MouseActions.MouseMove(LayoutHelper.FindElement(View, element => (string)element.GetValue(System.Windows.Controls.TextBlock.TextProperty) == "Count=2155"), 5, 5);
            Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
            Assert.AreEqual("FixedTotalSummary", GetHitInfoNameTextControl(3).NameValue);
            Assert.AreEqual("Count=2155", GetHitInfoNameTextControl(3).TextValue);
        }
Exemple #2
0
        void CreateCheckHitTestDemoActions()
        {
            AddLoadModuleActions(typeof(GridDemo.HitTesting));
            AddSimpleAction(delegate() {
                Assert.IsTrue(HitTestModule.showHitInfoCheckEdit.IsChecked.Value);
                Assert.AreEqual(0, HitTestModule.viewsListBox.SelectedIndex);
                Assert.AreEqual(GridControl, HitTestModule.hitInfoPopup.PlacementTarget);
                Assert.AreEqual(PlacementMode.Mouse, HitTestModule.hitInfoPopup.Placement);
                MouseActions.MouseMove(GridControl, -5, -5);
                Assert.IsFalse(HitTestModule.hitInfoPopup.IsOpen);
                MouseActions.MouseMove(GridControl, 5, 5);
                Assert.IsTrue(HitTestModule.hitInfoPopup.IsOpen);
                Assert.AreEqual(0d, HitTestModule.hitInfoPopup.HorizontalOffset);
                Assert.AreEqual(0d, HitTestModule.hitInfoPopup.VerticalOffset);

                EditorsActions.ToggleCheckEdit(HitTestModule.showHitInfoCheckEdit);
                Assert.IsFalse(HitTestModule.hitInfoPopup.IsOpen);
                EditorsActions.ToggleCheckEdit(HitTestModule.showHitInfoCheckEdit);
                Assert.IsTrue(HitTestModule.hitInfoPopup.IsOpen);

                MouseActions.LeftMouseDown(GridControlHelper.GetColumnHeaderElements(GridControl, GridControl.Columns[0])[0], 5, 5);
                MouseActions.MouseMove(GridControlHelper.GetColumnHeaderElements(GridControl, GridControl.Columns[0])[0], 25, 5);
                Assert.IsFalse(HitTestModule.hitInfoPopup.IsOpen);
                MouseActions.LeftMouseUp(GridControlHelper.GetColumnHeaderElements(GridControl, GridControl.Columns[0])[0], 5, 5);
                Assert.IsTrue(HitTestModule.hitInfoPopup.IsOpen);

                TableView.ShowColumnChooser();
                UpdateLayoutAndDoEvents();
                Assert.IsFalse(HitTestModule.hitInfoPopup.IsOpen);
                TableView.HideColumnChooser();
                UpdateLayoutAndDoEvents();
                Assert.IsTrue(HitTestModule.hitInfoPopup.IsOpen);

                Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
                Assert.AreEqual("HitTest", GetHitInfoNameTextControl(0).NameValue);
                Assert.AreEqual("ColumnHeader", GetHitInfoNameTextControl(0).TextValue);
                Assert.AreEqual("Column", GetHitInfoNameTextControl(1).NameValue);
                Assert.AreEqual("ID", GetHitInfoNameTextControl(1).TextValue);
                Assert.AreEqual("RowHandle", GetHitInfoNameTextControl(2).NameValue);
                Assert.AreEqual("No row", GetHitInfoNameTextControl(2).TextValue);
                Assert.AreEqual("CellValue", GetHitInfoNameTextControl(3).NameValue);
                Assert.AreEqual("", GetHitInfoNameTextControl(3).TextValue);

                MouseActions.MouseMove(LayoutHelper.FindElementByName(GridControl, "PART_NewItemRow"), 35, 5);
                Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
                Assert.AreEqual("New Item Row", GetHitInfoNameTextControl(2).TextValue);

                MouseActions.MouseMove(LayoutHelper.FindElementByName(GridControl, "PART_FilterRow"), 35, 5);
                Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
                Assert.AreEqual("Auto Filter Row", GetHitInfoNameTextControl(2).TextValue);

                MouseActions.MouseMove(View.GetCellElementByRowHandleAndColumn(0, GridControl.Columns[0]), 35, 5);
                Assert.AreEqual(4, HitTestModule.hitIfoItemsControl.Items.Count);
                Assert.AreEqual("0 (data row)", GetHitInfoNameTextControl(2).TextValue);
                Assert.AreEqual("10248", GetHitInfoNameTextControl(3).TextValue);

                AssertAdditionalElements();

                MouseActions.MouseMove(LayoutHelper.FindElement(LayoutHelper.FindElement(GridControl, IsGroupGridRow), e => e is DevExpress.Xpf.Grid.GroupRowIndicator), 5, 5);
                Assert.AreEqual(5, HitTestModule.hitIfoItemsControl.Items.Count);
                Assert.AreEqual("RowIndicatorState", GetHitInfoNameTextControl(4).NameValue);
                Assert.AreEqual("Focused", GetHitInfoNameTextControl(4).TextValue);

                HitTestModule.viewsListBox.SelectedIndex = 1;
                CardView.CardLayout = DevExpress.Xpf.Grid.CardLayout.Rows;
                UpdateLayoutAndDoEvents();
                Assert.IsNotNull(CardView);
                AssertAdditionalElements();
            });
        }