evjkz.
This commit is contained in:
parent
5e702200a2
commit
d802aa0ec6
@ -72,88 +72,89 @@ public partial class FormTruckConfig : Form
|
||||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// Передаем информацию при нажатии на Label(Объект)
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//private void LabelObject_MouseDown(object sender, MouseEventArgs e)
|
||||
//{
|
||||
// (sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому)
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||
//{
|
||||
// e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Действия при приеме перетаскиваемой информации
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//private void PanelObject_DragDrop(object sender, DragEventArgs e)
|
||||
//{
|
||||
// switch (e.Data?.GetData(DataFormats.Text)?.ToString())
|
||||
// {
|
||||
// case "labelSimpleObject":
|
||||
// _truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White);
|
||||
// break;
|
||||
|
||||
// case "labelModifiedObject":
|
||||
// _truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black,
|
||||
// checkBoxAwning.Checked, checkBoxTent.Checked);
|
||||
// break;
|
||||
// }
|
||||
|
||||
// DrawObject();
|
||||
|
||||
//}
|
||||
/// <summary>
|
||||
/// Передаем информацию при нажатии на Label(Объект)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void LabelObject_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
Label? label = sender as Label;
|
||||
if (label?.Name == "labelSimpleObject")
|
||||
{
|
||||
label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value,
|
||||
(double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy);
|
||||
}
|
||||
else
|
||||
{
|
||||
label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value,
|
||||
(double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy);
|
||||
}
|
||||
(sender as Label)?.DoDragDrop((sender as Label)?.Name ?? string.Empty, DragDropEffects.Move | DragDropEffects.Copy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Проверка получаемой информации(Объект) (ее типа на соответствие требуемому)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? DragDropEffects.Copy : DragDropEffects.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Действия при приеме перетаскиваемой информации
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void PanelObject_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null)
|
||||
switch (e.Data?.GetData(DataFormats.Text)?.ToString())
|
||||
{
|
||||
_truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck));
|
||||
}
|
||||
else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null)
|
||||
{
|
||||
_truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck));
|
||||
case "labelSimpleObject":
|
||||
_truck = new DrawningTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White);
|
||||
break;
|
||||
|
||||
case "labelModifiedObject":
|
||||
_truck = new DrawningDumpTruck((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White, Color.Black,
|
||||
checkBoxAwning.Checked, checkBoxTent.Checked);
|
||||
break;
|
||||
}
|
||||
|
||||
DrawObject();
|
||||
}
|
||||
|
||||
private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck)))
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
//допка
|
||||
//private void LabelObject_MouseDown(object sender, MouseEventArgs e)
|
||||
//{
|
||||
// Label? label = sender as Label;
|
||||
// if (label?.Name == "labelSimpleObject")
|
||||
// {
|
||||
// label?.DoDragDrop(new DrawningTruck((int)numericUpDownSpeed.Value,
|
||||
// (double)numericUpDownWeight.Value, Color.White), DragDropEffects.Copy);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// label?.DoDragDrop(new DrawningDumpTruck((int)numericUpDownSpeed.Value,
|
||||
// (double)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxAwning.Checked, checkBoxTent.Checked), DragDropEffects.Copy);
|
||||
// }
|
||||
//}
|
||||
|
||||
//private void PanelObject_DragDrop(object sender, DragEventArgs e)
|
||||
//{
|
||||
// if ((DrawningTruck?)e.Data.GetData(typeof(DrawningTruck)) != null)
|
||||
// {
|
||||
// _truck = (DrawningTruck?)e.Data.GetData(typeof(DrawningTruck));
|
||||
// }
|
||||
// else if ((DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck)) != null)
|
||||
// {
|
||||
// _truck = (DrawningDumpTruck?)e.Data.GetData(typeof(DrawningDumpTruck));
|
||||
// }
|
||||
|
||||
// DrawObject();
|
||||
//}
|
||||
|
||||
//private void PanelObject_DragEnter(object sender, DragEventArgs e)
|
||||
//{
|
||||
// if ((e.Data.GetDataPresent(typeof(DrawningTruck))) || e.Data.GetDataPresent(typeof(DrawningDumpTruck)))
|
||||
// {
|
||||
// e.Effect = DragDropEffects.Copy;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// e.Effect = DragDropEffects.None;
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Панель отправка цвета при нажатии на Panel
|
||||
|
Loading…
Reference in New Issue
Block a user