/// <inheritdoc /> public override Control OnNavigate(NavDirection direction, Float2 location, Control caller, List <Control> visited) { if (IsFocused) { // Dropdown root is focused if (direction == NavDirection.Down) { // Pick the first item return(FindItem(this)); } // Close popup Defocus(); return(null); } return(base.OnNavigate(direction, location, caller, visited)); }
void ICommand.Execute(object parameter) { if (!(parameter is NavDirection)) { return; } NavDirection navDirection = (NavDirection)parameter; switch (navDirection) { case NavDirection.Next: placeInfoControl.OnShowNextPlace(); break; case NavDirection.Previous: placeInfoControl.OnShowPreviousPlace(); break; } }
public void Execute(object parameter) { if (parameter == null) { return; } NavDirection navDirection = (NavDirection)parameter; switch (navDirection) { case NavDirection.Next: placeInfoControl.OnShowNextPlace(); break; case NavDirection.Previous: placeInfoControl.OnShowPreviousPlace(); break; } }
protected void UpdateButtonIndex(NavDirection dir) { switch (dir) { case NavDirection.Up: // Clamp minimum index to first option currentButtonIndex = currentButtonIndex - 1 < 0 ? 0 : currentButtonIndex - 1; SoundController.PlaySound(SoundType.UIClick, false); break; case NavDirection.Down: // Clamp maximum index to last option currentButtonIndex = currentButtonIndex + 1 >= _options.Count ? currentButtonIndex : currentButtonIndex + 1; SoundController.PlaySound(SoundType.UIClick, false); break; } Debug.Log("Menu.cs: Button index = " + currentButtonIndex); _options[currentButtonIndex].Button.Select(); }
/// <summary> /// Fills all fields with the default data. /// </summary> public void SetUp() { org_links = new List <string>(); nav_direction = NavDirection.In; hnav = true; worker_count = 3; links_regex = new List <string>(); max_ext = 0; max_int = 0; max_size_html = 100000000; timeout_html = 10000; user_agent = "Robot"; accept_lang = "en,es*"; //Make this smart!! save_folder = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "Robot Saved Sites/"; fs_retry = 10; }
/// <summary> /// Moves the selected cell in a certain direction. /// </summary> /// <param name="direction">The direction.</param> public void MoveSelection(NavDirection direction) { switch (direction) { case NavDirection.Up: _selectionY = _selectionY - 1 >= 0 ? _selectionY - 1 : _selectionY; break; case NavDirection.Down: _selectionY = _selectionY + 1 < Height ? _selectionY + 1 : _selectionY; break; case NavDirection.Left: _selectionX = _selectionX - 1 >= 0 ? _selectionX - 1 : _selectionX; break; case NavDirection.Right: _selectionX = _selectionX + 1 < Width ? _selectionX + 1 : _selectionX; break; default: break; } }
/// <summary> /// Handles the navigation between the different "pages" in the app. Nav buttons in the footer call this. /// </summary> public void NavHandler(NavDirection direction) { switch (_currentPage) { case Pages.ChooseFile: switch (direction) { case NavDirection.Next: if (_usingPreConfigSettings || _usingSettingFile) { cvsPage1.Visibility = System.Windows.Visibility.Hidden; cvsPage3.Visibility = System.Windows.Visibility.Visible; btnBack.IsEnabled = true; ShowReady(); if (AllExceptInOutputFile()) { string[] allExcept = OpenPResources.PreConfig_OutputCols.Substring(11, OpenPResources.PreConfig_OutputCols.Length - 11).Split(','); foreach (ColumnData cd in _ColumnCollection) { // if the cd is not in the AllExcept array then add it as an output column if (!allExcept.Contains(cd.ColumnHeading)) { _preConfigOutputColumns.Add(cd.ColumnHeading); } } } _currentPage = Pages.ChooseDestination; } else { cvsPage1.Visibility = System.Windows.Visibility.Hidden; cvsPage2.Visibility = System.Windows.Visibility.Visible; btnBack.IsEnabled = true; _currentPage = Pages.ChooseColumns; DetermineIfPageTwoIsCorrectlyFilledIn(); } break; } break; case Pages.ChooseColumns: switch (direction) { case NavDirection.Next: cvsPage3.Visibility = System.Windows.Visibility.Visible; btnNext.IsEnabled = false; cvsPage2.Visibility = System.Windows.Visibility.Hidden; _currentPage = Pages.ChooseDestination; if (!_usingPreConfigSettings) { SetDateColumnsForQAdmin(); } ShowReady(); break; case NavDirection.Back: cvsPage1.Visibility = System.Windows.Visibility.Visible; cvsPage2.Visibility = System.Windows.Visibility.Hidden; _currentPage = Pages.ChooseFile; btnBack.IsEnabled = false; btnNext.IsEnabled = true; break; } break; case Pages.ChooseDestination: switch (direction) { case NavDirection.Back: btnNext.IsEnabled = true; btnFinish.IsEnabled = true; if (_usingPreConfigSettings || _usingSettingFile) { cvsPage1.Visibility = System.Windows.Visibility.Visible; cvsPage3.Visibility = System.Windows.Visibility.Hidden; _currentPage = Pages.ChooseFile; break; } else { cvsPage2.Visibility = System.Windows.Visibility.Visible; cvsPage3.Visibility = System.Windows.Visibility.Hidden; _currentPage = Pages.ChooseColumns; break; } } break; default: break; } SetPageHeader(_currentPage); }
public NodeConnection CreateConnection(int id, Node connectTo, NavDirection direction) { if (connectTo == null) { return(null); } NodeConnection thisConnection = null; NodeConnection targetConnection = null; bool diagonal = false; switch (direction) { case NavDirection.Top: Top = thisConnection; connectTo.Bottom = targetConnection; break; case NavDirection.Right: Right = thisConnection; connectTo.Left = targetConnection; break; case NavDirection.Bottom: Bottom = thisConnection; connectTo.Top = targetConnection; break; case NavDirection.Left: Left = thisConnection; connectTo.Right = targetConnection; break; case NavDirection.TopLeft: TopLeft = thisConnection; connectTo.BottomRight = targetConnection; diagonal = true; break; case NavDirection.TopRight: TopRight = thisConnection; connectTo.BottomLeft = targetConnection; diagonal = true; break; case NavDirection.BottomRight: BottomRight = thisConnection; connectTo.TopLeft = targetConnection; diagonal = true; break; case NavDirection.BotttomLeft: BottomLeft = thisConnection; connectTo.TopRight = targetConnection; diagonal = true; break; } NodeConnection newConnection = new NodeConnection(owner, id, this, connectTo, diagonal); thisConnection = targetConnection = newConnection; this.adyacentNodePaths.Add(new NodePath(connectTo, newConnection)); connectTo.adyacentNodePaths.Add(new NodePath(this, newConnection)); return(newConnection); }
void CreateConnection(List <NodeConnection> connectionList, Node node1, Node node2, NavDirection direction) { if (node1 == null || node2 == null) { return; } connectionList.Add(node1.CreateConnection(connectionIdCounter, node2, direction)); connectionIdCounter++; }