Radiobuttons

Radiobuttons

Postby Otto » Mon Feb 02, 2009 4: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Radiobuttons

Postby driessen » Mon Feb 02, 2009 5: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 :
Code: Select all  Expand view
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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Radiobuttons

Postby Otto » Mon Feb 02, 2009 5:40 pm

Hello Michael,
thank you very much.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Radiobuttons

Postby Armando » Mon Feb 02, 2009 6: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
User avatar
Armando
 
Posts: 3211
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Radiobuttons

Postby Antonio Linares » Mon Feb 02, 2009 6: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:
Code: Select all  Expand view
// 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests

cron