Multiple Radio button behavoir

Multiple Radio button behavoir

Postby Rick Lipkin » Wed Oct 03, 2012 10:26 pm

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

When you select any radio button from either group the other radio group loses its value
Image

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
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Multiple Radio button behavoir

Postby Armando » Thu Oct 04, 2012 2:07 am

Rick:

Try to set YES for TABSTOP property on the first radio of each group (113 and 128 ids)

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3103
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Multiple Radio button behavoir

Postby joseluisysturiz » Thu Oct 04, 2012 4:17 am

Saludos, verifica que hayas devidido los radio en 2 grupos difererntes, desmarcalos todos y agrupas los primeros 10 que usas, salvas tu recurso y luego agrupas los radios restantes, bueno, asi lo hago con pelles c y me funcionan bien, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Multiple Radio button behavoir

Postby ukoenig » Thu Oct 04, 2012 9:01 am

Rick,

inside Your Resource, change the Radiobutton-style
from < Auto Radio button > to < Radio button >

Image

Image

or activate < Group >

Image

Best Regards
Uwe :lol:
Last edited by ukoenig on Thu Oct 04, 2012 10:35 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Multiple Radio button behavoir

Postby Enrico Maria Giordano » Thu Oct 04, 2012 9:19 am

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 | WS_GROUP, 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 | WS_GROUP, 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
}


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Multiple Radio button behavoir

Postby Rick Lipkin » Thu Oct 04, 2012 12:53 pm

To All my friends

I have never used multiple groups of radio buttons and selecting the 'group' attribute on the first element of each group was the secret.

Thank you very much !
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 118 guests