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.

PointerX(), PointerY() problem

2 posts in Objects Last posting was on 2002-09-02 11:30:10.0Z
Stefan Hubert Posted on 2002-08-30 07:20:49.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Stefan Hubert" <hubert@ai-lab.fh-furtwangen.de>
Subject: PointerX(), PointerY() problem
Date: Fri, 30 Aug 2002 09:20:49 +0200
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: p5090ADB6.dip.t-dialin.net 80.144.173.182
Message-ID: <364_gb1mAf$TCHA.258@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:982
Article PK: 713547

Hi,

The helpfile reads:

*************
objectname.PointerX ( )

Argument Description
objectname: The name of the control or window for which you want the
pointer's distance from the left edge. If you don't specify objectname,
PointerX reports the distance from the left edge of the current sheet or
window
**************

I've got an user object derived from PB's datawindow control. In this class
I want to implement to open a context popup menu on
right_mouse_button_click. The PB's popmenu function takes the x and y
location relative to the left top corner of the current window. Since I
don't know, on which position on a window my datawindow control class'
instances will be put, I could not code sth like this in the rbuttondown
event of my dw-class:
my_menu.popmenu( this.PointerX(), this.PointerY() )

So what I thougt needing to do was, as the helpfile of PointerX() tells,
leaving the objectname specifier out in order NOT to get the pointer
position relative to the datawindow control BUT to the whole current window.
Here comes the problem. This did not have any effect. The popmenu displayed
at the same wrong position, as it did before. I can tell that
'this.PointerX()' calls the same function as just 'PointerX()' because
'this' is optional (functions are always called on 'this', if present,
first, right?).

How can I call PointerX() and PointerY() properly in order that my popmenu
displays on the right position, no matter where my datawindow's position
will be on a window/custom visual/tabpage ect.?

thanks a lot in advance for any advice,

regards,

Stefan

P.S.
parent.PointerX() does not work (compiler does not accept it) and I also
don't like it much, as I don't like 'this.PointerX() + this.X', because this
works only for one parent-level: What if the datawindow is on a window's
tabpage's custom visual. I would only get the Pointer position relative to
the custom visual, wouldn't I (?), not for the whole window as I need it,
still.


Arnoud Oortwijk Posted on 2002-09-02 11:30:10.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Arnoud Oortwijk" <aoortwijk@tangram.nl>
Subject: Re: PointerX(), PointerY() problem
Date: Mon, 2 Sep 2002 13:30:10 +0200
Lines: 80
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: tangram.nl 213.84.194.121
Message-ID: <364_5FfxqXnUCHA.276@forums.sybase.com>
References: <364_gb1mAf$TCHA.258@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:973
Article PK: 713536

Here's how I fixed it.

Window lw
DragObject ld
IF This.Trigger Event ue_PrePopMenu( lm ) = 1 THEN
IF This.Getparent( ).TypeOf() = window! THEN
lw = This.GetParent()
lm.f_PopMenu( lw.pointerx(), lw.pointery() )
ELSE
ld = This.GetParent()
lm.PopMenu( ld.pointerx(), ld.pointery() )
END IF
END IF

HTH

Arnoud
Url: http://www.gloriant.be



"Stefan Hubert" <hubert@ai-lab.fh-furtwangen.de> schreef in bericht
news:gb1mAf$TCHA.258@forums.sybase.com...

> Hi,
>
> The helpfile reads:
>
> *************
> objectname.PointerX ( )
>
> Argument Description
> objectname: The name of the control or window for which you want the
> pointer's distance from the left edge. If you don't specify objectname,
> PointerX reports the distance from the left edge of the current sheet or
> window
> **************
>
> I've got an user object derived from PB's datawindow control. In this
class
> I want to implement to open a context popup menu on
> right_mouse_button_click. The PB's popmenu function takes the x and y
> location relative to the left top corner of the current window. Since I
> don't know, on which position on a window my datawindow control class'
> instances will be put, I could not code sth like this in the rbuttondown
> event of my dw-class:
> my_menu.popmenu( this.PointerX(), this.PointerY() )
>
> So what I thougt needing to do was, as the helpfile of PointerX() tells,
> leaving the objectname specifier out in order NOT to get the pointer
> position relative to the datawindow control BUT to the whole current
window.
> Here comes the problem. This did not have any effect. The popmenu
displayed
> at the same wrong position, as it did before. I can tell that
> 'this.PointerX()' calls the same function as just 'PointerX()' because
> 'this' is optional (functions are always called on 'this', if present,
> first, right?).
>
> How can I call PointerX() and PointerY() properly in order that my popmenu
> displays on the right position, no matter where my datawindow's position
> will be on a window/custom visual/tabpage ect.?
>
> thanks a lot in advance for any advice,
>
> regards,
>
> Stefan
>
> P.S.
> parent.PointerX() does not work (compiler does not accept it) and I also
> don't like it much, as I don't like 'this.PointerX() + this.X', because
this
> works only for one parent-level: What if the datawindow is on a window's
> tabpage's custom visual. I would only get the Pointer position relative to
> the custom visual, wouldn't I (?), not for the whole window as I need it,
> still.
>
>