PlanetSquires Forums

Support Forums => General Board => Topic started by: Sean Scott on September 10, 2010, 09:55:59 PM

Title: Turning the checkmark in a menu off
Post by: Sean Scott on September 10, 2010, 09:55:59 PM
I have a menu item with Checked turned on. I want to have the menu item be a toggle, which reverses the checkmark visibility each time the menu item is selected.

I found the FF_Menu_SetState function, but I can't figure out what idItem is. Is this the correct function to call to toggle a menu checkmark? If so, what do I pass in for the idItem parameter?
Title: Re: Turning the checkmark in a menu off
Post by: Paul Squires on September 10, 2010, 10:13:39 PM
Hi Sean,

The idItem is the "IDC_" control identifier for the menu item. You can get these values from the F4 popup dialog (Handles and Control IDs).


   Local nState As Long
   
   nState = FF_Menu_GetState( HWND_FORM1_TOPMENU, IDC_FORM1_MNUPRINT )

   nState = IIF&( nState = %MFS_CHECKED, %MFS_UNCHECKED, %MFS_CHECKED )   
       
   FF_Menu_SetState hWndForm, HWND_FORM1_TOPMENU, IDC_FORM1_MNUPRINT, nState


Title: Re: Turning the checkmark in a menu off
Post by: Sean Scott on September 10, 2010, 10:39:50 PM
I get error 443: TO EXPECTED

Here is the code I ran:
   Local nState As Long
   nState = FF_Menu_GetState( HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUTOGGLECALC )
   nState = IIF&( nState = %MFS_CHECKED, %MFS_UNCHECKED, %MFS_CHECKED )
   FF_Menu_SetState gHwndForm, HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUTOGGLECALC, nState

The FF_Menu_SetState is causing the error.

What am I doing wrong?
Title: Re: Turning the checkmark in a menu off
Post by: Sean Scott on September 10, 2010, 11:01:17 PM
I figured it out, I didn't need to pass the HwndForm