FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Radio Button Help
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Radio Button Help
Posted: Fri Mar 20, 2009 01:41 AM
Hi Everybody,

I am trying to use Radio Buttons in my program settings to allow the user to select a device.
Everything seems to work as far as the correct number being returned but when I return to the settings screen the Radio Button will not show what the current selection is unless the current selection is the first option.

I have checked the stored value and it is fine (in this case it is 3)

In the code below I have 3 items. If anything other that the first item is selected, when you leave and return to the settings screen all 3 radios are empty (none selected) but again the value in my database is 3.

Note: when you are selecting the radio it will fill in the circle. The problem is when you leave and come back.

Code (fw): Select all Collapse
      @ 0.65,1 say "Device:" SIZE 22,10
      @ 0.5,4 RADIO  oRad  VAR Config->Device SIZE 50,10 ITEMS "Nonin 9560" of oDlgCfg UPDATE COLOR RGB(0,0,0),RGB(230,225,172)        
      @ 1.0,4 RADIOITEM "Nonin 4100"       RADIOMENU oRad OF oDlgCfg SIZE 50, 10
        @ 1.5,4 RADIOITEM "Nonin 2500, 8500" RADIOMENU oRad OF oDlgCfg SIZE 70, 10
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Radio Button Help
Posted: Fri Mar 20, 2009 08:30 AM
Please take the time to build a reduced and self-contained sample of the problem.

EMG
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Radio Button Help
Posted: Fri Mar 20, 2009 12:09 PM
Here is the small sample.

I have defaulted nDevice to 3 so the last radio button should be selected but isn't :-)

Code (fw): Select all Collapse
#include "Fwce.ch"

Function ConfigGen()
   Local oDlgCfg, nDevice:=3, oRad

   DEFINE DIALOG oDlgCfg FROM 2,2 to 18,32 TITLE "Test" 
      @ 0.65,1 say "Device:" SIZE 22,10
      @ 0.5,4 RADIO  oRad  VAR nDevice SIZE 50,10 ITEMS "Item 1" of oDlgCfg 
      @ 1.0,4 RADIOITEM "Item 2" RADIOMENU oRad OF oDlgCfg SIZE 50, 10
        @ 1.5,4 RADIOITEM "Item 3" RADIOMENU oRad OF oDlgCfg SIZE 50, 10
      @ 5.5,7 BUTTON oBtn  PROMPT "OK"  SIZE 30,13 of oDlgCfg Action ( Msginfo("Item # "+str(nDevice)),oDlgCfg:End() )
   Activate Dialog oDlgCfg CENTER
Return Nil
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Radio Button Help
Posted: Fri Mar 20, 2009 12:32 PM
A workaround (tested with FWH): put

Code (fw): Select all Collapse
oRad:aItems[ nDevice ]:Check()


just before ACTIVATE DIALOG command.

EMG
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Radio Button Help
Posted: Fri Mar 20, 2009 02:34 PM

Thanks Enrico. That solved the problem.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion