public void ShowItem(Point aPoint, PuzzleItem aPuzzleItem) { Show(); panelItemHolder_Visual1.PuzzleItems.Clear(); panelItemHolder_Visual1.RemoveAllFromSelected(); this.Location = aPoint; PuzzleItem aPuzzleItem2 = aPuzzleItem.Clone(); aPuzzleItem2.SubcatagoryIndex = 0; for (int i = 0; i <= aPuzzleItem.SubcatagoryIndexMax; i++) { panelItemHolder_Visual1.PuzzleItems.Add(aPuzzleItem2.Clone()); aPuzzleItem2.ToggleSubcatagory(); } panelItemHolder_Visual1.AddToSelected(aPuzzleItem.SubcatagoryIndex); panelItemHolder_Visual1.Width = 337 - (4 - aPuzzleItem.SubcatagoryIndexMax) * 64; UpdateProperties(aPuzzleItem2); }
private void panelItemHolderPalette_MouseMove(object sender, MouseEventArgs e) { PuzzleItem aPuzzleItem = panelItemHolderPalette.GetSelectedItem(); if (aPuzzleItem != null) { if (e.Button == MouseButtons.Left) { MarkAsSender(panelItemHolderPalette); aPuzzleItem = aPuzzleItem.Clone(); DoDragDrop(aPuzzleItem, DragDropEffects.Move); } } int x = e.X, y = e.Y; aPuzzleItem = panelItemHolderPalette.getItemAt(new Point(x, y)); if (aPuzzleItem != null) { if (aPuzzleItem != oldpitem) { //toolTip1.Show(aPuzzleItem.Name_ToolTip, panelItemHolderPalette, new Point(paletteSelectedItemLabel.Left - panelItemHolderPalette.Left, paletteSelectedItemLabel.Top - panelItemHolderPalette.Top + 32), 2000); toolTip1.Show(aPuzzleItem.Name_ToolTip, panelItemHolderPalette, new Point(paletteSelectedItemLabel.Left - panelItemHolderPalette.Left - 9, paletteSelectedItemLabel.Top - panelItemHolderPalette.Top + 32 + 40), 2000); oldpitem = aPuzzleItem; } } else { toolTip1.RemoveAll(); oldpitem = null; } panelItemHolderBucket_Focus(); }
private void panelItemHolderBucket_MouseMove(object sender, MouseEventArgs e) { //PuzzleItem aPuzzleItem = sender as PuzzleItem; PuzzleItem aPuzzleItem = panelItemHolderBucket.GetSelectedItem(); if (aPuzzleItem != null) { if (e.Button == MouseButtons.Left) { MarkAsSender(panelItemHolderBucket); aPuzzleItem = aPuzzleItem.Clone(); DoDragDrop(aPuzzleItem, DragDropEffects.Copy); } } int x = e.X, y = e.Y; aPuzzleItem = panelItemHolderBucket.getItemAt(new Point(x, y)); if (aPuzzleItem != null) { if (aPuzzleItem != oldpitem) { //toolTip1.Show(aPuzzleItem.Name_ToolTip, panelItemHolderBucket, new Point(0, panelItemHolderBucket.Height-4), 2000); toolTip1.Show(aPuzzleItem.Name_ToolTip, panelItemHolderBucket, new Point(0, panelItemHolderBucket.GridLength * 65 + 10), 2000); oldpitem = aPuzzleItem; } } else { toolTip1.RemoveAll(); oldpitem = null; } }
public void ShowItem(Point aPoint, PuzzleItem aPuzzleItem, Point Offset, bool ShouldChangeActualItem) { if (aPuzzleItem != null) { if (!ShouldChangeActualItem) { aPuzzleItem = aPuzzleItem.Clone(); ThePuzzleItem = null; } else { ThePuzzleItem = aPuzzleItem; } ShowItem(aPoint, aPuzzleItem); aPoint = MousePosition; aPoint.X = aPoint.X - Offset.X - (aPuzzleItem.SubcatagoryIndex * 65); aPoint.Y = aPoint.Y - Offset.Y; if (aPoint.X < 0) { aPoint.X = 0; } if (aPoint.Y < 0) { aPoint.Y = 0; } //check to make sure it will appear on screen int screenHeight = Screen.FromControl(this).Bounds.Height; int screenWidth = Screen.FromControl(this).Bounds.Width; //MessageBox.Show(this.Location.X + " " + this.Location.Y); this.TopMost = false; Point aMousePoint = System.Windows.Forms.Cursor.Position; if (aPoint.X + Width > screenWidth || aPoint.X + Width < 0) { aPoint.X = screenWidth - Width; this.TopMost = true; } if (aPoint.Y + Height > screenHeight || aPoint.Y + Height < 0) { aPoint.Y = screenHeight - Height; this.TopMost = true; } aMousePoint = new Point(aPoint.X + Offset.X + aPuzzleItem.SubcatagoryIndex * 66, aPoint.Y + Offset.Y); System.Windows.Forms.Cursor.Position = aMousePoint; Location = aPoint; } }
private void panelItemHolderRecentlyUsed_MouseMove(object sender, MouseEventArgs e) { PuzzleItem aPuzzleItem = panelItemHolderRecentlyUsed.GetSelectedItem(); if (aPuzzleItem != null) { if (e.Button == MouseButtons.Left) { MarkAsSender(panelItemHolderRecentlyUsed); aPuzzleItem = aPuzzleItem.Clone(); DoDragDrop(aPuzzleItem, DragDropEffects.Copy); } } panelItemHolderBucket_Focus(); }
public static void PopulateWithAllItems(PanelItemHolder holder) { string[] filePaths = Directory.GetFiles(itemDirectory, "*.bee"); string[] temp; foreach (string path in filePaths) { if (path.EndsWith(individualItemExtension)) { temp = path.Split('\\'); PuzzleItem aPuzzleItem = new PuzzleItem(temp[temp.Length - 1].Replace(individualItemExtension, "")); //get each subcatagory for (int i = 0; i <= aPuzzleItem.SubcatagoryIndexMax; i++) { holder.InsertBefore(aPuzzleItem.Clone(), 0); aPuzzleItem.ToggleSubcatagory(); } } } }
public void ShowItem(Point aPoint, PuzzleItem aPuzzleItem, Point Offset, bool ShouldChangeActualItem) { if (aPuzzleItem != null) { if (!ShouldChangeActualItem) { aPuzzleItem = aPuzzleItem.Clone(); ThePuzzleItem = null; } else ThePuzzleItem = aPuzzleItem; ShowItem(aPoint, aPuzzleItem); aPoint = MousePosition; aPoint.X = aPoint.X - Offset.X - (aPuzzleItem.SubcatagoryIndex * 65); aPoint.Y = aPoint.Y - Offset.Y; if (aPoint.X < 0) aPoint.X = 0; if (aPoint.Y < 0) aPoint.Y = 0; //check to make sure it will appear on screen int screenHeight = Screen.FromControl(this).Bounds.Height; int screenWidth = Screen.FromControl(this).Bounds.Width; //MessageBox.Show(this.Location.X + " " + this.Location.Y); this.TopMost = false; Point aMousePoint = System.Windows.Forms.Cursor.Position; if (aPoint.X + Width > screenWidth || aPoint.X + Width<0) { aPoint.X = screenWidth - Width; this.TopMost = true; } if (aPoint.Y + Height > screenHeight || aPoint.Y + Height<0) { aPoint.Y = screenHeight - Height; this.TopMost = true; } aMousePoint = new Point(aPoint.X + Offset.X + aPuzzleItem.SubcatagoryIndex * 66, aPoint.Y + Offset.Y); System.Windows.Forms.Cursor.Position = aMousePoint; Location = aPoint; } }
public PuzzleItem getItemNumber(int value) { PuzzleItem aPuzzleItem = PuzzleItems[value]; return(aPuzzleItem.Clone()); }