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.

Calling inherited menufunction popmenu()

5 posts in Objects Last posting was on 2009-03-09 10:03:40.0Z
Rolf Knaden Posted on 2009-03-06 07:56:18.0Z
From: Rolf Knaden <rolf.knaden@conject.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Calling inherited menufunction popmenu()
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49b0d722$1@forums-1-dub>
Date: 5 Mar 2009 23:56:18 -0800
X-Trace: forums-1-dub 1236326178 10.22.241.152 (5 Mar 2009 23:56:18 -0800)
X-Original-Trace: 5 Mar 2009 23:56:18 -0800, vip152.sybase.com
Lines: 38
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9817
Article PK: 736948

Hello.

I have a menu "m_mymenu" with subitems (see below):
m_mymenu
-> m_1
-> m_1.1
-> m_1.2
-> m_2
-> m_2.1
-> m_2.2

Menu "m_mymenu" is inherited from a menu "m_base". In "m_base" I
modified the function popmenu(), so that the menu is translated into a
different language before it is shown:
public function integer popmenu (integer x, integer y);
//translate menu
n_enable.translate(this)
return (super::popmenu (x,y))
end function
If calling m_mymenu.popmenu(x,y) all works fine.
But when calling m_mymenu.m_1.popmenu(x,y) the changed function popmenu
is not called, but the original function of object menu.
The reason is clear: all subitems in m_mymenu are of type menu, not m_base.

Is it possible to call the function popmenu of object m_base also for
subitems?
As I already tried out it is possible, by changing "from menu" into
"from m_base" in the source editor. Works fine. But when inserting new
subitems in the painter, they are "from menu".
Is it possible to have all subitems(!) enherited "from m_base" when
using the painter?

Unfortunately menus don't have a constructor-event, don't they? If they
had, that also would solve my problem.

Thanks,

Rolf


Jeremy Lakeman Posted on 2009-03-06 11:02:38.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Calling inherited menufunction popmenu()
Date: Fri, 6 Mar 2009 03:02:38 -0800 (PST)
Organization: http://groups.google.com
Lines: 45
Message-ID: <6c446dd9-438b-4853-a2e7-e1acada39390@s9g2000prg.googlegroups.com>
References: <49b0d722$1@forums-1-dub>
NNTP-Posting-Host: 122.49.157.94
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1236337359 23523 127.0.0.1 (6 Mar 2009 11:02:39 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 6 Mar 2009 11:02:39 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: s9g2000prg.googlegroups.com; posting-host=122.49.157.94; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!newsfeed.news2me.com!news.glorb.com!postnews.google.com!s9g2000prg.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9818
Article PK: 736950


On Mar 6, 5:56 pm, Rolf Knaden <rolf.kna...@conject.com> wrote:
> Hello.
>
> I have a menu "m_mymenu" with subitems (see below):
>         m_mymenu
>         -> m_1
>            -> m_1.1
>            -> m_1.2
>         -> m_2
>            -> m_2.1
>            -> m_2.2
>
> Menu "m_mymenu" is inherited from a menu "m_base". In "m_base" I
> modified the function popmenu(), so that the menu is translated into a
> different language before it is shown:
>         public function integer popmenu (integer x, integer y);
>                 //translate menu
>                 n_enable.translate(this)
>                 return (super::popmenu (x,y))
>         end function
> If calling m_mymenu.popmenu(x,y) all works fine.
> But when calling m_mymenu.m_1.popmenu(x,y) the changed function popmenu
> is not called, but the original function of object menu.
> The reason is clear: all subitems in m_mymenu are of type menu, not m_base.
>
> Is it possible to call the function popmenu of object m_base also for
> subitems?
> As I already tried out it is possible, by changing "from menu" into
> "from m_base" in the source editor. Works fine. But when inserting new
> subitems in the painter, they are "from menu".
> Is it possible to have all subitems(!) enherited "from m_base" when
> using the painter?
>
> Unfortunately menus don't have a constructor-event, don't they? If they
> had, that also would solve my problem.
>
> Thanks,
>
> Rolf

You can probably define a pbm_constructor event yourself. Personally
I'd write a global function and call that instead;
f_pop_menu(menu am_menu, integer x, integer y);
...


Rolf Knaden Posted on 2009-03-06 15:30:45.0Z
From: Rolf Knaden <rolf.knaden@conject.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Calling inherited menufunction popmenu()
References: <49b0d722$1@forums-1-dub> <6c446dd9-438b-4853-a2e7-e1acada39390@s9g2000prg.googlegroups.com>
In-Reply-To: <6c446dd9-438b-4853-a2e7-e1acada39390@s9g2000prg.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49b141a5$1@forums-1-dub>
Date: 6 Mar 2009 07:30:45 -0800
X-Trace: forums-1-dub 1236353445 10.22.241.152 (6 Mar 2009 07:30:45 -0800)
X-Original-Trace: 6 Mar 2009 07:30:45 -0800, vip152.sybase.com
Lines: 49
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9819
Article PK: 736952

Jeremy Lakeman schrieb:

> On Mar 6, 5:56 pm, Rolf Knaden <rolf.kna...@conject.com> wrote:
>> Hello.
>>
>> I have a menu "m_mymenu" with subitems (see below):
>> m_mymenu
>> -> m_1
>> -> m_1.1
>> -> m_1.2
>> -> m_2
>> -> m_2.1
>> -> m_2.2
>>
>> Menu "m_mymenu" is inherited from a menu "m_base". In "m_base" I
>> modified the function popmenu(), so that the menu is translated into a
>> different language before it is shown:
>> public function integer popmenu (integer x, integer y);
>> //translate menu
>> n_enable.translate(this)
>> return (super::popmenu (x,y))
>> end function
>> If calling m_mymenu.popmenu(x,y) all works fine.
>> But when calling m_mymenu.m_1.popmenu(x,y) the changed function popmenu
>> is not called, but the original function of object menu.
>> The reason is clear: all subitems in m_mymenu are of type menu, not m_base.
>>
>> Is it possible to call the function popmenu of object m_base also for
>> subitems?
>> As I already tried out it is possible, by changing "from menu" into
>> "from m_base" in the source editor. Works fine. But when inserting new
>> subitems in the painter, they are "from menu".
>> Is it possible to have all subitems(!) enherited "from m_base" when
>> using the painter?
>>
>> Unfortunately menus don't have a constructor-event, don't they? If they
>> had, that also would solve my problem.
>>
>> Thanks,
>>
>> Rolf
>
> You can probably define a pbm_constructor event yourself. Personally
> I'd write a global function and call that instead;
> f_pop_menu(menu am_menu, integer x, integer y);
> ...

I already have programmed a pbm_constructor event. But that never is
fired. As is the same with the clicked event, which already is provided.
To be honest, I don't know why?


Rolf Knaden Posted on 2009-03-09 10:03:40.0Z
From: Rolf Knaden <rolf.knaden@conject.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Calling inherited menufunction popmenu()
References: <49b0d722$1@forums-1-dub> <6c446dd9-438b-4853-a2e7-e1acada39390@s9g2000prg.googlegroups.com>
In-Reply-To: <6c446dd9-438b-4853-a2e7-e1acada39390@s9g2000prg.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49b4e97c$1@forums-1-dub>
Date: 9 Mar 2009 02:03:40 -0800
X-Trace: forums-1-dub 1236593020 10.22.241.152 (9 Mar 2009 02:03:40 -0800)
X-Original-Trace: 9 Mar 2009 02:03:40 -0800, vip152.sybase.com
Lines: 50
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9821
Article PK: 736955

Jeremy Lakeman schrieb:

> On Mar 6, 5:56 pm, Rolf Knaden <rolf.kna...@conject.com> wrote:
>> Hello.
>>
>> I have a menu "m_mymenu" with subitems (see below):
>> m_mymenu
>> -> m_1
>> -> m_1.1
>> -> m_1.2
>> -> m_2
>> -> m_2.1
>> -> m_2.2
>>
>> Menu "m_mymenu" is inherited from a menu "m_base". In "m_base" I
>> modified the function popmenu(), so that the menu is translated into a
>> different language before it is shown:
>> public function integer popmenu (integer x, integer y);
>> //translate menu
>> n_enable.translate(this)
>> return (super::popmenu (x,y))
>> end function
>> If calling m_mymenu.popmenu(x,y) all works fine.
>> But when calling m_mymenu.m_1.popmenu(x,y) the changed function popmenu
>> is not called, but the original function of object menu.
>> The reason is clear: all subitems in m_mymenu are of type menu, not m_base.
>>
>> Is it possible to call the function popmenu of object m_base also for
>> subitems?
>> As I already tried out it is possible, by changing "from menu" into
>> "from m_base" in the source editor. Works fine. But when inserting new
>> subitems in the painter, they are "from menu".
>> Is it possible to have all subitems(!) enherited "from m_base" when
>> using the painter?
>>
>> Unfortunately menus don't have a constructor-event, don't they? If they
>> had, that also would solve my problem.
>>
>> Thanks,
>>
>> Rolf
>
> You can probably define a pbm_constructor event yourself. Personally
> I'd write a global function and call that instead;
> f_pop_menu(menu am_menu, integer x, integer y);
> ...

I think I must take your advise with the global function for another
reason. In some cases we create menu-items dynamically. Translating the
menu at creation-time would would not cover those items.
Thank you,
Rolf


Philip Salgannik Posted on 2009-03-06 16:29:51.0Z
From: "Philip Salgannik" <philip@MeMyselfAndI.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <49b0d722$1@forums-1-dub>
Subject: Re: Calling inherited menufunction popmenu()
Lines: 47
Organization: MeMyselfAndI
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49b14f7f$1@forums-1-dub>
Date: 6 Mar 2009 08:29:51 -0800
X-Trace: forums-1-dub 1236356991 10.22.241.152 (6 Mar 2009 08:29:51 -0800)
X-Original-Trace: 6 Mar 2009 08:29:51 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9820
Article PK: 736951

Since the painter does not support it, create the menu always dynamically,
this way you can ensure that all menuitems are derived from m_base...

"Rolf Knaden" <rolf.knaden@conject.com> wrote in message
news:49b0d722$1@forums-1-dub...
> Hello.
>
> I have a menu "m_mymenu" with subitems (see below):
> m_mymenu
> -> m_1
> -> m_1.1
> -> m_1.2
> -> m_2
> -> m_2.1
> -> m_2.2
>
> Menu "m_mymenu" is inherited from a menu "m_base". In "m_base" I modified
> the function popmenu(), so that the menu is translated into a different
> language before it is shown:
> public function integer popmenu (integer x, integer y);
> //translate menu
> n_enable.translate(this)
> return (super::popmenu (x,y))
> end function
> If calling m_mymenu.popmenu(x,y) all works fine.
> But when calling m_mymenu.m_1.popmenu(x,y) the changed function popmenu is
> not called, but the original function of object menu.
> The reason is clear: all subitems in m_mymenu are of type menu, not
> m_base.
>
> Is it possible to call the function popmenu of object m_base also for
> subitems?
> As I already tried out it is possible, by changing "from menu" into "from
> m_base" in the source editor. Works fine. But when inserting new subitems
> in the painter, they are "from menu".
> Is it possible to have all subitems(!) enherited "from m_base" when using
> the painter?
>
> Unfortunately menus don't have a constructor-event, don't they? If they
> had, that also would solve my problem.
>
> Thanks,
>
> Rolf
>