Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/trunk@20204 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b75d371c32
commit
aaf65e127f
@ -31,7 +31,7 @@ bool error_box(
|
||||
// @comm Se si opera in ambiente Windows crea la finestra con il bottone OK
|
||||
// e l'icona punto esclamativo.
|
||||
{
|
||||
buildmsg();
|
||||
buildmsg();
|
||||
xvt_dm_post_error(msg);
|
||||
return false;
|
||||
}
|
||||
|
@ -456,6 +456,9 @@ bool TDongle::network_login(bool test_all_keys)
|
||||
_serno = rpc_DongleNumber();
|
||||
_year_assist = rpc_DongleYear();
|
||||
ok = rpc_DongleModules(_module);
|
||||
if (ok && main_app().name() == "ba0100")
|
||||
warning_box("ATTENZIONE! Il server di protezione non e' aggiornato:\n"
|
||||
"Controllare la corretta installazione del servizio");
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
|
@ -5309,7 +5309,7 @@ TZoom_mask::TZoom_mask(const char* prompt, int width) : TAutomask(prompt, 1, wid
|
||||
|
||||
bool TZoom_field::on_key( KEY key )
|
||||
{
|
||||
static KEY __k = '\0';
|
||||
static KEY __k = 0;
|
||||
switch (key)
|
||||
{
|
||||
case K_TAB:
|
||||
@ -5324,17 +5324,17 @@ bool TZoom_field::on_key( KEY key )
|
||||
get_window_data();
|
||||
TZoom_mask m(prompt(), size());
|
||||
|
||||
if (__k)
|
||||
if (xvt_chr_is_alnum(__k))
|
||||
{
|
||||
_str << (const char)__k;
|
||||
__k = '\0';
|
||||
_str << char(__k);
|
||||
__k = char(0);
|
||||
}
|
||||
m.set(DLG_USER, _str);
|
||||
m.set(DLG_USER, _str.rtrim());
|
||||
|
||||
if (m.run() == K_ENTER && !read_only())
|
||||
{
|
||||
_str = m.get(DLG_USER);
|
||||
set_window_data(raw2win(_str));
|
||||
set_window_data(raw2win(_str.rtrim()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -5350,7 +5350,7 @@ bool TZoom_field::on_key( KEY key )
|
||||
on_key(K_F8);
|
||||
else
|
||||
{
|
||||
TSheet_field * s = mask().get_sheet();
|
||||
TSheet_field* s = mask().get_sheet();
|
||||
if (s != NULL)
|
||||
dispatch_e_char(s->mask().win(), K_F8);
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ extern "C"
|
||||
#include <xiutils.h>
|
||||
}
|
||||
|
||||
#include <colors.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
#include <controls.h>
|
||||
#include <currency.h>
|
||||
#include <diction.h>
|
||||
#include <currency.h>
|
||||
#include <diction.h>
|
||||
#include <msksheet.h>
|
||||
#include <recarray.h>
|
||||
#include <relation.h>
|
||||
@ -63,8 +63,7 @@ public:
|
||||
|
||||
TRow_property::TRow_property()
|
||||
: _back(COLOR_INVALID), _fore(COLOR_INVALID), _height(-1), _cell_prop(NULL)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void TRow_property::set(int col, COLOR back, COLOR fore)
|
||||
{
|
||||
@ -141,7 +140,7 @@ class TSpreadsheet : public TControl
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
// @cmember:(INTERNAL) costanti
|
||||
enum {MAX_COL=96};
|
||||
enum { MAX_COL=96 };
|
||||
static int ROW_NUMBER_WIDTH;
|
||||
|
||||
// @cmember:(INTERNAL) Array di TToken_strings contenenti le righe
|
||||
@ -261,7 +260,7 @@ protected:
|
||||
XI_OBJ* find_column(int col) const;
|
||||
|
||||
// @cmember Cerca le proprieta' della riga r e volendo le crea pure
|
||||
TRow_property* get_property(int r, bool create = FALSE);
|
||||
TRow_property* get_property(int r, bool create = false);
|
||||
|
||||
TSheet_field& owner() const { return (TSheet_field&)*_fld; }
|
||||
|
||||
@ -283,7 +282,7 @@ public:
|
||||
// @cmember Inserisce un record in una posizione stabilita
|
||||
int insert(int rec, bool update_sheet, bool call_notify);
|
||||
// @cmember Elimina il record <p rec>
|
||||
bool destroy(int rec = -1, bool update_sheet = TRUE);
|
||||
bool destroy(int rec = -1, bool update_sheet = true);
|
||||
// @cmember Ritorna l'array di tutte le stringhe delle righe
|
||||
TString_array& rows_array() { return _str; }
|
||||
|
||||
@ -296,9 +295,9 @@ public:
|
||||
// @cmember Abilita/disabilita tutto lo spreadsheet (vedi <mf TMask::activate>)
|
||||
void activate(bool on);
|
||||
// @cmember Permette di abilitare/disabilitare una colonna
|
||||
void enable_column(int col, bool on = TRUE);
|
||||
void enable_column(int col, bool on = true);
|
||||
// @cmember Permette di visualizzare/nascondere una colonna
|
||||
void show_column(int col, bool on = TRUE);
|
||||
void show_column(int col, bool on = true);
|
||||
// @cmember Permette di eliminare una colonna dallo spreadsheet
|
||||
void delete_column(const int col) const;
|
||||
// @cmember Permette di attivare/ disattivare l'auto append
|
||||
@ -337,7 +336,7 @@ public:
|
||||
// @cmember Setta l'altezza della riga
|
||||
void set_row_height(const int row, const int height);
|
||||
// @cmember Permette di abilitare/disabilitare una singola cella
|
||||
void enable_cell(int row, int column, bool on = TRUE);
|
||||
void enable_cell(int row, int column, bool on = true);
|
||||
// @cmember Controlla se una cella e' disabilitata
|
||||
bool cell_disabled(int row, int column) const;
|
||||
// @cmember Setta i colori di una riga
|
||||
@ -361,39 +360,32 @@ public:
|
||||
KEY edit(int n);
|
||||
|
||||
// @cmember Ritorna il numero di righe dello sheet
|
||||
int items() const
|
||||
{ return _str.items(); }
|
||||
int items() const { return _str.items(); }
|
||||
// @cmember Ritorna il record corrente
|
||||
int selected() const
|
||||
{ return _cur_rec; }
|
||||
int selected() const { return _cur_rec; }
|
||||
// @cmember Seleziona una riga dandogli il focus
|
||||
void select(int row, bool scrollto) { select(row, -1, scrollto); }
|
||||
// @cmember Seleziona una riga e una colonna dandogli il focus
|
||||
void select(int row, int col, bool scrollto);
|
||||
// @cmember Ritorna il numero di colonne presenti nello spreadsheet
|
||||
int columns() const
|
||||
{ return _columns; }
|
||||
int columns() const { return _columns; }
|
||||
|
||||
// @cmember Seleziona una riga appena possibile
|
||||
void post_select(int r);
|
||||
|
||||
// @cmember Controlla se e' stato modificato una cella dello spreadsheet
|
||||
byte dirty() const
|
||||
{ return owner().dirty(); }
|
||||
byte dirty() const { return owner().dirty(); }
|
||||
// @cmember Permette di indicare se e' stata modificata una cella dello spreadsheet
|
||||
void set_dirty(byte spork = TRUE)
|
||||
{ owner().set_dirty(spork); _row_dirty = _cell_dirty = spork!=0; }
|
||||
void set_dirty(byte spork = true) { owner().set_dirty(spork); _row_dirty = _cell_dirty = spork!=0; }
|
||||
|
||||
// @cmember Ritorna il valore della variabile active
|
||||
bool active() const
|
||||
{ return _active; }
|
||||
bool active() const { return _active; }
|
||||
|
||||
// @cmember Ritorna se e' possibile lasciare il focus dallo spreadsheet (TRUE se e' possibile)
|
||||
// @cmember Ritorna se e' possibile lasciare il focus dallo spreadsheet (true se e' possibile)
|
||||
bool test_focus_change();
|
||||
|
||||
// @cmember Setta il membro <p _notify> al valore <p n>
|
||||
void set_notify(SPREADSHEET_NOTIFY n)
|
||||
{ _notify = n; }
|
||||
void set_notify(SPREADSHEET_NOTIFY n) { _notify = n; }
|
||||
// @cmember aggiunge una riga
|
||||
bool add_row_auto();
|
||||
bool error_box(const char* msg);
|
||||
@ -408,13 +400,7 @@ int TSpreadsheet::ROW_NUMBER_WIDTH = 3;
|
||||
|
||||
KEY TSpreadsheet::barcode_newline() const
|
||||
{
|
||||
static KEY _barcode_newline = 0xFFFF;
|
||||
|
||||
if (_barcode_newline == 0xFFFF)
|
||||
{
|
||||
TConfig ini(CONFIG_INSTALL, "Main");
|
||||
_barcode_newline = ini.get_int("BarcodeNewline");
|
||||
}
|
||||
static KEY _barcode_newline = ini_get_int(CONFIG_INSTALL, "Main", "BarcodeNewline");
|
||||
return _barcode_newline;
|
||||
}
|
||||
|
||||
@ -435,7 +421,7 @@ TSpreadsheet::TSpreadsheet(
|
||||
:
|
||||
_mask(), _active(true), _notify(NULL),
|
||||
_edit_field(NULL), _cur_row(0), _cur_rec(0), _cur_col(1),
|
||||
_row_dirty(false), _cell_dirty(false), _check_enabled(TRUE),
|
||||
_row_dirty(false), _cell_dirty(false), _check_enabled(true),
|
||||
_needs_update(-1), _selection_posted(-1), _ignore_button(0), _save_columns_order(false),
|
||||
_f9_target(NULL), _auto_append(false), _first_nav_column_id(-1),
|
||||
_last_nav_column_id(-1)
|
||||
@ -540,16 +526,16 @@ TSpreadsheet::TSpreadsheet(
|
||||
XI_LIST_DEF* l = listdef->v.list;
|
||||
l->width = rct.right - rct.left;
|
||||
l->min_heading_height = xi_button_calc_height_font(xi_get_system_font()) * lines_in_header;
|
||||
l->sizable_columns = TRUE;
|
||||
l->movable_columns = TRUE;
|
||||
l->scroll_bar = TRUE;
|
||||
l->scroll_bar_button = TRUE;
|
||||
l->sizable_columns = true;
|
||||
l->movable_columns = true;
|
||||
l->scroll_bar = true;
|
||||
l->scroll_bar_button = true;
|
||||
l->fixed_columns = fixed_cols+1;
|
||||
l->active_back_color = FOCUS_BACK_COLOR;
|
||||
l->white_space_color = MASK_DARK_COLOR;
|
||||
l->rule_color = MASK_DARK_COLOR;
|
||||
#ifdef LINUX
|
||||
l->scroll_on_thumb_track = TRUE;
|
||||
l->scroll_on_thumb_track = true;
|
||||
#endif
|
||||
|
||||
// Definizione della prima colonna (numero di riga)
|
||||
@ -562,8 +548,8 @@ TSpreadsheet::TSpreadsheet(
|
||||
(char *)((attr & XI_ATR_SELECTABLE) ? "X" : ""));
|
||||
|
||||
coldef->app_data = (long)this;
|
||||
coldef->v.column->heading_platform = TRUE;
|
||||
coldef->v.column->column_platform = TRUE;
|
||||
coldef->v.column->heading_platform = true;
|
||||
coldef->v.column->column_platform = true;
|
||||
|
||||
if (attr & XI_ATR_SELECTABLE)
|
||||
{
|
||||
@ -574,7 +560,7 @@ TSpreadsheet::TSpreadsheet(
|
||||
listdef->v.list->min_heading_height = 20;
|
||||
}
|
||||
else
|
||||
coldef->v.column->center_heading = TRUE;
|
||||
coldef->v.column->center_heading = true;
|
||||
|
||||
|
||||
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
||||
@ -615,8 +601,8 @@ TSpreadsheet::TSpreadsheet(
|
||||
(char*)(const char*)testo);
|
||||
|
||||
coldef->app_data = (long)this;
|
||||
coldef->v.column->heading_platform = TRUE;
|
||||
coldef->v.column->center_heading = TRUE;
|
||||
coldef->v.column->heading_platform = true;
|
||||
coldef->v.column->center_heading = true;
|
||||
if (flags & XI_ATR_SELECTABLE)
|
||||
coldef->v.column->icon_mode = XIM_ICON_HAS_PRIORITY;
|
||||
}
|
||||
@ -641,13 +627,10 @@ TSpreadsheet::TSpreadsheet(
|
||||
}
|
||||
|
||||
TSpreadsheet::~TSpreadsheet()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
TMask& TSpreadsheet::sheet_mask() const
|
||||
{
|
||||
return ((TSpreadsheet*)this)->_mask;
|
||||
}
|
||||
{ return ((TSpreadsheet*)this)->_mask; }
|
||||
|
||||
// Converts a row number in the correspondig record number
|
||||
int TSpreadsheet::row2rec(int& row)
|
||||
@ -655,7 +638,7 @@ int TSpreadsheet::row2rec(int& row)
|
||||
int rows;
|
||||
const long* handle = xi_get_list_info(_obj, &rows);
|
||||
|
||||
if (row < 0)
|
||||
if (row < 0)
|
||||
row = 0;
|
||||
else
|
||||
{
|
||||
@ -848,7 +831,7 @@ bool TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||
{
|
||||
_cur_rec = rec;
|
||||
_cur_row = riga;
|
||||
_row_dirty = FALSE;
|
||||
_row_dirty = false;
|
||||
}
|
||||
_edit_field = col2field(_cur_col = colonna); // qui
|
||||
}
|
||||
@ -870,23 +853,23 @@ int TSpreadsheet::insert(
|
||||
// @comm Non e' possibile inserire un nuovo record nel caso nello spreadsheet vi siano
|
||||
// almeno 9999 righe oppure se lo spreadsheet non e' attivo.
|
||||
{
|
||||
static bool ininsert = FALSE;
|
||||
static bool ininsert = false;
|
||||
|
||||
// TMask & m = owner().mask(); verificare
|
||||
if (ininsert || items() >= 9999)
|
||||
return -1;
|
||||
|
||||
ininsert = TRUE;
|
||||
ininsert = true;
|
||||
int r = rec < 0 ? items() : rec;
|
||||
|
||||
bool ok = call_notify ? notify(r, K_INS) : TRUE;
|
||||
bool ok = call_notify ? notify(r, K_INS) : true;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
TToken_string* toktok = new TToken_string(80, owner().separator());
|
||||
r = _str.insert(toktok, rec);
|
||||
|
||||
_property.insert(NULL, r, TRUE); // Crea lo spazio necessario per le proprieta'
|
||||
_property.insert(NULL, r, true); // Crea lo spazio necessario per le proprieta'
|
||||
|
||||
// Notifica che l'inserimento e' terminato
|
||||
owner().post_insert(r);
|
||||
@ -905,7 +888,7 @@ int TSpreadsheet::insert(
|
||||
}
|
||||
else
|
||||
r = -1;
|
||||
ininsert = FALSE;
|
||||
ininsert = false;
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -915,8 +898,8 @@ int TSpreadsheet::insert(
|
||||
//
|
||||
// @rdesc Ritorna il risultato dell'operazione:
|
||||
//
|
||||
// @flag TRUE | Se la riga esisteve e quindi e' stata eliminata
|
||||
// @flag FALSE | Se la riga non esisteve
|
||||
// @flag true | Se la riga esisteve e quindi e' stata eliminata
|
||||
// @flag false | Se la riga non esisteve
|
||||
bool TSpreadsheet::destroy(
|
||||
int rec, // @parm Numero della riga da eliminare
|
||||
bool update_sheet) // @parm Aggiornamento visuale dell sheet
|
||||
@ -924,30 +907,30 @@ bool TSpreadsheet::destroy(
|
||||
// @comm Se il parametro <p rec> assume valore -1 vengono eliminate tutte le righe presenti
|
||||
// nello spreadsheet
|
||||
{
|
||||
static bool indestroy = FALSE;
|
||||
static bool indestroy = false;
|
||||
|
||||
if ( indestroy )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
indestroy = TRUE;
|
||||
bool ok = TRUE;
|
||||
indestroy = true;
|
||||
bool ok = true;
|
||||
|
||||
if (rec < 0)
|
||||
{
|
||||
_str.destroy();
|
||||
_property.destroy();
|
||||
set_dirty(_row_dirty = FALSE);
|
||||
set_dirty(_row_dirty = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_property.destroy(rec, TRUE); // Destroy line info
|
||||
ok = _str.destroy(rec, TRUE); // Destroy line
|
||||
_property.destroy(rec, true); // Destroy line info
|
||||
ok = _str.destroy(rec, true); // Destroy line
|
||||
}
|
||||
|
||||
if (ok && mask().is_running() && update_sheet)
|
||||
update(-1);
|
||||
|
||||
indestroy = FALSE;
|
||||
indestroy = false;
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -1035,7 +1018,7 @@ bool TSpreadsheet::off_cell_handler(XI_OBJ *cell)
|
||||
if (_edit_field != NULL)
|
||||
{
|
||||
const char* nuo = copy_cell2field(cell);
|
||||
if (_edit_field->on_key(_edit_field->is_edit() ? K_TAB : K_SPACE) == FALSE) // Test it
|
||||
if (_edit_field->on_key(_edit_field->is_edit() ? K_TAB : K_SPACE) == false) // Test it
|
||||
ok = *nuo == '\0'; // Se e' vuoto lascia stare
|
||||
else
|
||||
_cell_dirty = false;
|
||||
@ -1050,11 +1033,11 @@ bool TSpreadsheet::off_cell_handler(XI_OBJ *cell)
|
||||
|
||||
bool TSpreadsheet::test_focus_change()
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (_cell_dirty)
|
||||
ok = off_cell_handler();
|
||||
if (ok)
|
||||
ok = xi_move_focus(get_interface()) ? TRUE : FALSE;
|
||||
ok = xi_move_focus(get_interface()) ? true : false;
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -1079,7 +1062,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
xiev->v.rec_request.row_height = prop->height();
|
||||
}
|
||||
else
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
break;
|
||||
case XIE_GET_LAST:
|
||||
{
|
||||
@ -1094,7 +1077,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
const long n = xiev->v.rec_request.spec_rec + (xiev->type == XIE_GET_NEXT ? +1 : -1) ;
|
||||
if (n < 0 || n >= items())
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
else
|
||||
{
|
||||
xiev->v.rec_request.data_rec = n;
|
||||
@ -1110,7 +1093,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
const short& maxlen = xiev->v.cell_request.len;
|
||||
if (rec < 0 || rec >= items() || maxlen <= 0) // Puo' succedere: strano ma vero!
|
||||
{
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1162,7 +1145,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
const int pos = driver->dlg() - FIRST_FIELD;
|
||||
const TString4 codval = rowrec.get(pos); // Codice valuta
|
||||
const TCurrency c(r, codval, ZERO, _exchange_undefined, e->uppercase());
|
||||
src = c.string(TRUE);
|
||||
src = c.string(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1198,8 +1181,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
|
||||
if (e->has_query_button()) // Metto il bottone sulle celle attive
|
||||
{
|
||||
xiev->v.cell_request.button = TRUE;
|
||||
xiev->v.cell_request.button_on_focus = TRUE;
|
||||
xiev->v.cell_request.button = true;
|
||||
xiev->v.cell_request.button_on_focus = true;
|
||||
// Imposto l'icona della lente per ricerche normali/customizzate sui campi testo
|
||||
if (e->is_edit())
|
||||
xiev->v.cell_request.button_icon_rid = ICO_SEARCH;
|
||||
@ -1268,7 +1251,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (xiev->v.xi_obj->type == XIT_ROW)
|
||||
{
|
||||
_check_enabled = false;
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
|
||||
if (!test_focus_change())
|
||||
break;
|
||||
@ -1281,7 +1264,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
const int record = set_pos(xiev->v.select.xi_obj->v.row, _cur_col);
|
||||
if (oldrec != _cur_rec)
|
||||
{
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
|
||||
on_idle(); // Forces update delayed by str2mask
|
||||
_cur_rec = record; // Forces correct record (may be changed by on_idle!)
|
||||
@ -1304,7 +1287,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
f->on_key(K_SPACE);
|
||||
mask2str(_cur_rec);
|
||||
on_idle();
|
||||
_cell_dirty = FALSE; // Non e' necessario lasciare dirty la cella in quanto mask2str e' gia' fatta
|
||||
_cell_dirty = false; // Non e' necessario lasciare dirty la cella in quanto mask2str e' gia' fatta
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1320,14 +1303,14 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (!_row_dirty)
|
||||
{
|
||||
notify_change();
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
FOR_EACH_MASK_FIELD(sm, i, fld)
|
||||
fld->set_dirty(false);
|
||||
}
|
||||
button.on_hit();
|
||||
if (sm.dirty())
|
||||
{
|
||||
_row_dirty = TRUE;
|
||||
_row_dirty = true;
|
||||
mask2str(_cur_rec);
|
||||
}
|
||||
button.enable();
|
||||
@ -1341,7 +1324,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
case XIE_DBL_CELL:
|
||||
if (!_cell_dirty || off_cell_handler())
|
||||
{
|
||||
_check_enabled = FALSE;
|
||||
_check_enabled = false;
|
||||
|
||||
const int oldrec = _cur_rec;
|
||||
if ( xiev->v.xi_obj != NULL )
|
||||
@ -1351,29 +1334,29 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
const bool ok = set_focus_cell(cell.row, cell.column);
|
||||
if (!ok)
|
||||
{
|
||||
_check_enabled = TRUE;
|
||||
refused = TRUE;
|
||||
_check_enabled = true;
|
||||
refused = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (oldrec != _cur_rec || !_row_dirty)
|
||||
{
|
||||
_row_dirty = FALSE;
|
||||
_row_dirty = false;
|
||||
notify_change();
|
||||
_cell_dirty = FALSE;
|
||||
_cell_dirty = false;
|
||||
}
|
||||
const KEY k = edit(_cur_rec);
|
||||
if (k == K_ENTER)
|
||||
_row_dirty = TRUE;
|
||||
_row_dirty = true;
|
||||
else
|
||||
if (k == K_DEL)
|
||||
{
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
|
||||
if (_cur_rec >= items())
|
||||
{
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
_cur_rec = items()-1;
|
||||
_cur_row = 0; _cur_col = 1;
|
||||
}
|
||||
@ -1387,7 +1370,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
XI_MAKE_ROW(&row, _obj, _cur_row);
|
||||
xi_cell_request(&row);
|
||||
}
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
}
|
||||
break;
|
||||
case XIE_ON_LIST:
|
||||
@ -1413,7 +1396,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
next_rec = find_enabled_record(next_rec, next_rec >= _cur_rec ? +1 : -1);
|
||||
post_select(next_rec);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1441,14 +1424,14 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
else
|
||||
{
|
||||
_cur_row = _cur_rec = 0;
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XIE_OFF_ROW:
|
||||
if (_check_enabled)
|
||||
{
|
||||
_check_enabled = FALSE; // Avoid recursion!
|
||||
_check_enabled = false; // Avoid recursion!
|
||||
if (_row_dirty && active())
|
||||
{
|
||||
bool ok = owner().sheet_mask().check_fields();
|
||||
@ -1456,15 +1439,15 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
mask2str(_cur_rec); // Update sheet with mask contents
|
||||
ok = notify(_cur_rec, K_ENTER); // Notify edit
|
||||
_row_dirty = FALSE; // Avoid double notifications!
|
||||
_row_dirty = false; // Avoid double notifications!
|
||||
}
|
||||
if (!ok)
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
if (!refused) // Notifica l'abbandono della riga
|
||||
refused = !notify(_cur_rec, K_CTRL+K_TAB);
|
||||
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
}
|
||||
break;
|
||||
case XIE_ON_CELL:
|
||||
@ -1472,7 +1455,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
const int physical_column = xiev->v.xi_obj->v.cell.column;
|
||||
TOperable_field* f = test_field(physical_column);
|
||||
bool disabled = TRUE;
|
||||
bool disabled = true;
|
||||
if (f)
|
||||
{
|
||||
const int logical_column = (f->dlg()-FIRST_FIELD) % 100;
|
||||
@ -1484,13 +1467,13 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
const int nex = find_enabled_column(_cur_rec, physical_column, dir);
|
||||
if (nex > 0) // If at least one enabled cell exists
|
||||
set_focus_cell(_cur_row, nex);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_edit_field = f;
|
||||
_cur_col = physical_column;
|
||||
_edit_field->set_focusdirty(_cell_dirty = FALSE);
|
||||
_edit_field->set_focusdirty(_cell_dirty = false);
|
||||
|
||||
// Azzera il flag di update_pending
|
||||
//#ifdef XI_R4
|
||||
@ -1513,10 +1496,10 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
case XIE_OFF_CELL:
|
||||
if (_edit_field && _check_enabled && _cell_dirty)
|
||||
{
|
||||
_check_enabled = FALSE;
|
||||
_check_enabled = false;
|
||||
XI_OBJ* cell = xiev->v.xi_obj;
|
||||
refused = !off_cell_handler(cell);
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
}
|
||||
if (! refused)
|
||||
{
|
||||
@ -1530,12 +1513,12 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
case XIE_COL_MOVE:
|
||||
if (xiev->v.column.in_fixed ||
|
||||
xiev->v.column.col_nbr < xi_get_fixed_columns(xiev->v.column.list))
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
else
|
||||
_save_columns_order = TRUE;
|
||||
_save_columns_order = true;
|
||||
break;
|
||||
case XIE_COL_SIZE:
|
||||
_save_columns_order = TRUE;
|
||||
_save_columns_order = true;
|
||||
break;
|
||||
case XIE_GET_PERCENT:
|
||||
{
|
||||
@ -1566,7 +1549,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
switch(k)
|
||||
{
|
||||
case K_F2:
|
||||
_cell_dirty = TRUE;
|
||||
_cell_dirty = true;
|
||||
case K_F8:
|
||||
case K_F9:
|
||||
if (_f9_target != NULL)
|
||||
@ -1590,9 +1573,9 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
case K_F11:
|
||||
if (_check_enabled && active())
|
||||
{
|
||||
_check_enabled = FALSE; // Disable checks
|
||||
_check_enabled = false; // Disable checks
|
||||
notify_change();
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
|
||||
if (k == K_F9 && _edit_field->is_kind_of(CLASS_LIST_FIELD)) // list or radio
|
||||
{
|
||||
@ -1632,33 +1615,33 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
else
|
||||
set_focus_cell(_cur_row, _cur_col);
|
||||
|
||||
_check_enabled = TRUE; // Re-enable checks
|
||||
_check_enabled = true; // Re-enable checks
|
||||
}
|
||||
break;
|
||||
case K_CTRL + '-': // ********* delete line
|
||||
if (_check_enabled)
|
||||
{
|
||||
_check_enabled = FALSE; // Disable checks
|
||||
_check_enabled = false; // Disable checks
|
||||
notify_change();
|
||||
if (sheet_mask().id2pos(DLG_DELREC)>=0 &&
|
||||
sheet_mask().field(DLG_DELREC).enabled() &&
|
||||
notify(_cur_rec, K_DEL))
|
||||
{
|
||||
int rec = _cur_rec;
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
destroy(rec);
|
||||
if (rec < items())
|
||||
str2mask(rec);
|
||||
notify(rec, K_CTRL+K_DEL); // Notifica l'avvenuta cancellazione
|
||||
set_dirty(); // Setta il flag sheet modificato
|
||||
_row_dirty = _cell_dirty = FALSE; // Resetta i flag di modifica appena settati di riflesso
|
||||
_row_dirty = _cell_dirty = false; // Resetta i flag di modifica appena settati di riflesso
|
||||
if (rec >= items())
|
||||
rec = items() - 1;
|
||||
if (rec >= 0)
|
||||
select(rec, FALSE);
|
||||
select(rec, false);
|
||||
}
|
||||
refused = TRUE;
|
||||
_check_enabled = TRUE; // Re-enable checks
|
||||
refused = true;
|
||||
_check_enabled = true; // Re-enable checks
|
||||
}
|
||||
break;
|
||||
case K_CTRL + '+': // ********* insert line
|
||||
@ -1667,21 +1650,21 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
break;
|
||||
case K_CTRL + 'A':
|
||||
{
|
||||
_check_enabled = FALSE;
|
||||
_check_enabled = false;
|
||||
if (_cell_dirty)
|
||||
off_cell_handler();
|
||||
notify_change(); // CM500244
|
||||
const KEY k = edit(_cur_rec);
|
||||
if (k == K_ENTER)
|
||||
_row_dirty = TRUE;
|
||||
_row_dirty = true;
|
||||
else
|
||||
if (k == K_DEL)
|
||||
{
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
|
||||
if (_cur_rec >= items())
|
||||
{
|
||||
_row_dirty = _cell_dirty = FALSE;
|
||||
_row_dirty = _cell_dirty = false;
|
||||
_cur_rec = items()-1;
|
||||
_cur_row = 0; _cur_col = 1;
|
||||
}
|
||||
@ -1695,13 +1678,13 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
XI_MAKE_ROW(&row, _obj, _cur_row);
|
||||
xi_cell_request(&row);
|
||||
}
|
||||
_check_enabled = TRUE;
|
||||
refused = TRUE;
|
||||
_check_enabled = true;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
case K_CTRL + 'B':
|
||||
{
|
||||
_check_enabled = FALSE;
|
||||
_check_enabled = false;
|
||||
if (_cell_dirty)
|
||||
off_cell_handler();
|
||||
|
||||
@ -1718,9 +1701,9 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
mask2str(_cur_rec);
|
||||
}
|
||||
}
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
owner().highlight();
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
case K_CTRL+K_PREV:
|
||||
@ -1738,7 +1721,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
default:
|
||||
if (k > K_CTRL)
|
||||
{
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
} else
|
||||
if (_edit_field->is_kind_of(CLASS_LIST_FIELD))
|
||||
{
|
||||
@ -1756,9 +1739,9 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
XI_OBJ cell; XI_MAKE_CELL(&cell, _obj, _cur_row, _cur_col);
|
||||
xi_set_text(&cell, (char*)lst.raw2win(lst.get()));
|
||||
_cell_dirty = TRUE;
|
||||
_cell_dirty = true;
|
||||
}
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
} else
|
||||
if (is_edit_key(k))
|
||||
{
|
||||
@ -1869,7 +1852,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (xi_move_focus(get_interface()))
|
||||
{
|
||||
owner().mask().on_key(k);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
case K_CTRL + 'A':
|
||||
@ -1886,7 +1869,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
if (xi_move_focus(get_interface()))
|
||||
owner().mask().on_key(k);
|
||||
refused = TRUE;
|
||||
refused = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1978,7 +1961,7 @@ void TSpreadsheet::select(int rec, int col, bool scrollto)
|
||||
_edit_field = _cur_col > 0 ? col2field(_cur_col) : NULL;
|
||||
|
||||
str2mask(_cur_rec);
|
||||
_row_dirty = FALSE;
|
||||
_row_dirty = false;
|
||||
}
|
||||
|
||||
notify(rec, K_TAB);
|
||||
@ -2005,7 +1988,7 @@ void TSpreadsheet::on_idle()
|
||||
// if (next_row == _cur_rec)
|
||||
// return ;
|
||||
if (next_row < items())
|
||||
select(next_row, 1, FALSE);
|
||||
select(next_row, 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2076,8 +2059,8 @@ void TSpreadsheet::enable_cell(
|
||||
int column, // @parm Colonna della cella da abilitare/disabilitare (-1=tutta la riga)
|
||||
bool on) // @parm Indica l'operazione da effettuare sulla cella:
|
||||
//
|
||||
// @flag TRUE | La cella viene abilitata (default)
|
||||
// @flag FALSE| La cella viene disabilitata
|
||||
// @flag true | La cella viene abilitata (default)
|
||||
// @flag false| La cella viene disabilitata
|
||||
{
|
||||
if (column >= FIRST_FIELD)
|
||||
column = cid2index(column);
|
||||
@ -2086,7 +2069,7 @@ void TSpreadsheet::enable_cell(
|
||||
if (prop == NULL)
|
||||
{
|
||||
if (on) return; // Don't waste time and memory
|
||||
prop = get_property(row, TRUE);
|
||||
prop = get_property(row, true);
|
||||
}
|
||||
|
||||
TBit_array& ba = prop->disabled();
|
||||
@ -2148,8 +2131,8 @@ void TSpreadsheet::enable_column(
|
||||
int col, // @parm Numero della colonna da abilitare/disabilitare
|
||||
bool on) // @parm Indica l'operazione da effettuare sulla colonna:
|
||||
//
|
||||
// @flag TRUE | Abilita la colonna (default)
|
||||
// @flag FALSE| Disabilita la colonna
|
||||
// @flag true | Abilita la colonna (default)
|
||||
// @flag false| Disabilita la colonna
|
||||
{
|
||||
if (col >= FIRST_FIELD)
|
||||
col = cid2index(col);
|
||||
@ -2326,7 +2309,7 @@ void TSpreadsheet::save_columns_order() const
|
||||
TFilename parag; field2parag(owner(), parag);
|
||||
TConfig config(CONFIG_USER, parag); // Apre il file di configurazione
|
||||
|
||||
if (_save_columns_order == TRUE) // Se vale 3 devo solo resettare
|
||||
if (_save_columns_order == 1) // Se vale 3 devo solo resettare
|
||||
{
|
||||
int num;
|
||||
XI_OBJ** column = xi_get_member_list(_obj, &num);
|
||||
@ -2337,7 +2320,7 @@ void TSpreadsheet::save_columns_order() const
|
||||
RCT rct; xi_get_rect(column[i], (XinRect *) &rct);
|
||||
order << ',' << rct.right - rct.left;
|
||||
}
|
||||
config.set("Browse", order, NULL, TRUE, owner().dlg());
|
||||
config.set("Browse", order, NULL, true, owner().dlg());
|
||||
}
|
||||
else
|
||||
config.remove("Browse", owner().dlg());
|
||||
@ -2417,7 +2400,7 @@ void TSpreadsheet::set_columns_order(TToken_string* order)
|
||||
xi_column_set_pixel_width(col, width - offset);
|
||||
}
|
||||
}
|
||||
_save_columns_order = FALSE;
|
||||
_save_columns_order = false;
|
||||
}
|
||||
|
||||
if (fixed > 1)
|
||||
@ -2435,8 +2418,8 @@ void TSpreadsheet::set_columns_order(TToken_string* order)
|
||||
// @rdesc Se column e' minore di zero si considera l'intera riga
|
||||
// @rdesc Ritorna lo stato della cella indicata:
|
||||
//
|
||||
// @flag TRUE | Se la cella e' disabilitata
|
||||
// @flag FALSE| Se la cella e' abilitata
|
||||
// @flag true | Se la cella e' disabilitata
|
||||
// @flag false| Se la cella e' abilitata
|
||||
bool TSpreadsheet::cell_disabled(int row, int column) const
|
||||
{
|
||||
const TRow_property* prop = ((TSpreadsheet*)this)->get_property(row);
|
||||
@ -2612,7 +2595,7 @@ void TSheet_field::reset()
|
||||
{
|
||||
TSpreadsheet* s = (TSpreadsheet*)_ctl;
|
||||
if (s->items())
|
||||
s->select(0, FALSE);
|
||||
s->select(0, false);
|
||||
s->destroy();
|
||||
s->sheet_mask().reset();
|
||||
set_dirty(); // Reset any error (dirty = 3)
|
||||
@ -2648,7 +2631,7 @@ bool TSheet_field::parse_item(TScanner& scanner)
|
||||
{
|
||||
const char* h = dictionary_translate_header(scanner.string());
|
||||
_ctl_data._park.add(h);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (scanner.key() == "FL") // FLAGS
|
||||
{
|
||||
@ -2657,13 +2640,13 @@ bool TSheet_field::parse_item(TScanner& scanner)
|
||||
{
|
||||
switch(*f)
|
||||
{
|
||||
case 'A': _enable_autoload = TRUE; break;
|
||||
case 'I': _append = FALSE; break;
|
||||
case 'A': _enable_autoload = true; break;
|
||||
case 'I': _append = false; break;
|
||||
case '|': _separator = SAFE_PIPE_CHR; break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (scanner.key() == "US") // USE
|
||||
{
|
||||
@ -2691,13 +2674,13 @@ bool TSheet_field::parse_item(TScanner& scanner)
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "IN") // input (definisce la chiave)
|
||||
{
|
||||
parse_input(scanner);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return TLoadable_field::parse_item(scanner);
|
||||
@ -2739,7 +2722,7 @@ void TSheet_field::create(WINDOW parent)
|
||||
_ctl->show(shown());
|
||||
if (!_flags.enable_default)
|
||||
{
|
||||
_flags.enabled = TRUE; // Lo sheet e' sempre operabile anche se non editabile
|
||||
_flags.enabled = true; // Lo sheet e' sempre operabile anche se non editabile
|
||||
disable();
|
||||
}
|
||||
const TMask & s = sheet_mask();
|
||||
@ -3075,11 +3058,11 @@ bool TSheet_field::on_hit()
|
||||
if (items() > 0)
|
||||
{
|
||||
m.notify_focus_field(dlg()); // Fa' credere alla maschera che ha il focus ...
|
||||
select(0, -2, TRUE); // ... cosi' la set_focus_cell funziona bene
|
||||
select(0, -2, true); // ... cosi' la set_focus_cell funziona bene
|
||||
}
|
||||
}
|
||||
|
||||
set_dirty(FALSE);
|
||||
set_dirty(false);
|
||||
}
|
||||
const bool ok = handler(K_SPACE);
|
||||
return ok;
|
||||
@ -3137,7 +3120,7 @@ bool TSheet_field::on_key(KEY k)
|
||||
{
|
||||
TSpreadsheet* s = (TSpreadsheet*)_ctl;
|
||||
if (!s->test_focus_change())
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3148,12 +3131,11 @@ bool TSheet_field::on_key(KEY k)
|
||||
xie.type = XIE_DBL_CELL;
|
||||
xie.v.xi_obj = NULL;
|
||||
_ctl->event_handler(NULL, &xie);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if ( k== K_CTRL + '+')
|
||||
if (k == K_CTRL+'+')
|
||||
{
|
||||
TSpreadsheet* s = (TSpreadsheet*)_ctl;
|
||||
|
||||
s->add_row_auto();
|
||||
return true;
|
||||
}
|
||||
@ -3169,10 +3151,9 @@ void TSheet_field::on_idle()
|
||||
void TSheet_field::mask2row(int n, TToken_string & rec)
|
||||
{
|
||||
const TMask& m = sheet_row_mask(n);
|
||||
|
||||
rec.cut(0);
|
||||
const TSpreadsheet& s = (const TSpreadsheet&)*_ctl;
|
||||
|
||||
rec.cut(0);
|
||||
for (short id = FIRST_FIELD; id <= _last_column_id ; id++)
|
||||
{
|
||||
int pos = m.id2pos(id);
|
||||
@ -3208,24 +3189,23 @@ void TSheet_field::mask2row(int n, TToken_string & rec)
|
||||
{
|
||||
const int col = cid2index(id);
|
||||
if (!s.column_disabled(col))
|
||||
enable_cell(n, col, FALSE);
|
||||
enable_cell(n, col, false);
|
||||
}
|
||||
|
||||
if (pos < 0)
|
||||
rec.add(firstpos >= 0 ? m.fld(firstpos).get() : " ");
|
||||
}
|
||||
rec.pack();
|
||||
}
|
||||
|
||||
|
||||
// Ricopia i campi del record dato nella maschera
|
||||
void TSheet_field::row2mask(int n, TToken_string& r, int mode)
|
||||
{
|
||||
TString val(80);
|
||||
|
||||
TMask& m = sheet_row_mask(n);
|
||||
const int campi = m.fields();
|
||||
const TSpreadsheet& s = (const TSpreadsheet&)*_ctl;
|
||||
|
||||
TString val;
|
||||
for (short id = FIRST_FIELD; id <= _last_column_id; id++)
|
||||
{
|
||||
const int index = cid2index(id);
|
||||
@ -3254,7 +3234,7 @@ void TSheet_field::row2mask(int n, TToken_string& r, int mode)
|
||||
{
|
||||
if (f.has_check() && (mode & 0x1))
|
||||
f.check(STARTING_CHECK);
|
||||
f.set_dirty(FALSE);
|
||||
f.set_dirty(false);
|
||||
if (mode & 0x2)
|
||||
f.on_hit();
|
||||
}
|
||||
@ -3264,8 +3244,8 @@ void TSheet_field::row2mask(int n, TToken_string& r, int mode)
|
||||
for (int i = 0; i < campi; i++)
|
||||
{
|
||||
TMask_field& f = m.fld(i);
|
||||
if (f.dirty() == TRUE)
|
||||
f.set_dirty(FALSE);
|
||||
if (f.dirty() == 1)
|
||||
f.set_dirty(false);
|
||||
}
|
||||
|
||||
// Imposta titolo se pagina singola
|
||||
@ -3403,7 +3383,7 @@ bool TSheet_field::autoload_line(int i, const TRectype& rec)
|
||||
if (_userget)
|
||||
_userget(*this,i);
|
||||
check_row(i-1);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Certified: ...under debug..
|
||||
@ -3425,7 +3405,7 @@ bool TSheet_field::autosave_line(int i,TRectype & rec)
|
||||
// completa l'operazione con le funzioni definite dall'utente
|
||||
if (_userput)
|
||||
_userput(*this,i);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Certified: ...under debug..
|
||||
@ -3440,7 +3420,7 @@ bool TSheet_field::autoload(const TRelation& rel)
|
||||
const int last_line = _linee_rec->last_row();
|
||||
for (int i= 1; i <= last_line; i++)
|
||||
{
|
||||
autoload_line(i,_linee_rec->row(i, TRUE));
|
||||
autoload_line(i,_linee_rec->row(i, true));
|
||||
}
|
||||
|
||||
return(0);
|
||||
@ -3488,7 +3468,7 @@ bool TSheet_field::autosave(TRelation& rel)
|
||||
i--;
|
||||
for (; i >= 1; i--)
|
||||
{
|
||||
TRectype &rec = _linee_rec->row(i, TRUE);
|
||||
TRectype &rec = _linee_rec->row(i, true);
|
||||
autosave_line(i,rec);
|
||||
}
|
||||
}
|
||||
|
@ -922,9 +922,7 @@ long TFirm::get_long(const char* attr) const
|
||||
{ return atol(get(attr)); }
|
||||
|
||||
long TFirm::codice() const
|
||||
{
|
||||
return get_long(NDT_CODDITTA);
|
||||
}
|
||||
{ return get_long(NDT_CODDITTA); }
|
||||
|
||||
const TString& TFirm::codice_valuta() const
|
||||
{
|
||||
@ -935,14 +933,10 @@ const TString& TFirm::codice_valuta() const
|
||||
}
|
||||
|
||||
const TString& TFirm::ragione_sociale() const
|
||||
{
|
||||
return get(NDT_RAGSOC);
|
||||
}
|
||||
{ return get(NDT_RAGSOC); }
|
||||
|
||||
TFirm::TFirm(long code)
|
||||
{
|
||||
read(code);
|
||||
}
|
||||
{ read(code); }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TPrefix
|
||||
|
@ -1955,6 +1955,32 @@ void TToken_string::destroy(int n)
|
||||
restart();
|
||||
}
|
||||
|
||||
TToken_string& TToken_string::pack()
|
||||
{
|
||||
const char sep = separator();
|
||||
int dst = 0, last_good = -1;
|
||||
trim();
|
||||
for (int src = 0; _str[src]; src++)
|
||||
{
|
||||
if ((_str[src] == ' ' || _str[src] == '0') &&
|
||||
(_str[src+1] == sep || _str[src+1] == '\0') &&
|
||||
(src == 0 || _str[src-1] == sep))
|
||||
{
|
||||
// Ignore empty item
|
||||
}
|
||||
else
|
||||
{
|
||||
if (src > dst)
|
||||
_str[dst] = _str[src];
|
||||
if (_str[src] != sep)
|
||||
last_good = dst;
|
||||
dst++;
|
||||
}
|
||||
}
|
||||
cut(last_good+1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TAuto_token_string
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -625,6 +625,8 @@ public:
|
||||
int items() const;
|
||||
// @cmember Controlla se tutti i token sono nulli
|
||||
bool empty_items() const;
|
||||
// @cmember Compatta tutti i campi " " in ""
|
||||
TToken_string& pack();
|
||||
};
|
||||
|
||||
#define FOR_EACH_TOKEN(__tok, __str) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user