MenuItem with Checked clause

MenuItem with Checked clause

Postby pawelu » Wed Feb 21, 2007 7:37 pm

Antonio,

Is this possible work with menu this type.

Thanks
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby pawelu » Thu Mar 01, 2007 7:55 pm

Antonio,

Checked menu type is possible or not ?

Thanks
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Thu Mar 01, 2007 9:00 pm

Pawel,

Yes, it is possible:
Image
Though a new function and method is required:
Code: Select all  Expand view  RUN
HB_FUNC( ENABLEMENUITEM )
{
   hb_retl( EnableMenuItem( ( HMENU ) hb_parnl( 1 ), hb_parnl( 2 ), hb_parnl( 3 ) ) );
}      

#define MF_BYCOMMAND  0
#define MF_UNCHECKED  0
#define MF_CHECKED    8

DATA lChecked

   METHOD SetCheck( lOnOff ) INLINE ;
          ::lChecked := lOnOff, CheckMenuItem( ::oMenu:hMenu,;
          ::nId, nOR( MF_BYCOMMAND, If( lOnOff, MF_CHECKED, MF_UNCHECKED ) ) )

   REDEFINE MENUITEM oItem ID 110 OF oMenu ACTION ( MsgInfo( "Clientes" ), oItem:SetCheck( .t. ) )
regards, saludos

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


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 34 guests

cron