FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Radiobuttons
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Radiobuttons
Posted: Mon Feb 02, 2009 04:30 PM

I would need 3 groups of independent radiobuttons.
I use a resource. How can I group the buttons?
Could someone help me please.
Thanks in advance
Otto

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Radiobuttons
Posted: Mon Feb 02, 2009 05:14 PM
Otto,

In your resources, don't define the radiobuttons as "Auto radio button" (Resource Workshop). You need to define them just as a simple "Radio button".

In your source just use :
REDEFINE RADIO cField1 ID 101,102,103 OF oDlg
REDEFINE RADIO cField2 ID 104,105,106 OF oDlg
REDEFINE RADIO cField3 ID 107,108,109 OF oDlg


cField1, cField2 and cField3 will return a numeric value 1, 2 or 3, depending on your choice in each group of radiobuttons.

If you use "Auto radio button", I think that all radio buttons are handled in one group.

It works fine here.

Good luck.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Radiobuttons
Posted: Mon Feb 02, 2009 05:40 PM

Hello Michael,
thank you very much.
Best regards,
Otto

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Radiobuttons
Posted: Mon Feb 02, 2009 06:13 PM

Otto:

Also try to switch on the tab stop attribute to the first radio button of each group.

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Radiobuttons
Posted: Mon Feb 02, 2009 06:47 PM
Otto,

The first radio of a group of radios must use Group and TabStop: WS_GROUP | WS_TABSTOP

Here you have an example built with PellesC:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 5.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1001 DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 0, 0, 1
{
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 160, 5, 45, 15
  CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 160, 23, 45, 15
  CONTROL "Radio-button", 4001, "Button", BS_AUTORADIOBUTTON|WS_GROUP|WS_TABSTOP, 8, 32, 56, 10
  CONTROL "Radio-button", 4002, "Button", BS_AUTORADIOBUTTON, 8, 48, 56, 10
  CONTROL "Radio-button", 4003, "Button", BS_AUTORADIOBUTTON, 8, 64, 56, 10
  CONTROL "Radio-button", 4004, "Button", BS_AUTORADIOBUTTON|WS_GROUP|WS_TABSTOP, 84, 48, 56, 10
  CONTROL "Radio-button", 4005, "Button", BS_AUTORADIOBUTTON, 84, 64, 56, 10
}
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion