4

I'm using a ESRI.ArcGIS.Desktop.AddIns.ComboBox. I configure the size of the combobox in config.esriaddinx with the following xml:

    <ComboBox id="my_id"
              class="MyComboBox"
              message="Everything is awesome!"
              caption="Everything is awesome!"
              tip="Everything is awesome!"
              category="Add-In Controls" 
              sizeString =     "WWWWWWWWWWWWW" 
              itemSizeString = "WWWWWWWWWWWWW" />

It work fine, but it really baffles me that the width is configured with a bunch of 'W's.

Can anyone explain the reasoning behind it?

5

This is just conjecture, but there is probably some variable-width text measurement logic going on behind the scenes, and the character W was probably chosen because it is one of the widest characters available in variable-width fonts. I agree that it is a bit nonsensical to do it this way.

  • I think this is the closest we'll get to an answer. Would be wonderful with some esri insider knowledge to shed light on the reasoning behind. – steenhulthin Jan 6 '15 at 8:10
2

That string represent the maximum length of string that you can show on that combo-box.That mean if it shows "WWW" you can add items of maximum 3 character.If you entered otherwise the arc-map split that string by the maximum length and balance will shown as next item.This also mentioned in Add-in _wizard. See image below addin-wizard

  • This is not (entirely) correct. I use 12 Ws which still shows all of my longest element of about 20 chars. And it does not answer the question about the 'why'? Is there some standard where W is a magic representation of string length? I would this to make sense. – steenhulthin Dec 3 '14 at 12:40
  • i have tested that also.You have enter string in to "item size string" text-box to restrict the number of characters in the item."W" is just a representation of width. But you can enter any character to that text-box.Number of the string is that only matters.. – Subin Dec 3 '14 at 13:54
  • 1
    That is not entirely correct either. The size of the combobox is not the same when I use sizeString="aaaa" in stead of sizeString="WWWW" for instance. Maybe this question can really only be answered by esri. I makes no sense to me at least. – steenhulthin Dec 4 '14 at 8:05
  • yeah that's right. – Subin Dec 4 '14 at 8:35
1

As stated previously, this defines the width of the drop-down box, as shown here in the ESRI help. This doesn't have to be a 'W'. You can use any repeated character. It does bring up the question of why not just use a numeric value where the number is equivalent to the width value in some predefined units.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.