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:
guy 2008-12-03 12:09:13 +00:00
parent 0cc5a6b35f
commit 47cd76df01
3 changed files with 25 additions and 9 deletions

View File

@ -37,6 +37,7 @@ extern bool AUTOEND;
extern int TOOL_SIZE; extern int TOOL_SIZE;
extern bool TOOL_TEXT; extern bool TOOL_TEXT;
extern bool EASY_RIDER; extern bool EASY_RIDER;
extern bool ENTER_AS_TAB;
const COLOR COLOR_DKCYAN = XVT_MAKE_COLOR(0,128,128); const COLOR COLOR_DKCYAN = XVT_MAKE_COLOR(0,128,128);
const COLOR COLOR_DKYELLOW = XVT_MAKE_COLOR(128,128, 0); const COLOR COLOR_DKYELLOW = XVT_MAKE_COLOR(128,128, 0);

View File

@ -44,6 +44,7 @@ bool NATIVE_CONTROLS = false;
int TOOL_SIZE = 24; int TOOL_SIZE = 24;
bool TOOL_TEXT = false; bool TOOL_TEXT = false;
bool EASY_RIDER = true; bool EASY_RIDER = true;
bool ENTER_AS_TAB = false;
HIDDEN bool _button_blocked = false; HIDDEN bool _button_blocked = false;
HIDDEN int _last_mouse_button = 0; 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); 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); NATIVE_CONTROLS = ADVANCED_GRAPHICS && colors.get_bool("NativeControls", NULL, -1, NATIVE_CONTROLS);
xi_set_pref(XI_PREF_NATIVE_CTRLS, 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_SIZE = colors.get_int("ToolSize", NULL, -1, TOOL_SIZE);
TOOL_TEXT = colors.get_bool("ToolText", NULL, -1, TOOL_TEXT); TOOL_TEXT = colors.get_bool("ToolText", NULL, -1, TOOL_TEXT);

View File

@ -1730,17 +1730,30 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
case K_ENTER: case K_ENTER:
case K_SHIFT+K_ENTER: case K_SHIFT+K_ENTER:
{ {
const int next_rec = find_enabled_record(_cur_rec, k == K_ENTER ? +1 : -1); const int dir = k == K_ENTER ? +1 : -1;
if (next_rec >= 0) if (ENTER_AS_TAB)
{ {
dispatch_e_char(parent(), K_TAB); const int next_col = find_enabled_column(_cur_rec, _cur_col+dir, dir);
dispatch_e_char(parent(), k == K_ENTER ? K_DOWN : K_UP); if (next_col != 0 && next_col != _cur_col && ((next_col>_cur_col)^(dir < 0)))
refused = TRUE; {
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); const int next_rec = find_enabled_record(_cur_rec, dir);
refused = TRUE; 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; break;