PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: James Fuller on October 25, 2016, 02:23:00 PM

Title: combobox issues
Post by: James Fuller on October 25, 2016, 02:23:00 PM
Jose,
  If  we add a resource containing the manifest we have been using, the combobox does not honor it's size. I thought it might be Win10 but it shows the same thing on Win7 (although it was compiled on Win10)
It is not just FreeBasic either. I get the same results with bc9Basic -> c++.
It's not just the full DPI aware manifest either. This simple one does the same thing.
Quote
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="Company.Product.Name"
    type="win32"
/>
<description></description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

Any Ideas?

James
Title: Re: combobox issues
Post by: James Fuller on October 25, 2016, 03:27:03 PM
Well I did find a work-a-round but ......
SendMessage(hCombobox,CB_SETMINVISIBLE,10,0)
Shows the first 10 items in the list.
James
Title: Re: combobox issues
Post by: José Roca on October 25, 2016, 04:05:53 PM
Comboboxes behave differently if you use version 6 of the common controls (that is the one used by Windows if you add a manifest) or version 5 (without a manifest). It is by design.
Title: Re: combobox issues
Post by: James Fuller on October 26, 2016, 09:37:22 AM
Jose,
  I modified CWindow.inc to handle this.
If you use a negative value for the height in  .AddControl it will interpret it as the number of rows you want to show.

Line 1686
After:
SELECT CASE UCASE(wszClassName)
I added:
    CASE "COMBOBOX"
        If nHeight < 0 Then
            SendMessage(hCtl,CB_SETMINVISIBLE,ABS(nHeight),0)
        End If

It is probably the same for "COMBOBOXEX", "COMBOBOXEX32" but I am not familiar with their uses.

James