Example #1
0
        /// <summary>
        /// Selects the specified node by scrolling it into view and clicking on it
        /// </summary>
        /// <param name="nodeIndex">The index of the node to click on</param>
        /// <param name="button">The button with which to click</param>
        /// <param name="locationInCell">The location in the cell to click</param>
        public void SingleClickItem(int nodeIndex, MouseButton button, CellClickLocation locationInCell)
        {
            string nodeText = GetNodePath(nodeIndex);

            if (nodeText == null)
            {
                GUI.Log("Failed to find node index " + nodeIndex.ToString() + " in the " + Description, LogItemType.Information);
                throw GUI.ApeException("Failed to find node index in the " + Description);
            }
            SingleClickItem(nodeText, button, locationInCell);
        }
Example #2
0
        /// <summary>
        /// Selects the specified node by scrolling it into view and clicking on it
        /// </summary>
        /// <param name="nodeText">The node to look for delimited by -> for example Order -> Id</param>
        /// <param name="button">The button with which to click</param>
        /// <param name="locationInCell">The location in the cell to click</param>
        public void SingleClickItem(string nodeText, MouseButton button, CellClickLocation locationInCell)
        {
            GUIFlexgrid grid = new GUIFlexgrid(ParentForm, Identity.Description + " grid", new Identifier(Identifiers.Name, "Grid"), new Identifier(Identifiers.ChildOf, this));
            string      uid  = FindNodeUid(nodeText);

            if (uid == null)
            {
                GUI.Log("Failed to find node " + nodeText, LogItemType.Information);
                throw new Exception("Failed to find node");
            }
            int row = grid.FindRow(uid, 1);     // hidden column 1 contains the uid for each row

            if (row == -1)
            {
                GUI.Log("Failed to find uid " + uid + " in the grid", LogItemType.Information);
                throw new Exception("Failed to find uid in the grid");
            }
            GUI.Log("Single " + button.ToString() + " click on the " + Identity.Description + " node " + nodeText, LogItemType.Action);
            grid.SingleClickCellInternal(row, 0, button, locationInCell, MouseKeyModifier.None);
        }