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.

Menu constructor event

5 posts in Objects Last posting was on 2002-09-06 11:53:46.0Z
Pablo Loyber Posted on 2002-09-06 00:58:46.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Pablo Loyber" <pablo@mail.com>
Subject: Menu constructor event
Date: Thu, 5 Sep 2002 21:58:46 -0300
Lines: 10
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: modem86-as9.capfed1.sinectis.com.ar 216.244.200.86
Message-ID: <364_IpwA#JUVCHA.81@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:300
Article PK: 712879

Hi,

Anyone knows how to map a constructor event to a menu object?

Or at least how to simulate this behaviour.

TIA
Pablo


Chris Pollach Posted on 2002-09-06 11:53:46.0Z
Newsgroups: sybase.public.powerbuilder.objects
Reply-To: "Chris Pollach" <cpollach@ajja.com>
From: "Chris Pollach" <cpollach@ajja.com>
Subject: Re: Menu constructor event
Date: Fri, 6 Sep 2002 07:53:46 -0400
Lines: 56
Organization: STD Inc
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: 209.47.227.134
Message-ID: <364_yZ$Sy3ZVCHA.258@forums.sybase.com>
References: <364_IpwA#JUVCHA.81@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:296
Article PK: 712871

Pablo;

The Menu does have a CREATE, but Powerbuilder does not allow you to have
access to this event for coding. If you do code this in the source code, you
loose it when another programmer modifies the menu object. So I would never
recommend this approach.
I would recommend using the Window object's MENUID property, as this
points to the current Menu Object. The Window does have a create event as
well, but PB does not allow you to access it. You have to use the OPEN event
which occurs after all other Child object's have processed their Constructor
events. In the OPEN event you could do the following ...

THIS.MenuID.Trigger Event Dynamic ue_Constructor ( )

The above code will send this event to the Menu attached to the current
Window. In the Menu object (PB7 and above) you can add User Events (yeh
baby - OK so Mike Myers is Canadian)! So add the "ue_Constructor" event to
the Menu Object and what ever code you want to perform. (Note: You can also
use a function instead of an event).

For the proper Object Oriented approach, I would use Inclusional
Polymorphism (try that at your next Java party and see if any of those
programmers knows what you are talking about!). That means setting up
Ancestor Window and Menu objects the define and implement the Trigger and
User Event approach described above. If you go this route, your descendants
may not have a real Menu object attached, so I would wrap an "IF" statement
around the Trigger Event like this ...

IF IsValid (THIS.MenuID) THEN

or

IF Handle (THIS.MenuID) > 0 THEN

That should bullet proof the case where there is no sense in send a
message to the Menu Object if it does not exist!

Hope that helps!

Regards ... Chris Pollach
Great White North Technical Evangelist

"Pablo Loyber" <pablo@mail.com> wrote in message
news:IpwA#JUVCHA.81@forums.sybase.com...
> Hi,
>
> Anyone knows how to map a constructor event to a menu object?
>
> Or at least how to simulate this behaviour.
>
> TIA
> Pablo
>
>


Arnoud Oortwijk Posted on 2002-09-06 07:25:20.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Arnoud Oortwijk" <arnoud@gloriant.be>
Subject: Re: Menu constructor event
Date: Fri, 6 Sep 2002 09:25:20 +0200
Lines: 33
Organization: Gloriant Belgium
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: 217.136.147.39
Message-ID: <364_Vtp8YhXVCHA.74@forums.sybase.com>
References: <364_IpwA#JUVCHA.81@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:298
Article PK: 712874

A menu does not have a constructor event that you can code using the
painters.

I can see two implementations
1) You set your menu dynamically using the ChangeMenu function after which
you do the things you want to during the construction phase

2) From the constructor event of a window you could generically post or
trigger a function or event on the menu like of_constructor() in which you
can do your thingy.

HTH

Arnoud

Url: http://www.gloriant.be

"Pablo Loyber" <pablo@mail.com> wrote in message
news:IpwA#JUVCHA.81@forums.sybase.com...
> Hi,
>
> Anyone knows how to map a constructor event to a menu object?
>
> Or at least how to simulate this behaviour.
>
> TIA
> Pablo
>
>


Mirko Di Tommaso Posted on 2002-09-06 10:41:20.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Mirko Di Tommaso" <mirko.ditommaso@ilmessaggero.it>
Subject: Re: Menu constructor event
Date: Fri, 6 Sep 2002 12:41:20 +0200
Lines: 48
Organization: Il Messaggero (Rome, Italy)
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: host200-239.pool8019.interbusiness.it 80.19.239.200
Message-ID: <364_YPKYoPZVCHA.197@forums.sybase.com>
References: <364_IpwA#JUVCHA.81@forums.sybase.com> <364_Vtp8YhXVCHA.74@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:297
Article PK: 712872

you can try to coded the Create event in the Export of Menu (or Source in
PB8) but every time you modify the Menu you lose the code. I use to write a
function:

inv_menusrv.of_Create () and put all my code inside

Take carefully this is a Not supported method (I think)



"Arnoud Oortwijk" <arnoud@gloriant.be> ha scritto nel messaggio
news:Vtp8YhXVCHA.74@forums.sybase.com...

> A menu does not have a constructor event that you can code using the
> painters.
>
> I can see two implementations
> 1) You set your menu dynamically using the ChangeMenu function after which
> you do the things you want to during the construction phase
>
> 2) From the constructor event of a window you could generically post or
> trigger a function or event on the menu like of_constructor() in which you
> can do your thingy.
>
> HTH
>
> Arnoud
>
> Url: http://www.gloriant.be
>
>
>
> "Pablo Loyber" <pablo@mail.com> wrote in message
> news:IpwA#JUVCHA.81@forums.sybase.com...
> > Hi,
> >
> > Anyone knows how to map a constructor event to a menu object?
> >
> > Or at least how to simulate this behaviour.
> >
> > TIA
> > Pablo
> >
> >
>
>


Pablo Loyber Posted on 2002-09-06 01:06:28.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Pablo Loyber" <pablo@mail.com>
Subject: Re: Menu constructor event
Date: Thu, 5 Sep 2002 22:06:28 -0300
Lines: 16
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: modem86-as9.capfed1.sinectis.com.ar 216.244.200.86
Message-ID: <364_5B0VLOUVCHA.81@forums.sybase.com>
References: <364_IpwA#JUVCHA.81@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:299
Article PK: 712878

This in PB 6.5

"Pablo Loyber" <pablo@mail.com> escribió en el mensaje
news:IpwA#JUVCHA.81@forums.sybase.com...

> Hi,
>
> Anyone knows how to map a constructor event to a menu object?
>
> Or at least how to simulate this behaviour.
>
> TIA
> Pablo
>
>