summaryrefslogtreecommitdiff
path: root/src/widget/widget_textfield.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-17 13:12:28 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-17 13:12:28 +0000
commit727e15323c6f1a902495d9b155ddbdbfa95f2f46 (patch)
tree41d64011a95c659d7353f7f2a5cd86c1494261a5 /src/widget/widget_textfield.c
parent7efb51e2cb64a417d9d18ba0064c84abad265dad (diff)
- 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
Diffstat (limited to 'src/widget/widget_textfield.c')
-rw-r--r--src/widget/widget_textfield.c37
1 files changed, 35 insertions, 2 deletions
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];
@@ -365,6 +381,23 @@ static void readKey(widget_textfield_t *p)
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)
+ {
p->text[len] -= 32;
}