Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-03-11 14:22:27 +0300
committerJoshua Leung <aligorith@gmail.com>2008-03-11 14:22:27 +0300
commit51a8a60d96ac49c625787abd0406cf12cb2d3636 (patch)
tree92316ebfb055b8c9f13eb3866e26de15d1f7413a /source/blender/src/interface.c
parent294f884a7d1f61440a5d14cfa25ca2c8450f7096 (diff)
Bugfixes:
* Menus could no longer have their items accessed by number (i.e. W-5 didn't run merge tool in EditMode when accessed by keyboard). This was caused by my commit for BUTM (there was some extra code there that isn't really needed, but was causing havok). * NumPad can now be used for the above feature too now * Typo in error message in Constraints PyAPI
Diffstat (limited to 'source/blender/src/interface.c')
-rw-r--r--source/blender/src/interface.c75
1 files changed, 35 insertions, 40 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 1075937ae8b..6513a3a2a4e 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -2687,8 +2687,7 @@ static uiBlock *ui_do_but_BLOCK(uiBut *but, int event)
static int ui_do_but_BUTM(uiBut *but)
{
- int activated;
-
+ /* draw 'pushing-in' when clicked on for use as a normal button in a panel */
do {
int oflag= but->flag;
short mval[2];
@@ -2707,22 +2706,18 @@ static int ui_do_but_BUTM(uiBut *but)
PIL_sleep_ms(10);
} while (get_mbut() & L_MOUSE);
-
- activated= (but->flag & UI_SELECT);
-
- if (activated) {
- ui_set_but_val(but, but->min);
- UIafterfunc_butm= but->butm_func;
- UIafterfunc_arg1= but->butm_func_arg;
- UIafterval= but->a2;
-
- uibut_do_func(but);
- }
+
+ ui_set_but_val(but, but->min);
+ UIafterfunc_butm= but->butm_func;
+ UIafterfunc_arg1= but->butm_func_arg;
+ UIafterval= but->a2;
+
+ uibut_do_func(but);
but->flag &= ~UI_SELECT;
ui_draw_but(but);
- return activated?but->retval:0;
+ return but->retval;
}
static int ui_do_but_LABEL(uiBut *but)
@@ -4477,21 +4472,13 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
}
break;
- case PAD8: case PAD2:
case UPARROWKEY:
case DOWNARROWKEY:
if(inside || (block->flag & UI_BLOCK_LOOP)) {
/* arrowkeys: only handle for block_loop blocks */
event= 0;
- if(block->flag & UI_BLOCK_LOOP) {
+ if(block->flag & UI_BLOCK_LOOP)
event= uevent->event;
- if(event==PAD8) event= UPARROWKEY;
- if(event==PAD2) event= DOWNARROWKEY;
- }
- else {
- if(uevent->event==PAD8) event= UPARROWKEY;
- if(uevent->event==PAD2) event= DOWNARROWKEY;
- }
if(event && uevent->val) {
for(but= block->buttons.first; but; but= but->next) {
@@ -4520,7 +4507,6 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
/* nothing done */
if(but==NULL) {
-
if(event==UPARROWKEY) {
if(block->direction & UI_TOP) but= ui_but_first(block);
else but= ui_but_last(block);
@@ -4539,16 +4525,26 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
}
break;
- case ONEKEY: act= 1;
- case TWOKEY: if(act==0) act= 2;
- case THREEKEY: if(act==0) act= 3;
- case FOURKEY: if(act==0) act= 4;
- case FIVEKEY: if(act==0) act= 5;
- case SIXKEY: if(act==0) act= 6;
- case SEVENKEY: if(act==0) act= 7;
- case EIGHTKEY: if(act==0) act= 8;
- case NINEKEY: if(act==0) act= 9;
- case ZEROKEY: if(act==0) act= 10;
+ case ONEKEY: case PAD1:
+ act= 1;
+ case TWOKEY: case PAD2:
+ if(act==0) act= 2;
+ case THREEKEY: case PAD3:
+ if(act==0) act= 3;
+ case FOURKEY: case PAD4:
+ if(act==0) act= 4;
+ case FIVEKEY: case PAD5:
+ if(act==0) act= 5;
+ case SIXKEY: case PAD6:
+ if(act==0) act= 6;
+ case SEVENKEY: case PAD7:
+ if(act==0) act= 7;
+ case EIGHTKEY: case PAD8:
+ if(act==0) act= 8;
+ case NINEKEY: case PAD9:
+ if(act==0) act= 9;
+ case ZEROKEY: case PAD0:
+ if(act==0) act= 10;
if( block->flag & UI_BLOCK_NUMSELECT ) {
@@ -4758,15 +4754,14 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
if(uevent->val || (block->flag & UI_BLOCK_RET_1)==0) {
if ELEM6(uevent->event, LEFTMOUSE, PADENTER, RETKEY, BUT_ACTIVATE, BUT_NEXT, BUT_PREV) {
/* when mouse outside, don't do button */
- if(inside || uevent->event!=LEFTMOUSE) {
-
+ if(inside || uevent->event!=LEFTMOUSE) {
if ELEM(uevent->event, BUT_NEXT, BUT_PREV) {
butevent= ui_act_as_text_but(but);
uibut_do_func(but);
}
else
butevent= ui_do_button(block, but, uevent);
-
+
/* add undo pushes if... */
if( !(block->flag & UI_BLOCK_LOOP)) {
if(!G.obedit) {
@@ -4780,12 +4775,12 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit)
}
}
}
-
+
if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent);
-
+
/* i doubt about the next line! */
/* if(but->func) mywinset(block->win); */
-
+
if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK);
else
if (butevent) retval= UI_RETURN_OK;