<?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: Dialog Combo Box - Setting Initial Value from Drop List in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955110#M20596</link>
    <description>As far as I know, versions of DFLOGM (more precisely, dflogm.lib) up from 6.0 do recognize items as entered in "Data" tab, but do not handle them correctly; for example, DLG_NUMITEMS property is not correctly set (it will return 0 for DlgGet) and I'm not sure about whether the DlgSet as in your example would work correctly. I don't know what's the situation in newer versions. To be on the safe side, it's better to fill in the combo programmatically. I usually do it by declaring a CHARACTER, PARAMETER array: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt; 
 
CHARACTER(*), PARAMETER:: sItem(4)=(/ &amp;amp; 
'Black', &amp;amp; 
'Blue ', &amp;amp; 
'Red  ', &amp;amp; 
'Green' /) 
 
iSt=DlgSet(Dlg, IDC_COMBO_COLOR, 4, DLG_NUMITEMS) 
DO i=1,4 
    iSt=DlgSet(Dlg, IDC_COMBO_COLOR, sItem(i), i) 
END DO 
&lt;/FONT&gt;&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
    <pubDate>Tue, 19 Jun 2001 06:33:56 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2001-06-19T06:33:56Z</dc:date>
    <item>
      <title>Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955108#M20594</link>
      <description>I have a Dialog Combo Box (type Drop List) that I am using to set a color preference. The listbox items are entered under the Data tab in Combo Box properties. I use the statement   logstatus=dlgset(dlg,iprefc,color) to set the initial color. While the color does seem to be set to the correct color (based on my testing), the combo box appears blank when it first appears. I cannot get this dlgset command to initialize the box when it first appears. It is always blank. I can create a callback subroutine with the same dlgset command which will cause the color to appear in the combo box. &lt;BR /&gt; &lt;BR /&gt;Is there some reason the dlgset command will not initialize the combo box (I am using version 6.0.B3 of the compiler)? &lt;BR /&gt; &lt;BR /&gt;I tried to send an a sample test program to vf-support@compaq.com but it was returned as undeliverable. Is this address no longer valid? &lt;BR /&gt; &lt;BR /&gt;Thank you, &lt;BR /&gt;Bruce Wiland</description>
      <pubDate>Tue, 19 Jun 2001 02:04:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955108#M20594</guid>
      <dc:creator>wiland</dc:creator>
      <dc:date>2001-06-19T02:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955109#M20595</link>
      <description>The address is still valid - please try again.  If it fails, please send the complete bounce error to fortran@compaq.com.&lt;BR /&gt;&lt;BR /&gt;I would suggest upgrading to at least 6.1A, if not 6.5 - 6.0B3 is quite old at this point.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 19 Jun 2001 03:51:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955109#M20595</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-06-19T03:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955110#M20596</link>
      <description>As far as I know, versions of DFLOGM (more precisely, dflogm.lib) up from 6.0 do recognize items as entered in "Data" tab, but do not handle them correctly; for example, DLG_NUMITEMS property is not correctly set (it will return 0 for DlgGet) and I'm not sure about whether the DlgSet as in your example would work correctly. I don't know what's the situation in newer versions. To be on the safe side, it's better to fill in the combo programmatically. I usually do it by declaring a CHARACTER, PARAMETER array: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt; 
 
CHARACTER(*), PARAMETER:: sItem(4)=(/ &amp;amp; 
'Black', &amp;amp; 
'Blue ', &amp;amp; 
'Red  ', &amp;amp; 
'Green' /) 
 
iSt=DlgSet(Dlg, IDC_COMBO_COLOR, 4, DLG_NUMITEMS) 
DO i=1,4 
    iSt=DlgSet(Dlg, IDC_COMBO_COLOR, sItem(i), i) 
END DO 
&lt;/FONT&gt;&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Tue, 19 Jun 2001 06:33:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955110#M20596</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-06-19T06:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955111#M20597</link>
      <description>Steve,  &lt;BR /&gt;  &lt;BR /&gt;I had 6.1A but had never upgraded to it. I just applied the upgrade to 6.1A and the same problem exists. Can you address the issue that Jugoslav Dujic makes in his reply (that items in the Data tab are not handled correctly)? Would this problem be fixed in 6.5. I would prefer not to spend the money for the upgrade right now if the problem is not corrected.  &lt;BR /&gt;  &lt;BR /&gt;Bruce</description>
      <pubDate>Tue, 19 Jun 2001 06:49:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955111#M20597</guid>
      <dc:creator>wiland</dc:creator>
      <dc:date>2001-06-19T06:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955112#M20598</link>
      <description>I see you successfully sent us your problem report - I forwarded it to our DFLOGM expert (Leo) for response.&lt;BR /&gt;&lt;BR /&gt;I'll point out that the cost of upgrading will go up after July 31, when the $149 Programmer's Paradise offer expires.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 19 Jun 2001 09:56:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955112#M20598</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-06-19T09:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955113#M20599</link>
      <description>Hi Bruce,&lt;BR /&gt;&lt;BR /&gt;The problem appears to still be there in our current code.  I will investigate it further.  For now, I have a workaround for you.  Add the following line before your call to DlgModal:&lt;BR /&gt;&lt;BR /&gt;    logstatus=dlgsetsub(dlg,ipref,setdefcol)  !sets color to default when called&lt;BR /&gt;&lt;BR /&gt;This will cause "setdefcol" to be called immediately before the dialog box is displayed.  It is a DLGINIT callback.  Why would this work and the DlgSet a few statements before not work?  The reason is that the actual dialog box, as far as Windows is concerned, is not created until the call to DlgModal.  Prior to that, the Dialog procedures save the information that you specify in DlgSet calls for use when the dialog box is created.  In the DLGINIT callback, the dialog box exists and settings that you make in DlgSet calls are sent to Windows right away.  The problem probably has to do with the sequence of Windows API calls made by the Dialog procedures, e.g., it is setting the default, but then a later call is wiping it out.&lt;BR /&gt;&lt;BR /&gt;Leo</description>
      <pubDate>Tue, 19 Jun 2001 22:22:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955113#M20599</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-06-19T22:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955114#M20600</link>
      <description>Leo,  &lt;BR /&gt;  &lt;BR /&gt;Your workaround works, but only if I want to initialize to the default each time. I want to initialize to the last chosen preference. Setting the values externally seems to work properly as Jugoslav suggested even though setting the values in the Data tab does not. I created a subroutine as follows:  &lt;BR /&gt;  &lt;BR /&gt;&lt;FONT size="+1"&gt;&lt;PRE&gt;
    subroutine definecolors(dlg,inum)  
    use dflogm  
    logical logstatus  
    INCLUDE 'resource.FD'  
    TYPE (dialog) dlg  
    integer(4) i4status  
    logstatus=dlgset(dlg,iprefc,15,DLG_NUMITEMS)    
    logstatus=dlgset(dlg,inum,'black', 1)    
    logstatus=dlgset(dlg,inum,'bright blue', 2)    
    logstatus=dlgset(dlg,inum,'bright cyan', 3)    
    logstatus=dlgset(dlg,inum,'bright green', 4)    
    logstatus=dlgset(dlg,inum,'bright magenta', 5)    
    logstatus=dlgset(dlg,inum,'bright red', 6)    
    logstatus=dlgset(dlg,inum,'bright yellow', 7)    
    logstatus=dlgset(dlg,inum,'dark blue', 8)    
    logstatus=dlgset(dlg,inum,'dark cyan', 9)    
    logstatus=dlgset(dlg,inum,'dark green', 10)    
    logstatus=dlgset(dlg,inum,'dark magenta', 11)    
    logstatus=dlgset(dlg,inum,'dark red', 12)    
    logstatus=dlgset(dlg,inum,'dark yellow', 13)    
    logstatus=dlgset(dlg,inum,'light gray', 14)    
    logstatus=dlgset(dlg,inum,'dark gray', 15)    
    return  
    end  
&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I then put a call to this subroutine before the line that sets the preferred color:  &lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="+1"&gt;&lt;PRE&gt;
    call definecolors(dlg,iprefc)  
    logstatus=dlgset(dlg,iprefc,color) !sets preferred color  
&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The example I sent you is actually an abbreviated version of what is in the application I am programming. There are a number of other colors I need to set, so I call this definecolors subroutine for each drop down list:  &lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="+1"&gt;&lt;PRE&gt;
    call definecolors(dlg,iprefc)  
    logstatus=dlgset(dlg,iprefc,color) !sets preferred color  
    call definecolors(dlg,iprefc2)  
    logstatus=dlgset(dlg,iprefc2,color2) !sets preferred color 2  
    call definecolors(dlg,iprefc3)  
    logstatus=dlgset(dlg,iprefc3,color3) !sets preferred color 3  
    etc.  
&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;However, it would be nice if the entering the data in the Combo Box "Data" tab worked properly.  &lt;BR /&gt;  &lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Bruce W.</description>
      <pubDate>Wed, 20 Jun 2001 00:25:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955114#M20600</guid>
      <dc:creator>wiland</dc:creator>
      <dc:date>2001-06-20T00:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955115#M20601</link>
      <description>Have you tried using the optional fourth argument of dlgset to get more control of what is going on? I have been using the following calls successfully for some time now &lt;BR /&gt;	RET = DLGSET(DLG,IDC_COMBO1,IX,DLG_STATE) &lt;BR /&gt;	RET = DLGSET(DLG,IDC_COMBO2,IY,DLG_STATE) &lt;BR /&gt;	RET = DLGSET(DLG,IDC_COMBO3,I3,DLG_STATE) &lt;BR /&gt;	RET = DLGSET(DLG,IDC_COMBO4,I4,DLG_STATE) &lt;BR /&gt;This form was essentially copied from some of the on-line help files I think. &lt;BR /&gt; &lt;BR /&gt;David Jones</description>
      <pubDate>Wed, 20 Jun 2001 18:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955115#M20601</guid>
      <dc:creator>david_jones</dc:creator>
      <dc:date>2001-06-20T18:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955116#M20602</link>
      <description>David, &lt;BR /&gt; &lt;BR /&gt;Yes, I have tried using the optional fourth argument (dlg_state). It did not help. The problem is with entering the listbox items under the "Data" tab in the Combo Box properties. As pointed out in previous discussion, if the items are entered programmatically, everything seems to work. There is apparently a problem with using the "Data" tab to enter the list items. Compaq technical support is aware of the problem and is looking into it. &lt;BR /&gt; &lt;BR /&gt;Bruce</description>
      <pubDate>Thu, 21 Jun 2001 00:38:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955116#M20602</guid>
      <dc:creator>wiland</dc:creator>
      <dc:date>2001-06-21T00:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dialog Combo Box - Setting Initial Value from Drop List</title>
      <link>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955117#M20603</link>
      <description>Bruce, &lt;BR /&gt;this is strange, since I seem to be doing exactly what you want to do; ie. entering the options via the data tab. Perhaps we have different option set under properties. The items I have in a checked condition are: &lt;BR /&gt; &lt;BR /&gt;General: visible, tab stop &lt;BR /&gt; &lt;BR /&gt;Styles: sort, vertical scroll   with Type=drop list  and Owner draw=No &lt;BR /&gt; &lt;BR /&gt;I don't recall having to do anything special to get this to work. The date on the subroutine file is June 2000, so it was working with whatever version was extant then and even earlier.</description>
      <pubDate>Thu, 21 Jun 2001 02:40:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Dialog-Combo-Box-Setting-Initial-Value-from-Drop-List/m-p/955117#M20603</guid>
      <dc:creator>david_jones</dc:creator>
      <dc:date>2001-06-21T02:40:46Z</dc:date>
    </item>
  </channel>
</rss>

