Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int

9 posts in DataWindow .NET Last posting was on 2004-09-23 14:52:23.0Z
Jack Addington Posted on 2004-09-21 22:16:03.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
Subject: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <4150a9f4$1@forums-2-dub>
X-Original-Trace: 21 Sep 2004 15:23:48 -0700, s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 21 Sep 2004 15:03:19 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 21 Sep 2004 15:16:03 -0700
X-Trace: forums-1-dub 1095804963 10.22.108.75 (21 Sep 2004 15:16:03 -0700)
X-Original-Trace: 21 Sep 2004 15:16:03 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:416
Article PK: 124846

I am capturing the ObjectUnderMouse object in a DWClicked event and passing
the X,Y coordinates to another function. However there are certain areas
that I click on where the X property throws an exception. I am clicking
basically on the rowdivider but I am getting a row number in the detail
band. Should a GraphicObject always have an X property or is there
something I can key off to say (don't use this object for row clicking X,Y
functions). This is in the demo version.
thx

jack


Jim O'Neil [Sybase] Posted on 2004-09-22 02:37:43.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Message-ID: <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com>
References: <4150a9f4$1@forums-2-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-concord-020.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-020.sybase.com
Date: 21 Sep 2004 19:37:43 -0700
X-Trace: forums-1-dub 1095820663 158.159.8.20 (21 Sep 2004 19:37:43 -0700)
X-Original-Trace: 21 Sep 2004 19:37:43 -0700, vpn-concord-020.sybase.com
Lines: 19
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:417
Article PK: 124847

What you are doing should be supported. What specifically do you mean
by 'row divider', are you using a grid layout for instance and
referring to the gridlines?

On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>

wrote:

>I am capturing the ObjectUnderMouse object in a DWClicked event and passing
>the X,Y coordinates to another function. However there are certain areas
>that I click on where the X property throws an exception. I am clicking
>basically on the rowdivider but I am getting a row number in the detail
>band. Should a GraphicObject always have an X property or is there
>something I can key off to say (don't use this object for row clicking X,Y
>functions). This is in the demo version.
>thx
>
>jack
>


Jack Addington Posted on 2004-09-22 15:39:00.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <41519c94$1@forums-1-dub>
Date: 22 Sep 2004 08:39:00 -0700
X-Trace: forums-1-dub 1095867540 68.147.193.82 (22 Sep 2004 08:39:00 -0700)
X-Original-Trace: 22 Sep 2004 08:39:00 -0700, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:422
Article PK: 124852

It is not a grid layout, I just meant I'm clicking as close to exactly
between the rows as possible. In PB though I thought the row would be equal
to 0 if you clicked in a space that couldn't be determined.

Nonetheless I went back to my datawindow and put 3d borders on the columns.
If I click anywhere outside the column, above, below, and on the side, then
the X, Y and a few other properties don't work.

Here is the offending code: (I originally was just using the objAtPointer
but started playing around)

private void DWAnc_Click(object sender, System.EventArgs e)
{
Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
Sybase.DataWindow.GraphicObject dwo = obj.Gob;

// call the sort manager
if (obj.Band.Type.ToString() == "Header")
if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
dwo);

// call the rowmanager
if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
dwo);
}

It blows up when trying to pass the .X to the functions...

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
> What you are doing should be supported. What specifically do you mean
> by 'row divider', are you using a grid layout for instance and
> referring to the gridlines?
>
> On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
> wrote:
>
>>I am capturing the ObjectUnderMouse object in a DWClicked event and
>>passing
>>the X,Y coordinates to another function. However there are certain areas
>>that I click on where the X property throws an exception. I am clicking
>>basically on the rowdivider but I am getting a row number in the detail
>>band. Should a GraphicObject always have an X property or is there
>>something I can key off to say (don't use this object for row clicking X,Y
>>functions). This is in the demo version.
>>thx
>>
>>jack
>>
>


David Avera Posted on 2004-09-22 18:32:58.0Z
From: "David Avera" <davera@sybase.com>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: vpn-concord-050.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-050.sybase.com
Message-ID: <4151c55a@forums-1-dub>
Date: 22 Sep 2004 11:32:58 -0700
X-Trace: forums-1-dub 1095877978 158.159.8.50 (22 Sep 2004 11:32:58 -0700)
X-Original-Trace: 22 Sep 2004 11:32:58 -0700, vpn-concord-050.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:426
Article PK: 124853

You might try checking the "Empty" property of GraphicObject to see if there
is anything there. When you click between columns or not on an actual object
you'll get Empty=True. If what you want at this point is an X or Y value you
should be able to get that from the inherited Forms property for X or Y.

"Jack Addington" <jaddington@shaw.ca> wrote in message
news:41519c94$1@forums-1-dub...
> It is not a grid layout, I just meant I'm clicking as close to exactly
> between the rows as possible. In PB though I thought the row would be
equal
> to 0 if you clicked in a space that couldn't be determined.
>
> Nonetheless I went back to my datawindow and put 3d borders on the
columns.
> If I click anywhere outside the column, above, below, and on the side,
then
> the X, Y and a few other properties don't work.
>
> Here is the offending code: (I originally was just using the objAtPointer
> but started playing around)
>
> private void DWAnc_Click(object sender, System.EventArgs e)
> {
> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
>
> // call the sort manager
> if (obj.Band.Type.ToString() == "Header")
> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
> dwo);
>
> // call the rowmanager
> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
> dwo);
> }
>
> It blows up when trying to pass the .X to the functions...
>
> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
> > What you are doing should be supported. What specifically do you mean
> > by 'row divider', are you using a grid layout for instance and
> > referring to the gridlines?
> >
> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
> > wrote:
> >
> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
> >>passing
> >>the X,Y coordinates to another function. However there are certain
areas
> >>that I click on where the X property throws an exception. I am clicking
> >>basically on the rowdivider but I am getting a row number in the detail
> >>band. Should a GraphicObject always have an X property or is there
> >>something I can key off to say (don't use this object for row clicking
X,Y
> >>functions). This is in the demo version.
> >>thx
> >>
> >>jack
> >>
> >
>
>


David Avera Posted on 2004-09-22 19:25:08.0Z
From: "David Avera" <davera@sybase.com>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 116
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: vpn-concord-050.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-050.sybase.com
Message-ID: <4151d194$1@forums-1-dub>
Date: 22 Sep 2004 12:25:08 -0700
X-Trace: forums-1-dub 1095881108 158.159.8.50 (22 Sep 2004 12:25:08 -0700)
X-Original-Trace: 22 Sep 2004 12:25:08 -0700, vpn-concord-050.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:427
Article PK: 124854

My prior message referred to an inherited X position when you click in an
area that is not a GraphicObject. That isn't correct, there is an inherited
"MousePosition" property that evaluates to a Point and you can use that if
you wanted the X Y of the mouse when it isn't on a GraphicObject.
Code snippet follows:

private void MyClicked(object sender, System.EventArgs e)

{

Sybase.DataWindow.ObjectAtPointer OAP = dw_1.ObjectUnderMouse;

if ( OAP.Gob is GraphicObjectColumn )

{

lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectColumn)
OAP.Gob).DataType.ToString( ) );

}

else if ( OAP.Gob is GraphicObjectText )

{

lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectText) OAP.Gob).Text );

}

else if ( OAP.Gob is GraphicObjectButton )

{

lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectButton) OAP.Gob).Text );

( (GraphicObjectButton) OAP.Gob).Text = "Spanky";

}

else

{

lb_1.Items.Add ( "Clicked :" + OAP.ToString( ) );

Point p = DataWindowControl.MousePosition;

lb_1.Items.Add ( "X = " + p.X.ToString( ) );

lb_1.Items.Add ( "Y = " + p.Y.ToString( ) );

}

}

"Jack Addington" <jaddington@shaw.ca> wrote in message
news:41519c94$1@forums-1-dub...
> It is not a grid layout, I just meant I'm clicking as close to exactly
> between the rows as possible. In PB though I thought the row would be
equal
> to 0 if you clicked in a space that couldn't be determined.
>
> Nonetheless I went back to my datawindow and put 3d borders on the
columns.
> If I click anywhere outside the column, above, below, and on the side,
then
> the X, Y and a few other properties don't work.
>
> Here is the offending code: (I originally was just using the objAtPointer
> but started playing around)
>
> private void DWAnc_Click(object sender, System.EventArgs e)
> {
> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
>
> // call the sort manager
> if (obj.Band.Type.ToString() == "Header")
> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
> dwo);
>
> // call the rowmanager
> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
> dwo);
> }
>
> It blows up when trying to pass the .X to the functions...
>
> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
> > What you are doing should be supported. What specifically do you mean
> > by 'row divider', are you using a grid layout for instance and
> > referring to the gridlines?
> >
> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
> > wrote:
> >
> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
> >>passing
> >>the X,Y coordinates to another function. However there are certain
areas
> >>that I click on where the X property throws an exception. I am clicking
> >>basically on the rowdivider but I am getting a row number in the detail
> >>band. Should a GraphicObject always have an X property or is there
> >>something I can key off to say (don't use this object for row clicking
X,Y
> >>functions). This is in the demo version.
> >>thx
> >>
> >>jack
> >>
> >
>
>


Jack Addington Posted on 2004-09-22 22:02:15.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub> <4151d194$1@forums-1-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 133
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <4151f664$1@forums-2-dub>
X-Original-Trace: 22 Sep 2004 15:02:12 -0700, s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Sep 2004 15:02:13 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Sep 2004 15:02:15 -0700
X-Trace: forums-1-dub 1095890535 10.22.108.75 (22 Sep 2004 15:02:15 -0700)
X-Original-Trace: 22 Sep 2004 15:02:15 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:428
Article PK: 124857

David,

Thanks a lot. I'm mostly interested in the row for selecting and for a
mouse popup on the coordinates. This will work fine.

thx

jack

"David Avera" <davera@sybase.com> wrote in message
news:4151d194$1@forums-1-dub...
> My prior message referred to an inherited X position when you click in an
> area that is not a GraphicObject. That isn't correct, there is an
> inherited
> "MousePosition" property that evaluates to a Point and you can use that if
> you wanted the X Y of the mouse when it isn't on a GraphicObject.
> Code snippet follows:
>
> private void MyClicked(object sender, System.EventArgs e)
>
> {
>
> Sybase.DataWindow.ObjectAtPointer OAP = dw_1.ObjectUnderMouse;
>
> if ( OAP.Gob is GraphicObjectColumn )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectColumn)
> OAP.Gob).DataType.ToString( ) );
>
> }
>
> else if ( OAP.Gob is GraphicObjectText )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectText) OAP.Gob).Text );
>
> }
>
> else if ( OAP.Gob is GraphicObjectButton )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectButton) OAP.Gob).Text );
>
> ( (GraphicObjectButton) OAP.Gob).Text = "Spanky";
>
> }
>
> else
>
> {
>
> lb_1.Items.Add ( "Clicked :" + OAP.ToString( ) );
>
> Point p = DataWindowControl.MousePosition;
>
> lb_1.Items.Add ( "X = " + p.X.ToString( ) );
>
> lb_1.Items.Add ( "Y = " + p.Y.ToString( ) );
>
> }
>
> }
>
> "Jack Addington" <jaddington@shaw.ca> wrote in message
> news:41519c94$1@forums-1-dub...
>> It is not a grid layout, I just meant I'm clicking as close to exactly
>> between the rows as possible. In PB though I thought the row would be
> equal
>> to 0 if you clicked in a space that couldn't be determined.
>>
>> Nonetheless I went back to my datawindow and put 3d borders on the
> columns.
>> If I click anywhere outside the column, above, below, and on the side,
> then
>> the X, Y and a few other properties don't work.
>>
>> Here is the offending code: (I originally was just using the objAtPointer
>> but started playing around)
>>
>> private void DWAnc_Click(object sender, System.EventArgs e)
>> {
>> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
>> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
>>
>> // call the sort manager
>> if (obj.Band.Type.ToString() == "Header")
>> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y,
>> obj.RowNumber,
>> dwo);
>>
>> // call the rowmanager
>> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
>> dwo);
>> }
>>
>> It blows up when trying to pass the .X to the functions...
>>
>> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
>> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
>> > What you are doing should be supported. What specifically do you mean
>> > by 'row divider', are you using a grid layout for instance and
>> > referring to the gridlines?
>> >
>> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
>> > wrote:
>> >
>> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
>> >>passing
>> >>the X,Y coordinates to another function. However there are certain
> areas
>> >>that I click on where the X property throws an exception. I am
>> >>clicking
>> >>basically on the rowdivider but I am getting a row number in the detail
>> >>band. Should a GraphicObject always have an X property or is there
>> >>something I can key off to say (don't use this object for row clicking
> X,Y
>> >>functions). This is in the demo version.
>> >>thx
>> >>
>> >>jack
>> >>
>> >
>>
>>
>
>


Jack Addington Posted on 2004-09-22 23:45:58.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub> <4151d194$1@forums-1-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 130
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <41520eb6$1@forums-1-dub>
Date: 22 Sep 2004 16:45:58 -0700
X-Trace: forums-1-dub 1095896758 68.147.193.82 (22 Sep 2004 16:45:58 -0700)
X-Original-Trace: 22 Sep 2004 16:45:58 -0700, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:429
Article PK: 124859

David,

I can't find a MousePosition property anywhere, not public at least. A
search on mouse only brings up all the GraphicObject and ObjjectUnderMouse
references...

"David Avera" <davera@sybase.com> wrote in message
news:4151d194$1@forums-1-dub...
> My prior message referred to an inherited X position when you click in an
> area that is not a GraphicObject. That isn't correct, there is an
> inherited
> "MousePosition" property that evaluates to a Point and you can use that if
> you wanted the X Y of the mouse when it isn't on a GraphicObject.
> Code snippet follows:
>
> private void MyClicked(object sender, System.EventArgs e)
>
> {
>
> Sybase.DataWindow.ObjectAtPointer OAP = dw_1.ObjectUnderMouse;
>
> if ( OAP.Gob is GraphicObjectColumn )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectColumn)
> OAP.Gob).DataType.ToString( ) );
>
> }
>
> else if ( OAP.Gob is GraphicObjectText )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectText) OAP.Gob).Text );
>
> }
>
> else if ( OAP.Gob is GraphicObjectButton )
>
> {
>
> lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectButton) OAP.Gob).Text );
>
> ( (GraphicObjectButton) OAP.Gob).Text = "Spanky";
>
> }
>
> else
>
> {
>
> lb_1.Items.Add ( "Clicked :" + OAP.ToString( ) );
>
> Point p = DataWindowControl.MousePosition;
>
> lb_1.Items.Add ( "X = " + p.X.ToString( ) );
>
> lb_1.Items.Add ( "Y = " + p.Y.ToString( ) );
>
> }
>
> }
>
> "Jack Addington" <jaddington@shaw.ca> wrote in message
> news:41519c94$1@forums-1-dub...
>> It is not a grid layout, I just meant I'm clicking as close to exactly
>> between the rows as possible. In PB though I thought the row would be
> equal
>> to 0 if you clicked in a space that couldn't be determined.
>>
>> Nonetheless I went back to my datawindow and put 3d borders on the
> columns.
>> If I click anywhere outside the column, above, below, and on the side,
> then
>> the X, Y and a few other properties don't work.
>>
>> Here is the offending code: (I originally was just using the objAtPointer
>> but started playing around)
>>
>> private void DWAnc_Click(object sender, System.EventArgs e)
>> {
>> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
>> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
>>
>> // call the sort manager
>> if (obj.Band.Type.ToString() == "Header")
>> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y,
>> obj.RowNumber,
>> dwo);
>>
>> // call the rowmanager
>> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
>> dwo);
>> }
>>
>> It blows up when trying to pass the .X to the functions...
>>
>> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
>> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
>> > What you are doing should be supported. What specifically do you mean
>> > by 'row divider', are you using a grid layout for instance and
>> > referring to the gridlines?
>> >
>> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
>> > wrote:
>> >
>> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
>> >>passing
>> >>the X,Y coordinates to another function. However there are certain
> areas
>> >>that I click on where the X property throws an exception. I am
>> >>clicking
>> >>basically on the rowdivider but I am getting a row number in the detail
>> >>band. Should a GraphicObject always have an X property or is there
>> >>something I can key off to say (don't use this object for row clicking
> X,Y
>> >>functions). This is in the demo version.
>> >>thx
>> >>
>> >>jack
>> >>
>> >
>>
>>
>
>


David Avera Posted on 2004-09-23 00:35:07.0Z
From: "David Avera" <davera@sybase.com>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub> <4151d194$1@forums-1-dub> <41520eb6$1@forums-1-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 144
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: vpn-concord-050.sybase.com
Message-ID: <41521a36$1@forums-2-dub>
X-Original-Trace: 22 Sep 2004 17:35:02 -0700, vpn-concord-050.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Sep 2004 17:35:04 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Sep 2004 17:35:07 -0700
X-Trace: forums-1-dub 1095899707 10.22.108.75 (22 Sep 2004 17:35:07 -0700)
X-Original-Trace: 22 Sep 2004 17:35:07 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:430
Article PK: 124860

MousePosition is a property on the ancestor of the DataWindowControl,
System.Windows.Form.Control (I think). It is a static property so you have
to get it with "Point p = DataWindowControl.MousePosition;"

"Jack Addington" <jaddington@shaw.ca> wrote in message
news:41520eb6$1@forums-1-dub...
> David,
>
> I can't find a MousePosition property anywhere, not public at least. A
> search on mouse only brings up all the GraphicObject and ObjjectUnderMouse
> references...
>
>
> "David Avera" <davera@sybase.com> wrote in message
> news:4151d194$1@forums-1-dub...
> > My prior message referred to an inherited X position when you click in
an
> > area that is not a GraphicObject. That isn't correct, there is an
> > inherited
> > "MousePosition" property that evaluates to a Point and you can use that
if
> > you wanted the X Y of the mouse when it isn't on a GraphicObject.
> > Code snippet follows:
> >
> > private void MyClicked(object sender, System.EventArgs e)
> >
> > {
> >
> > Sybase.DataWindow.ObjectAtPointer OAP = dw_1.ObjectUnderMouse;
> >
> > if ( OAP.Gob is GraphicObjectColumn )
> >
> > {
> >
> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectColumn)
> > OAP.Gob).DataType.ToString( ) );
> >
> > }
> >
> > else if ( OAP.Gob is GraphicObjectText )
> >
> > {
> >
> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectText) OAP.Gob).Text );
> >
> > }
> >
> > else if ( OAP.Gob is GraphicObjectButton )
> >
> > {
> >
> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectButton) OAP.Gob).Text );
> >
> > ( (GraphicObjectButton) OAP.Gob).Text = "Spanky";
> >
> > }
> >
> > else
> >
> > {
> >
> > lb_1.Items.Add ( "Clicked :" + OAP.ToString( ) );
> >
> > Point p = DataWindowControl.MousePosition;
> >
> > lb_1.Items.Add ( "X = " + p.X.ToString( ) );
> >
> > lb_1.Items.Add ( "Y = " + p.Y.ToString( ) );
> >
> > }
> >
> > }
> >
> > "Jack Addington" <jaddington@shaw.ca> wrote in message
> > news:41519c94$1@forums-1-dub...
> >> It is not a grid layout, I just meant I'm clicking as close to exactly
> >> between the rows as possible. In PB though I thought the row would be
> > equal
> >> to 0 if you clicked in a space that couldn't be determined.
> >>
> >> Nonetheless I went back to my datawindow and put 3d borders on the
> > columns.
> >> If I click anywhere outside the column, above, below, and on the side,
> > then
> >> the X, Y and a few other properties don't work.
> >>
> >> Here is the offending code: (I originally was just using the
objAtPointer
> >> but started playing around)
> >>
> >> private void DWAnc_Click(object sender, System.EventArgs e)
> >> {
> >> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
> >> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
> >>
> >> // call the sort manager
> >> if (obj.Band.Type.ToString() == "Header")
> >> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y,
> >> obj.RowNumber,
> >> dwo);
> >>
> >> // call the rowmanager
> >> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y, obj.RowNumber,
> >> dwo);
> >> }
> >>
> >> It blows up when trying to pass the .X to the functions...
> >>
> >> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
> >> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
> >> > What you are doing should be supported. What specifically do you
mean
> >> > by 'row divider', are you using a grid layout for instance and
> >> > referring to the gridlines?
> >> >
> >> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
> >> > wrote:
> >> >
> >> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
> >> >>passing
> >> >>the X,Y coordinates to another function. However there are certain
> > areas
> >> >>that I click on where the X property throws an exception. I am
> >> >>clicking
> >> >>basically on the rowdivider but I am getting a row number in the
detail
> >> >>band. Should a GraphicObject always have an X property or is there
> >> >>something I can key off to say (don't use this object for row
clicking
> > X,Y
> >> >>functions). This is in the demo version.
> >> >>thx
> >> >>
> >> >>jack
> >> >>
> >> >
> >>
> >>
> >
> >
>
>


Jack Addington Posted on 2004-09-23 14:52:23.0Z
From: "Jack Addington" <jaddington@shaw.ca>
Newsgroups: sybase.public.datawindow.net
References: <4150a9f4$1@forums-2-dub> <jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com> <41519c94$1@forums-1-dub> <4151d194$1@forums-1-dub> <41520eb6$1@forums-1-dub> <41521a36$1@forums-2-dub>
Subject: Re: GraphicObject.X property = <error: an exception of type: {System.InvalidOperationException} occurred> int
Lines: 157
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
X-Original-NNTP-Posting-Host: s010600e018e32f17.cg.shawcable.net
Message-ID: <4152e327$1@forums-1-dub>
Date: 23 Sep 2004 07:52:23 -0700
X-Trace: forums-1-dub 1095951143 68.147.193.82 (23 Sep 2004 07:52:23 -0700)
X-Original-Trace: 23 Sep 2004 07:52:23 -0700, s010600e018e32f17.cg.shawcable.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:431
Article PK: 124855

Got it... just had to adjust my syntax a bit.

DWVariable.MousePosition.X worked for me.

thx

"David Avera" <davera@sybase.com> wrote in message
news:41521a36$1@forums-2-dub...
> MousePosition is a property on the ancestor of the DataWindowControl,
> System.Windows.Form.Control (I think). It is a static property so you have
> to get it with "Point p = DataWindowControl.MousePosition;"
>
> "Jack Addington" <jaddington@shaw.ca> wrote in message
> news:41520eb6$1@forums-1-dub...
>> David,
>>
>> I can't find a MousePosition property anywhere, not public at least. A
>> search on mouse only brings up all the GraphicObject and
>> ObjjectUnderMouse
>> references...
>>
>>
>> "David Avera" <davera@sybase.com> wrote in message
>> news:4151d194$1@forums-1-dub...
>> > My prior message referred to an inherited X position when you click in
> an
>> > area that is not a GraphicObject. That isn't correct, there is an
>> > inherited
>> > "MousePosition" property that evaluates to a Point and you can use that
> if
>> > you wanted the X Y of the mouse when it isn't on a GraphicObject.
>> > Code snippet follows:
>> >
>> > private void MyClicked(object sender, System.EventArgs e)
>> >
>> > {
>> >
>> > Sybase.DataWindow.ObjectAtPointer OAP = dw_1.ObjectUnderMouse;
>> >
>> > if ( OAP.Gob is GraphicObjectColumn )
>> >
>> > {
>> >
>> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectColumn)
>> > OAP.Gob).DataType.ToString( ) );
>> >
>> > }
>> >
>> > else if ( OAP.Gob is GraphicObjectText )
>> >
>> > {
>> >
>> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectText) OAP.Gob).Text );
>> >
>> > }
>> >
>> > else if ( OAP.Gob is GraphicObjectButton )
>> >
>> > {
>> >
>> > lb_1.Items.Add ( "Clicked : " + ( (GraphicObjectButton)
>> > OAP.Gob).Text );
>> >
>> > ( (GraphicObjectButton) OAP.Gob).Text = "Spanky";
>> >
>> > }
>> >
>> > else
>> >
>> > {
>> >
>> > lb_1.Items.Add ( "Clicked :" + OAP.ToString( ) );
>> >
>> > Point p = DataWindowControl.MousePosition;
>> >
>> > lb_1.Items.Add ( "X = " + p.X.ToString( ) );
>> >
>> > lb_1.Items.Add ( "Y = " + p.Y.ToString( ) );
>> >
>> > }
>> >
>> > }
>> >
>> > "Jack Addington" <jaddington@shaw.ca> wrote in message
>> > news:41519c94$1@forums-1-dub...
>> >> It is not a grid layout, I just meant I'm clicking as close to exactly
>> >> between the rows as possible. In PB though I thought the row would be
>> > equal
>> >> to 0 if you clicked in a space that couldn't be determined.
>> >>
>> >> Nonetheless I went back to my datawindow and put 3d borders on the
>> > columns.
>> >> If I click anywhere outside the column, above, below, and on the side,
>> > then
>> >> the X, Y and a few other properties don't work.
>> >>
>> >> Here is the offending code: (I originally was just using the
> objAtPointer
>> >> but started playing around)
>> >>
>> >> private void DWAnc_Click(object sender, System.EventArgs e)
>> >> {
>> >> Sybase.DataWindow.ObjectAtPointer obj = this.ObjectUnderMouse;
>> >> Sybase.DataWindow.GraphicObject dwo = obj.Gob;
>> >>
>> >> // call the sort manager
>> >> if (obj.Band.Type.ToString() == "Header")
>> >> if ( _rowSort != null) _rowSort.DWClicked(dwo.X, dwo.Y,
>> >> obj.RowNumber,
>> >> dwo);
>> >>
>> >> // call the rowmanager
>> >> if ( _rowMgr != null) _rowMgr.DWClicked(dwo.X, dwo.Y,
>> >> obj.RowNumber,
>> >> dwo);
>> >> }
>> >>
>> >> It blows up when trying to pass the .X to the functions...
>> >>
>> >> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
>> >> news:jio1l09gmdql576mbjfhb9t43jf5fjhlgj@4ax.com...
>> >> > What you are doing should be supported. What specifically do you
> mean
>> >> > by 'row divider', are you using a grid layout for instance and
>> >> > referring to the gridlines?
>> >> >
>> >> > On 21 Sep 2004 15:16:03 -0700, "Jack Addington" <jaddington@shaw.ca>
>> >> > wrote:
>> >> >
>> >> >>I am capturing the ObjectUnderMouse object in a DWClicked event and
>> >> >>passing
>> >> >>the X,Y coordinates to another function. However there are certain
>> > areas
>> >> >>that I click on where the X property throws an exception. I am
>> >> >>clicking
>> >> >>basically on the rowdivider but I am getting a row number in the
> detail
>> >> >>band. Should a GraphicObject always have an X property or is there
>> >> >>something I can key off to say (don't use this object for row
> clicking
>> > X,Y
>> >> >>functions). This is in the demo version.
>> >> >>thx
>> >> >>
>> >> >>jack
>> >> >>
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>