# OnMouseClickCore in edit interactive overlays

**URL:** <https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682>\
**Category:** WinForms\
**Created:** [September 13, 2009, 4:13pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682 "2009-09-13T16:13:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [September 13, 2009, 4:13pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682/1 "2009-09-13T16:13:53Z")

</div>

I&nbsp;have&nbsp;built&nbsp;a&nbsp;couple&nbsp;of&nbsp;EditInteractiveOverlays.&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;have&nbsp;implemented&nbsp;OnMouseClickCore&nbsp;overrides&nbsp;to&nbsp;the&nbsp;base&nbsp;class.&nbsp;&nbsp;However,&nbsp;they&nbsp;are&nbsp;never&nbsp;called.&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;have&nbsp;also&nbsp;implemented&nbsp;DrawCore&nbsp;on&nbsp;those&nbsp;same&nbsp;classes&nbsp;and&nbsp;those&nbsp;methods&nbsp;are&nbsp;called.&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;do&nbsp;not&nbsp;have&nbsp;any&nbsp;shapes&nbsp;in&nbsp;the&nbsp;EditShapesLayer.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Is&nbsp;there&nbsp;anything&nbsp;else&nbsp;that&nbsp;I&nbsp;should&nbsp;look&nbsp;at&nbsp;to&nbsp;ensure&nbsp;that&nbsp;the&nbsp;Mouse\*Core&nbsp;methods&nbsp;get&nbsp;called?

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 13, 2009, 6:12pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682/2 "2009-09-13T18:12:01Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;So&nbsp;you&nbsp;are&nbsp;not&nbsp;getting&nbsp;the&nbsp;click&nbsp;called&nbsp;on&nbsp;any&nbsp;of&nbsp;the&nbsp;custom&nbsp;overlays&nbsp;you&nbsp;built?&nbsp;&nbsp;A&nbsp;few&nbsp;things&nbsp;to&nbsp;keep&nbsp;in&nbsp;mind,&nbsp;when&nbsp;you&nbsp;override&nbsp;the&nbsp;methods&nbsp;like&nbsp;the&nbsp;mouse&nbsp;click&nbsp;you&nbsp;need&nbsp;to&nbsp;make&nbsp;sure&nbsp;that&nbsp;if&nbsp;you&nbsp;do&nbsp;not&nbsp;handle&nbsp;the&nbsp;event&nbsp;with&nbsp;that&nbsp;overlay&nbsp;that&nbsp;you&nbsp;return&nbsp;that&nbsp;you&nbsp;did&nbsp;not&nbsp;handle&nbsp;the&nbsp;event.&nbsp;&nbsp;To&nbsp;do&nbsp;this&nbsp;make&nbsp;sure&nbsp;the&nbsp;ResultsClass&nbsp;that&nbsp;you&nbsp;pass&nbsp;back&nbsp;returned&nbsp;true&nbsp;in&nbsp;the&nbsp;InteractiveResults.ProcessOtherOverlays.&nbsp;&nbsp;If&nbsp;one&nbsp;of&nbsp;the&nbsp;overlays&nbsp;you&nbsp;created&nbsp;passes&nbsp;false&nbsp;through&nbsp;that&nbsp;property&nbsp;then&nbsp;it&nbsp;will&nbsp;stop&nbsp;the&nbsp;other&nbsp;overlays&nbsp;from&nbsp;getting&nbsp;the&nbsp;mouse&nbsp;clicks.&nbsp;&nbsp;I&nbsp;don’t&nbsp;think&nbsp;this&nbsp;stops&nbsp;them&nbsp;from&nbsp;drawing&nbsp;though.&nbsp;&nbsp;This&nbsp;is&nbsp;the&nbsp;first&nbsp;thing&nbsp;I&nbsp;would&nbsp;check&nbsp;and&nbsp;be&nbsp;100%&nbsp;sure&nbsp;about.&nbsp;&nbsp;One&nbsp;way&nbsp;to&nbsp;test&nbsp;this&nbsp;is&nbsp;by&nbsp;a&nbsp;break&nbsp;point&nbsp;but&nbsp;also&nbsp;you&nbsp;could&nbsp;remove&nbsp;all&nbsp;of&nbsp;the&nbsp;interactive&nbsp;overlays&nbsp;and&nbsp;see&nbsp;how&nbsp;one&nbsp;of&nbsp;your’s&nbsp;does&nbsp;when&nbsp;it&nbsp;is&nbsp;the&nbsp;only&nbsp;one.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 13, 2009, 6:14pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682/3 "2009-09-13T18:14:08Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;One&nbsp;other&nbsp;thing&nbsp;to&nbsp;remember&nbsp;about&nbsp;the&nbsp;click&nbsp;event&nbsp;is&nbsp;that&nbsp;it&nbsp;only&nbsp;gets&nbsp;called&nbsp;on&nbsp;a&nbsp;real&nbsp;click.&nbsp;&nbsp;I&nbsp;mean&nbsp;a&nbsp;mouse&nbsp;down&nbsp;and&nbsp;a&nbsp;mouse&nbsp;up&nbsp;in&nbsp;a&nbsp;specific&nbsp;period&nbsp;of&nbsp;time.&nbsp;&nbsp;It&nbsp;is&nbsp;a&nbsp;bit&nbsp;different&nbsp;then&nbsp;the&nbsp;Winforms&nbsp;version.&nbsp;&nbsp;We&nbsp;also&nbsp;check&nbsp;for&nbsp;double&nbsp;click&nbsp;separately&nbsp;so&nbsp;if&nbsp;the&nbsp;user&nbsp;double&nbsp;clicks&nbsp;you&nbsp;should&nbsp;get&nbsp;one&nbsp;double&nbsp;click&nbsp;event&nbsp;but&nbsp;not&nbsp;two&nbsp;click&nbsp;events.&nbsp;&nbsp;We&nbsp;wanted&nbsp;to&nbsp;intelligently&nbsp;handle&nbsp;this&nbsp;as&nbsp;this&nbsp;always&nbsp;drove&nbsp;me&nbsp;nuts&nbsp;in&nbsp;every&nbsp;Winforms&nbsp;application&nbsp;I&nbsp;ever&nbsp;built.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [September 13, 2009, 6:20pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682/4 "2009-09-13T18:20:15Z")

</div>

I've&nbsp;spent&nbsp;most&nbsp;of&nbsp;the&nbsp;afternoon&nbsp;on&nbsp;this...&nbsp;and&nbsp;at&nbsp;some&nbsp;point,&nbsp;the&nbsp;MouseClick&nbsp;did&nbsp;start&nbsp;firing.&nbsp;&nbsp;&nbsp;&nbsp;And&nbsp;then&nbsp;I&nbsp;couldn't&nbsp;figure&nbsp;out&nbsp;how&nbsp;to&nbsp;get&nbsp;it&nbsp;not&nbsp;to&nbsp;fire&nbsp;when&nbsp;I&nbsp;would&nbsp;click&nbsp;on&nbsp;the&nbsp;resizing&nbsp;control,&nbsp;relocating&nbsp;control,&nbsp;etc.

I&nbsp;finally&nbsp;realized&nbsp;that&nbsp;the&nbsp;MouseClick&nbsp;was&nbsp;not&nbsp;the&nbsp;event&nbsp;I&nbsp;wanted&nbsp;:(&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;MapClick&nbsp;is&nbsp;the&nbsp;right&nbsp;event.&nbsp;&nbsp;&nbsp;It&nbsp;will&nbsp;not&nbsp;fire&nbsp;when&nbsp;you&nbsp;click&nbsp;on&nbsp;the&nbsp;resizing&nbsp;handle,&nbsp;etc.&nbsp;&nbsp;&nbsp;It&nbsp;only&nbsp;fires&nbsp;if&nbsp;there&nbsp;the&nbsp;use&nbsp;of&nbsp;the&nbsp;mouse&nbsp;serves&nbsp;no&nbsp;purpose&nbsp;in&nbsp;an&nbsp;interactive&nbsp;overlay,&nbsp;apparently.&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;is&nbsp;what&nbsp;I&nbsp;was&nbsp;looking&nbsp;for.&nbsp;&nbsp;&nbsp;I&nbsp;wanted&nbsp;to&nbsp;select&nbsp;a&nbsp;shape&nbsp;to&nbsp;put&nbsp;it&nbsp;into&nbsp;the&nbsp;editor,&nbsp;but&nbsp;not&nbsp;be&nbsp;selecting&nbsp;shapes&nbsp;again&nbsp;when&nbsp;a&nbsp;person&nbsp;click&nbsp;on&nbsp;an&nbsp;editor&nbsp;control.

It&nbsp;just&nbsp;took&nbsp;me&nbsp;a&nbsp;long&nbsp;time&nbsp;to&nbsp;recognize&nbsp;the&nbsp;difference&nbsp;between&nbsp;Chen's&nbsp;code&nbsp;that&nbsp;worked,&nbsp;and&nbsp;mine&nbsp;that&nbsp;was&nbsp;getting&nbsp;loaded&nbsp;up&nbsp;with&nbsp;all&nbsp;sorts&nbsp;of&nbsp;flags.

I&nbsp;think&nbsp;I've&nbsp;got&nbsp;it&nbsp;now...&nbsp;anyway.

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 13, 2009, 7:36pm UTC](https://community.thinkgeo.com/t/onmouseclickcore-in-edit-interactive-overlays/682/5 "2009-09-13T19:36:35Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;Glad&nbsp;you&nbsp;got&nbsp;it&nbsp;figured&nbsp;out.&nbsp;&nbsp;Yea&nbsp;the&nbsp;order&nbsp;of&nbsp;the&nbsp;overlays&nbsp;is&nbsp;important&nbsp;as&nbsp;they&nbsp;handle&nbsp;the&nbsp;events&nbsp;in&nbsp;that&nbsp;order.&nbsp;&nbsp;Also&nbsp;if&nbsp;one&nbsp;interactive&nbsp;overlay&nbsp;things&nbsp;you&nbsp;are&nbsp;talking&nbsp;to&nbsp;it&nbsp;then&nbsp;it&nbsp;will&nbsp;‘steal’&nbsp;the&nbsp;event&nbsp;and&nbsp;may&nbsp;or&nbsp;may&nbsp;not&nbsp;raise&nbsp;it&nbsp;up.&nbsp;&nbsp;This&nbsp;was&nbsp;put&nbsp;in&nbsp;to&nbsp;stop&nbsp;multiple&nbsp;overlays&nbsp;from&nbsp;thinking&nbsp;they&nbsp;all&nbsp;have&nbsp;to&nbsp;respond.&nbsp;&nbsp;If&nbsp;you&nbsp;click&nbsp;on&nbsp;a&nbsp;control&nbsp;point&nbsp;and&nbsp;drag&nbsp;it&nbsp;we&nbsp;don’t&nbsp;want&nbsp;the&nbsp;panning&nbsp;to&nbsp;happen&nbsp;,&nbsp;you&nbsp;know&nbsp;what&nbsp;I&nbsp;mean.&nbsp;&nbsp;We&nbsp;also&nbsp;like&nbsp;you&nbsp;to&nbsp;work&nbsp;with&nbsp;the&nbsp;MapClick&nbsp;or&nbsp;Mapxxx&nbsp;events&nbsp;as&nbsp;we&nbsp;pre-process&nbsp;them&nbsp;and&nbsp;only&nbsp;raise&nbsp;them&nbsp;when&nbsp;it&nbsp;makes&nbsp;sense,&nbsp;as&nbsp;I&nbsp;went&nbsp;over&nbsp;in&nbsp;the&nbsp;previous&nbsp;post.&nbsp;&nbsp;We&nbsp;are&nbsp;going&nbsp;to&nbsp;be&nbsp;adding&nbsp;a&nbsp;keys&nbsp;type&nbsp;of&nbsp;event&nbsp;soon&nbsp;so&nbsp;you&nbsp;can&nbsp;process&nbsp;keyboard&nbsp;key&nbsp;presses&nbsp;etc&nbsp;to&nbsp;things&nbsp;like&nbsp;undo&nbsp;with&nbsp;escape&nbsp;key&nbsp;and&nbsp;arrow&nbsp;key&nbsp;stuff.&nbsp;&nbsp;Also&nbsp;one&nbsp;thing&nbsp;that&nbsp;is&nbsp;cool&nbsp;is&nbsp;that&nbsp;with&nbsp;our&nbsp;own&nbsp;events&nbsp;it&nbsp;is&nbsp;possible&nbsp;to&nbsp;fire&nbsp;them&nbsp;without&nbsp;any&nbsp;mouse&nbsp;at&nbsp;all.&nbsp;&nbsp;It&nbsp;will&nbsp;be&nbsp;possible&nbsp;to&nbsp;just&nbsp;create&nbsp;an&nbsp;event&nbsp;that&nbsp;happened&nbsp;say&nbsp;a&nbsp;mouse&nbsp;click&nbsp;and&nbsp;feed&nbsp;it&nbsp;through&nbsp;the&nbsp;system&nbsp;and&nbsp;it&nbsp;responds&nbsp;to&nbsp;it&nbsp;even&nbsp;though&nbsp;it&nbsp;didn’t&nbsp;really&nbsp;happen.&nbsp;&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;how&nbsp;we&nbsp;will&nbsp;use&nbsp;this&nbsp;but&nbsp;it&nbsp;has&nbsp;been&nbsp;on&nbsp;my&nbsp;mind.&nbsp;&nbsp;I&nbsp;think&nbsp;things&nbsp;like&nbsp;testing&nbsp;or&nbsp;using&nbsp;keys&nbsp;to&nbsp;do&nbsp;things&nbsp;like&nbsp;pan&nbsp;or&nbsp;keys&nbsp;to&nbsp;do&nbsp;mouse&nbsp;clicks&nbsp;etc…&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;you&nbsp;had&nbsp;to&nbsp;spend&nbsp;more&nbsp;time&nbsp;on&nbsp;this&nbsp;then&nbsp;maybe&nbsp;you&nbsp;should&nbsp;have&nbsp;but&nbsp;once&nbsp;you&nbsp;get&nbsp;it&nbsp;down&nbsp;it&nbsp;is&nbsp;a&nbsp;really&nbsp;powerful&nbsp;system.&nbsp;&nbsp;I&nbsp;have&nbsp;a&nbsp;feeling&nbsp;you&nbsp;are&nbsp;going&nbsp;to&nbsp;push&nbsp;it&nbsp;to&nbsp;the&nbsp;limits.&nbsp;:-)&nbsp;  
&nbsp;&nbsp;  
&nbsp;David
