diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-02-02 20:37:46 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-02-02 20:37:46 +0000 |
| commit | 601a366b8c665f760463259552fedd7be43e5754 (patch) | |
| tree | f9d315a3bc89b502a2d7cb5508c8c5a470ab01c5 /src/widget_textfield.c | |
| parent | 6d4e1eae16b84918009625a866104ec26a234277 (diff) | |
- zvuky v hre
- hudba/zvuky sa daju zapnut/vypnut
- tuxovia nemozu ist v arene do nekonecna
- oprava chyby, ak bol zaskrknuty iba samopal, hra sa zasekla
- do widgetu textfiled sa neda pisat donekonecna
- tux ovladany pomocou keyboard_left stiriela a meni zbran
- tuxovia nemozu prechadzat cez seba
git-svn-id: http://opensvn.csie.org/tuxanci_ng@2 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/widget_textfield.c')
| -rw-r--r-- | src/widget_textfield.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widget_textfield.c b/src/widget_textfield.c index 67138fb..99b861c 100644 --- a/src/widget_textfield.c +++ b/src/widget_textfield.c @@ -109,6 +109,11 @@ static void readKey(widget_textfield_t *p) return; } + if( p->w > WIDGET_TEXTFIELD_WIDTH-40 ) + { + return; + } + //klavesy abecedy for(i=SDLK_SPACE /*SDLK_a*/;i<=SDLK_z;i++) { @@ -118,11 +123,13 @@ static void readKey(widget_textfield_t *p) p->time = WIDGET_TEXTFIELD_TIME_READ_KEY; strcat( p->text, SDL_GetKeyName(i) ); + getTextSize(p->text, &p->w, &p->h); if( mapa[SDLK_LSHIFT] == SDL_PRESSED || mapa[SDLK_RSHIFT] == SDL_PRESSED) { p->text[ strlen( p->text ) - 1 ] -= 32; + getTextSize(p->text, &p->w, &p->h); return; } } @@ -135,6 +142,7 @@ static void readKey(widget_textfield_t *p) { p->time = WIDGET_TEXTFIELD_TIME_READ_KEY; strcat( p->text, SDL_GetKeyName(i) ); + getTextSize(p->text, &p->w, &p->h); return; } } @@ -146,6 +154,7 @@ static void readKey(widget_textfield_t *p) { p->time = WIDGET_TEXTFIELD_TIME_READ_KEY; strncat( p->text, SDL_GetKeyName(i)+1, 1 ); // napr. "[4]" + getTextSize(p->text, &p->w, &p->h); return; } } |