change char detection to use unichar and upper case so now pressing 't' or 'T'

gets you the first item that begin with 't' ot 'T'
Bug 34630
This commit is contained in:
rods%netscape.com 2000-04-19 14:57:44 +00:00
parent ad2f705153
commit 1e83686bb3
3 changed files with 11 additions and 12 deletions

View File

@ -3332,10 +3332,10 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
if (optionElement) {
nsAutoString text;
if (NS_OK == optionElement->GetText(text)) {
char * buf = text.ToNewCString();
char c = buf[0];
delete [] buf;
if (c == (char)code) {
text.ToUpperCase();
PRUnichar firstChar = text.CharAt(0);
printf("[%d][%d]\n", firstChar, (PRUnichar)code);
if (firstChar == (PRUnichar)code) {
mOldSelectedIndex = mSelectedIndex;
mSelectedIndex = selectedIndex;
SingleSelection();

View File

@ -3507,10 +3507,9 @@ nsGfxListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
if (optionElement) {
nsAutoString text;
if (NS_OK == optionElement->GetText(text)) {
char * buf = text.ToNewCString();
char c = buf[0];
delete [] buf;
if (c == (char)code) {
text.ToUpperCase();
PRUnichar firstChar = text.CharAt(0);
if (firstChar == (PRUnichar)code) {
mOldSelectedIndex = mSelectedIndex;
mSelectedIndex = selectedIndex;
SingleSelection();

View File

@ -3332,10 +3332,10 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
if (optionElement) {
nsAutoString text;
if (NS_OK == optionElement->GetText(text)) {
char * buf = text.ToNewCString();
char c = buf[0];
delete [] buf;
if (c == (char)code) {
text.ToUpperCase();
PRUnichar firstChar = text.CharAt(0);
printf("[%d][%d]\n", firstChar, (PRUnichar)code);
if (firstChar == (PRUnichar)code) {
mOldSelectedIndex = mSelectedIndex;
mSelectedIndex = selectedIndex;
SingleSelection();