FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Menu popup checked Solved!!!
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Menu popup checked Solved!!!
Posted: Mon Apr 17, 2017 04:05 PM

Please a sample of a Popup menu with checked items . thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Menu popup checked
Posted: Mon Apr 17, 2017 05:52 PM
Code (fw): Select all Collapse
 MENUITEM oMenuItem[1] PROMPT  "5 minutes - massimo spazio per i dettagli" CHECKED  ACTION (oApp():oCalex:oDayView:SetInterval( 5 )  ,oApp():oCalex:oDayView:refresh(), oMenuItem[1]:SetCheck( !oMenuItem[ 1 ]:lChecked ) )

.../...
 ACTIVATE POPUP oMenu OF oView:oCalex AT nRow, nCol

oMenuItem[ 1 ]:SetCheck( .F. )
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 01:00 PM
Crisobal I have six options on that menupopup and the it make error .. lchecked value

Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\Prg\Agenda - giusto_15_04_2017\main.Exe (32 bits)
   Size: 3,804,160 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603)
   FiveWin  version: FWHX 17.02
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 5 secs 
   Error occurred at: 18-04-2017, 15:09:11
   Error description: Error BASE/1004  Class: 'CHARACTER' has no exported method: LCHECKED
   Args:
     [   1] = C   10 minutes

Stack Calls
===========
   Called from:  => LCHECKED( 0 )
   Called from: Source\PAgenda.prg => (b)BUILDPOP( 658 )
   Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1270 )
   Called from: Source\PAgenda.prg => BUILDPOP( 677 )
   Called from: Source\PAgenda.prg => (b)BUILDCALEX( 273 )
   Called from: Lib\calex\prg\tcalex.prg => TCALEX:RBUTTONUP( 1267 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCALEX:HANDLEEVENT( 1731 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1036 )
   Called from: Source\main.prg => TAPPLICATION
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 02:16 PM
I made a sample but not run ok I wish only one is true

Code (fw): Select all Collapse
 
#include "FiveWin.ch"
static oWnd

//----------------------------------------------------------------------------//

Function test()

 DEFINE WINDOW oWnd FROM 1, 5 TO 20, 70 TITLE "Testing Menus" ;
      MENU BuildMenu()

 SET MESSAGE OF oWnd TO FWVERSION + " - Menu Management Power"

   ACTIVATE WINDOW oWnd
return nil 

//----------------------------------------------------------------------------//

Function BuildMenu()
Local oMenu
Local ofirst,oSecond,oThird
Local ofirst1,oSecond1,oThird1
 MENU oMenu
      MENUITEM "&Test"
        MENU
           MENUITEM oFirst PROMPT "First"     checked    action oFirst:SetCheck( ! oFirst:lChecked )
           MENUITEM oSecond PROMPT "Second"   checked    action oSecond:SetCheck( ! oSecond:lChecked )
           MENUITEM oThird PROMPT "Third"     checked    action oThird:SetCheck( ! oThird:lChecked )
           MENUITEM oFirst1 PROMPT "First1"   checked    action oFirst1:SetCheck( ! oFirst1:lChecked )
           MENUITEM oSecond1 PROMPT "Second1" checked    action oSecond1:SetCheck( ! oSecond1:lChecked )
           MENUITEM oThird1 PROMPT "Third1"   checked    action oThird1:SetCheck( ! oThird1:lChecked )

         ENDMENU
  ENDMENU

oFirst:SetCheck(.f.)
oSecond:SetCheck(.f.)
oThird:SetCheck(.f.)
oFirst1:SetCheck(.f.)
oSecond1:SetCheck(.f.)
oThird1:SetCheck(.f.)



return oMen
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 02:50 PM
Silvio, this sample run OK for me

Please look line of RETURN oMenu in your sample

Code (fw): Select all Collapse
Function BuildMenuSil()

   Local oMenu
   Local ofirst, oSecond, oThird
   Local ofirst1, oSecond1, oThird1
   MENU oMenu
      MENUITEM "&Test"
        MENU
           MENUITEM oFirst PROMPT "First"     CHECKED    ACTION oFirst:SetCheck( ! oFirst:lChecked )
           MENUITEM oSecond PROMPT "Second"   CHECKED    ACTION oSecond:SetCheck( ! oSecond:lChecked )
           MENUITEM oThird PROMPT "Third"     CHECKED    ACTION oThird:SetCheck( ! oThird:lChecked )
           MENUITEM oFirst1 PROMPT "First1"   CHECKED    ACTION oFirst1:SetCheck( ! oFirst1:lChecked )
           MENUITEM oSecond1 PROMPT "Second1" CHECKED    ACTION oSecond1:SetCheck( ! oSecond1:lChecked )
           MENUITEM oThird1 PROMPT "Third1"   CHECKED    ACTION oThird1:SetCheck( ! oThird1:lChecked )

         ENDMENU
   ENDMENU

   oFirst:SetCheck(.f.)
   oSecond:SetCheck(.f.)
   oThird:SetCheck(.f.)
   oFirst1:SetCheck(.f.)
   oSecond1:SetCheck(.f.)
   oThird1:SetCheck(.f.)

return oMenu
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 03:18 PM


I wish only one menuitem checked each times
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 03:36 PM
Try this

Code (fw): Select all Collapse
Function BuildMenuSil()

   Local oMenu
   local oItems   := Array( 6 )
   
   MENU oMenu
      MENUITEM "&Test"
        MENU
           MENUITEM oItems[ 1 ] PROMPT "First"   CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 1 ]:SetCheck( ! oItems[ 1 ]:lChecked ) )
           MENUITEM oItems[ 2 ] PROMPT "Second"  CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 2 ]:SetCheck( ! oItems[ 2 ]:lChecked ) )
           MENUITEM oItems[ 3 ] PROMPT "Third"   CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 3 ]:SetCheck( ! oItems[ 3 ]:lChecked ) )
           MENUITEM oItems[ 4 ] PROMPT "First1"  CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 4 ]:SetCheck( ! oItems[ 4 ]:lChecked ) )
           MENUITEM oItems[ 5 ] PROMPT "Second1" CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 5 ]:SetCheck( ! oItems[ 5 ]:lChecked ) )
           MENUITEM oItems[ 6 ] PROMPT "Third1"  CHECKED  ACTION ( ChangeCheck( oItems ), oItems[ 6 ]:SetCheck( ! oItems[ 6 ]:lChecked ) )

         ENDMENU
   ENDMENU
   ChangeCheck( oItems )

return oMenu

Function ChangeCheck( oItems )
   AEval( oItems, { | o | o:SetCheck( .F. ) } )
Return nil

//----------------------------------------------------------------------------//
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Menu popup checked
Posted: Tue Apr 18, 2017 03:43 PM
ok Now run ok thanks!!!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion