public void MouseUp(MapEventInfo mei) { //foreach (var n in mei.editedMap.Notes) //{ // int xmin = n.tx * 16 + 1; // int ymin = n.ty * 16 + 1; // int xmax = (xmin + Render.measureText(n.note) / 16) * 16; // int ymax = ymin + 16; // if (mei.current.px >= xmin && mei.current.px < xmax && mei.current.py >= ymin && mei.current.py < ymax) // { // //edit existing note // var ibr = winmaped2.pr2.InputBox.Show("Enter your note", "Note entry", n.note); // if (ibr.ReturnCode == DialogResult.OK) // { // n.note = ibr.Text; // if (n.note == "") // mei.editedMap.Notes.Remove(n); // } // return; // } //} if (draggedNote != null && mei.clicks == 2) { var ibr = winmaped2.pr2.InputBox.Show("Edit your note", "Note entry", draggedNote.note); if (ibr.ReturnCode == DialogResult.OK) { draggedNote.note = ibr.Text; } } if(draggedNote == null && mei.lb) { var ibr = winmaped2.pr2.InputBox.Show("Enter your note", "Note entry", "default"); if (ibr.ReturnCode == DialogResult.OK) { var note = new Map.Note(); note.x = mei.current.px; note.y = mei.current.py; note.note = ibr.Text; mei.editedMap.Notes.Add(note); modified(mei); } } draggedNote = null; }
public void MouseDown(MapEventInfo mei) { Map.Note note = Poll(mei.editedMap, mei.current.px, mei.current.py); if (note != null) { if (mei.lb) { draggedNote = note; dx = draggedNote.x - mei.current.px; dy = draggedNote.y - mei.current.py; modified(mei); } else { mei.editedMap.Notes.Remove(note); modified(mei); } } }