@@ -82,7 +82,7 @@ public MemoryViewControl()
8282
8383 font = Program . MonoSpaceFont ;
8484
85- editBox . Font = font ;
85+ hotSpotEditBox . Font = font ;
8686
8787 memoryPreviewPopUp = new MemoryPreviewPopUp ( font ) ;
8888 }
@@ -166,6 +166,8 @@ protected override void OnMouseClick(MouseEventArgs e)
166166 {
167167 Contract . Requires ( e != null ) ;
168168
169+ hotSpotEditBox . Hide ( ) ;
170+
169171 var invalidate = false ;
170172
171173 foreach ( var hotSpot in hotSpots )
@@ -316,8 +318,6 @@ protected override void OnMouseClick(MouseEventArgs e)
316318 }
317319 }
318320
319- editBox . Visible = false ;
320-
321321 if ( invalidate )
322322 {
323323 Invalidate ( ) ;
@@ -330,7 +330,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e)
330330 {
331331 Contract . Requires ( e != null ) ;
332332
333- editBox . Visible = false ;
333+ hotSpotEditBox . Hide ( ) ;
334334
335335 var invalidate = false ;
336336
@@ -354,7 +354,7 @@ protected override void OnMouseDoubleClick(MouseEventArgs e)
354354 }
355355 if ( hotSpot . Type == HotSpotType . Edit )
356356 {
357- ShowNodeNameEditBox ( hotSpot ) ;
357+ hotSpotEditBox . ShowOnHotSpot ( hotSpot ) ;
358358
359359 break ;
360360 }
@@ -441,7 +441,7 @@ protected override void OnMouseMove(MouseEventArgs e)
441441
442442 protected override void OnMouseWheel ( MouseEventArgs e )
443443 {
444- editBox . Visible = false ;
444+ hotSpotEditBox . Hide ( ) ;
445445
446446 if ( memoryPreviewPopUp . Visible )
447447 {
@@ -455,7 +455,7 @@ protected override void OnMouseWheel(MouseEventArgs e)
455455
456456 protected override bool ProcessCmdKey ( ref Message msg , Keys keyData )
457457 {
458- if ( editBox . Visible == false ) // Only process keys if the edit field is not visible.
458+ if ( hotSpotEditBox . Visible == false ) // Only process keys if the edit field is not visible.
459459 {
460460 var key = keyData & Keys . KeyCode ;
461461 var modifier = keyData & Keys . Modifiers ;
@@ -602,11 +602,9 @@ private void repaintTimer_Tick(object sender, EventArgs e)
602602 Invalidate ( false ) ;
603603 }
604604
605- private void editBox_Committed ( object sender , EventArgs e )
605+ private void editBox_Committed ( object sender , HotSpotTextBoxCommitEventArgs e )
606606 {
607- var hotspotTextBox = sender as HotSpotTextBox ;
608-
609- var hotSpot = hotspotTextBox ? . HotSpot ;
607+ var hotSpot = e . HotSpot ;
610608 if ( hotSpot != null )
611609 {
612610 try
@@ -673,18 +671,10 @@ public void ShowNodeNameEditBox(BaseNode node)
673671 . FirstOrDefault ( s => s . Node == node && s . Type == HotSpotType . Edit && s . Id == HotSpot . NameId ) ;
674672 if ( hotSpot != null )
675673 {
676- ShowNodeNameEditBox ( hotSpot ) ;
674+ hotSpotEditBox . ShowOnHotSpot ( hotSpot ) ;
677675 }
678676 }
679677
680- private void ShowNodeNameEditBox ( HotSpot hotSpot )
681- {
682- editBox . BackColor = Program . Settings . SelectedColor ;
683- editBox . HotSpot = hotSpot ;
684- editBox . Visible = true ;
685- editBox . ReadOnly = hotSpot . Id == HotSpot . ReadOnlyId ;
686- }
687-
688678 /// <summary>
689679 /// Resets the selection state of all selected nodes.
690680 /// </summary>
@@ -708,7 +698,7 @@ public void Reset()
708698 {
709699 ClearSelection ( ) ;
710700
711- editBox . Visible = false ;
701+ hotSpotEditBox . Hide ( ) ;
712702
713703 VerticalScroll . Value = VerticalScroll . Minimum ;
714704 }
0 commit comments