Menu popup checked Solved!!!

Menu popup checked Solved!!!

Postby Silvio.Falconi » Mon Apr 17, 2017 4:05 pm

Please a sample of a Popup menu with checked items . thanks
Last edited by Silvio.Falconi on Tue Apr 18, 2017 3:58 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Menu popup checked

Postby cnavarro » Mon Apr 17, 2017 5:52 pm

Code: Select all  Expand view


 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Menu popup checked

Postby Silvio.Falconi » Tue Apr 18, 2017 1:00 pm

Crisobal I have six options on that menupopup and the it make error .. lchecked value

Code: Select all  Expand view
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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Menu popup checked

Postby Silvio.Falconi » Tue Apr 18, 2017 2:16 pm

I made a sample but not run ok I wish only one is true

Code: Select all  Expand view

#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Menu popup checked

Postby cnavarro » Tue Apr 18, 2017 2:50 pm

Silvio, this sample run OK for me

Please look line of RETURN oMenu in your sample

Code: Select all  Expand view


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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Menu popup checked

Postby Silvio.Falconi » Tue Apr 18, 2017 3:18 pm

Image

I wish only one menuitem checked each times
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Menu popup checked

Postby cnavarro » Tue Apr 18, 2017 3:36 pm

Try this

Code: Select all  Expand view


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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Menu popup checked

Postby Silvio.Falconi » Tue Apr 18, 2017 3:43 pm

ok Now run ok thanks!!!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests