Multiple Radio button behavoir
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
To All
I have created a small sample of some strange Radio button behavior. I have two groups of radio buttons that should work independently, but for some reason when you change a selection in one group, it erases the value of the second group.
I am using FWH 1203 and xHarbour..
Start showing values of both radio groups
![Image](http://imageshack.us/a/img824/5190/rnew.jpg)
When you select any radio button from either group the other radio group loses its value
![Image](http://imageshack.us/a/img811/4499/rchg.jpg)
Here is my code:
Here is the .rc
Any help would be appreciated.
Rick Lipkin
I have created a small sample of some strange Radio button behavior. I have two groups of radio buttons that should work independently, but for some reason when you change a selection in one group, it erases the value of the second group.
I am using FWH 1203 and xHarbour..
Start showing values of both radio groups
![Image](http://imageshack.us/a/img824/5190/rnew.jpg)
When you select any radio button from either group the other radio group loses its value
![Image](http://imageshack.us/a/img811/4499/rchg.jpg)
Here is my code:
- Code: Select all Expand view
// main.prg
#Include "FiveWin.ch"
//---------------------
FUNC _ChgStat()
Local oBtn1,oBtn2,oBtn3
Local oSay1,oSay2,oSay3,oSay4
Local oGrp1,oGrp2,oGrp3
Local nStatus,oStatus,nRequest,oRequest,oFontB
Local oDlg
Local nRepairNumber,oRepairNumber,oStat,cStat,cReq,oReq,cRepairNumber
Local lOk,cMode
lOK := .F.
cMode := "E"
cRepairNumber := "123456"
nRepairNumber := 123456
cStat := "Awaiting Parts"
cReq := "Repair"
oFontB := TFont():New("Ms Sans Serif",,-6,.F.,.T. ,,,,.F. )
nStatus := 1
nRequest := 1
DEFINE DIALOG oDlg RESOURCE "CHGSTAT" ;
Title "Change Repair Status"
REDEFINE SAY oSay1 ID 114 OF oDlg UPDATE
oSay1:SetFont( oFontB )
REDEFINE SAY oSay2 ID 115 OF oDlg UPDATE
oSay2:SetFont( oFontB )
REDEFINE SAY oSay3 ID 117 OF oDlg UPDATE
oSay3:SetFont( oFontB )
REDEFINE GROUP oGrp1 ID 200 OF oDlg
oGrp1:SetFont( oFontB )
oGrp1:nClrText := nRgb( 7,7,224 ) // blue
REDEFINE GROUP oGrp2 ID 201 OF oDlg
oGrp2:SetFont( oFontB )
oGrp2:nClrText := nRgb( 7,7,224 ) // blue
REDEFINE GROUP oGrp3 ID 202 OF oDlg
oGrp3:SetFont( oFontB )
oGrp3:nClrText := nRgb( 7,7,224 ) // blue
REDEFINE SAY oSay4 ID 131 OF oDlg UPDATE
oSay4:SetFont( oFontB )
oSay4:SetColor( 255,0 )
REDEFINE GET oRepairNumber var cRepairNumber ID 133 of oDlg COLOR CLR_BLACK,14869218 UPDATE
REDEFINE GET oStat var cStat ID 116 of oDlg COLOR CLR_BLACK,14869218 UPDATE
REDEFINE GET oReq var cReq ID 118 of oDlg COLOR CLR_BLACK,14869218 UPDATE
REDEFINE RADIO oStatus VAR nStatus ID 113,122,123,126,120,127,121,125,119,124 ;
OF oDlg COLOR 0 UPDATE
AEval( oStatus:aItems, { | oRad | oRad:lTransparent := .T., ;
oRad:SetFont( oFontB )} )
REDEFINE RADIO oRequest VAR nRequest ID 128,129,130 ;
OF oDlg COLOR 0 UPDATE
AEval( oRequest:aItems, { | oRad | oRad:lTransparent := .T., ;
oRad:SetFont( oFontB )} )
REDEFINE BTNBMP oBtn1 ID 111 OF oDlg ;
PROMPT "Change Status and Request" CENTER 2007;
ACTION ( oDLG:END() )
REDEFINE BTNBMP oBtn2 ID 112 OF oDlg ;
PROMPT "Cancel Repair" CENTER 2007;
ACTION ( oDLG:END() )
REDEFINE BTNBMP oBtn3 ID 132 OF oDlg ;
PROMPT "&Close" CENTER 2007;
ACTION ( oDLG:END() )
ACTIVATE DIALOG oDlg ;
RELEASE oFontB
RETURN(.t.)
Here is the .rc
- Code: Select all Expand view
CHGSTAT DIALOG 372, 29, 221, 319
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
FONT 8, "Microsoft Sans Serif"
{
LTEXT "The Currently selected Repair is", 114, 8, 4, 73, 25, SS_NOPREFIX | WS_GROUP
EDITTEXT 133, 115, 5, 98, 13, ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
LTEXT "Current Status", 115, 8, 33, 96, 13, SS_NOPREFIX | WS_GROUP
EDITTEXT 116, 115, 33, 98, 13, ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
LTEXT "Current Request Type", 117, 8, 48, 96, 13, SS_NOPREFIX | WS_GROUP
EDITTEXT 118, 115, 48, 98, 13, ES_AUTOHSCROLL | NOT WS_TABSTOP | WS_BORDER
GROUPBOX "New Repair Status", 200, 8, 68, 205, 79, BS_GROUPBOX
CONTROL " New", 113, "BUTTON", BS_AUTORADIOBUTTON, 13, 84, 49, 12
CONTROL " Incomplete", 122, "BUTTON", BS_AUTORADIOBUTTON, 85, 84, 61, 12
CONTROL " Hold", 123, "BUTTON", BS_AUTORADIOBUTTON, 157, 84, 45, 12
CONTROL " Ready", 126, "BUTTON", BS_AUTORADIOBUTTON, 13, 96, 46, 12
CONTROL " Expedite", 120, "BUTTON", BS_AUTORADIOBUTTON, 85, 96, 64, 12
CONTROL " Complete", 127, "BUTTON", BS_AUTORADIOBUTTON, 157, 96, 51, 12
CONTROL " Needs Approval", 121, "BUTTON", BS_AUTORADIOBUTTON, 13, 113, 82, 12
CONTROL " Price and Availability", 125, "BUTTON", BS_AUTORADIOBUTTON, 107, 113, 96, 12
CONTROL " Awaiting Parts", 119, "BUTTON", BS_AUTORADIOBUTTON, 13, 127, 83, 12
CONTROL " Parts Received", 124, "BUTTON", BS_AUTORADIOBUTTON, 107, 127, 96, 11
GROUPBOX "New Request Type", 201, 8, 153, 205, 28, BS_GROUPBOX
CONTROL " Repair", 128, "BUTTON", BS_AUTORADIOBUTTON, 13, 164, 61, 12
CONTROL " Service Call", 129, "BUTTON", BS_AUTORADIOBUTTON, 85, 164, 61, 12
CONTROL " Estimate", 130, "BUTTON", BS_AUTORADIOBUTTON, 159, 164, 49, 12
CONTROL "Change Status and Request", 111, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 35, 182, 151, 25
GROUPBOX "CANCEL SERVICE", 202, 8, 210, 205, 66, BS_GROUPBOX
LTEXT "Remove the Repair \\ Estimate \\ Service Call from the system completely", 131, 22, 222, 179, 20, SS_NOPREFIX | WS_GROUP
CONTROL "Cancel Repair", 112, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 38, 247, 151, 25
CONTROL "Close", 132, "TBtnBmp", 32 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 175, 286, 37, 25
}
Any help would be appreciated.
Rick Lipkin