- pressing Enter key on numbutton increases/decreases again.

- added displist.h for proper prototype in previous commit
This commit is contained in:
2004-01-16 21:16:09 +00:00
parent d5a1b582c3
commit 24c43b835d
2 changed files with 46 additions and 46 deletions

View File

@@ -60,6 +60,7 @@
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_mesh.h" #include "BKE_mesh.h"
#include "BKE_displist.h"
#include "BIF_gl.h" #include "BIF_gl.h"
#include "BIF_interface.h" #include "BIF_interface.h"

View File

@@ -2661,63 +2661,62 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
break; break;
default: default:
if (uevent->event!=RETKEY) { /* when previous command was arrow */
but= block->buttons.first; but= block->buttons.first;
while(but) { while(but) {
but->flag &= ~UI_MOUSE_OVER;
but->flag &= ~UI_MOUSE_OVER; /* check boundbox */
if (uibut_contains_pt(but, uevent->mval)) {
/* check boundbox */ but->flag |= UI_MOUSE_OVER;
if (uibut_contains_pt(but, uevent->mval)) { UIbuttip= but;
but->flag |= UI_MOUSE_OVER; }
UIbuttip= but; /* hilite case 1 */
if(but->flag & UI_MOUSE_OVER) {
if( (but->flag & UI_ACTIVE)==0) {
but->flag |= UI_ACTIVE;
if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
} }
/* hilite case 1 */ }
if(but->flag & UI_MOUSE_OVER) { /* hilite case 2 */
if( (but->flag & UI_ACTIVE)==0) { if(but->flag & UI_ACTIVE) {
but->flag |= UI_ACTIVE; if( (but->flag & UI_MOUSE_OVER)==0) {
/* we dont clear active flag until mouse move, for Menu buttons to remain showing active item when opened */
if (uevent->event==MOUSEY) {
but->flag &= ~UI_ACTIVE;
if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but); if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but);
} }
} }
/* hilite case 2 */ else if(but->type==BLOCK || but->type==MENU) { // automatic opens block button (pulldown)
if(but->flag & UI_ACTIVE) { int time;
if( (but->flag & UI_MOUSE_OVER)==0) { if(uevent->event!=LEFTMOUSE ) {
/* we dont clear active flag until mouse move, for Menu buttons to remain showing active item when opened */ if(block->auto_open==2) time= 1; // test for toolbox
if (uevent->event==MOUSEY) { else if(block->auto_open) time= 5*U.menuthreshold2;
but->flag &= ~UI_ACTIVE; else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but); else time= -1;
for (; time>0; time--) {
if (qtest()) break;
else PIL_sleep_ms(20);
}
if(time==0) {
uevent->val= 1; // otherwise buttons dont react
ui_do_button(block, but, uevent);
} }
} }
else if(but->type==BLOCK || but->type==MENU) { // automatic opens block button (pulldown)
int time;
if(uevent->event!=LEFTMOUSE ) {
if(block->auto_open==2) time= 1; // test for toolbox
else if(block->auto_open) time= 5*U.menuthreshold2;
else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
else time= -1;
for (; time>0; time--) {
if (qtest()) break;
else PIL_sleep_ms(20);
}
if(time==0) {
uevent->val= 1; // otherwise buttons dont react
ui_do_button(block, but, uevent);
}
}
}
if(but->flag & UI_ACTIVE) active= 1;
} }
if(but->flag & UI_ACTIVE) active= 1;
but= but->next;
} }
/* if there are no active buttons... otherwise clear lines */ but= but->next;
if(active) ui_do_active_linklines(block, 0);
else ui_do_active_linklines(block, uevent->mval);
} }
/* if there are no active buttons... otherwise clear lines */
if(active) ui_do_active_linklines(block, 0);
else ui_do_active_linklines(block, uevent->mval);
} }
/* middlemouse exception, not for regular blocks */ /* middlemouse exception, not for regular blocks */