Silverfrost Forums

Welcome to our forums

%el combo box

15 Jan 2009 3:38 #4204

I am trying to use %el as a list box with a user input that constantly shows the list box with the nearest item to the typed string highlighted. Ideally a use of the arrow keys and enter should then select the item required. I have related text that I have found within a Win32 API help document (shown below) which suggests that I am looking for the Combo with an Edit box. Even though this would appear to be a standard variant of a Combo box I cannot get %el to even display the list box whilst typing in the values. Could you help please. Cheers

The COMBOBOX statement creates a combination box control (a combo box). A combo box consists of either a static text box or an edit box combined with a list box. The list box can be displayed at all times or pulled down by the user. If the combo box contains a static text box, the text box always displays the selection (if any) in the list box portion of the combo box. If it uses an edit box, the user can type in the desired selection; the list box highlights the first item (if any) that matches what the user has entered in the edit box. The user can then select the item highlighted in the list box to complete the choice. In addition, the combo box can be owner-drawn and of fixed or variable height.

15 Jan 2009 4:41 #4205

%el uses a standard Microsoft ComboBox control with the style CBS_DROPDOWN. As far as I know this does not automatically produce the effect that you are asking for. If you want to post a simple sample I will run some tests on it.

17 Jan 2009 2:41 #4211

The standard Microsoft combobox control does not provide auto-completion. You can get auto completion when using Windows Forms under .NET but I am assuming that this is an extension for .NET only. It does not seem to feature in the original control.

You can do a little on your own, as illustrated by the following sample, but there is not a lot that you can do in Fortran using ClearWin+.

      WINAPP
      character*20 textArray(10),textCurrent
      common textArray,textCurrent
      integer cb
      external cb
      textArray(1) = 'apples'
      textArray(2) = 'bananas'
      textArray(3) = 'charries'
      textArray(4) = 'damsons'
      textArray(5) = 'figs'
      textArray(6) = 'grapes'
      textArray(7) = 'kiwi'
      textArray(8) = 'nuts'
      textArray(9) = 'pears'
      textArray(10) = 'tomatoes'
      iw=winio@('%^20el',textArray,10,textCurrent,cb)
      end

      integer function cb()
      character*20 textArray(10),textCurrent
      common textArray,textCurrent
      integer len
      len = len_trim(textCurrent)
      do i=1,10
        if(textCurrent(1:len)==textArray(i)(1:len))then
          textCurrent = textArray(i)
          exit
        endif 
      enddo  
      cb = 1
      end
Please login to reply.