diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 667ef7440..aa64da5af 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -625,15 +625,9 @@ bool TMask_field::error_box( { build_msg(); if (mask().is_sheetmask() && !mask().is_running()) - { - xvt_dm_post_speech(_msg, 0, TRUE); - xvtil_statbar_set(_msg); - beep(2); // Error sound - } + mask().get_sheet()->error_box(_msg); else - { mask().post_error_message(_msg, 3); - } return false; } diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 548fc6dd8..8ae13bf25 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -377,7 +377,8 @@ public: void set_notify(SPREADSHEET_NOTIFY n) { _notify = n; } // @cmember aggiunge una riga - bool TSpreadsheet::add_row_auto(); + bool add_row_auto(); + bool error_box(const char * msg); // @cmember Costruttore TSpreadsheet(WINDOW parent, short dlg, short x, short y, short dx, short dy, const char* maskname, int maskno, const char* head, TSheet_field* owner); @@ -2506,6 +2507,18 @@ bool TSpreadsheet::add_row_auto() return ok; } +bool TSpreadsheet::error_box(const char * msg) +{ + _check_enabled = false; + xvt_dm_post_speech(msg, 0, TRUE); + const int r = _cur_row; + const int c = _cur_col; + ::error_box(msg); + xvt_scr_set_focus_vobj(parent()); + set_focus_cell(r, c); + _check_enabled = true; + return false; +} /////////////////////////////////////////////////////////// // TSheet_field @@ -3035,6 +3048,18 @@ void TSheet_field::set_focus_cell(int riga, int colonna) s->set_focus_cell(riga, colonna); } +void TSheet_field::set_focus_cell_id(long rec, short cid) +{ + TSpreadsheet* s = (TSpreadsheet*)_ctl; + + //qui + + const int row = s->rec2row(rec); + const int col = s->cid2col(cid); + + s->set_focus_cell(rec, col); +} + bool TSheet_field::on_key(KEY k) { if (k == K_TAB && items() > 0) @@ -3467,3 +3492,9 @@ bool TSheet_field::esporta() const return true; } +bool TSheet_field::error_box(const char * msg) +{ + TSpreadsheet& s = (TSpreadsheet&)*_ctl; + + return s.error_box(msg); +} diff --git a/include/msksheet.h b/include/msksheet.h index f7112b56a..3dca846be 100755 --- a/include/msksheet.h +++ b/include/msksheet.h @@ -100,11 +100,14 @@ protected: virtual void mask2row(int n, TToken_string & rec); // @cmember Ricopia i campi del record
-esimo nella maschera virtual void row2mask(int n, TToken_string & rec, int mode = 0x3); + // @cmember Permette di mettere il focus su una cella + void set_focus_cell(int riga, int colonna); // @access Public Member public: - // @cmember Permette di mettere il focus su una cella - void set_focus_cell(int riga, int colonna); + + // @cmember Permette di mettere il focus su una cella + void set_focus_cell_id(long rec, short cid); // @cmember Gestisce la pressione del tasto (true se la gestione ha avuto successo) virtual bool on_key(KEY k); @@ -278,6 +281,9 @@ public: bool esporta() const; + bool error_box(const char * msg); + + // @cmember Costruttore TSheet_field(TMask* m); // @cmember Distruttore