diff options
author | Tim Angus <tim@ngus.net> | 2006-12-29 18:34:50 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-12-29 18:34:50 +0000 |
commit | 421cbbd5c614c11b244763f300140d5f8849ac63 (patch) | |
tree | d61eb2429c8125bbaf6cd53b25396b5eedd1ee09 /src/ui | |
parent | 2cbc5f0f690009765eff894f24d7623a480f7e49 (diff) |
* (bug 2926) Tesla range reduced to sphere, instead of cube
(Christophe Cavalaria <chris.cavalaria@free.fr>)
* (bug 2786) Cleanup of error message display (Martin Doucha)
* (bug 2787) Scroll-wheel support in list widgets (rasz)
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_shared.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 041ea7ec..f3132378 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -1874,7 +1874,23 @@ qboolean Item_ListBox_HandleKey(itemDef_t *item, int key, qboolean down, qboolea return qtrue; } - //TA: invoke the doubleClick handler when enter is pressed + // Scroll wheel + if (key == K_MWHEELUP) { + listPtr->startPos--; + if (listPtr->startPos < 0) { + listPtr->startPos = 0; + } + return qtrue; + } + if (key == K_MWHEELDOWN) { + listPtr->startPos++; + if (listPtr->startPos > max) { + listPtr->startPos = max; + } + return qtrue; + } + + // Invoke the doubleClick handler when enter is pressed if( key == K_ENTER ) { if( listPtr->doubleClick ) @@ -2348,7 +2364,6 @@ void Item_StopCapture(itemDef_t *item) { qboolean Item_Slider_HandleKey(itemDef_t *item, int key, qboolean down) { float x, value, width, work; - //DC->Print("slider handle key\n"); if (item->window.flags & WINDOW_HASFOCUS && item->cvar && Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) { if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) { editFieldDef_t *editDef = item->typeData; @@ -2365,9 +2380,7 @@ qboolean Item_Slider_HandleKey(itemDef_t *item, int key, qboolean down) { testRect.x = x; value = (float)SLIDER_THUMB_WIDTH / 2; testRect.x -= value; - //DC->Print("slider x: %f\n", testRect.x); testRect.w = (SLIDER_WIDTH + (float)SLIDER_THUMB_WIDTH / 2); - //DC->Print("slider w: %f\n", testRect.w); if (Rect_ContainsPoint(&testRect, DC->cursorx, DC->cursory)) { work = DC->cursorx - x; value = work / width; @@ -2381,7 +2394,6 @@ qboolean Item_Slider_HandleKey(itemDef_t *item, int key, qboolean down) { } } } - DC->Print("slider handle key exit\n"); return qfalse; } |