home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.tools
- Path: sparky!uunet!spool.mu.edu!wupost!cs.utexas.edu!torn!nott!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: Re: Borland's RESource manager
- Message-ID: <1992Dec14.010010.17900@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- References: <Bz7woH.M49@news.cso.uiuc.edu>
- Date: Mon, 14 Dec 1992 01:00:10 GMT
- Lines: 37
-
- 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
-