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.

Context menu...

6 posts in Objects Last posting was on 2005-09-19 19:33:01.0Z
Alex Castillo Posted on 2005-09-19 15:52:12.0Z
From: "Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Context menu...
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: 12.173.207.194
Message-ID: <432ede6e@forums-2-dub>
X-Original-Trace: 19 Sep 2005 08:51:10 -0700, 12.173.207.194
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 08:51:11 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 08:52:12 -0700
X-Trace: forums-1-dub 1127145132 10.22.108.75 (19 Sep 2005 08:52:12 -0700)
X-Original-Trace: 19 Sep 2005 08:52:12 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8609
Article PK: 735825

Hi..!

How can I create a contextual menu?

What I would like to do is: I have a treeview object, and I want a menu
displayed when right click over it... that menu will have New, Edit and
Delete options (for items on the treeview object)... How can I implement it?

Thank you..!


Jason 'Bug' Fenter <fenter_bug_ Posted on 2005-09-19 16:53:58.0Z
From: Jason 'Bug' Fenter <fenter_bug_@_hot_mail_dot_com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Context menu...
References: <432ede6e@forums-2-dub>
In-Reply-To: <432ede6e@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 66.196.228.211
Message-ID: <432eecee$1@forums-2-dub>
X-Original-Trace: 19 Sep 2005 09:53:02 -0700, 66.196.228.211
Lines: 29
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 09:53:03 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 09:53:58 -0700
X-Trace: forums-1-dub 1127148838 10.22.108.75 (19 Sep 2005 09:53:58 -0700)
X-Original-Trace: 19 Sep 2005 09:53:58 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8610
Article PK: 735827


Alex Castillo wrote:
> Hi..!
>
> How can I create a contextual menu?
>
> What I would like to do is: I have a treeview object, and I want a menu
> displayed when right click over it... that menu will have New, Edit and
> Delete options (for items on the treeview object)... How can I implement it?
>
> Thank you..!
>
>

Take a look at the PopMenu() function. Basically, you'll create your
context menu in the menu painter and use PopMenu() to display it.

--
"Don't just fix; teach."

For GUI ideas, visit
http://guiolympics.codexchange.sybase.com
http://fenterbug.homeip.net/gallery

On using newsgroups in general:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html


Alex Castillo Posted on 2005-09-19 17:35:31.0Z
From: "Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com>
Newsgroups: sybase.public.powerbuilder.objects
References: <432ede6e@forums-2-dub> <432eecee$1@forums-2-dub>
Subject: Re: Context menu...
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: 12.173.207.194
Message-ID: <432ef6aa$1@forums-2-dub>
X-Original-Trace: 19 Sep 2005 10:34:34 -0700, 12.173.207.194
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 10:34:35 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 10:35:31 -0700
X-Trace: forums-1-dub 1127151331 10.22.108.75 (19 Sep 2005 10:35:31 -0700)
X-Original-Trace: 19 Sep 2005 10:35:31 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8611
Article PK: 735828

Fine..!

Now... how can I know which option from the Menu the user selected? What do
I need to place on the 'clicked event on the menu? Something on
message.stringparm?

Thank you..!

"Jason 'Bug' Fenter" <fenter_bug_@_hot_mail_dot_com> wrote in message
news:432eecee$1@forums-2-dub...
> Alex Castillo wrote:
> > Hi..!
> >
> > How can I create a contextual menu?
> >
> > What I would like to do is: I have a treeview object, and I want a menu
> > displayed when right click over it... that menu will have New, Edit and
> > Delete options (for items on the treeview object)... How can I implement
it?
> >
> > Thank you..!
> >
> >
>
> Take a look at the PopMenu() function. Basically, you'll create your
> context menu in the menu painter and use PopMenu() to display it.
>
> --
> "Don't just fix; teach."
>
> For GUI ideas, visit
> http://guiolympics.codexchange.sybase.com
> http://fenterbug.homeip.net/gallery
>
> On using newsgroups in general:
> news:news.announce.newusers
> http://www.geocities.com/nnqweb/
> http://www.catb.org/~esr/faqs/smart-questions.html
> http://www.caliburn.nl/topposting.html
> http://www.netmeister.org/news/learn2quote.html


"Richard Coleman" Posted on 2005-09-19 18:58:48.0Z
From: "Richard Coleman" <Richard Coleman at DRE DOT CA DOT GOV>
Newsgroups: sybase.public.powerbuilder.objects
References: <432ede6e@forums-2-dub> <432eecee$1@forums-2-dub> <432ef6aa$1@forums-2-dub>
Subject: Re: Context menu...
Lines: 99
Organization: Dept of Real Estate
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-Original-NNTP-Posting-Host: 165.235.56.38
Message-ID: <432f0a2b$1@forums-2-dub>
X-Original-Trace: 19 Sep 2005 11:57:47 -0700, 165.235.56.38
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 11:57:50 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 11:58:48 -0700
X-Trace: forums-1-dub 1127156328 10.22.108.75 (19 Sep 2005 11:58:48 -0700)
X-Original-Trace: 19 Sep 2005 11:58:48 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8612
Article PK: 735824

Depends on how you are implementing it. In a lot of cases, we have a
special menu list on the window menu
that we want the user to access rather than having to go up to the menu.
The code is something like:

m_licensing_main.m_actions.PopMenu ( gnv_app.of_GetFrame().PointerX(),
gnv_app.of_GetFrame().PointerX() )

So since the Actions menu is already on the window menu, it works fine from
there. The code just executes the
actual menu code.

If you are using a menu that you will be creating solely for popup purposes,
then you need to create some function on the menu to pass in
the pointer to where you want to execute the code. The following mini-menu
has an Insert Row and a Delete Row item only. It is
defined with a top level menu of m_actions, with the two sub items as
mentioned.:

m_insert_delete lm_menu
// Let's create the teeny tiny menu
lm_Menu = CREATE m_insert_delete

// Pass a pointer to the menu so it will know what to call
lm_Menu.mf_SetDatawindow ( this )

// And display the menu
lm_menu.m_actions.PopMenu(w_fiscal_barcode_multiple_chk.Pointerx(),
w_fiscal_barcode_multiple_chk.PointerY())

// Then destroy it
IF IsValid ( lm_Menu ) THEN
DESTROY lm_Menu
END IF

Then, in the custom menu created, for example, I have an 'Insert Row' that
goes directly to the datawindow. The code
in the menu for that menu item is:

iu_dw.EVENT DYNAMIC ue_insertrow()

iu_dw is an instance variable on the menu and was populated by the
mf_SetDataWindow call above.

You can change that to a window from the datawindow if that is more
appropriate and where you have the code.

Richard

"Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com> wrote in message
news:432ef6aa$1@forums-2-dub...
> Fine..!
>
> Now... how can I know which option from the Menu the user selected? What
do
> I need to place on the 'clicked event on the menu? Something on
> message.stringparm?
>
> Thank you..!
>
> "Jason 'Bug' Fenter" <fenter_bug_@_hot_mail_dot_com> wrote in message
> news:432eecee$1@forums-2-dub...
> > Alex Castillo wrote:
> > > Hi..!
> > >
> > > How can I create a contextual menu?
> > >
> > > What I would like to do is: I have a treeview object, and I want a
menu
> > > displayed when right click over it... that menu will have New, Edit
and
> > > Delete options (for items on the treeview object)... How can I
implement
> it?
> > >
> > > Thank you..!
> > >
> > >
> >
> > Take a look at the PopMenu() function. Basically, you'll create your
> > context menu in the menu painter and use PopMenu() to display it.
> >
> > --
> > "Don't just fix; teach."
> >
> > For GUI ideas, visit
> > http://guiolympics.codexchange.sybase.com
> > http://fenterbug.homeip.net/gallery
> >
> > On using newsgroups in general:
> > news:news.announce.newusers
> > http://www.geocities.com/nnqweb/
> > http://www.catb.org/~esr/faqs/smart-questions.html
> > http://www.caliburn.nl/topposting.html
> > http://www.netmeister.org/news/learn2quote.html
>
>


Brad Wery Posted on 2005-09-19 19:07:57.0Z
From: Brad Wery <bradweryatagricoreunited.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Context menu...
References: <432ede6e@forums-2-dub> <432eecee$1@forums-2-dub> <432ef6aa$1@forums-2-dub> <432f0a2b$1@forums-2-dub>
In-Reply-To: <432f0a2b$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: ugg10.unitedgrain.ca
Message-ID: <432f0c56$1@forums-2-dub>
X-Original-Trace: 19 Sep 2005 12:07:02 -0700, ugg10.unitedgrain.ca
Lines: 122
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 12:07:03 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 12:07:57 -0700
X-Trace: forums-1-dub 1127156877 10.22.108.75 (19 Sep 2005 12:07:57 -0700)
X-Original-Trace: 19 Sep 2005 12:07:57 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8613
Article PK: 735826

Or you can just trigger events on the window.

//Menu Clicked Event
ParentWindow.TriggerEvent('ue_insert')

//Ue_insert on window
dw_1.InsertRow(0)


Brad

Richard Coleman wrote:
> Depends on how you are implementing it. In a lot of cases, we have a
> special menu list on the window menu
> that we want the user to access rather than having to go up to the menu.
> The code is something like:
>
> m_licensing_main.m_actions.PopMenu ( gnv_app.of_GetFrame().PointerX(),
> gnv_app.of_GetFrame().PointerX() )
>
> So since the Actions menu is already on the window menu, it works fine from
> there. The code just executes the
> actual menu code.
>
> If you are using a menu that you will be creating solely for popup purposes,
> then you need to create some function on the menu to pass in
> the pointer to where you want to execute the code. The following mini-menu
> has an Insert Row and a Delete Row item only. It is
> defined with a top level menu of m_actions, with the two sub items as
> mentioned.:
>
> m_insert_delete lm_menu
> // Let's create the teeny tiny menu
> lm_Menu = CREATE m_insert_delete
>
> // Pass a pointer to the menu so it will know what to call
> lm_Menu.mf_SetDatawindow ( this )
>
> // And display the menu
> lm_menu.m_actions.PopMenu(w_fiscal_barcode_multiple_chk.Pointerx(),
> w_fiscal_barcode_multiple_chk.PointerY())
>
> // Then destroy it
> IF IsValid ( lm_Menu ) THEN
> DESTROY lm_Menu
> END IF
>
> Then, in the custom menu created, for example, I have an 'Insert Row' that
> goes directly to the datawindow. The code
> in the menu for that menu item is:
>
> iu_dw.EVENT DYNAMIC ue_insertrow()
>
> iu_dw is an instance variable on the menu and was populated by the
> mf_SetDataWindow call above.
>
> You can change that to a window from the datawindow if that is more
> appropriate and where you have the code.
>
> Richard
>
> "Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com> wrote in message
> news:432ef6aa$1@forums-2-dub...
>
>>Fine..!
>>
>>Now... how can I know which option from the Menu the user selected? What
>
> do
>
>>I need to place on the 'clicked event on the menu? Something on
>>message.stringparm?
>>
>>Thank you..!
>>
>>"Jason 'Bug' Fenter" <fenter_bug_@_hot_mail_dot_com> wrote in message
>>news:432eecee$1@forums-2-dub...
>>
>>>Alex Castillo wrote:
>>>
>>>>Hi..!
>>>>
>>>>How can I create a contextual menu?
>>>>
>>>>What I would like to do is: I have a treeview object, and I want a
>
> menu
>
>>>>displayed when right click over it... that menu will have New, Edit
>
> and
>
>>>>Delete options (for items on the treeview object)... How can I
>
> implement
>
>>it?
>>
>>>>Thank you..!
>>>>
>>>>
>>>
>>>Take a look at the PopMenu() function. Basically, you'll create your
>>>context menu in the menu painter and use PopMenu() to display it.
>>>
>>>--
>>>"Don't just fix; teach."
>>>
>>>For GUI ideas, visit
>>> http://guiolympics.codexchange.sybase.com
>>> http://fenterbug.homeip.net/gallery
>>>
>>>On using newsgroups in general:
>>> news:news.announce.newusers
>>> http://www.geocities.com/nnqweb/
>>> http://www.catb.org/~esr/faqs/smart-questions.html
>>> http://www.caliburn.nl/topposting.html
>>> http://www.netmeister.org/news/learn2quote.html
>>
>>
>
>


Alex Castillo Posted on 2005-09-19 19:33:01.0Z
From: "Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com>
Newsgroups: sybase.public.powerbuilder.objects
References: <432ede6e@forums-2-dub> <432eecee$1@forums-2-dub> <432ef6aa$1@forums-2-dub> <432f0a2b$1@forums-2-dub> <432f0c56$1@forums-2-dub>
Subject: Re: Context menu...
Lines: 136
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: 12.173.207.194
Message-ID: <432f1234@forums-2-dub>
X-Original-Trace: 19 Sep 2005 12:32:04 -0700, 12.173.207.194
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Sep 2005 12:32:05 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Sep 2005 12:33:01 -0700
X-Trace: forums-1-dub 1127158381 10.22.108.75 (19 Sep 2005 12:33:01 -0700)
X-Original-Trace: 19 Sep 2005 12:33:01 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8614
Article PK: 735829

Great..!

Thank you for the enlightment..!

Alex.

"Brad Wery" <bradweryatagricoreunited.com> wrote in message
news:432f0c56$1@forums-2-dub...
> Or you can just trigger events on the window.
>
> //Menu Clicked Event
> ParentWindow.TriggerEvent('ue_insert')
>
> //Ue_insert on window
> dw_1.InsertRow(0)
>
>
> Brad
>
> Richard Coleman wrote:
> > Depends on how you are implementing it. In a lot of cases, we have a
> > special menu list on the window menu
> > that we want the user to access rather than having to go up to the menu.
> > The code is something like:
> >
> > m_licensing_main.m_actions.PopMenu ( gnv_app.of_GetFrame().PointerX(),
> > gnv_app.of_GetFrame().PointerX() )
> >
> > So since the Actions menu is already on the window menu, it works fine
from
> > there. The code just executes the
> > actual menu code.
> >
> > If you are using a menu that you will be creating solely for popup
purposes,
> > then you need to create some function on the menu to pass in
> > the pointer to where you want to execute the code. The following
mini-menu
> > has an Insert Row and a Delete Row item only. It is
> > defined with a top level menu of m_actions, with the two sub items as
> > mentioned.:
> >
> > m_insert_delete lm_menu
> > // Let's create the teeny tiny menu
> > lm_Menu = CREATE m_insert_delete
> >
> > // Pass a pointer to the menu so it will know what to call
> > lm_Menu.mf_SetDatawindow ( this )
> >
> > // And display the menu
> > lm_menu.m_actions.PopMenu(w_fiscal_barcode_multiple_chk.Pointerx(),
> > w_fiscal_barcode_multiple_chk.PointerY())
> >
> > // Then destroy it
> > IF IsValid ( lm_Menu ) THEN
> > DESTROY lm_Menu
> > END IF
> >
> > Then, in the custom menu created, for example, I have an 'Insert Row'
that
> > goes directly to the datawindow. The code
> > in the menu for that menu item is:
> >
> > iu_dw.EVENT DYNAMIC ue_insertrow()
> >
> > iu_dw is an instance variable on the menu and was populated by the
> > mf_SetDataWindow call above.
> >
> > You can change that to a window from the datawindow if that is more
> > appropriate and where you have the code.
> >
> > Richard
> >
> > "Alex Castillo" <klmAlexCast_SlwMx@HotMail.Com> wrote in message
> > news:432ef6aa$1@forums-2-dub...
> >
> >>Fine..!
> >>
> >>Now... how can I know which option from the Menu the user selected? What
> >
> > do
> >
> >>I need to place on the 'clicked event on the menu? Something on
> >>message.stringparm?
> >>
> >>Thank you..!
> >>
> >>"Jason 'Bug' Fenter" <fenter_bug_@_hot_mail_dot_com> wrote in message
> >>news:432eecee$1@forums-2-dub...
> >>
> >>>Alex Castillo wrote:
> >>>
> >>>>Hi..!
> >>>>
> >>>>How can I create a contextual menu?
> >>>>
> >>>>What I would like to do is: I have a treeview object, and I want a
> >
> > menu
> >
> >>>>displayed when right click over it... that menu will have New, Edit
> >
> > and
> >
> >>>>Delete options (for items on the treeview object)... How can I
> >
> > implement
> >
> >>it?
> >>
> >>>>Thank you..!
> >>>>
> >>>>
> >>>
> >>>Take a look at the PopMenu() function. Basically, you'll create your
> >>>context menu in the menu painter and use PopMenu() to display it.
> >>>
> >>>--
> >>>"Don't just fix; teach."
> >>>
> >>>For GUI ideas, visit
> >>> http://guiolympics.codexchange.sybase.com
> >>> http://fenterbug.homeip.net/gallery
> >>>
> >>>On using newsgroups in general:
> >>> news:news.announce.newusers
> >>> http://www.geocities.com/nnqweb/
> >>> http://www.catb.org/~esr/faqs/smart-questions.html
> >>> http://www.caliburn.nl/topposting.html
> >>> http://www.netmeister.org/news/learn2quote.html
> >>
> >>
> >
> >