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.

How to automatically find parent window from NVO

9 posts in Objects Last posting was on 2006-03-02 05:43:42.0Z
rob Posted on 2006-03-01 21:52:29.0Z
Sender: 7ec2.44060632.1804289383@sybase.com
From: Rob
Newsgroups: sybase.public.powerbuilder.objects
Subject: How to automatically find parent window from NVO
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4406081d.7edc.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 1 Mar 2006 12:46:21 -0800, 10.22.241.42
Lines: 9
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Mar 2006 12:46:22 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Mar 2006 13:52:29 -0800
X-Trace: forums-1-dub 1141249949 10.22.108.75 (1 Mar 2006 13:52:29 -0800)
X-Original-Trace: 1 Mar 2006 13:52:29 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8793
Article PK: 735998

Is there a way to identify the parent (or active) window
automatically from an NVO. The window may be an MDI sheet
(can do that) but may also be a response or popup window.
Can get the window handle from a Windows API but can't
figure out how to identify the window object to access the
window's methods.

Any help is much appreciated!
Thanks


Scott Morris Posted on 2006-03-01 22:33:57.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4406081d.7edc.1681692777@sybase.com>
Subject: Re: How to automatically find parent window from NVO
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 65.205.162.2
X-Original-NNTP-Posting-Host: 65.205.162.2
Message-ID: <44062155$1@forums-1-dub>
Date: 1 Mar 2006 14:33:57 -0800
X-Trace: forums-1-dub 1141252437 65.205.162.2 (1 Mar 2006 14:33:57 -0800)
X-Original-Trace: 1 Mar 2006 14:33:57 -0800, 65.205.162.2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8797
Article PK: 736001


> Is there a way to identify the parent (or active) window
> automatically from an NVO. The window may be an MDI sheet
> (can do that) but may also be a response or popup window.

A NVO has no GUI parent and has no built-in knowledge of any windows that
might be active within the application. You would need to provide a
mechanism within your application to handle this. Personally, I would
recommend that you associate your NVO with a specific window in some fashion
rather than try to "find" an available window after the fact.

Assuming you can get a reference to some window object, you can use metadata
functions to determine its class. You can use the classname function /
method as well as the classdefintion attribute of an object. PFC also has
the n_cst_metaclass class for assisting in such matters.


Shah din sani [Certified PowerBuilder Developer] Posted on 2006-03-01 22:09:19.0Z
Reply-To: "Shah din sani [Certified PowerBuilder Developer]" <shah.din.sani@gmail.com>
From: "Shah din sani [Certified PowerBuilder Developer]" <shah.din.sani@gmail.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4406081d.7edc.1681692777@sybase.com>
Subject: Re: How to automatically find parent window from NVO
Lines: 26
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: usenet.diversified.com
X-Original-NNTP-Posting-Host: usenet.diversified.com
Message-ID: <44061b8f$1@forums-1-dub>
Date: 1 Mar 2006 14:09:19 -0800
X-Trace: forums-1-dub 1141250959 206.11.112.251 (1 Mar 2006 14:09:19 -0800)
X-Original-Trace: 1 Mar 2006 14:09:19 -0800, usenet.diversified.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8794
Article PK: 736002

Try following.

Let us say you want to call a function wf_parent_window_function when user
cliks on nvo. In click event of NVO write following script.

window l_window
l_window = getParent()
l_window.Dynamic wf_parent_window_function()

--
Shah din sani [PowerObjects]
Certified PowerBuilder Developer
www.powerobjects.com

<Rob> wrote in message news:4406081d.7edc.1681692777@sybase.com...
> Is there a way to identify the parent (or active) window
> automatically from an NVO. The window may be an MDI sheet
> (can do that) but may also be a response or popup window.
> Can get the window handle from a Windows API but can't
> figure out how to identify the window object to access the
> window's methods.
>
> Any help is much appreciated!
> Thanks


rob Posted on 2006-03-01 22:51:55.0Z
Sender: 7f72.4406157a.1804289383@sybase.com
From: Rob
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: How to automatically find parent window from NVO
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4406160b.7f7e.1681692777@sybase.com>
References: <44061b8f$1@forums-1-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 1 Mar 2006 13:45:47 -0800, 10.22.241.42
Lines: 34
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Mar 2006 13:45:48 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Mar 2006 14:51:55 -0800
X-Trace: forums-1-dub 1141253515 10.22.108.75 (1 Mar 2006 14:51:55 -0800)
X-Original-Trace: 1 Mar 2006 14:51:55 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8798
Article PK: 736003

I'm using a nonvisualobject, as opposed to a visual
userobject. getParent() doesn't work in this instance.

Thanks anyway.
Rob

> Try following.
>
> Let us say you want to call a function
> wf_parent_window_function when user cliks on nvo. In
> click event of NVO write following script.
>
> window l_window
> l_window = getParent()
> l_window.Dynamic wf_parent_window_function()
>
> --
> Shah din sani [PowerObjects]
> Certified PowerBuilder Developer
> www.powerobjects.com
>
> <Rob> wrote in message
> > news:4406081d.7edc.1681692777@sybase.com... Is there a
> > way to identify the parent (or active) window
> > automatically from an NVO. The window may be an MDI
> sheet (can do that) but may also be a response or popup
> > window. Can get the window handle from a Windows API but
> > can't figure out how to identify the window object to
> > access the window's methods.
> >
> > Any help is much appreciated!
> > Thanks
>
>


Shah din sani [Certified PowerBuilder Developer] Posted on 2006-03-01 22:29:50.0Z
Reply-To: "Shah din sani [Certified PowerBuilder Developer]" <shah.din.sani@gmail.com>
From: "Shah din sani [Certified PowerBuilder Developer]" <shah.din.sani@gmail.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <44061b8f$1@forums-1-dub> <44060ed5.7f2e.1681692777@sybase.com>
Subject: Re: How to automatically find parent window from NVO
Lines: 45
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: usenet.diversified.com
X-Original-NNTP-Posting-Host: usenet.diversified.com
Message-ID: <4406205e$1@forums-1-dub>
Date: 1 Mar 2006 14:29:50 -0800
X-Trace: forums-1-dub 1141252190 206.11.112.251 (1 Mar 2006 14:29:50 -0800)
X-Original-Trace: 1 Mar 2006 14:29:50 -0800, usenet.diversified.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8796
Article PK: 736004

Are you creating this NVO inside that window or you want to call a function
from active window?

--
Shah din sani [PowerObjects]
Certified PowerBuilder Developer
www.powerobjects.com

<Rob> wrote in message news:44060ed5.7f2e.1681692777@sybase.com...
> I'm using a nonvisualobject, as opposed to a visual
> userobject. getParent() doesn't work in this instance.
>
> Thanks anyway.
> Rob
>
>> Try following.
>>
>> Let us say you want to call a function
>> wf_parent_window_function when user cliks on nvo. In
>> click event of NVO write following script.
>>
>> window l_window
>> l_window = getParent()
>> l_window.Dynamic wf_parent_window_function()
>>
>> --
>> Shah din sani [PowerObjects]
>> Certified PowerBuilder Developer
>> www.powerobjects.com
>>
>> <Rob> wrote in message
>> > news:4406081d.7edc.1681692777@sybase.com... Is there a
>> > way to identify the parent (or active) window
>> > automatically from an NVO. The window may be an MDI
>> sheet (can do that) but may also be a response or popup
>> > window. Can get the window handle from a Windows API but
>> > can't figure out how to identify the window object to
>> > access the window's methods.
>> >
>> > Any help is much appreciated!
>> > Thanks
>>
>>


rob Posted on 2006-03-01 23:25:25.0Z
Sender: 663f.44062c65.1804289383@sybase.com
From: Rob
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: How to automatically find parent window from NVO
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <44062d65.6648.1681692777@sybase.com>
References: <4406205e$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Mar 2006 15:25:25 -0800
X-Trace: forums-1-dub 1141255525 10.22.241.41 (1 Mar 2006 15:25:25 -0800)
X-Original-Trace: 1 Mar 2006 15:25:25 -0800, 10.22.241.41
Lines: 47
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8799
Article PK: 736005

call a function from active window (not active sheet)

> Are you creating this NVO inside that window or you want
> to call a function from active window?
>
> --
> Shah din sani [PowerObjects]
> Certified PowerBuilder Developer
> www.powerobjects.com
>
> <Rob> wrote in message
> > news:44060ed5.7f2e.1681692777@sybase.com... I'm using a
> > nonvisualobject, as opposed to a visual userobject.
> getParent() doesn't work in this instance. >
> > Thanks anyway.
> > Rob
> >
> >> Try following.
> >>
> >> Let us say you want to call a function
> >> wf_parent_window_function when user cliks on nvo. In
> >> click event of NVO write following script.
> >>
> >> window l_window
> >> l_window = getParent()
> >> l_window.Dynamic wf_parent_window_function()
> >>
> >> --
> >> Shah din sani [PowerObjects]
> >> Certified PowerBuilder Developer
> >> www.powerobjects.com
> >>
> >> <Rob> wrote in message
> >> > news:4406081d.7edc.1681692777@sybase.com... Is there
> a >> > way to identify the parent (or active) window
> >> > automatically from an NVO. The window may be an MDI
> >> sheet (can do that) but may also be a response or popup
> >> > window. Can get the window handle from a Windows API
> but >> > can't figure out how to identify the window
> object to >> > access the window's methods.
> >> >
> >> > Any help is much appreciated!
> >> > Thanks
> >>
> >>
>
>


"Paul Horan[TeamSybase]" <paul.horan Posted on 2006-03-01 23:57:29.0Z
From: "Paul Horan[TeamSybase]" <paul.horan@NOSPAM_cynergysystems.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <4406081d.7edc.1681692777@sybase.com>
Subject: Re: How to automatically find parent window from NVO
Lines: 29
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: 12.40.150.233
Message-ID: <44062569$1@forums-2-dub>
X-Original-Trace: 1 Mar 2006 14:51:21 -0800, 12.40.150.233
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Mar 2006 14:51:22 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Mar 2006 15:57:29 -0800
X-Trace: forums-1-dub 1141257449 10.22.108.75 (1 Mar 2006 15:57:29 -0800)
X-Original-Trace: 1 Mar 2006 15:57:29 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8800
Article PK: 736006

Declare an instance variable in the NVO base class:
powerObject ipo_master

Put a method in your NVO base class:
of_setmaster( powerobject apo)
this.ipo_master = apo

Now, right after instantiating the NVO, you can call:
myNVO.of_setMaster( this )

The NVO can then cast the powerObject reference to a window, another NVO, or
whatever...

Paul Horan[TeamSybase]
Cynergy Systems
www.cynergysystems.com

<Rob> wrote in message news:4406081d.7edc.1681692777@sybase.com...
> Is there a way to identify the parent (or active) window
> automatically from an NVO. The window may be an MDI sheet
> (can do that) but may also be a response or popup window.
> Can get the window handle from a Windows API but can't
> figure out how to identify the window object to access the
> window's methods.
>
> Any help is much appreciated!
> Thanks


Philip Salgannik Posted on 2006-03-02 05:43:42.0Z
From: "Philip Salgannik" <philemaxNOSPAM@comcast.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <4406081d.7edc.1681692777@sybase.com>
Subject: Re: How to automatically find parent window from NVO
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: c-24-34-75-142.hsd1.ma.comcast.net
Message-ID: <4406768b$1@forums-2-dub>
X-Original-Trace: 1 Mar 2006 20:37:31 -0800, c-24-34-75-142.hsd1.ma.comcast.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 1 Mar 2006 20:37:34 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 1 Mar 2006 21:43:42 -0800
X-Trace: forums-1-dub 1141278222 10.22.108.75 (1 Mar 2006 21:43:42 -0800)
X-Original-Trace: 1 Mar 2006 21:43:42 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8801
Article PK: 736007

The simplest (if you insist on this design) would be to call a GetFocus()
function.
If you get a valid GraphicObject from it, it would be trivial to find it's
parent window...

<Rob> wrote in message news:4406081d.7edc.1681692777@sybase.com...
> Is there a way to identify the parent (or active) window
> automatically from an NVO. The window may be an MDI sheet
> (can do that) but may also be a response or popup window.
> Can get the window handle from a Windows API but can't
> figure out how to identify the window object to access the
> window's methods.
>
> Any help is much appreciated!
> Thanks