Re-open Is user drawn freeform Poly Closed thread

tfmiltz
11-09-2007, 02:48 AM
Hi folks

Just checked the forum before posting for this problem

Using vb6 + MapPointControl

I let the user draw a polygon - and I have them NOW use the right click functionality of Close Curve.

I observe the thread Anonymous posted - and it closed (the thread) with 'there does not seem to be a way to determine if the poly is closed other than assuming'

Anonymous had a neat point there that if the user Closes a poly - using Close Curve, indeed the last vertice is not the first - as I USED to do - requiring the user to click a 'Close' button I added - where I did come up with the same solution myself - use the first Location object array item as the last -

So, here I let the user draw their poly - and I let them 'Close Curve'

I need a way to 'stop collecting' mouse clicks.

and I'd prefer NOT to have them press a button, for - they just clicked ' Close Curve ' and I don't want them to have to go through the same hoop twice.

Anyone ever resolve or find a way to determine if a poly is closed ?

PolyHitTest ? some method like that ?
IsClosed ?

I don't see these - and need a way to stop collecting mouse clicks.

I do say - it might be my methodology.

I DO build an array of Location Objects on Mousedown

it may be I need to TRULY formally set a FreeForm shape object on the form

then - MP control takes care of itself -

Maybe this is the problem ? Has anyone ever created a freeform shape object with MP Control ? I just maintain my own Location object array - and then use .AddPolyLine - that's a step up from my older approach of using .AddLine heh - that was a nightmare, before I started to 'get' the MP OM better.

It may be I'm about to make a paradigmatic shift in MP OM to ludicrous speed ! and realize- oh, sheesh, I've STILL been re-inventing the wheel, MP can just drop a freeform shape object on the form and the control can manage auto line segmenting etc... instead of me collecting clicks - assigning from GetLocation then CalcPos -t hen Add PolyLine with that location object array.

Any insights ?

Tim Miltz
I'd drive a Fed-X truck, but I don't have a truck driving license !

tfmiltz
11-09-2007, 03:40 AM
By the way folks

I HAD a real nice solution to this.

I mandated CTRL be pressed (you get the Button value on Mousedown) to 'count' as a poly click.

this prevented more poly lines showing up as they went to edit their poly.

My client thought it would be counter-intuitive to the user to have to press CTRL to make a poly segment addition count.

I am playing with this without the CTRL mandate - and it's a mess.

I can trap the right click atleast to say - hey - don't add that as a new line.

But - without feedback on when Close Curve was selected ?

there is no way I can see to stop collection clicks on Left click to 'add a new poly segment' I mean, it re-opens the poly and adds a point.

I went to explore dropping a dedicated freeform 'shape' object on the form - MP doesn't like that.

Seems .AddPolyline is the only means to drop or present a custom poly on the form.

Sometimes I wish the app control was in my hands - heh, I'd say - the user will hold CTRL down and this will free up any other distractive left clicks -

I am more or less saying, once a custom poly creation is selected, I HAVE to collect the left clicks to know to extend my Location object array and recreate my shape with .AddPolyline

BUT - if the user right clicks and selects Close Curve, I have no way of knowing this

so if they left click again to go to 'move' their segment lines around ? I end up adding yet a NEW line segment - because there was no notification they are done.

I liked my use 'CTRL' button to make poly additions count.

really worked nice - but - since my offerings are put aside here - for 'the way things must be' ? for my client ?

any way to know if Close Curve was selected ?

Seems MP is a work in progress from MS, I wish they'd put more into MP, they do, but I wish they'd put as much as they put into re-inventing the Word Processor with Office what is it now ? 13 ? what could possibly be new in office ? oh yes, I forgot, it's 'live' now ? oh well.

Any thoughts ?

Tim Miltz

Wilfried
11-09-2007, 12:58 PM
Hi,

Trap the mouseclicks as you already do but draw the poly yourself. then you have complete control.

 
Web mp2kmag.com
mapforums.com