private void updateByteSelectionUI() { for (int i = 0; i < DataStackPanel.Children.Count; i++) { StackPanel dataLineStack = (StackPanel)DataStackPanel.Children[i]; for (int j = 0; j < dataLineStack.Children.Count; j++) { ByteControl item = (ByteControl)dataLineStack.Children[j]; int index = ((getBaseVisibleIndex() + j) + (i * (int)BYTE_PER_LINE)); if (selectedHexItems[index] == true) { if (item.getControlState() != 2) { item.selectedState(); AsciiControl testItem = getAsciiControl((int)item.Tag); testItem.selectedState(); } } else { item.defaultState(); getAsciiControl((int)item.Tag).defaultState(); } } } }
private void mouseLeaveEventHandler(object sender, MouseEventArgs e) { ByteControl byteItem = sender as ByteControl; AsciiControl asciiItem = sender as AsciiControl; if (asciiItem != null) { //if (asciiItem.Background != Brushes.Blue) { } //asciiItem.Background = Brushes.White; if (asciiItem.getControlState() == 1) { asciiItem.defaultState(); } } else { if (byteItem.getControlState() == 1) { byteItem.defaultState(); } } }
private void mouseRightDownHandler(object sender, MouseEventArgs e) { ByteControl byteItem = sender as ByteControl; AsciiControl asciiItem = sender as AsciiControl; if (byteItem != null) { if (byteItem.getControlState() == 2) { byteItem.HexCopy.IsEnabled = true; byteItem.AsciiCopy.IsEnabled = true; } } else { if (asciiItem.getControlState() == 2) { asciiItem.HexCopy.IsEnabled = true; asciiItem.AsciiCopy.IsEnabled = true; } } }
private void mouseEnterEventHandler(object sender, MouseEventArgs e) { ByteControl byteItem = sender as ByteControl; AsciiControl asciiItem = sender as AsciiControl; if (selectionFlag) // indicates that the user is dragging the mouse pointer to select more items in the editor { if (asciiItem != null) { endSelection = getBaseVisibleIndex() + (int)asciiItem.Tag; updateSelection(); } else { endSelection = getBaseVisibleIndex() + (int)byteItem.Tag; updateSelection(); } } else { //auto highlight items when mouse is hovering over them if (asciiItem != null) { if (asciiItem.Background != Brushes.Blue) { asciiItem.highlightedState(); } } else { if (byteItem.getControlState() != 2) { byteItem.highlightedState(); } } } }