I have created some code to allow for type down capabilities in a combobox.
You need to add a property to the combobox like this.
putProperty(genreCmbo, "typeDown", "0");
Add a global variable to your class that extends thinlet.
int lastTypeDownIndex=0;
Then add this method.
public void typeDown(String value, Object choice)
{
Object[] items = getItems(choice);
lastTypeDownIndex=Integer.valueOf(getProperty(choice, "typeDown").toString()).intValue();
lastTypeDownIndex++;
if(lastTypeDownIndex>value.length())
{
lastTypeDownIndex=value.length();
putProperty(choice, "typeDown", lastTypeDownIndex+"");
}
for(int i=0; i {
String itemText = getString(items[i], "text");
try
{
if(!(itemText.substring(0,lastTypeDownIndex).equalsIgnoreCase(value)))
{
value=value.substring(0, lastTypeDownIndex);
}
if((itemText.substring(0,value.length()).equalsIgnoreCase(value)))
{
setString(choice, "text", itemText);
putProperty(choice, "typeDown", lastTypeDownIndex+"");
break;
}
else
{
setString(choice, "text", value);
putProperty(choice, "typeDown", lastTypeDownIndex+"");
}
}
catch(Exception e){}
}
}I realize that there are some small issues with it, but if you want to change it feel free.
Paul R. Johnson
Paul Johnson [fingers_magoo@mac.com]