Page 1 of 1

UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 5:04 am
by Colin Haig
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



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

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 6:44 am
by Antonio Linares
Colin,

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

oWnd:oMenu:UnHilite( nItem )

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 7:11 am
by Colin Haig
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

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 11:11 am
by Antonio Linares
Colin,

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

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 12:10 pm
by Colin Haig
Hi Antonio

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

Cheers

Colin

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 12:39 pm
by Antonio Linares
Colin,

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

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 3:00 pm
by Colin Haig
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

Re: UnHilite/Hilite Popup Menu Option

Posted: Tue Jul 02, 2013 6:20 pm
by Antonio Linares
Colin,

The Class TMenu Method Hilite()/Unhilite() is basically a wrapper to this Windows API function:
http://msdn.microsoft.com/en-us/library ... s.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.