capture right click in getpoint

capture right click in getpoint

Anonymous
Not applicable
1,059 Views
8 Replies
Message 1 of 9

capture right click in getpoint

Anonymous
Not applicable
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
1,060 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 3 of 9

Anonymous
Not applicable
Hi Tony,
Yes i did look at the code, thanks for that,
I missed the part about AllowNone , Will review that again.
That's interesting about the code reformatting, I only use newsreader also
and that's the first i've seen a newsreader munge formatting, I thought that
was only the web interface that did that.
so even in newsreader you need the {code} tags?
will remember that
thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 4 of 9

Anonymous
Not applicable
Thanks Tony, AllowNone did the trick
I have to admit the documentation of that property is obscure to me, but I
see it does what i wanted.
Thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 5 of 9

Anonymous
Not applicable
I'm assuming you mean this:

"Gets or sets whether the prompt accepts ENTER as sole input. "

If so, that's not nearly as obscure as some of the stuff I've read in the
docs.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6296024@discussion.autodesk.com...
Thanks Tony, AllowNone did the trick
I have to admit the documentation of that property is obscure to me, but I
see it does what i wanted.
Thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 6 of 9

Anonymous
Not applicable
It's not the newsreader itself that's doing the mangling, it's Autodesk's
discussion software. Yes, you need the code tags regardless of how you
post.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6296021@discussion.autodesk.com...
Hi Tony,
Yes i did look at the code, thanks for that,
I missed the part about AllowNone , Will review that again.
That's interesting about the code reformatting, I only use newsreader also
and that's the first i've seen a newsreader munge formatting, I thought that
was only the web interface that did that.
so even in newsreader you need the {code} tags?
will remember that
thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 7 of 9

Anonymous
Not applicable
When using a newsreader such as Outlook Express - set your return to "Plain
Text" instead of HTML and I believe you will be alright. I don't seem to
have any issues doing it this way.

Public Function OpenMDBDatabase(Connect As ADODB.Connection, Name As String)
As Boolean
On Error Resume Next
If Not Connect.State = adStateOpen Then
Connect.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Name & ";"
End If

If Err Then Exit Function
OpenMDBDatabase = True
End Function

Unless of course this test goes South on me.


"mp" wrote in message
news:6296021@discussion.autodesk.com...
Hi Tony,
Yes i did look at the code, thanks for that,
I missed the part about AllowNone , Will review that again.
That's interesting about the code reformatting, I only use newsreader also
and that's the first i've seen a newsreader munge formatting, I thought that
was only the web interface that did that.
so even in newsreader you need the {code} tags?
will remember that
thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 8 of 9

Anonymous
Not applicable
Right, I've always had it set that way and don't remember having problem
before.
oh well


"Steve" wrote in message
news:6297460@discussion.autodesk.com...
When using a newsreader such as Outlook Express - set your return to "Plain
Text" instead of HTML and I believe you will be alright. I don't seem to
have any issues doing it this way.

Public Function OpenMDBDatabase(Connect As ADODB.Connection, Name As String)
As Boolean
On Error Resume Next
If Not Connect.State = adStateOpen Then
Connect.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Name & ";"
End If

If Err Then Exit Function
OpenMDBDatabase = True
End Function

Unless of course this test goes South on me.


"mp" wrote in message
news:6296021@discussion.autodesk.com...
Hi Tony,
Yes i did look at the code, thanks for that,
I missed the part about AllowNone , Will review that again.
That's interesting about the code reformatting, I only use newsreader also
and that's the first i've seen a newsreader munge formatting, I thought that
was only the web interface that did that.
so even in newsreader you need the {code} tags?
will remember that
thanks
mark

"Tony Tanzillo" wrote in message
news:6295971@discussion.autodesk.com...
Did you look at the sample I referred you to, and specifically it's use of
the AllowNone property of the PromptPointObjects class?

Also, the code in your post is reformatted and unreadable in my newsreader.
I'm not sure what the current state of the forum software is, but most here
use a newsreader and put code inside of {code} tags to preserve formatting.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"mp" wrote in message
news:6295901@discussion.autodesk.com...
How to detect right click as response to a getxxx call
The various flavors of PromptStatus dont seem to be the trick,
I see the following about mousegesture in msdn but no clue if this is the
way somehow...any tips?
MouseGesture CutCmdMouseGesture = new MouseGesture(
MouseAction.MiddleClick);

MouseBinding CutMouseBinding = new MouseBinding(
ApplicationCommands.Cut,
CutCmdMouseGesture);

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(CutMouseBinding);

from acads' lab2(modified)[CommandMethod("selectPoint")]static public void
selectpoint() {while (true){PromptPointOptions prPointOptions = new
PromptPointOptions("Select a point");PromptPointResult prPointRes;Editor ed
= Application.DocumentManager.MdiActiveDocument.Editor;prPointRes =
ed.GetPoint(prPointOptions);//i tried .Other but that didn't fire on right
click//i get "Invalid Point" at the command line...so it didn't throw an
error either//if (prPointRes.Status == PromptStatus.Other)
//{//ed.WriteMessage("Other\n");//break;//}if (prPointRes.Status !=
PromptStatus.OK){ed.WriteMessage("Error\n");break;}else{ed.WriteMessage("You
selected point " + prPointRes.Value.ToString());}}}
0 Likes
Message 9 of 9

Anonymous
Not applicable

Hi Tony,

 

I got the same problem? could you please let me know where is the trick?

 

Thanks very much

 

Regards,

Yaqi

0 Likes