home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / tools / 1692 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.9 KB  |  48 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools
  2. Path: sparky!uunet!spool.mu.edu!wupost!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Borland's RESource manager
  5. Message-ID: <1992Dec14.010010.17900@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <Bz7woH.M49@news.cso.uiuc.edu>
  8. Date: Mon, 14 Dec 1992 01:00:10 GMT
  9. Lines: 37
  10.  
  11. In article <Bz7woH.M49@news.cso.uiuc.edu> duff@cs.uiuc.edu writes:
  12. >I began making my first .RES file using the Toolkit last night, and I
  13. >finished the "pretty" part of making it, but I'm having trouble understanding
  14. >how to make one set of Radio buttons allow the user to ONLY choose ONE
  15. >of five buttons.  What I mean to say is, I have five buttons, GROUPED,
  16. >and I want the user to be able to choose one of them and have ONLY that one
  17. >highlighted.  Do I have to do that from my calling program, or
  18. >can I set that up in the .RES ?
  19.       1. give each one an ID (ID_RB1,ID_RB2,...ID_RB5)
  20.       2. in the DlgProc for the dialog box, handle the messages
  21.          as follows:
  22.         case WM_COMMAND:
  23.           id=(int)wparam;
  24.           switch(id){
  25.             ID_RB1:
  26.             ID_RB2:
  27.             ID_RB3:
  28.             ID_RB4:
  29.             ID_RB5: CheckRadioButton(hdlg,ID_RB1,ID_RB5,id);
  30.                 break;
  31. >
  32. >Also, I have another set of radio buttons that I want to be able to
  33. >have the user choose any or ALL of them, depending on preferences.
  34. >The same question applies to this: can I do this in .res or in my .cpp?
  35.  
  36.     You should not use radio buttons for this type of selection.
  37.     Use checkboxes instead.  If you use BS_AUTOCHECKBOX, then
  38.     the control will check & uncheck itself.  You only have to
  39.     'read' the settings when you press OK to terminate the
  40.     dialog box.  Here you will want to use IsDlgButtonChecked().
  41.  
  42. BTW, most of this stuff is in Petzold's "Programming Windows 3.1"
  43. which is essential.  If you don't have it, get it.
  44. -- 
  45. John A. Grant                        jagrant@emr1.emr.ca
  46. Airborne Geophysics
  47. Geological Survey of Canada, Ottawa
  48.