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
- #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
- #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