diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 6bd6fa4c3..36591d038 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -1800,7 +1800,7 @@ bool TBrowse::check(CheckTime t) _cursor->setkey(); _cursor->file().read(_isequal); passed = _cursor->ok(); - + if (t != FINAL_CHECK) { if (passed) @@ -1822,17 +1822,29 @@ bool TBrowse::check(CheckTime t) } } } + else + { + if (chk == CHECK_SEARCH) + passed = TRUE; + } } else - if (t != FINAL_CHECK) do_clear(); + { + if (chk == CHECK_SEARCH) + passed = TRUE; + else + { + if (t != FINAL_CHECK) + do_clear(); + } + } } return passed; } bool TBrowse::empty_check() { - if ( field().mask().query_mode() || _fld->check_type() == CHECK_NONE || - _fld->check_type() == CHECK_NORMAL) + if (field().mask().query_mode() || _fld->check_type() != CHECK_REQUIRED) return TRUE; else return do_input() > 0; @@ -2288,7 +2300,7 @@ bool TEdit_field::on_key(KEY key) if (!ok) { if (_warning.not_empty()) - error_box(_warning); + default_error_box(); return FALSE; } @@ -2330,7 +2342,7 @@ bool TEdit_field::on_key(KEY key) if (!ok) { if (_warning.not_empty()) - error_box(_warning); + default_error_box(); return FALSE; } diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 1cced8f26..74d20952e 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -979,7 +979,7 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev) if (_check_enabled) { _check_enabled = FALSE; // Avoid recursion! - if (_row_dirty) + if (_row_dirty && active()) { bool ok = sheet_mask().check_fields(); if (ok) @@ -1429,9 +1429,7 @@ void TSpreadsheet::mask2str(int rec) { if (_needs_update >= 0) { -#ifdef DBG - warning_box("Double update: %d and %d", _needs_update, rec); -#endif + // Double update! update_rec(_needs_update); } _needs_update = rec; @@ -1537,7 +1535,7 @@ void TSpreadsheet::swap_columns(const int fromid, const int toid) const int from_pos = 0; int to_pos = 0; - for (int c = 1; c < num; c++) + for (int c = num-1; c > 0; c--) { XI_OBJ* column = columns[c]; if (column->cid == fromid) @@ -1551,9 +1549,9 @@ void TSpreadsheet::swap_columns(const int fromid, const int toid) const to_pos = c; }; } - + CHECKD(from_pos, "Can't swap column ", fromid); + CHECKD(to_pos, "Can't swap column ", toid); xi_move_column(from_column, to_pos); - if (to_pos < from_pos) from_pos++; xi_move_column(to_column, from_pos); #endif } diff --git a/include/tokens.h b/include/tokens.h index e3dc6b281..6534a3fe5 100755 --- a/include/tokens.h +++ b/include/tokens.h @@ -37,6 +37,7 @@ #define PROMPT PR #define RADIOBUTTON RA #define RUN RU +#define SEARCH SE #define SELECT SE #define STRING ST #define SHEET SH