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 problem (possibile?)

5 posts in Objects Last posting was on 2002-11-06 15:54:12.0Z
Marco Sarti Posted on 2002-10-30 11:55:12.0Z
Newsgroups: sybase.public.powerbuilder.objects
Subject: Menu problem (possibile?)
From: Marco Sarti <invalid@invalid.it>
Organization: no company
User-Agent: Xnews/5.04.25
Date: Wed, 30 Oct 2002 06:55:12 -0500
Lines: 16
NNTP-Posting-Host: 212.102.35.130
Message-ID: <364_Xns92B78040742E4marcone@199.93.177.77>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:830
Article PK: 713394

PB 6.5.1

I need to apply to a w_frame a runtime-istantiated menu. This menu is
inherited from m_myframe (supposing m_myframe is my pfe-extension of
m_frame).
Well, I code as follow:

m_myframe lm_newmenu

lm_newmenu = create using "m_newmenuframe"
// m_newmenuframe is obviously inherited from lm_newmenu
w_myframe.changemenu(lm_newmenu)

But the changed menu is a menu of m_myframe, when I expect to be
m_newmenuframe! This is an unpredictable result for me...

Assuming this is an incorrect method: is there a method to assign a
dinamically-created (by name) menu to a MDI-frame?

Thanks!! Marco


"Tim Wallace" <reply Posted on 2002-10-30 20:39:02.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Tim Wallace" <reply@this_group.com>
Subject: Re: Menu problem (possibile?)
Date: Wed, 30 Oct 2002 15:39:02 -0500
Lines: 78
Organization: Solar Flare Software, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: mail.pit-magnus.com 206.139.208.13
Message-ID: <364_$SYBkXFgCHA.296@forums.sybase.com>
References: <364_Xns92B78040742E4marcone@199.93.177.77> <364_c5mAXVCgCHA.196@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:825
Article PK: 713389

I'm the guy who wrote the article about dynamic menu items posted on Eric's
site. I wanted to clarify something in your post. You indicated you wanted
to try to "add some code to the newly created menu items". This cannot be
done after the fact. You need to know something about what it is that the
dynamic menu items are going to do. Then, you create your individual menu
items from which the dynamic ones are created. If you still need the
dynamic menu item functionality, post to the group and I'll help you out.

Tim Wallace

"G. Serdijn" <gserdijn@koper-it.nl> wrote in message
news:c5mAXVCgCHA.196@forums.sybase.com...
> Marco,
>
> There is some information about this at the site of Eric Aling. I tried it
> some time ago with the following result. But I failed to find a reasonable
> way to add some code to the newly created menu items.
>
> It is not exactly an answer to your question, but maybe it helps somewhat.
>
> Gerry
>
> /* ************************* */
> Powerbuilder Code Snippet
>
> integer li_menu
>
> MenuID.Item[UpperBound(MenuID.Item[]) + 1] = CREATE menu
> MenuID.Item[UpperBound(MenuID.Item[])].text = "&New Menu Item"
>
> li_menu = UpperBound(MenuID.Item[]) // save some typing
>
> MenuID.item[li_menu].item[1] = CREATE menu
> MenuID.item[li_menu].item[1].text = "&New sub menu item"
> MenuID.item[li_menu].item[1].toolbaritemname = 'Update!'
> MenuID.item[li_menu].item[1].toolbaritemvisible = TRUE
>
> MenuID.item[li_menu].item[2] = CREATE menu
> MenuID.item[li_menu].item[2].text = "&Another new sub menu item"
>
> MenuID.item[li_menu].item[2].item[1] = CREATE menu
> MenuID.item[li_menu].item[2].item[1].text = "&Cascaded menu item"
>
> // REDRAW menu
> Hide(MenuID.Item[1])
> Show(MenuID.Item[1])
>
>
> "Marco Sarti" <invalid@invalid.it> schreef in bericht
> news:Xns92B78040742E4marcone@199.93.177.77...
> > PB 6.5.1
> >
> > I need to apply to a w_frame a runtime-istantiated menu. This menu is
> > inherited from m_myframe (supposing m_myframe is my pfe-extension of
> > m_frame).
> > Well, I code as follow:
> >
> > m_myframe lm_newmenu
> >
> > lm_newmenu = create using "m_newmenuframe"
> > // m_newmenuframe is obviously inherited from lm_newmenu
> > w_myframe.changemenu(lm_newmenu)
> >
> > But the changed menu is a menu of m_myframe, when I expect to be
> > m_newmenuframe! This is an unpredictable result for me...
> >
> > Assuming this is an incorrect method: is there a method to assign a
> > dinamically-created (by name) menu to a MDI-frame?
> >
> > Thanks!! Marco
> >
> >
> >
>
>
>


G. Serdijn Posted on 2002-10-31 08:34:00.0Z
Newsgroups: sybase.public.powerbuilder.objects
Reply-To: "G. Serdijn" <gserdijn@koper-it.nl>
From: "G. Serdijn" <gserdijn@koper-it.nl>
Subject: Re: Menu problem (possibile?)
Date: Thu, 31 Oct 2002 09:34:00 +0100
Lines: 109
Organization: Koper IT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: 194.151.214.130
Message-ID: <364_BBuTyoLgCHA.196@forums.sybase.com>
References: <364_Xns92B78040742E4marcone@199.93.177.77> <364_c5mAXVCgCHA.196@forums.sybase.com> <364_$SYBkXFgCHA.296@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:823
Article PK: 713388

Tim,

Thank you for your reaction.

Last year I was looking for a solution for the following problem:
Our company has a base application with some additional modules.
Implementing a module results in some additional menu items in my frame
menu, and of course some windows to be opened when clicked upon the
corresponding menu item.
I tried to find a way to hook up the modules with the application by means
of the dynamic menu items, but failed - spectacularly - to find a way. Now I
put all the code for the modules in the base application and dis/enable the
menu items in the open event of my frame window depending upon Registry
settings. It works but I am not satisfied with this solution.

Maybe you know of a better way?

Rereading your article at http://eric.aling.tripod.com/ I think I shall
study the contents of the zipfiles more carefully.

Gerry

"Tim Wallace" <reply@this_group.com> schreef in bericht
news:$SYBkXFgCHA.296@forums.sybase.com...

> I'm the guy who wrote the article about dynamic menu items posted on
Eric's
> site. I wanted to clarify something in your post. You indicated you
wanted
> to try to "add some code to the newly created menu items". This cannot be
> done after the fact. You need to know something about what it is that the
> dynamic menu items are going to do. Then, you create your individual menu
> items from which the dynamic ones are created. If you still need the
> dynamic menu item functionality, post to the group and I'll help you out.
>
> Tim Wallace
>
> "G. Serdijn" <gserdijn@koper-it.nl> wrote in message
> news:c5mAXVCgCHA.196@forums.sybase.com...
> > Marco,
> >
> > There is some information about this at the site of Eric Aling. I tried
it
> > some time ago with the following result. But I failed to find a
reasonable
> > way to add some code to the newly created menu items.
> >
> > It is not exactly an answer to your question, but maybe it helps
somewhat.
> >
> > Gerry
> >
> > /* ************************* */
> > Powerbuilder Code Snippet
> >
> > integer li_menu
> >
> > MenuID.Item[UpperBound(MenuID.Item[]) + 1] = CREATE menu
> > MenuID.Item[UpperBound(MenuID.Item[])].text = "&New Menu Item"
> >
> > li_menu = UpperBound(MenuID.Item[]) // save some typing
> >
> > MenuID.item[li_menu].item[1] = CREATE menu
> > MenuID.item[li_menu].item[1].text = "&New sub menu item"
> > MenuID.item[li_menu].item[1].toolbaritemname = 'Update!'
> > MenuID.item[li_menu].item[1].toolbaritemvisible = TRUE
> >
> > MenuID.item[li_menu].item[2] = CREATE menu
> > MenuID.item[li_menu].item[2].text = "&Another new sub menu item"
> >
> > MenuID.item[li_menu].item[2].item[1] = CREATE menu
> > MenuID.item[li_menu].item[2].item[1].text = "&Cascaded menu item"
> >
> > // REDRAW menu
> > Hide(MenuID.Item[1])
> > Show(MenuID.Item[1])
> >
> >
> > "Marco Sarti" <invalid@invalid.it> schreef in bericht
> > news:Xns92B78040742E4marcone@199.93.177.77...
> > > PB 6.5.1
> > >
> > > I need to apply to a w_frame a runtime-istantiated menu. This menu is
> > > inherited from m_myframe (supposing m_myframe is my pfe-extension of
> > > m_frame).
> > > Well, I code as follow:
> > >
> > > m_myframe lm_newmenu
> > >
> > > lm_newmenu = create using "m_newmenuframe"
> > > // m_newmenuframe is obviously inherited from lm_newmenu
> > > w_myframe.changemenu(lm_newmenu)
> > >
> > > But the changed menu is a menu of m_myframe, when I expect to be
> > > m_newmenuframe! This is an unpredictable result for me...
> > >
> > > Assuming this is an incorrect method: is there a method to assign a
> > > dinamically-created (by name) menu to a MDI-frame?
> > >
> > > Thanks!! Marco
> > >
> > >
> > >
> >
> >
> >
>
>


Brian Leslie Posted on 2002-10-30 23:33:25.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Brian Leslie" <brian.leslie@rogers.com>
Subject: Re: Menu problem (possibile?)
Date: Wed, 30 Oct 2002 18:33:25 -0500
Lines: 103
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: CPE00b0d00614b8.cpe.net.cable.rogers.com 24.42.84.174
Message-ID: <364_AFxlH6GgCHA.313@forums.sybase.com>
References: <364_Xns92B78040742E4marcone@199.93.177.77> <364_c5mAXVCgCHA.196@forums.sybase.com> <364_$SYBkXFgCHA.296@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:824
Article PK: 713392

I'm using Eric's approach to dynamic menu items in our PFC app. However,
I'm only using this for the datawindow popup menu (m_dw). It works very
well, and for the code in the dynamic menu, you have to create a class with
a reference to an object to trigger an event.

Create a single menu item with code with code in it to trigger a known
event.

idw_requestor.Event ue_RButtonMenuAction(index)

-Brian

"Tim Wallace" <reply@this_group.com> wrote in message
news:$SYBkXFgCHA.296@forums.sybase.com...
> I'm the guy who wrote the article about dynamic menu items posted on
Eric's
> site. I wanted to clarify something in your post. You indicated you
wanted
> to try to "add some code to the newly created menu items". This cannot be
> done after the fact. You need to know something about what it is that the
> dynamic menu items are going to do. Then, you create your individual menu
> items from which the dynamic ones are created. If you still need the
> dynamic menu item functionality, post to the group and I'll help you out.
>
> Tim Wallace
>
> "G. Serdijn" <gserdijn@koper-it.nl> wrote in message
> news:c5mAXVCgCHA.196@forums.sybase.com...
> > Marco,
> >
> > There is some information about this at the site of Eric Aling. I tried
it
> > some time ago with the following result. But I failed to find a
reasonable
> > way to add some code to the newly created menu items.
> >
> > It is not exactly an answer to your question, but maybe it helps
somewhat.
> >
> > Gerry
> >
> > /* ************************* */
> > Powerbuilder Code Snippet
> >
> > integer li_menu
> >
> > MenuID.Item[UpperBound(MenuID.Item[]) + 1] = CREATE menu
> > MenuID.Item[UpperBound(MenuID.Item[])].text = "&New Menu Item"
> >
> > li_menu = UpperBound(MenuID.Item[]) // save some typing
> >
> > MenuID.item[li_menu].item[1] = CREATE menu
> > MenuID.item[li_menu].item[1].text = "&New sub menu item"
> > MenuID.item[li_menu].item[1].toolbaritemname = 'Update!'
> > MenuID.item[li_menu].item[1].toolbaritemvisible = TRUE
> >
> > MenuID.item[li_menu].item[2] = CREATE menu
> > MenuID.item[li_menu].item[2].text = "&Another new sub menu item"
> >
> > MenuID.item[li_menu].item[2].item[1] = CREATE menu
> > MenuID.item[li_menu].item[2].item[1].text = "&Cascaded menu item"
> >
> > // REDRAW menu
> > Hide(MenuID.Item[1])
> > Show(MenuID.Item[1])
> >
> >
> > "Marco Sarti" <invalid@invalid.it> schreef in bericht
> > news:Xns92B78040742E4marcone@199.93.177.77...
> > > PB 6.5.1
> > >
> > > I need to apply to a w_frame a runtime-istantiated menu. This menu is
> > > inherited from m_myframe (supposing m_myframe is my pfe-extension of
> > > m_frame).
> > > Well, I code as follow:
> > >
> > > m_myframe lm_newmenu
> > >
> > > lm_newmenu = create using "m_newmenuframe"
> > > // m_newmenuframe is obviously inherited from lm_newmenu
> > > w_myframe.changemenu(lm_newmenu)
> > >
> > > But the changed menu is a menu of m_myframe, when I expect to be
> > > m_newmenuframe! This is an unpredictable result for me...
> > >
> > > Assuming this is an incorrect method: is there a method to assign a
> > > dinamically-created (by name) menu to a MDI-frame?
> > >
> > > Thanks!! Marco
> > >
> > >
> > >
> >
> >
> >
>
>


"Tim Wallace" <reply Posted on 2002-11-06 15:54:12.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Tim Wallace" <reply@this_group.com>
Subject: Re: Menu problem (possibile?)
Date: Wed, 6 Nov 2002 10:54:12 -0500
Lines: 126
Organization: Solar Flare Software, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: mail.pit-magnus.com 206.139.208.13
Message-ID: <364_xsOjD5ahCHA.258@forums.sybase.com>
References: <364_Xns92B78040742E4marcone@199.93.177.77> <364_c5mAXVCgCHA.196@forums.sybase.com> <364_$SYBkXFgCHA.296@forums.sybase.com> <364_AFxlH6GgCHA.313@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:793
Article PK: 713356

Actually, Brian, I never meant to imply in my article that you have to code
for a known event. You can easily pass a reference to an object and store
it in a variable of type PowerObject. Then, you can pass the event name you
want fired as a string and store that. Then in the clicked event, you can
do this: iPObj.TriggerEvent( isEventAsString). This will allow for a truly
dynamic menu item.

I've extended my original example quite a bit since I sent it to Eric a
couple of years ago. It is now quite robost and flexible.

Tim Wallace

"Brian Leslie" <brian.leslie@rogers.com> wrote in message
news:AFxlH6GgCHA.313@forums.sybase.com...
> I'm using Eric's approach to dynamic menu items in our PFC app. However,
> I'm only using this for the datawindow popup menu (m_dw). It works very
> well, and for the code in the dynamic menu, you have to create a class
with
> a reference to an object to trigger an event.
>
> Create a single menu item with code with code in it to trigger a known
> event.
>
> idw_requestor.Event ue_RButtonMenuAction(index)
>
> -Brian
>
>
>
>
>
> "Tim Wallace" <reply@this_group.com> wrote in message
> news:$SYBkXFgCHA.296@forums.sybase.com...
> > I'm the guy who wrote the article about dynamic menu items posted on
> Eric's
> > site. I wanted to clarify something in your post. You indicated you
> wanted
> > to try to "add some code to the newly created menu items". This cannot
be
> > done after the fact. You need to know something about what it is that
the
> > dynamic menu items are going to do. Then, you create your individual
menu
> > items from which the dynamic ones are created. If you still need the
> > dynamic menu item functionality, post to the group and I'll help you
out.
> >
> > Tim Wallace
> >
> > "G. Serdijn" <gserdijn@koper-it.nl> wrote in message
> > news:c5mAXVCgCHA.196@forums.sybase.com...
> > > Marco,
> > >
> > > There is some information about this at the site of Eric Aling. I
tried
> it
> > > some time ago with the following result. But I failed to find a
> reasonable
> > > way to add some code to the newly created menu items.
> > >
> > > It is not exactly an answer to your question, but maybe it helps
> somewhat.
> > >
> > > Gerry
> > >
> > > /* ************************* */
> > > Powerbuilder Code Snippet
> > >
> > > integer li_menu
> > >
> > > MenuID.Item[UpperBound(MenuID.Item[]) + 1] = CREATE menu
> > > MenuID.Item[UpperBound(MenuID.Item[])].text = "&New Menu Item"
> > >
> > > li_menu = UpperBound(MenuID.Item[]) // save some typing
> > >
> > > MenuID.item[li_menu].item[1] = CREATE menu
> > > MenuID.item[li_menu].item[1].text = "&New sub menu item"
> > > MenuID.item[li_menu].item[1].toolbaritemname = 'Update!'
> > > MenuID.item[li_menu].item[1].toolbaritemvisible = TRUE
> > >
> > > MenuID.item[li_menu].item[2] = CREATE menu
> > > MenuID.item[li_menu].item[2].text = "&Another new sub menu item"
> > >
> > > MenuID.item[li_menu].item[2].item[1] = CREATE menu
> > > MenuID.item[li_menu].item[2].item[1].text = "&Cascaded menu item"
> > >
> > > // REDRAW menu
> > > Hide(MenuID.Item[1])
> > > Show(MenuID.Item[1])
> > >
> > >
> > > "Marco Sarti" <invalid@invalid.it> schreef in bericht
> > > news:Xns92B78040742E4marcone@199.93.177.77...
> > > > PB 6.5.1
> > > >
> > > > I need to apply to a w_frame a runtime-istantiated menu. This menu
is
> > > > inherited from m_myframe (supposing m_myframe is my pfe-extension of
> > > > m_frame).
> > > > Well, I code as follow:
> > > >
> > > > m_myframe lm_newmenu
> > > >
> > > > lm_newmenu = create using "m_newmenuframe"
> > > > // m_newmenuframe is obviously inherited from lm_newmenu
> > > > w_myframe.changemenu(lm_newmenu)
> > > >
> > > > But the changed menu is a menu of m_myframe, when I expect to be
> > > > m_newmenuframe! This is an unpredictable result for me...
> > > >
> > > > Assuming this is an incorrect method: is there a method to assign a
> > > > dinamically-created (by name) menu to a MDI-frame?
> > > >
> > > > Thanks!! Marco
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>