<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help on Radio Buttons in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931662#M14964</link>
    <description>Hi David, &lt;BR /&gt; &lt;BR /&gt;I investigated a bit and you were right - I overlooked &lt;BR /&gt;(and, frankly, I didn't know) the possibility that no &lt;BR /&gt;control initially has focus. In that case, Alt+Letter &lt;BR /&gt;for some reason fails. I don't know why -- ask MS, but &lt;BR /&gt;the fix is simple: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; 
   case (WM_INITDIALOG) 
      iret=SetFocus(GetDlgItem(hWnd,IDCANCEL)) 
      EditProc=1 
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;As you designed the dialog, setting the focus to &lt;BR /&gt;a radio button (IDCANCEL is a push button in my &lt;BR /&gt;example) would cause a WM_COMMAND to be generated, &lt;BR /&gt;since radio buttons by default set their state to &lt;BR /&gt;"on". That would cause the dialog to close immediately &lt;BR /&gt;with return value equal to the one corresponding &lt;BR /&gt;with the focused radio button. I guess that you choose &lt;BR /&gt;radio buttons just because of that feature. But then, &lt;BR /&gt;it looks that you have to have at least one non-radio-button &lt;BR /&gt;control in the dialog to have focus initially. &lt;BR /&gt; &lt;BR /&gt;Regards &lt;BR /&gt;Jugoslav</description>
    <pubDate>Mon, 18 Dec 2000 23:49:37 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2000-12-18T23:49:37Z</dc:date>
    <item>
      <title>Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931657#M14959</link>
      <description>The help on Radio Buttons says the following -  &lt;BR /&gt;"Caption - The text that labels the control. To make one of the letters in the caption of a control the mnemonic key, precede it with an ampersand (&amp;amp;)." &lt;BR /&gt; &lt;BR /&gt;I have added the "&amp;amp;" to the captions and they are displayed correctly but how do I get them to work? &lt;BR /&gt;It is a WinApi program. &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;David</description>
      <pubDate>Thu, 14 Dec 2000 19:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931657#M14959</guid>
      <dc:creator>davidgraham</dc:creator>
      <dc:date>2000-12-14T19:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931658#M14960</link>
      <description>You don't have to do anything to get them work. DefDlgProc &lt;BR /&gt;handles Alt+key correctly if the control is in a dialog (and the &lt;BR /&gt;mnemonic letter is not duplicated).  &lt;BR /&gt; &lt;BR /&gt;If the control is not in a dialog, but in a child window, well, I don't &lt;BR /&gt;know the way (except the brute-force approach: process &lt;BR /&gt;WM_KEYDOWN, use EnumChildWindows and then compare &lt;BR /&gt;names of child-controls with the Alt+key pressed)  &lt;BR /&gt;though I tried hard. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 14 Dec 2000 21:35:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931658#M14960</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2000-12-14T21:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931659#M14961</link>
      <description>I'm not using a DefDlgProc, and don't know where to call it - so I'm not sure what to do. &lt;BR /&gt; &lt;BR /&gt;I'm calling a DialogBox procedure then a case (WM_COMMAND) then &lt;BR /&gt;select case (loword(wparam) then CASE(IDC_RADIOBUTTON1).  &lt;BR /&gt; &lt;BR /&gt;Please could you expand on your help. &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;David</description>
      <pubDate>Thu, 14 Dec 2000 23:54:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931659#M14961</guid>
      <dc:creator>davidgraham</dc:creator>
      <dc:date>2000-12-14T23:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931660#M14962</link>
      <description>I meant, you have to do &lt;I&gt;nothing&lt;/I&gt;. DefDlgProc exists, &lt;BR /&gt;but, as the documentation says, it should almost never be called  &lt;BR /&gt;from dialog box procedure. Radio-button title designed &lt;BR /&gt;in rc editor such as &lt;BR /&gt; &lt;BR /&gt;"&amp;amp;First option" &lt;BR /&gt; &lt;BR /&gt;shoud be expanded to &lt;BR /&gt; &lt;BR /&gt;&lt;U&gt;F&lt;/U&gt;irst option &lt;BR /&gt; &lt;BR /&gt;and when user presses Alt+F, radio button is activated.  &lt;BR /&gt;(Granted there is no other control with &amp;amp;F as mnemonic). &lt;BR /&gt;I tried it in an Win32-handled dialog (with nothing special &lt;BR /&gt;in its DlgProc) and it worked. &lt;BR /&gt; &lt;BR /&gt;Btw (regarding your other post), what do you mean &lt;BR /&gt;"shimmering" of the color grid? How do you draw on &lt;BR /&gt;the dialog -- directly on dialog's hDC on WM_PAINT &lt;BR /&gt;or there is another control where you do the painting? &lt;BR /&gt;If the latter, you should use "owner-drawn" style on &lt;BR /&gt;that control. Can you post some code? (Please enclose &lt;BR /&gt;the code in &lt;PRE&gt; and &lt;/PRE&gt; HTML tags - replace [] with &lt;BR /&gt;&amp;lt;&amp;gt;). &lt;BR /&gt; &lt;BR /&gt;Regards  &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Fri, 15 Dec 2000 02:25:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931660#M14962</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2000-12-15T02:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931661#M14963</link>
      <description>Jugoslav, &lt;BR /&gt; &lt;BR /&gt;Here is the code I'm using.  Hope the tags are correct.  It's OK if I click on the radio button, but not if I press Alt+A etc.  Any ideas what I'm doing wrong? &lt;BR /&gt; &lt;BR /&gt;BTW I will answer the shimmerring question in that message. &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;David &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; 
	integer*4 function EditProc(hwnd, message, wParam, lParam)  
	!********************************************************** 
	!MS$ATTRIBUTES STDCALL, ALIAS : '_EditProc@16' :: EditProc 
	use dfwin 
	use grad_inc 
 
	include 'resource.fd' 
 
	integer*4	hwnd, message, wParam, lParam 
	integer*4	iCtrl,iret 
	logical*4	lret 
 
	! Unreferenced variables 
    lparam = lparam 
 
    select case (message) 
	case (#0053)			! WM_HELP 
		call help 
 
	case (WM_SHOWWINDOW) 
		if (wParam) then 
			iret=ShowCursor(.TRUE.) 
		endif 
        EditProc = 1 
        return 
		 
    case (WM_COMMAND)                       ! message: received a command 
		iCtrl=LoWord(wParam) 
		select case (iCtrl) 
					 
		case (IDC_ADD)						! Add 
			lret = EndDialog(hWnd,1) 
		 
		case (IDC_DELETE)					! Delete 
			lret = EndDialog(hWnd,2) 
 
		case (IDC_EDIT)						! Edit 
			lret = EndDialog(hWnd,3) 
 
		case (IDC_INSERT)					! Insert 
			lret = EndDialog(hWnd,4) 
 
		case (IDC_MOVE)						! Move 
			lret = EndDialog(hWnd,5) 
		 
		case (IDC_MENU)						! Menu 
			lret = EndDialog(hWnd,6) 
		 
		case (IDC_WINDOW)					! Window 
			lret = EndDialog(hWnd,7) 
 
		case (IDCANCEL)		! System menu close command? 
            lret = EndDialog(hWnd,0) 
            EditProc = 1 
 
		end select 
 
	case default 
		EditProc=0 
	end select 
     
	return 
 
	end function EditProc 
&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2000 18:25:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931661#M14963</guid>
      <dc:creator>davidgraham</dc:creator>
      <dc:date>2000-12-18T18:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help on Radio Buttons</title>
      <link>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931662#M14964</link>
      <description>Hi David, &lt;BR /&gt; &lt;BR /&gt;I investigated a bit and you were right - I overlooked &lt;BR /&gt;(and, frankly, I didn't know) the possibility that no &lt;BR /&gt;control initially has focus. In that case, Alt+Letter &lt;BR /&gt;for some reason fails. I don't know why -- ask MS, but &lt;BR /&gt;the fix is simple: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; 
   case (WM_INITDIALOG) 
      iret=SetFocus(GetDlgItem(hWnd,IDCANCEL)) 
      EditProc=1 
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;As you designed the dialog, setting the focus to &lt;BR /&gt;a radio button (IDCANCEL is a push button in my &lt;BR /&gt;example) would cause a WM_COMMAND to be generated, &lt;BR /&gt;since radio buttons by default set their state to &lt;BR /&gt;"on". That would cause the dialog to close immediately &lt;BR /&gt;with return value equal to the one corresponding &lt;BR /&gt;with the focused radio button. I guess that you choose &lt;BR /&gt;radio buttons just because of that feature. But then, &lt;BR /&gt;it looks that you have to have at least one non-radio-button &lt;BR /&gt;control in the dialog to have focus initially. &lt;BR /&gt; &lt;BR /&gt;Regards &lt;BR /&gt;Jugoslav</description>
      <pubDate>Mon, 18 Dec 2000 23:49:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Help-on-Radio-Buttons/m-p/931662#M14964</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2000-12-18T23:49:37Z</dc:date>
    </item>
  </channel>
</rss>

