Ejemplo n.º 1
0
 private void viewClik(object sender, PckViewMouseClickArgs e)
 {
     if (ViewClicked != null)
     {
         ViewClicked(sender, e);
     }
 }
Ejemplo n.º 2
0
        private void click(object sender, MouseEventArgs e)
        {
            if (myFile != null)
            {
                var x = e.X / GetSpecialWidth(myFile.IXCFile.ImageSize.Width);
                var y = (e.Y - _startY) / (myFile.IXCFile.ImageSize.Height + 2 * space);

                if (x >= numAcross())
                {
                    x = numAcross() - 1;
                }

                var index = y * numAcross() + x;

                var selected = new ViewPckItem();
                selected.X     = x;
                selected.Y     = y;
                selected.Index = index;

                if (index < Collection.Count)
                {
                    if (ModifierKeys == Keys.Control)
                    {
                        ViewPckItem existingItem = null;
                        foreach (var item in _selectedItems)
                        {
                            if (item.X == x && item.Y == y)
                            {
                                existingItem = item;
                            }
                        }

                        if (existingItem != null)
                        {
                            _selectedItems.Remove(existingItem);
                        }
                        else
                        {
                            _selectedItems.Add(selected);
                        }
                    }
                    else
                    {
                        _selectedItems.Clear();
                        _selectedItems.Add(selected);
                    }

                    Refresh();

                    if (ViewClicked != null)
                    {
                        var args = new PckViewMouseClickArgs(e, index);
                        ViewClicked(this, args);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void viewClicked(object sender, PckViewMouseClickArgs e)
        {
            if (_totalViewPck.SelectedItems.Count > 0)
            {
                editImage.Enabled   = true;
                saveImage.Enabled   = true;
                deleteImage.Enabled = true;
                var selected = _totalViewPck.SelectedItems[_totalViewPck.SelectedItems.Count - 1];
                BytesFormHelper.ReloadBytes(selected);
            }
            else             // selected is null
            {
                BytesFormHelper.ReloadBytes(null);

                editImage.Enabled   = false;
                saveImage.Enabled   = false;
                deleteImage.Enabled = false;
            }
        }
Ejemplo n.º 4
0
 private void viewClicked(object sender, PckViewMouseClickArgs e)
 {
     click = e.ClickedPck;
     statusOverTile.Text = "Selected: " + click + " Over: " + move;
 }