Patch level : 10.0
Files correlati : lv* Ricompilazione Demo : [ ] Commento : Aggiunto supporto per considerare il tasto Invio come Tab nelle griglie git-svn-id: svn://10.65.10.50/trunk@17787 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0cc5a6b35f
commit
47cd76df01
@ -37,6 +37,7 @@ extern bool AUTOEND;
|
||||
extern int TOOL_SIZE;
|
||||
extern bool TOOL_TEXT;
|
||||
extern bool EASY_RIDER;
|
||||
extern bool ENTER_AS_TAB;
|
||||
|
||||
const COLOR COLOR_DKCYAN = XVT_MAKE_COLOR(0,128,128);
|
||||
const COLOR COLOR_DKYELLOW = XVT_MAKE_COLOR(128,128, 0);
|
||||
|
@ -44,6 +44,7 @@ bool NATIVE_CONTROLS = false;
|
||||
int TOOL_SIZE = 24;
|
||||
bool TOOL_TEXT = false;
|
||||
bool EASY_RIDER = true;
|
||||
bool ENTER_AS_TAB = false;
|
||||
|
||||
HIDDEN bool _button_blocked = false;
|
||||
HIDDEN int _last_mouse_button = 0;
|
||||
@ -361,6 +362,7 @@ void customize_colors()
|
||||
EASY_RIDER_COLOR = blend_colors(NORMAL_BACK_COLOR, DISABLED_BACK_COLOR, 0.5);
|
||||
NATIVE_CONTROLS = ADVANCED_GRAPHICS && colors.get_bool("NativeControls", NULL, -1, NATIVE_CONTROLS);
|
||||
xi_set_pref(XI_PREF_NATIVE_CTRLS, NATIVE_CONTROLS);
|
||||
ENTER_AS_TAB = colors.get_bool("EnterAsTab", NULL, -1, ENTER_AS_TAB);
|
||||
|
||||
TOOL_SIZE = colors.get_int("ToolSize", NULL, -1, TOOL_SIZE);
|
||||
TOOL_TEXT = colors.get_bool("ToolText", NULL, -1, TOOL_TEXT);
|
||||
|
@ -1730,19 +1730,32 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
case K_ENTER:
|
||||
case K_SHIFT+K_ENTER:
|
||||
{
|
||||
const int next_rec = find_enabled_record(_cur_rec, k == K_ENTER ? +1 : -1);
|
||||
if (next_rec >= 0)
|
||||
const int dir = k == K_ENTER ? +1 : -1;
|
||||
if (ENTER_AS_TAB)
|
||||
{
|
||||
dispatch_e_char(parent(), K_TAB);
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP);
|
||||
refused = TRUE;
|
||||
const int next_col = find_enabled_column(_cur_rec, _cur_col+dir, dir);
|
||||
if (next_col != 0 && next_col != _cur_col && ((next_col>_cur_col)^(dir < 0)))
|
||||
{
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_TAB : K_BTAB);
|
||||
refused = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!refused)
|
||||
{
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_F3 : K_F4);
|
||||
refused = TRUE;
|
||||
const int next_rec = find_enabled_record(_cur_rec, dir);
|
||||
if (next_rec >= 0)
|
||||
{
|
||||
dispatch_e_char(parent(), K_TAB);
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP);
|
||||
refused = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_e_char(parent(), k == K_ENTER ? K_F3 : K_F4);
|
||||
refused = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_ESC:
|
||||
if (xi_move_focus(get_interface()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user