From 727e15323c6f1a902495d9b155ddbdbfa95f2f46 Mon Sep 17 00:00:00 2001 From: oroborus Date: Thu, 17 Jul 2008 13:12:28 +0000 Subject: - maximalny pocet ID je 1 000 000 - maximalny pocet item sa nastavuje v configu MAX_ITEM ( parameter --max-item ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@152 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/widget/widget_textfield.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'src/widget/widget_textfield.c') diff --git a/src/widget/widget_textfield.c b/src/widget/widget_textfield.c index 8dd68f6..2a8a02c 100644 --- a/src/widget/widget_textfield.c +++ b/src/widget/widget_textfield.c @@ -128,7 +128,7 @@ static void checkText(widget_textfield_t *p) if( ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || - c == '-' ) + ( c == '_' || c == '-' ) ) { isDel = FALSE; } @@ -302,6 +302,22 @@ static void readKey(widget_textfield_t *p) int len; int i; + const int len_shift_map = 20; + + char shift_map[] = + { + '-', '_', + '=', '+', + '[', '{', + ']', '}', + ';', ':', + '/', '\"', + '\\', '|', + ',', '<', + '.', '>', + '/', '?' + }; + if( p->active == FALSE ) { return; @@ -321,7 +337,7 @@ static void readKey(widget_textfield_t *p) char c = '\0'; if( name == NULL )continue; - printf("name %s\n", name); + //printf("name %s\n", name); if( strlen(name) == 1 )c = name[0]; if( strlen(name) == 3 )c = name[1]; @@ -362,6 +378,23 @@ static void readKey(widget_textfield_t *p) p->text[len] = c; + if( mapa[SDLK_LSHIFT] == SDL_PRESSED || + mapa[SDLK_RSHIFT] == SDL_PRESSED) + { + int i; + + for( i = 0 ; i < len_shift_map ; i+= 2 ) + { + if( c == shift_map[i] ) + { + p->text[len] = shift_map[i+1]; + } + } + + checkText(p); + return; + } + if( mapa[SDLK_LSHIFT] == SDL_PRESSED || mapa[SDLK_RSHIFT] == SDL_PRESSED) { -- cgit v1.2.3