Rad menu lost initial setting

Rad menu lost initial setting

Postby AntoninoP » Fri Oct 13, 2017 10:19 am

Hi,
In my program I see that a radio menu does not keep the initial value.
I did some try to solve it, without success...

here the code to reproduce the issue, prg:
Code: Select all  Expand view  RUN
#include <fivewin.ch>

proc main()
    LOCAL nTipGrp := 3, oDlg, oRadMenu, oFolder
   
    DEFINE DIALOG oDlg NAME "MAINDLG"
    REDEFINE FOLDER oFolder ID 4001  OF oDlg PROMPTS "Folder 1" DIALOGS "PAGE1"

    REDEFINE RADIO oRadMenu VAR nTipGrp ID 4001,4002,4003,4004,4005,4006,4045,4054,4055 OF oFolder:aDialogs[1]
    ACTIVATE DIALOG oDlg
    ? nTipGrp
return

and rc:
Code: Select all  Expand view  RUN
#include <windows.h>

MAINDLG DIALOGEX DISCARDABLE 6, 18, 614, 314
STYLE WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Test Rad Menu"
FONT 8, "Segoe UI", 0, 0, 1
BEGIN
  CONTROL "", 4001, "SysTabControl32", WS_TABSTOP, 4, 4, 608, 284
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 4, 292, 45, 15
  CONTROL "CANCEL", IDCANCEL, "Button", WS_TABSTOP, 108, 292, 45, 15
END

PAGE1 DIALOGEX 6, 18, 614, 278
STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE
FONT 8, "Segoe UI", 0, 0, 0x1
BEGIN
    CONTROL         "Opt 1",4001,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,8,64,8
    CONTROL         "Opt 2",4002,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,20,64,8
    CONTROL         "Opt 3",4003,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,32,64,8
    CONTROL         "Opt 4",4004,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,44,64,8
    CONTROL         "Opt 5",4005,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,80,8,68,8
    CONTROL         "Opt 6",4006,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,80,20,68,8
    CONTROL         "Opt 7",4045,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,80,32,68,8
    CONTROL         "Opt 8",4054,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,80,44,68,8
    CONTROL         "Opt 9",4055,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,148,8,76,8
END
 


The problem is the local nTipGrp that is initialized to 3 and become 1 before the dialog appears.

help :(
Antonino
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby AntoninoP » Tue Oct 17, 2017 9:04 am

has no one this issue too? a Rad Menu inside a folder...
:shock:
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby Silvio.Falconi » Tue Oct 17, 2017 9:28 am

on source code it run ok

Image

Code: Select all  Expand view  RUN
Function Test()
   LOCAL nTipGrp := 3, oDlg, oRadMenu, oFolder
   DEFINE DIALOG oDlg size 400,400

     @ 0,0 FOLDER  oFolder  OF oDlg PROMPTS "Folder 1"  SIZE 400,200

     @ 1,0 RADIO oRadMenu VAR nTipGrp prompt "option1","option2","option3","option4","option5","option6" OF oFolder:aDialogs[1]

   ACTIVATE DIALOG oDlg
   return nil
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Rad menu lost initial setting

Postby AntoninoP » Tue Oct 17, 2017 10:47 am

looks like the problem is with resources...
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby Antonio Linares » Tue Oct 17, 2017 1:38 pm

Antonino,

Please review FWH\samples\testrad.prg and testrad.rc
regards, saludos

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

Re: Rad menu lost initial setting

Postby AntoninoP » Tue Oct 17, 2017 3:33 pm

testrad is without folder.
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby Antonio Linares » Tue Oct 17, 2017 3:50 pm

Antonino,

Code: Select all  Expand view  RUN
   ACTIVATE DIALOG oDlg ;
       ON INIT ( oRadMenu:aItems[ nTipGrp ]:SetFocus(), .F. )
 
regards, saludos

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

Re: Rad menu lost initial setting

Postby AntoninoP » Tue Oct 17, 2017 3:59 pm

does not work
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby AntoninoP » Tue Oct 17, 2017 4:05 pm

does not work, Only this one works:

Code: Select all  Expand view  RUN

    ACTIVATE DIALOG oDlg ;
        ON INIT ( oRadMenu:aItems[ 3 ]:SetFocus(), .F. )
 


So, I change the code in this way:
Code: Select all  Expand view  RUN
#include <fivewin.ch>

proc main()
    LOCAL nTipGrp := 3, oDlg, oRadMenu, oFolder
    LOCAL nInitial := nTipGrp
   
    DEFINE DIALOG oDlg NAME "MAINDLG"
    REDEFINE FOLDER oFolder ID 4001  OF oDlg PROMPTS "Folder 1" DIALOGS "PAGE1"

    REDEFINE RADIO oRadMenu VAR nTipGrp ID 4001,4002,4003,4004,4005,4006,4045,4054,4055 OF oFolder:aDialogs[1]
    ACTIVATE DIALOG oDlg ;
        ON INIT ( oRadMenu:aItems[ nInitial ]:SetFocus(), .F. )
    ? nTipGrp
return

but it should not be necessary... :(
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Rad menu lost initial setting

Postby Antonio Linares » Tue Oct 17, 2017 4:34 pm

Antonino,

At least you have a workaround to solve it

We are going to review it, in the meantime you have it working
regards, saludos

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

Re: Rad menu lost initial setting

Postby Silvio.Falconi » Wed Oct 18, 2017 8:59 am

I am convinced that the error is in the resource but I not Know where
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 57 guests