<?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: Changing Text Colours/Fonts in dialog controls in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860676#M69034</link>
    <description>&lt;DIV style="margin:0px;"&gt;The problem with push buttons is that they consist of more than one component (the shadowed edge plus the main part), so apparently a single 'background' color is not allowed by the Windows system.&lt;BR /&gt;&lt;BR /&gt;Regarding fonts, once you have a handle to a font object,hFontObj, and a handle to the device context for the control, hDC, you can selectthe fontinto the device context forthe control using SelectObject(hDC, hFontObj).As to choosing and selcting fonts, I can be of no help. Try looking up 'ChooseFont' and 'Font and Text Functions' in the Help.&lt;BR /&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Apr 2009 09:38:46 GMT</pubDate>
    <dc:creator>anthonyrichards</dc:creator>
    <dc:date>2009-04-14T09:38:46Z</dc:date>
    <item>
      <title>Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860672#M69030</link>
      <description>I'm having difficulty in changing the colour of text in dialog controls. I am utilising the dflogm module and calling the following subroutine from the modal dialog callback.&lt;BR /&gt;&lt;BR /&gt;subroutine DlgSetTextColour(dlg,idc,RGBCol)&lt;BR /&gt;&lt;BR /&gt;!*************************************************************&lt;BR /&gt;! Set Text Colour in Dialog Control&lt;BR /&gt;!*************************************************************&lt;BR /&gt;&lt;BR /&gt;use dflogm&lt;BR /&gt;use dfwin&lt;BR /&gt;&lt;BR /&gt;implicit none&lt;BR /&gt;&lt;BR /&gt;! Arguements&lt;BR /&gt;type(DIALOG) :: dlg ! Dialog Data Structure&lt;BR /&gt;integer :: idc ! Dialog Control ID&lt;BR /&gt;integer :: RGBCol ! RGB(red,green,blue)&lt;BR /&gt;&lt;BR /&gt;! Local variables&lt;BR /&gt;integer(HANDLE) :: hWndControl ! Control Window handle&lt;BR /&gt;integer(HANDLE) :: hDC ! Device Context&lt;BR /&gt;integer(DWORD) :: iret&lt;BR /&gt;&lt;BR /&gt;if(dlg%hWnd.eq.0) return&lt;BR /&gt;&lt;BR /&gt;hWndControl = GetDlgItem(dlg%hwnd,idc)&lt;BR /&gt;hDC = GetDC(hWndControl)&lt;BR /&gt;iret = MSFWIN$SetTextColor(hDC,RGBCol)&lt;BR /&gt;&lt;BR /&gt;return&lt;BR /&gt;end subroutine&lt;BR /&gt;&lt;BR /&gt;It has no effect. Eventually I wish to be able to modify the Font by making it bold or italic also. Is it possible to do this using the DFLOGM/IFLOGM modules modal dialog boxes or will I have to reconfigure to Modeless or rewrite in Windows API approach. &lt;BR /&gt;&lt;BR /&gt;I tried changing the control (a push button) to Owner Draw but if crashed the program at the DlgInit(IDD_WW,dlg) statement.</description>
      <pubDate>Sat, 11 Apr 2009 18:15:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860672#M69030</guid>
      <dc:creator>dannycat</dc:creator>
      <dc:date>2009-04-11T18:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860673#M69031</link>
      <description>&lt;DIV style="margin:0px;"&gt;See this article &lt;A href="http://software.intel.com/en-us/articles/how-to-customize-dialog-box-colors-using-subclassing/" target="_blank"&gt;http://software.intel.com/en-us/articles/how-to-customize-dialog-box-colors-using-subclassing/&lt;/A&gt;&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Sat, 11 Apr 2009 20:00:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860673#M69031</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2009-04-11T20:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860674#M69032</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/341673"&gt;anthonyrichards&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;See this article &lt;A href="http://software.intel.com/en-us/articles/how-to-customize-dialog-box-colors-using-subclassing/" target="_blank"&gt;http://software.intel.com/en-us/articles/how-to-customize-dialog-box-colors-using-subclassing/&lt;/A&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Thanks Anthony, your example is really useful.&lt;BR /&gt;&lt;BR /&gt;This is almost what I was looking for and I have managed to incorporate the method into one of my dialogs. However it does not seem to work with pushbutton controls.My originalidea was to showthe currentlyselected colourfor the background of the button used to select the common colour dialog box.&lt;BR /&gt;&lt;BR /&gt;Is it possible to change the font style of individual controlsusing this technique?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Mon, 13 Apr 2009 19:12:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860674#M69032</guid>
      <dc:creator>dannycat</dc:creator>
      <dc:date>2009-04-13T19:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860675#M69033</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/290983"&gt;dannycat&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Thanks Anthony, your example is really useful.&lt;BR /&gt;&lt;BR /&gt;This is almost what I was looking for and I have managed to incorporate the method into one of my dialogs. However it does not seem to work with pushbutton controls.My originalidea was to showthe currentlyselected colourfor the background of the button used to select the common colour dialog box.&lt;BR /&gt;&lt;BR /&gt;Is it possible to change the font style of individual controlsusing this technique?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Unfortunately, you cannot change background of foreground colors of pushbuttons. That's by [stupid] Windows design.&lt;BR /&gt;&lt;BR /&gt;What you can do is to make a bitmap whose single color you change dynamically, and set it to button using BM_SETIMAGE (make sure to specify BS_BITMAP style for the button.) A simpler method is to use a static control+push button, as in the attached image. &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.intel.com/skins/images/7B13F55A7CE623EF42E69096FA81A3A1/2021_redesign/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Apr 2009 07:56:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860675#M69033</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-04-14T07:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860676#M69034</link>
      <description>&lt;DIV style="margin:0px;"&gt;The problem with push buttons is that they consist of more than one component (the shadowed edge plus the main part), so apparently a single 'background' color is not allowed by the Windows system.&lt;BR /&gt;&lt;BR /&gt;Regarding fonts, once you have a handle to a font object,hFontObj, and a handle to the device context for the control, hDC, you can selectthe fontinto the device context forthe control using SelectObject(hDC, hFontObj).As to choosing and selcting fonts, I can be of no help. Try looking up 'ChooseFont' and 'Font and Text Functions' in the Help.&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Apr 2009 09:38:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860676#M69034</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2009-04-14T09:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860677#M69035</link>
      <description>&lt;DIV style="margin:0px;"&gt;Jugoslav,&lt;BR /&gt;&lt;BR /&gt;I arrived at a similar conclusion, but I used an edit box+push button combination instead. However I tried to make the edit box read only the colour would not change. I understand from Anthony's example that edit-boxes become static if set to readonly, so I added code to deal with this, but it still does not work. It must be another Windows "design feature".&lt;/DIV&gt;
&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 14 Apr 2009 09:43:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860677#M69035</guid>
      <dc:creator>dannycat</dc:creator>
      <dc:date>2009-04-14T09:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860678#M69036</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/290983"&gt;dannycat&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;Jugoslav,&lt;BR /&gt;&lt;BR /&gt;I arrived at a similar conclusion, but I used an edit box+push button combination instead. However I tried to make the edit box read only the colour would not change. I understand from Anthony's example that edit-boxes become static if set to readonly, so I added code to deal with this, but it still does not work. It must be another Windows "design feature".&lt;/DIV&gt;
&lt;BR /&gt;Steve&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;In my example, I have just set the ReadOnly property of an edit box, recompiled and run itandthe read-only edit boxsent a WM_CTLCOLORSTATIC message OK as expected which I was able to intercept andwas then able to paint its background. Can you post your code to see what is happening?</description>
      <pubDate>Tue, 14 Apr 2009 10:27:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860678#M69036</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2009-04-14T10:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860679#M69037</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/290983"&gt;dannycat&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;I arrived at a similar conclusion, but I used an edit box+push button combination instead. However I tried to make the edit box read only the colour would not change. I understand from Anthony's example that edit-boxes become static if set to readonly, so I added code to deal with this, but it still does not work. It must be another Windows "design feature".&lt;/DIV&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Huh? No, it must be something else:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.intel.com/skins/images/7B13F55A7CE623EF42E69096FA81A3A1/2021_redesign/images/image_not_found.png" /&gt;&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Apr 2009 10:29:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860679#M69037</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-04-14T10:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860680#M69038</link>
      <description>&lt;DIV style="margin:0px;"&gt;I must apologise, I can get the edit-box readonly colour change to work after all. I'd not changed the control typefrom WM_CTLCOLOREDIT to WM_CTLCOLORSTATIC in the definition part on my dialog code.&lt;BR /&gt;&lt;BR /&gt;I'm going to try to get the font changes now. I only really want to make the text in group boxes bold.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Apr 2009 12:24:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860680#M69038</guid>
      <dc:creator>dannycat</dc:creator>
      <dc:date>2009-04-14T12:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860681#M69039</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/290983"&gt;dannycat&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;I must apologise, I can get the edit-box readonly colour change to work after all. I'd not changed the control typefrom WM_CTLCOLOREDIT to WM_CTLCOLORSTATIC in the definition part on my dialog code.&lt;BR /&gt;&lt;BR /&gt;I'm going to try to get the font changes now. I only really want to make the text in group boxes bold.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Here is how to create and use a 10 point, bold italic Verdana font&lt;BR /&gt;&lt;BR /&gt;TYPE(T_LOGFONT):: LF&lt;BR /&gt;INTEGER::i, hFont&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LF=T_LOGFONT(-10,0,0,0,FW_BOLD, 1_1,0_1,0_1,0_1, 0_1,0_1,0_1,0_1,"Verdana"C) !10-pointVerdana font&lt;BR /&gt;hFont = CreateFontIndirect(LF)&lt;BR /&gt;&lt;BR /&gt;To set the font for a control, you can use&lt;BR /&gt;&lt;BR /&gt;i = SendMessage(GetDlgItem(Dlg%hWnd,IDC_YOURCONTROL), WM_SETFONT, hFont, 0)&lt;BR /&gt;&lt;BR /&gt;I have tried this and find the text output using this bold font,is not as black as when using the default black font.&lt;BR /&gt;I have no idea why.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Apr 2009 16:42:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860681#M69039</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2009-04-14T16:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860682#M69040</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/341673"&gt;anthonyrichards&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Here is how to create and use a 10 point, bold italic Verdana font&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;You would better just bold the original system font. Semi-pseudo code follows, I don't have time to look at exact prototypes:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]type(T_LOGFONT) LF
hFont = SendDlgItemMessage(IDC_GROUP, WM_GETFONT)
!(Alternatively, use GetStockObject(DEFAULT_GUI_FONT))&lt;BR /&gt;iret = GetObject(hFont, LOC(LF))
LF%lfWeight = FW_BOLD
hFont2 = CreateFontIndirect(LF)
iret = SendDlgItemMessage(IDC_GROUP, WM_SETFONT, hFont2)

[/cpp]&lt;/PRE&gt;
Don't forget to destroy hFont2 after you're done with the dialog. Failure to do so creates a (small though) GDI memory leak.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Apr 2009 06:54:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860682#M69040</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-04-15T06:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Text Colours/Fonts in dialog controls</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860683#M69041</link>
      <description>&lt;DIV style="margin:0px;"&gt;Re: the text contrast being less when in a read-only edit box, I think this is because the box is given a greyed-out look when selected as read-only , so the contrast between background and text will always be less whatever text boldness is selected.&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Apr 2009 11:19:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Changing-Text-Colours-Fonts-in-dialog-controls/m-p/860683#M69041</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2009-04-15T11:19:45Z</dc:date>
    </item>
  </channel>
</rss>

