UnHilite/Hilite Popup Menu Option

UnHilite/Hilite Popup Menu Option

Postby Colin Haig » Tue Jul 02, 2013 5:04 am

Hi All

I have a popup menu activated by a button how can you hilite/unhilite a menu option - there is
sample code for a normal menu bit not a popup


I have tried oWnd:oMenuAddClient:UnHilite(3)
Code: Select all  Expand view



MENU oMenuAddClient POPUP
  MENUITEM "Add New Customer" ;
      ACTION(oCode:blank(),cOldCode := space(len(oCode:code)),oCode:append(),oLbx:SelectCol(1),oLbx:Refresh(),oLbx:SetFocus())

  MENUITEM "Add New Contact" ;
      ACTION(eval(bConAdd));

  MENUITEM "Add New Site" ;
      ACTION(eval(bDelAdd))
     
ENDMENU

DEFINE BUTTON oBtn2 of oBar RESOURCE "PLUS" ;
       PROMPT 'Add' ;
       MENU oMenuAddClient ;
       TOOLTIP('Add Record')

 


Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: UnHilite/Hilite Popup Menu Option

Postby Antonio Linares » Tue Jul 02, 2013 6:44 am

Colin,

oWnd:oMenu:Hilite( nItem ) // i.e. nItem --> 2

oWnd:oMenu:UnHilite( nItem )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: UnHilite/Hilite Popup Menu Option

Postby Colin Haig » Tue Jul 02, 2013 7:11 am

Hi Antonio

I tried that code - but it is a popup menu.

This is the error

Error description: Warning BASE/1004 Message not found: TMDICHILD:MENUADDCLIENT

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: UnHilite/Hilite Popup Menu Option

Postby Antonio Linares » Tue Jul 02, 2013 11:11 am

Colin,

Have you tried with oWnd:oPopup:Hilite( ... ) ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: UnHilite/Hilite Popup Menu Option

Postby Colin Haig » Tue Jul 02, 2013 12:10 pm

Hi Antonio

I had tried oWnd:oMenuAddClient:UnHilite(3) before I posted the first message.

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: UnHilite/Hilite Popup Menu Option

Postby Antonio Linares » Tue Jul 02, 2013 12:39 pm

Colin,

So the problem is that it looks focused and you don't want it focused ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: UnHilite/Hilite Popup Menu Option

Postby Colin Haig » Tue Jul 02, 2013 3:00 pm

Hi Antonio

I was trying to hilite/unhilite an option depending on a on change event with xbrowse - if not possible I can
use a another button on the buttonbar to do what I want.

Cheers

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: UnHilite/Hilite Popup Menu Option

Postby Antonio Linares » Tue Jul 02, 2013 6:20 pm

Colin,

The Class TMenu Method Hilite()/Unhilite() is basically a wrapper to this Windows API function:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647986(v=vs.85).aspx

so I guess that if all parameters are properly supplied, maybe the problem is that Windows is not able to do it under those circunstances.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42093
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha, nageswaragunupudi and 105 guests