Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

badders

Anfänger

  • »badders« ist der Autor dieses Themas

Beiträge: 4

Wohnort: East Kilbride

Beruf: Managing Director

  • Nachricht senden

1

Samstag, 21. August 2010, 19:47

Combo Box Auto Width

Is it possible to code a Combo Box so that it auto sizes the width to that of the Pano with the longest name?

Update: I've found this Actionscript code which seems to do what I want:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function autoWidthComboBox()
{
	var theComboBox = arguments[0];
	if(theComboBox)
	{
		var stretchTop = arguments[1] ? arguments[1] : false;
		var maxWidth = arguments[2] ? arguments[2] : Math.abs(Stage.width - theComboBox._x) - theComboBox.downArrow_mc._width;
		var currBiggestWidth = 0;
		for(i = 0; i < theComboBox.dropdown.length; i++)
		{
			theComboBox.selectedIndex = i;
			var currItemWidth = theComboBox.textField.focusTextField.textWidth;
			if(currItemWidth + theComboBox.downArrow_mc._width < maxWidth)
			{
				if(currItemWidth > currBiggestWidth)
				{
					currBiggestWidth = currItemWidth;
					trace(currBiggestWidth);
				}
			}
			else
			{
				currBiggestWidth = maxWidth;
				break;
			}
		}
		theComboBox.selectedIndex = 0;
		if(stretchTop)
		{
			theComboBox._width = currBiggestWidth + theComboBox.downArrow_mc._width;
		}
		theComboBox.dropdownWidth = currBiggestWidth + theComboBox.downArrow_mc._width;
	}
}


But this code was written in 2006 so I'm not sure if it's going to work....

Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »badders« (26. August 2010, 00:19)


badders

Anfänger

  • »badders« ist der Autor dieses Themas

Beiträge: 4

Wohnort: East Kilbride

Beruf: Managing Director

  • Nachricht senden

2

Donnerstag, 26. August 2010, 00:19

Nudge...

3

Donnerstag, 26. August 2010, 08:38

Hi,
Is it possible to code a Combo Box so that it auto sizes the width to that of the Pano with the longest name?
at the moment not, the plugin doesn't have such functionality,
but if you have Flash CS you could try add that code (a bit modified of course) to the plugin code,

e.g. add/calling it the "update_combobox_content" function,

best regards,
Klaus

badders

Anfänger

  • »badders« ist der Autor dieses Themas

Beiträge: 4

Wohnort: East Kilbride

Beruf: Managing Director

  • Nachricht senden

4

Donnerstag, 26. August 2010, 22:40

Ok thanks anyway. I'll see if I can get this code working via action script.