private void UpdateDetail(int id) { Ultima.ItemData item = Ultima.TileData.ItemTable[id]; Bitmap bit = Ultima.Art.GetStatic(id); DetailPictureBox.Tag = id; if (bit == null) { splitContainer2.SplitterDistance = 10; } else { splitContainer2.SplitterDistance = bit.Size.Height + 10; } DetailPictureBox.Invalidate(); DetailTextBox.Clear(); DetailTextBox.AppendText(String.Format("Name: {0}\n", item.Name)); DetailTextBox.AppendText(String.Format("Graphic: 0x{0:X4}\n", id)); DetailTextBox.AppendText(String.Format("Height/Capacity: {0}\n", item.Height)); DetailTextBox.AppendText(String.Format("Weight: {0}\n", item.Weight)); DetailTextBox.AppendText(String.Format("Animation: {0}\n", item.Animation)); DetailTextBox.AppendText(String.Format("Quality/Layer/Light: {0}\n", item.Quality)); DetailTextBox.AppendText(String.Format("Quantity: {0}\n", item.Quantity)); DetailTextBox.AppendText(String.Format("Hue: {0}\n", item.Hue)); DetailTextBox.AppendText(String.Format("StackingOffset/Unk4: {0}\n", item.StackingOffset)); DetailTextBox.AppendText(String.Format("Flags: {0}\n", item.Flags)); if ((item.Flags & TileFlag.Animation) != 0) { Animdata.Data info = Animdata.GetAnimData(id); if (info != null) { DetailTextBox.AppendText(String.Format("Animation FrameCount: {0} Interval: {1}\n", info.FrameCount, info.FrameInterval)); } } }
private void TitleTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { DetailTextBox.Focus(); } }
public ItemShowAlternative() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); RefMarker = this; pictureBox.MouseWheel += OnMouseWheel; DetailTextBox.AddBasicContextMenu(); }
public ItemsControl() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); RefMarker = this; DetailTextBox.AddBasicContextMenu(); }
private void DetailTextBox_Update(string LogText) { if (DetailTextBox.InvokeRequired) { Action <string> AppendText; AppendText = new Action <string>(DetailTextBox_Update); DetailTextBox.Invoke(AppendText, LogText); } else { DetailTextBox.AppendText(LogText + "\r\n"); } }
public ItemShow() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); RefMarker = this; if (!Files.CacheData) { PreloadItems.Visible = false; } ProgressBar.Visible = false; DetailPictureBox.Tag = -1; DetailTextBox.AddBasicContextMenu(); }
private void UpdateDetail(int id) { ItemData item = TileData.ItemTable[id]; Bitmap bit = Art.GetStatic(id); splitContainer2.SplitterDistance = bit?.Size.Height + 10 ?? 10; int xMin = 0; int xMax = 0; int yMin = 0; int yMax = 0; if (bit != null) { Art.Measure(bit, out xMin, out yMin, out xMax, out yMax); } DetailPictureBox.Tag = id; DetailPictureBox.Invalidate(); DetailTextBox.Clear(); DetailTextBox.AppendText($"Name: {item.Name}\n"); DetailTextBox.AppendText($"Graphic: 0x{id:X4}\n"); DetailTextBox.AppendText($"Height/Capacity: {item.Height}\n"); DetailTextBox.AppendText($"Weight: {item.Weight}\n"); DetailTextBox.AppendText($"Animation: {item.Animation}\n"); DetailTextBox.AppendText($"Quality/Layer/Light: {item.Quality}\n"); DetailTextBox.AppendText($"Quantity: {item.Quantity}\n"); DetailTextBox.AppendText($"Hue: {item.Hue}\n"); DetailTextBox.AppendText($"StackingOffset/Unk4: {item.StackingOffset}\n"); DetailTextBox.AppendText($"Flags: {item.Flags}\n"); DetailTextBox.AppendText($"Graphic pixel size width, height: {bit?.Width ?? 0} {bit?.Height ?? 0} \n"); DetailTextBox.AppendText($"Graphic pixel offset xMin, yMin, xMax, yMax: {xMin} {yMin} {xMax} {yMax}\n"); if ((item.Flags & TileFlag.Animation) == 0) { return; } Animdata.AnimdataEntry info = Animdata.GetAnimData(id); if (info != null) { DetailTextBox.AppendText( $"Animation FrameCount: {info.FrameCount} Interval: {info.FrameInterval}\n"); } }
private void UpdateDetail(int id) { Ultima.ItemData item = Ultima.TileData.ItemTable[id]; Bitmap bit = Ultima.Art.GetStatic(id); if (bit == null) { splitContainer2.SplitterDistance = 10; Bitmap newbit = new Bitmap(DetailPictureBox.Size.Width, DetailPictureBox.Size.Height); Graphics newgraph = Graphics.FromImage(newbit); newgraph.Clear(Color.FromArgb(-1)); DetailPictureBox.Image = newbit; } else { splitContainer2.SplitterDistance = bit.Size.Height + 10; Bitmap newbit = new Bitmap(DetailPictureBox.Size.Width, DetailPictureBox.Size.Height); Graphics newgraph = Graphics.FromImage(newbit); newgraph.Clear(Color.FromArgb(-1)); newgraph.DrawImage(bit, (DetailPictureBox.Size.Width - bit.Width) / 2, 5); DetailPictureBox.Image = newbit; } DetailTextBox.Clear(); DetailTextBox.AppendText(String.Format("Name: {0}\n", item.Name)); DetailTextBox.AppendText(String.Format("Graphic: 0x{0:X4}\n", id)); DetailTextBox.AppendText(String.Format("Height/Capacity: {0}\n", item.Height)); DetailTextBox.AppendText(String.Format("Weight: {0}\n", item.Weight)); DetailTextBox.AppendText(String.Format("Animation: {0}\n", item.Animation)); DetailTextBox.AppendText(String.Format("Quality/Layer/Light: {0}\n", item.Quality)); DetailTextBox.AppendText(String.Format("Quantity: {0}\n", item.Quantity)); DetailTextBox.AppendText(String.Format("Hue: {0}\n", item.Hue)); DetailTextBox.AppendText(String.Format("StackingOffset/Unk4: {0}\n", item.StackingOffset)); DetailTextBox.AppendText(String.Format("Flags: {0}\n", item.Flags)); if ((item.Flags & TileFlag.Animation) != 0) { Animdata.Data info = Animdata.GetAnimData(id); if (info != null) { DetailTextBox.AppendText(String.Format("Animation FrameCount: {0} Interval: {1}\n", info.FrameCount, info.FrameInterval)); } } }
public void Save() { // Název try { TitleTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); } catch { } if (string.IsNullOrWhiteSpace(Task.Title)) { Task.Title = AppResources.TitleUntitled; } else { Task.Title = Task.Title.Trim(); } // Detail try { DetailTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); } catch { } Task.Detail = Task.Detail.Trim(); // Datum & čas if (IsSetDueDate) { Task.DueDate = DueDate; } else { Task.DueDate = null; } // Připomenutí if (IsSetDueDate && IsSetReminder) { Task.Reminder = Reminder; } else { Task.Reminder = null; } // Opakování if (IsSetRepeats) { Task.Repeats = Repeats; } else { Task.Repeats = Repeats.None; } // Nastavení dlaždice if (Task.TileSettings == null) { Task.TileSettings = Settings.Current.DefaultTaskTileSettings.Clone(); } // ULOŽENÍ App.Tasks.Update(Task); }