- Fix: the MKEY 'movetolayer' option doesnt close anymore on numeric

input. Somewhere in end  NaN period this was changed... weird.

  Now you can set layers with numeric buttons, including using ALT for
  numbers larger than 10, and using SHIFT for extend-select buttons.

  for the UI diehards who like to know; when you create a menu block, you
  can provide two flags to control behaviour on keyboard input:
  UI_BLOCK_RET_1  == return on any keypress (not mouse)
  UI_BLOCK_ENTER_OK  == return on Enter key

  this was not correct in the doc/interface_API.txt , which will be fixed.
This commit is contained in:
Ton Roosendaal 2003-11-21 13:14:50 +00:00
parent 71500a2df1
commit dfc72b3f90
2 changed files with 8 additions and 4 deletions

@ -2609,10 +2609,14 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
if(count==act) {
but->flag |= UI_ACTIVE;
if(uevent->val==1) ui_draw_but(but);
else {
else if(block->flag & UI_BLOCK_RET_1) { /* to make UI_BLOCK_RET_1 working */
uevent->event= RETKEY;
uevent->val= 1; /* patch: to avoid UI_BLOCK_RET_1 type not working */
addqueue(block->winq, RIGHTARROWKEY, 1);
uevent->val= 1;
//addqueue(block->winq, RIGHTARROWKEY, 1); (why! (ton))
}
else {
uevent->event= LEFTMOUSE; /* to make sure the button is handled further on */
uevent->val= 1;
}
}
else if(but->flag & UI_ACTIVE) {

@ -1228,7 +1228,7 @@ int movetolayer_buts(unsigned int *lay)
y1= pivot[1]-sizey/2;
block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_RET_1);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK);
dx= (sizex-5)/12;
dy= sizey/2;