Thread View: comp.os.ms-windows.programmer.tools
4 messages
4 total messages
Started by Mike Duff
Sun, 13 Dec 1992 21:50
Borland's RESource manager
Author: Mike Duff
Date: Sun, 13 Dec 1992 21:50
Date: Sun, 13 Dec 1992 21:50
21 lines
1722 bytes
1722 bytes
I began making my first .RES file using the Toolkit last night, and I finished the "pretty" part of making it, but I'm having trouble understanding how to make one set of Radio buttons allow the user to ONLY choose ONE of five buttons. What I mean to say is, I have five buttons, GROUPED, and I want the user to be able to choose one of them and have ONLY that one highlighted. Do I have to do that from my calling program, or can I set that up in the .RES ? Also, I have another set of radio buttons that I want to be able to have the user choose any or ALL of them, depending on preferences. The same question applies to this: can I do this in .res or in my .cpp? Thanks for the help, and don't splat me because I don't know what I'm doing. ------------------------------------------------------------------------------- | Michael Duff | "Thank you for bringing up such a painful | | ACM membership coord. | subject. While you're at it, why don't you | | U. of Illinois- U/Champaign | give me a nice paper cut and pour lemon | | duff@cs.uiuc.edu | juice on it." - Miracle Max | -------------------------------------------------------------------------------
Re: Borland's RESource manager
Author: John Grant
Date: Mon, 14 Dec 1992 01:00
Date: Mon, 14 Dec 1992 01:00
37 lines
2015 bytes
2015 bytes
In article <Bz7woH.M49@news.cso.uiuc.edu> duff@cs.uiuc.edu writes:
>I began making my first .RES file using the Toolkit last night, and I
>finished the "pretty" part of making it, but I'm having trouble understanding
>how to make one set of Radio buttons allow the user to ONLY choose ONE
>of five buttons. What I mean to say is, I have five buttons, GROUPED,
>and I want the user to be able to choose one of them and have ONLY that one
>highlighted. Do I have to do that from my calling program, or
>can I set that up in the .RES ?
1. give each one an ID (ID_RB1,ID_RB2,...ID_RB5)
2. in the DlgProc for the dialog box, handle the messages
as follows:
case WM_COMMAND:
id=(int)wparam;
switch(id){
ID_RB1:
ID_RB2:
ID_RB3:
ID_RB4:
ID_RB5: CheckRadioButton(hdlg,ID_RB1,ID_RB5,id);
break;
>
>Also, I have another set of radio buttons that I want to be able to
>have the user choose any or ALL of them, depending on preferences.
>The same question applies to this: can I do this in .res or in my .cpp?
You should not use radio buttons for this type of selection.
Use checkboxes instead. If you use BS_AUTOCHECKBOX, then
the control will check & uncheck itself. You only have to
'read' the settings when you press OK to terminate the
dialog box. Here you will want to use IsDlgButtonChecked().
BTW, most of this stuff is in Petzold's "Programming Windows 3.1"
which is essential. If you don't have it, get it.
--
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Re: Borland's RESource manager
Author: torstein hansen
Date: Mon, 14 Dec 1992 18:33
Date: Mon, 14 Dec 1992 18:33
46 lines
2126 bytes
2126 bytes
In article <1992Dec14.010010.17900@emr1.emr.ca> jagrant@emr1.emr.ca (John Grant) writes:
In article <Bz7woH.M49@news.cso.uiuc.edu> duff@cs.uiuc.edu writes:
>I began making my first .RES file using the Toolkit last night, and I
>finished the "pretty" part of making it, but I'm having trouble understanding
>how to make one set of Radio buttons allow the user to ONLY choose ONE
>of five buttons. What I mean to say is, I have five buttons, GROUPED,
>and I want the user to be able to choose one of them and have ONLY that one
>highlighted. Do I have to do that from my calling program, or
>can I set that up in the .RES ?
1. give each one an ID (ID_RB1,ID_RB2,...ID_RB5)
2. in the DlgProc for the dialog box, handle the messages
as follows:
case WM_COMMAND:
id=(int)wparam;
switch(id){
ID_RB1:
ID_RB2:
ID_RB3:
ID_RB4:
ID_RB5: CheckRadioButton(hdlg,ID_RB1,ID_RB5,id);
break;
You could just as well set it up in your res file.
Using the Resource Workshop editor:
Double click the first radio button of the group
Set button type to "Auto radio button"
Make sure "Tab stop" atttribute is set
for the rest of your buttons:
Double click button 2..lastbutton
Set button type to "Auto radio button"
Remove any "Tab stop" attribute of the button
And that's it!
(Rest deleted...)
Good luck!
Torstein
--
Torstein Hansen
torstein@itekiris.kjemi.unit.no
Re: Borland's RESource manager
Author: Eric Kimmel
Date: Wed, 16 Dec 1992 04:57
Date: Wed, 16 Dec 1992 04:57
32 lines
2336 bytes
2336 bytes
In article <Bz7woH.M49@news.cso.uiuc.edu> duff@cs.uiuc.edu writes: >I began making my first .RES file using the Toolkit last night, and I >finished the "pretty" part of making it, but I'm having trouble understanding >how to make one set of Radio buttons allow the user to ONLY choose ONE >of five buttons. What I mean to say is, I have five buttons, GROUPED, >and I want the user to be able to choose one of them and have ONLY that one >highlighted. Do I have to do that from my calling program, or >can I set that up in the .RES ? > >Also, I have another set of radio buttons that I want to be able to >have the user choose any or ALL of them, depending on preferences. >The same question applies to this: can I do this in .res or in my .cpp? > >Thanks for the help, and don't splat me because I don't know what I'm doing. > I could never get it to work right either. What I do is to edit the resource as text and put all the radio buttons on consecutive lines and then put some other resource after that (like a CTEXT). The effectively groups your radio buttons (make sure they are all set to be auto-radio buttons as well). If you have more than one group of them, just make sure you have a non-radio button resource inbetween the groups. This is probably not the most elegant way of doing it, but it works... -Rick > >------------------------------------------------------------------------------- >| Michael Duff | "Thank you for bringing up such a painful | >| ACM membership coord. | subject. While you're at it, why don't you | >| U. of Illinois- U/Champaign | give me a nice paper cut and pour lemon | >| duff@cs.uiuc.edu | juice on it." - Miracle Max | >-------------------------------------------------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads