Radio Button problem
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Radio Button problem
Hi,
I'm having a weird problem with radio buttons in my development machine. When I clicked the radio button, the other radio buttons will be de-selected and the program will hang.
Initial screen
After selection
If I put the program in another PC, and run the program from my PC (So I'm running the program using a mapped network drive), I don't see the issue. Everything works just fine.
So it seems like locally (in my dev machine) the radio button will have problems. I have a feeling, that it is unable to re-draw.
Anyone have encountered this issue in their dev machine?
My development environment is Windows 7 32 bit, 2 GB RAM, Express++2.6, xBase 1.9.331
Best Regards,
Andy
I'm having a weird problem with radio buttons in my development machine. When I clicked the radio button, the other radio buttons will be de-selected and the program will hang.
Initial screen
After selection
If I put the program in another PC, and run the program from my PC (So I'm running the program using a mapped network drive), I don't see the issue. Everything works just fine.
So it seems like locally (in my dev machine) the radio button will have problems. I have a feeling, that it is unable to re-draw.
Anyone have encountered this issue in their dev machine?
My development environment is Windows 7 32 bit, 2 GB RAM, Express++2.6, xBase 1.9.331
Best Regards,
Andy
Re: Radio Button problem
Looks like you missed to put a group around every radio button pair. Place an empty DCSAY behind them and select this as the parent for the radiobuttons. Radio buttons need a group parent to act correct. Show your code.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
- sdenjupol148
- Posts: 151
- Joined: Thu Jan 28, 2010 10:27 am
- Location: NYC
Re: Radio Button problem
Hey Andy,
I usually place each radio button set on its own static, so in your case, I would have stacked 10 statics on top of each other.
Tom is right, each set needs its own parent.
Bobby
I usually place each radio button set on its own static, so in your case, I would have stacked 10 statics on top of each other.
Tom is right, each set needs its own parent.
Bobby
Re: Radio Button problem
I have been meaning to provide the means to group radiobuttons by a GROUP name rather than parent.
The eXpress train is coming - and it has more cars.
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: Radio Button problem
Tom wrote:Looks like you missed to put a group around every radio button pair. Place an empty DCSAY behind them and select this as the parent for the radiobuttons. Radio buttons need a group parent to act correct. Show your code.
Yes, my radio button sets doesn't have any parent object.SbDrakos wrote:Hey Andy,
I usually place each radio button set on its own static, so in your case, I would have stacked 10 statics on top of each other.
Tom is right, each set needs its own parent.
Bobby
My Code
Code: Select all
@RC1,99 DCRADIO lYESNO PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| o:=DBC_FILE(XF),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR TABGROUP XBP_BEGIN_GROUP
@RC1,109 DCRADIO lYESNO PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| o:=FERASE(XF),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR TABGROUP XBP_END_GROUP
Code: Select all
cObject = 'o' + var2char(RC1)
@RC1,99 DCSAY '' OBJECT &cObject SAYSIZE 10,1 && TO BE THE PARENT
@RC1,99 DCRADIO lYESNO PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| o:=DBC_FILE(XF),DC_GETREFRESH(GETLIST)};
PARENT &cObject COLOR M_RADIO_CLR TABGROUP XBP_BEGIN_GROUP
@RC1,109 DCRADIO lYESNO PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| o:=FERASE(XF),DC_GETREFRESH(GETLIST)};
PARENT &cObject COLOR M_RADIO_CLR TABGROUP XBP_END_GROUP

Andy
- sdenjupol148
- Posts: 151
- Joined: Thu Jan 28, 2010 10:27 am
- Location: NYC
Re: Radio Button problem
Hey Andy,
This is a matter of how objects layer on top of each other.
I took your code and modified it somewhat to show you how things get positioned.
I colored your DCSAY PARENT object in yellow so you can see where the radio buttons wind up in relation to it.
The parent should be slightly larger vertically and horizontally than the objects you're going to place on it.
I made it extra large for demonstration purposes.
Notice that you will need a row position smaller than 1 to get it near the top of your parent object
Anyway, play around with different values till you get the effect you want.
*----------------------------------
#INCLUDE "DCDIALOG.CH"
proc main
LOCAL GetList[0]
LOCAL cObject, lYesNo := .F., RC1
RC1 := 1
cObject = 'o' + var2char(RC1)
@RC1,1 DCSAY '' OBJECT cObject SAYSIZE 20,2 COLOR GRA_CLR_BLACK, GRA_CLR_YELLOW// TO BE THE PARENT
@RC1,1 DCRADIO lYESNO PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| /*o:=DBC_FILE(XF),*/DC_GETREFRESH(GETLIST)};
PARENT cObject TABGROUP XBP_BEGIN_GROUP
@RC1-1,10 DCRADIO lYESNO PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| /*o:=FERASE(XF),*/DC_GETREFRESH(GETLIST)};
PARENT cObject TABGROUP XBP_END_GROUP
DCREAD GUI ADDBUTTONS FIT ENTEREXIT MODAL SETAPPWINDOW EVAL {|| (WTF cObject)}
return
*--------------------------------------
procedure appsys; return
This is a matter of how objects layer on top of each other.
I took your code and modified it somewhat to show you how things get positioned.
I colored your DCSAY PARENT object in yellow so you can see where the radio buttons wind up in relation to it.
The parent should be slightly larger vertically and horizontally than the objects you're going to place on it.
I made it extra large for demonstration purposes.
Notice that you will need a row position smaller than 1 to get it near the top of your parent object
Anyway, play around with different values till you get the effect you want.
*----------------------------------
#INCLUDE "DCDIALOG.CH"
proc main
LOCAL GetList[0]
LOCAL cObject, lYesNo := .F., RC1
RC1 := 1
cObject = 'o' + var2char(RC1)
@RC1,1 DCSAY '' OBJECT cObject SAYSIZE 20,2 COLOR GRA_CLR_BLACK, GRA_CLR_YELLOW// TO BE THE PARENT
@RC1,1 DCRADIO lYESNO PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| /*o:=DBC_FILE(XF),*/DC_GETREFRESH(GETLIST)};
PARENT cObject TABGROUP XBP_BEGIN_GROUP
@RC1-1,10 DCRADIO lYESNO PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|o| /*o:=FERASE(XF),*/DC_GETREFRESH(GETLIST)};
PARENT cObject TABGROUP XBP_END_GROUP
DCREAD GUI ADDBUTTONS FIT ENTEREXIT MODAL SETAPPWINDOW EVAL {|| (WTF cObject)}
return
*--------------------------------------
procedure appsys; return
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: Radio Button problem
I've tried your code and it's not working at my endSbDrakos wrote:Hey Andy,
This is a matter of how objects layer on top of each other.
I took your code and modified it somewhat to show you how things get positioned.
Does a different approach is needed, if I'm trying to do the radio buttons in tabs? I didn't mention that at first because I didn't thought it was relevant.
My code:
Code: Select all
@0,0 DCTABPAGE oTabPage1 CAPTION 'General' SIZE 125,25 TABWIDTH 12 TOOLTIP 'Genaral feature' COLOR COL_HK1,COL_HK2 PARENT ABC
DCSETPARENT to oTabPage1
@0.0,0 DCTABPAGE oTabPage1A CAPTION 'General Page 1' SIZE 125,25 TABWIDTH 15 RELATIVE oTABPAGE1
@0,0 DCTABPAGE oTabPage1B CAPTION 'General Page 2' RELATIVE oTABPAGE1A
@0,0 DCTABPAGE oTabPage1C CAPTION 'General Page 3' RELATIVE oTABPAGE1B
@0,0 DCTABPAGE oTabPage1D CAPTION 'General Page 4' RELATIVE oTABPAGE1C
DCSETPARENT to oTabPage1A
RC1++
lSHORTCUT1:=.T.
@RC1+.2,5 DCSAY {|| xTEXT('To activate Shortcut Toolbar for Internet Access')} FONT cSAYFONT SAYSIZE 0 PARENT oTabPage1A
@RC1,99 DCSAY '' OBJECT andy SAYSIZE 20,2 PARENT oTabPage1A COLOR GRA_CLR_BLACK, GRA_CLR_YELLOW// TO BE THE PARENT
@RC1,99 DCRADIO lSHORTCUT1 PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| DBC_FILE('\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT andy TABGROUP XBP_BEGIN_GROUP
@RC1,109 DCRADIO lSHORTCUT1 PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| FERASE('\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT andy TABGROUP XBP_END_GROUP
RC1++
IF FILE('C:\INFOWIN\SHORTCUT.DB') && 20070316 && local PC setting
lSHORTCUT2:=.T.
ELSE
lSHORTCUT2:=.F.
ENDIF
@RC1+.2,5 DCSAY {|| xTEXT('To activate Shortcut Toolbar for Local PC Access')} FONT cSAYFONT SAYSIZE 0 OBJECT oTabPage1A
@RC1,99 DCRADIO lSHORTCUT2 PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| DBC_FILE('C:\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR TABGROUP XBP_BEGIN_GROUP OBJECT oTabPage1A
@RC1,109 DCRADIO lSHORTCUT2 PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| FERASE('C:\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR TABGROUP XBP_END_GROUP OBJECT oTabPage1A
DCSETPARENT to oTabPage1B
DCSETPARENT to oTabPage1C
DCSETPARENT to oTabPage1D
DCSETPARENT
.
.
.
code snipped for brevity
Andy
- sdenjupol148
- Posts: 151
- Joined: Thu Jan 28, 2010 10:27 am
- Location: NYC
Re: Radio Button problem
Hey Andy,
Using your supplied code snippet, I had to default a few of your #DEFINES to make it work.
Compare it with your code snippet.
Remember that each radio button group needs its own PARENT.
Notice that I added an extra DCSAY "" for the 2nd radio button group.
Result:
Using your supplied code snippet, I had to default a few of your #DEFINES to make it work.
Compare it with your code snippet.
Remember that each radio button group needs its own PARENT.
Notice that I added an extra DCSAY "" for the 2nd radio button group.
Code: Select all
#INCLUDE "DCDIALOG.CH"
proc main
#DEFINE COL_HK1 GRA_CLR_GREY
#DEFINE COL_HK2 GRA_CLR_YELLOW
#DEFINE M_RADIO_CLR GRA_CLR_BLUE
LOCAL GetList[0], GetOptions
LOCAL oTabPage1, oTabPage1A, oTabPage1B, oTabPage1C, oTabPage1D, ABC, oRadio1, oRadio2
LOCAL Rc1, cSayFont, cObject
LOCAL lShortcut1, lShortcut2
DEFAULT RC1 := 1
@ 0,0 DCTABPAGE oTabPage1 CAPTION 'General' SIZE 125,25 TABWIDTH 12 TOOLTIP 'Genaral feature' /*COLOR COL_HK1,COL_HK2*/ PARENT ABC
DCSETPARENT to oTabPage1
@ 0.0,0 DCTABPAGE oTabPage1A CAPTION 'General Page 1' SIZE 125,25 TABWIDTH 15 RELATIVE oTABPAGE1
@ 0,0 DCTABPAGE oTabPage1B CAPTION 'General Page 2' RELATIVE oTABPAGE1A
@ 0,0 DCTABPAGE oTabPage1C CAPTION 'General Page 3' RELATIVE oTABPAGE1B
@ 0,0 DCTABPAGE oTabPage1D CAPTION 'General Page 4' RELATIVE oTABPAGE1C
DCSETPARENT to oTabPage1A
RC1++
lSHORTCUT1:=.T.
@RC1, 5 DCSAY {|| 'To activate Shortcut Toolbar for Internet Access'} FONT cSAYFONT SAYSIZE 0 PARENT oTabPage1A
@RC1,99 DCSAY '' OBJECT oRadio1 SAYSIZE 16,1.1 PARENT oTabPage1A COLOR GRA_CLR_BLACK, GRA_CLR_YELLOW// TO BE THE PARENT
@ 0, 1 DCRADIO lSHORTCUT1 PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| DBC_FILE('\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT oRadio1 TABGROUP XBP_BEGIN_GROUP
@ 0,10 DCRADIO lSHORTCUT1 PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| FERASE('\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT oRadio1 TABGROUP XBP_END_GROUP
RC1++
IF FILE('C:\INFOWIN\SHORTCUT.DB') && 20070316 && local PC setting
lSHORTCUT2:=.T.
ELSE
lSHORTCUT2:=.F.
ENDIF
@RC1, 5 DCSAY {|| 'To activate Shortcut Toolbar for Local PC Access'} FONT cSAYFONT SAYSIZE 0 PARENT oTabPage1A
@RC1,99 DCSAY '' OBJECT oRadio2 SAYSIZE 16,1.1 PARENT oTabPage1A COLOR GRA_CLR_BLACK, GRA_CLR_GREEN// TO BE THE PARENT
@ 0, 1 DCRADIO lSHORTCUT2 PROMPT 'Yes' VALUE .T.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| DBC_FILE('C:\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT oRadio2 TABGROUP XBP_BEGIN_GROUP OBJECT oTabPage1A
@ 0,10 DCRADIO lSHORTCUT2 PROMPT 'No' VALUE .F.;
EVAL {|o|o:KEYBOARD:=NIL};
ACTION {|| FERASE('C:\INFOWIN\SHORTCUT.DB'),DC_GETREFRESH(GETLIST)};
COLOR M_RADIO_CLR PARENT oRadio2 TABGROUP XBP_END_GROUP OBJECT oTabPage1A
DCREAD GUI OPTIONS GetOptions ADDBUTTONS FIT ENTEREXIT MODAL SETAPPWINDOW
return
*--------------------------------------
function Dbc_File
return nil
*--------------------------------------
procedure appsys; return
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: Radio Button problem
Hi SbDrakos,
Everything is working now, thank you for the help.
I just want to add something, actually I had another problem after using parents for the radio buttons.
Whenever the second tab have an element, the problem persists. Apparently I need to remove DC_GETREFRESH(GETLIST) in all my radio button's action. It might be just me and my code, but just in case someone else encounter the same issue.
But all is well now. Thanks again.
Best Regards,
Andy
Everything is working now, thank you for the help.

I just want to add something, actually I had another problem after using parents for the radio buttons.
Whenever the second tab have an element, the problem persists. Apparently I need to remove DC_GETREFRESH(GETLIST) in all my radio button's action. It might be just me and my code, but just in case someone else encounter the same issue.
But all is well now. Thanks again.
Best Regards,
Andy