Thursday, 17 March 2016

arcobjects - Why is ESRI.ArcGIS.Desktop.AddIns.ComboBox configured with a number of W's?


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


                  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?



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...