public void highlightBox(double position) { foreach (var child in this.MenuBar.Children) { if ((position <= ((box)child).position) && (position > (((box)child).position - ((box)child).size))) { ((box)child).highlightBox(); currentSelectedBox = (box)child; } } }
public void SelectBox(box Box) { Box.highlightBox(); bool tooMuch = Boxes.Count >= 1; if (tooMuch) { unSelectBox(Boxes[0]); Boxes.Add(Box); } else { Boxes.Add(Box); } }
// instantiate a box instance private void addToBox(string name, string address, int rowspot, int colspot, int index) { box littleBox = new box(sizeOfBox, true); littleBox.index = index; littleBox.MouseEnter += Mouse_Enter; littleBox.MouseLeave += Mouse_Leave; // littleBox.boxName = name; // littleBox.address = address; // littleBox.name = name; // string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Tutorial_Art\\" + name + "_tutorial.png"; string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Tutorial_Art\\" + name + "_tutorial.png"; // string path = "/Resources/Images/" + Regex.Match(name, "([a-zA-Z]+)").Value + "-tutorial.png"; littleBox.setImage(path); Grid.SetRow(littleBox, rowspot); Grid.SetColumn(littleBox, colspot); selectionGallary.Children.Add(littleBox); }
public void unSelectBox(box Box) { Box.unHighlightBox(); Boxes.Remove(Box); }
// instantiate a box instance private void addToBox(string name, string address, int rowspot, int colspot) { box littleBox = new box(sizeOfBox); littleBox.MouseEnter += Mouse_Enter; littleBox.MouseLeave += Mouse_Leave; littleBox.boxName = name; littleBox.address = address; littleBox.name = name; string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Album_Art\\" + name + ".jpg"; littleBox.setImage(path); Grid.SetRow(littleBox, rowspot); Grid.SetColumn(littleBox, colspot); selectionGallary.Children.Add(littleBox); }
public void unSelectBox(box Box) { Box.unHighlightBox(); mySelections.Remove(Box); }
public void SelectBox(box Box) { Box.highlightBox(); bool tooMuch = (_type == "Solo" && mySelections.Count >= 3) || (_type == "Buddy" && mySelections.Count >= 1); if (tooMuch) { unSelectBox(mySelections[0]); mySelections.Add(Box); } else { mySelections.Add(Box); } }