Patch level : 10.0
Files correlati : ve0.exe Ricompilazione Demo : [ ] Commento : 0001556: Documenti interattivi Se inserisco una descrizione del tipo : Programma Campo modulo Effetti canone di manut. prova1 prova2 prova3 prova4 prova5 prova6 la prima volte che faccio F8 dopo aver registrato vengono persi alcuni caratteri in mezzo git-svn-id: svn://10.65.10.50/trunk@20118 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
104b3f56b9
commit
9e59e97970
@ -98,14 +98,13 @@ void TAdvanced_property_sheet::edit()
|
||||
if (n.exist())
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (n.ends_with(".msk"), true)
|
||||
if (n.ends_with(".msk", true) || n.ends_with(".ini", true))
|
||||
{
|
||||
n.insert("notepad ");
|
||||
xvt_sys_execute(n, FALSE, FALSE);
|
||||
}
|
||||
else
|
||||
} else
|
||||
#endif
|
||||
xvt_sys_goto_url(n, "open");
|
||||
xvt_sys_goto_url(n, "open");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,8 +198,8 @@ bool TAssoc_array::add(
|
||||
bool TAssoc_array::add(const char* key, const TObject& obj, bool force)
|
||||
{
|
||||
// Non inserire l'Hash_object se non lo trovi (ci pensa la add sotto)
|
||||
bool isnew = FALSE;
|
||||
_lookup(key,isnew,FALSE);
|
||||
bool isnew = false;
|
||||
_lookup(key,isnew,false);
|
||||
if (!isnew && !force)
|
||||
return true;
|
||||
return add(key,obj.dup(),force);
|
||||
@ -366,6 +366,27 @@ int TAssoc_array::get_keys(TString_array& kl, bool add_values)
|
||||
restart();
|
||||
return kl.items();
|
||||
}
|
||||
|
||||
const TString& TAssoc_array::get_str(const char* key) const
|
||||
{
|
||||
bool isnew = false;
|
||||
THash_object* o = ((TAssoc_array *)this)->_lookup(key,isnew);
|
||||
if (o != NULL && o->obj().is_kind_of(CLASS_STRING))
|
||||
return (const TString&)o->obj();
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
|
||||
bool TAssoc_array::get_bool(const char* key) const
|
||||
{
|
||||
const TString& str = get_str(key);
|
||||
return str.full() && strchr("1XY", str[0]) != NULL;
|
||||
}
|
||||
|
||||
int TAssoc_array::get_int(const char* key) const
|
||||
{
|
||||
const TString& str = get_str(key);
|
||||
return str.full() ? atoi(str) : 0;
|
||||
}
|
||||
|
||||
// @doc INTERNAL
|
||||
|
||||
|
@ -134,9 +134,13 @@ public:
|
||||
TObject* get();
|
||||
// @cmember Ritorna l'oggetto e la relativa chiave
|
||||
THash_object* get_hashobj();
|
||||
|
||||
bool get_bool(const char* key) const;
|
||||
int get_int(const char* key) const;
|
||||
const TString& get_str(const char* key) const;
|
||||
|
||||
// @cmember Mette chiavi e opzionalmente valori (come stringa) nel <c TString_array> passato
|
||||
int get_keys(TString_array& kl, bool add_values = FALSE);
|
||||
int get_keys(TString_array& kl, bool add_values = false);
|
||||
// @cmember Operatore di assegnamento tra array associativi
|
||||
TAssoc_array& operator= (const TAssoc_array & a)
|
||||
{ return copy(a); }
|
||||
|
@ -387,7 +387,7 @@ int TConfig::get_int(
|
||||
bool TConfig::get_bool(
|
||||
const char* var, // @parm Variabile della quale ritornare il valore
|
||||
const char* section, // @parm Sezione della varaibile (default NULL)
|
||||
int index, // @parm Eventuale indice della varaibailie (default -1)
|
||||
int index, // @parm Eventuale indice della variabile (default -1)
|
||||
bool def) // @parm Valore default della varaibile (default FALSE)
|
||||
|
||||
// @comm Viene chiamata la funzione <mf TConfig::get>.
|
||||
@ -398,10 +398,14 @@ bool TConfig::get_bool(
|
||||
// @xref <mf TConfig::get> <mf TConfig::get_long> <mf TConfig::get_int>
|
||||
// <mf TConfig::get_color>
|
||||
{
|
||||
const char* d = def ? "X" : "";
|
||||
TString& s = (TString&)get(var, section, index, d);
|
||||
s.upper();
|
||||
return s != "" && (s == "X" || s == "Y" || s == "1" || s == "ON" || s == "YES" || s == "OK" || s == "TRUE");
|
||||
bool yes = false;
|
||||
TString& s = (TString&)get(var, section, index, def ? "X" : "");
|
||||
if (s.full())
|
||||
{
|
||||
s.upper();
|
||||
yes = s == "X" || s == "Y" || s == "1" || s == "ON" || s == "YES" || s == "OK" || s == "TRUE";
|
||||
}
|
||||
return yes;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
@ -317,7 +317,7 @@ HIDDEN XI_BITMAP* get_background_bitmap(bool reload)
|
||||
if (bmp != NULL && bmp != XI_INVALID_BITMAP)
|
||||
xi_bitmap_destroy(bmp);
|
||||
bmp = NULL;
|
||||
if (ADVANCED_GRAPHICS && !NATIVE_CONTROLS)
|
||||
if (ADVANCED_GRAPHICS && !xi_get_pref(XI_PREF_NATIVE_CTRLS))
|
||||
{
|
||||
TFilename back = ini_get_string(CONFIG_GUI, "Colors", "Tile");
|
||||
if (back.custom_path())
|
||||
@ -361,10 +361,10 @@ void customize_colors()
|
||||
ADVANCED_GRAPHICS = colors.get_bool("AdvancedGraphics", NULL, -1, ADVANCED_GRAPHICS);
|
||||
EASY_RIDER = colors.get_bool("EasyRider", NULL, -1, EASY_RIDER);
|
||||
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);
|
||||
NATIVE_CONTROLS = colors.get_bool("NativeControls", NULL, -1, NATIVE_CONTROLS);
|
||||
xi_set_pref(XI_PREF_NATIVE_CTRLS, ADVANCED_GRAPHICS && NATIVE_CONTROLS);
|
||||
ENTER_AS_TAB = colors.get_bool("EnterAsTab", NULL, -1, ENTER_AS_TAB);
|
||||
ANIMATED_BOXES = ADVANCED_GRAPHICS && is_power_reseller() && colors.get_bool("AnimatedBoxes", NULL, -1, ANIMATED_BOXES);
|
||||
ANIMATED_BOXES = is_power_reseller() && colors.get_bool("AnimatedBoxes", NULL, -1, ANIMATED_BOXES);
|
||||
|
||||
TOOL_SIZE = colors.get_int("ToolSize", NULL, -1, TOOL_SIZE);
|
||||
TOOL_TEXT = colors.get_bool("ToolText", NULL, -1, TOOL_TEXT);
|
||||
@ -400,12 +400,14 @@ void customize_colors()
|
||||
xvtil_load_default_font(); // Aggiorna anche il font!
|
||||
}
|
||||
|
||||
static bool campi_scavati() { return CAMPI_SCAVATI && ADVANCED_GRAPHICS; }
|
||||
|
||||
void init_controls()
|
||||
{
|
||||
xi_set_font_id(xvtil_load_default_font());
|
||||
|
||||
xi_set_pref(XI_PREF_NATIVE_CTRLS, NATIVE_CONTROLS);
|
||||
xi_set_pref(XI_PREF_3D_LOOK, CAMPI_SCAVATI);
|
||||
xi_set_pref(XI_PREF_NATIVE_CTRLS, NATIVE_CONTROLS && ADVANCED_GRAPHICS);
|
||||
xi_set_pref(XI_PREF_3D_LOOK, campi_scavati());
|
||||
xi_set_pref(XI_PREF_CARET_WIDTH, 2);
|
||||
xi_set_pref(XI_PREF_COMBO_ICON, ICO_COMBO);
|
||||
xi_set_pref(XI_PREF_OPTIMIZE_CELL_REQUESTS, TRUE);
|
||||
@ -1245,10 +1247,10 @@ TGroupbox_control::TGroupbox_control(WINDOW win, short cid,
|
||||
if (erre)
|
||||
change_attrib(XI_ATR_RJUST, false, _obj); // Toglie l'erroneo allineamento a destra del titolo
|
||||
|
||||
if (CAMPI_SCAVATI)
|
||||
if (campi_scavati())
|
||||
def->v.rect->well = erre; // Mette eventualmente in rilievo il rettangolo
|
||||
else
|
||||
def->v.rect->ridge = true; // Angoli arrotondati in caso di stile piatto (!CAMPI_SCAVATI)
|
||||
def->v.rect->ridge = true; // Angoli arrotondati in caso di stile piatto
|
||||
|
||||
_rct = xi_create(itf, def);
|
||||
CHECKD(_rct, "Can't create Groupbox_control ", cid);
|
||||
@ -1323,7 +1325,7 @@ void TField_control::create(WINDOW win, short cid,
|
||||
attrib |= XI_ATR_AUTOSELECT;
|
||||
if (AUTOEND)
|
||||
attrib |= XI_AGA_ATR_AUTOEND;
|
||||
if (!CAMPI_SCAVATI)
|
||||
if (!campi_scavati())
|
||||
attrib |= XI_ATR_BORDER;
|
||||
if (maxlen > width)
|
||||
attrib |= XI_ATR_AUTOSCROLL;
|
||||
@ -1340,7 +1342,7 @@ void TField_control::create(WINDOW win, short cid,
|
||||
XI_FIELD_DEF* f = def->v.field;
|
||||
if (big || bold)
|
||||
f->font_id = xvtil_default_font(bold, big);
|
||||
f->well = CAMPI_SCAVATI;
|
||||
f->well = campi_scavati();
|
||||
f->active_back_color = FOCUS_BACK_COLOR;
|
||||
|
||||
if (height == 1)
|
||||
@ -1381,7 +1383,7 @@ void TField_control::create(WINDOW win, short cid,
|
||||
const int offset = stx->rct.right - br.left - 1;
|
||||
br.left += offset;
|
||||
br.right += offset;
|
||||
br.top = stx->rct.top + (CAMPI_SCAVATI ? 1 : 0);
|
||||
br.top = stx->rct.top + (campi_scavati() ? 1 : 0);
|
||||
br.bottom = stx->rct.bottom;
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ bool TGolem_window::on_key(KEY k)
|
||||
|
||||
if (!file.blank() && file.exist())
|
||||
{
|
||||
const TString16 ext = file.ext();
|
||||
TString16 ext = file.ext(); ext.upper();
|
||||
if (ext != "BMP")
|
||||
{
|
||||
TFilename cmd;
|
||||
@ -617,9 +617,9 @@ bool TGolem_window::on_key(KEY k)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!cmd.exist())
|
||||
if (cmd.blank() || !cmd.exist())
|
||||
xvt_sys_find_editor(file, cmd.get_buffer());
|
||||
if (cmd.not_empty())
|
||||
if (cmd.full())
|
||||
{
|
||||
cmd << ' ' << file;
|
||||
_last_handle = xvt_sys_execute_in_window(cmd, win());
|
||||
@ -645,7 +645,7 @@ long TGolem_window::handler(WINDOW win, EVENT* ep)
|
||||
{
|
||||
#ifdef WIN32 // verificare
|
||||
HDROP hdrop = (HDROP)(DWORD)ep->v.user.ptr;
|
||||
const int num_files = DragQueryFile(hdrop, -1, NULL, 0); // Numero totale di files
|
||||
const int num_files = ::DragQueryFile(hdrop, -1, NULL, 0); // Numero totale di files
|
||||
|
||||
TToken_string file_list(driver()->get(), '\n');
|
||||
TFilename fname; // File corrente
|
||||
|
@ -922,8 +922,8 @@ long TMask::handler(WINDOW w, EVENT* ep)
|
||||
rct.left += 2; rct.right -= 2; rct.bottom -= 2;
|
||||
DRAW_CTOOLS dct;
|
||||
xvt_dwin_get_draw_ctools(w, &dct);
|
||||
dct.fore_color = FOCUS_COLOR;
|
||||
dct.back_color = FOCUS_BACK_COLOR;
|
||||
dct.fore_color = MASK_BACK_COLOR;
|
||||
dct.back_color = PROMPT_COLOR;
|
||||
dct.opaque_text = TRUE;
|
||||
xvt_dwin_set_draw_ctools(w, &dct);
|
||||
//xvt_dwin_set_font(w, DEF_FONT);
|
||||
@ -931,7 +931,6 @@ long TMask::handler(WINDOW w, EVENT* ep)
|
||||
const char* text = "Custom";
|
||||
const int tw = xvt_dwin_get_text_width(w, text, -1);
|
||||
xvt_dwin_draw_text(w, rct.left, rct.bottom, text, -1);
|
||||
xvt_dwin_draw_text(w, (rct.right-rct.left-tw)/2, rct.bottom, text, -1);
|
||||
xvt_dwin_draw_text(w, rct.right-tw, rct.bottom, text, -1);
|
||||
}
|
||||
}
|
||||
@ -1853,7 +1852,6 @@ void TMask::on_firm_change()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TMask::on_idle()
|
||||
{
|
||||
if (_focus >= 0 && _focus < fields())
|
||||
@ -1875,7 +1873,7 @@ void TMask::on_idle()
|
||||
const int es = _error_severity; // Memorizzo per azzerare subito
|
||||
_error_severity = 0;
|
||||
set_focus();
|
||||
if (ANIMATED_BOXES)
|
||||
if (ADVANCED_GRAPHICS && ANIMATED_BOXES)
|
||||
{
|
||||
switch(es)
|
||||
{
|
||||
@ -1899,8 +1897,7 @@ void TMask::on_idle()
|
||||
const TOperable_field & f = focus_field();
|
||||
if (_last_test != f.dlg())
|
||||
{
|
||||
TEditable_field & e = (TEditable_field &) field(_test_fld);
|
||||
|
||||
TEditable_field & e = (TEditable_field &)field(_test_fld);
|
||||
if (!f.in_key(0) || !e.has_a_common_key(f))
|
||||
{
|
||||
e.test_key_complete(false);
|
||||
|
@ -35,10 +35,10 @@ HIDDEN void smart_trim(
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 1: s.ltrim(); break;
|
||||
case 2: s.rtrim(); break;
|
||||
case 3: s.trim(); break;
|
||||
default: break;
|
||||
case 1: s.ltrim(); break;
|
||||
case 2: s.rtrim(); break;
|
||||
case 3: s.trim(); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,18 +49,18 @@ HIDDEN void smart_trim(
|
||||
// Certified 100%
|
||||
TMask_field::TField_Flags::TField_Flags()
|
||||
{
|
||||
automagic = persistent = FALSE;
|
||||
enabled = enable_default = TRUE;
|
||||
shown = show_default = TRUE;
|
||||
uppercase = rightjust = FALSE;
|
||||
zerofilled = button = FALSE;
|
||||
dirty = focusdirty = FALSE;
|
||||
roman = read_only = FALSE;
|
||||
firm = ghost = FALSE;
|
||||
password = FALSE;
|
||||
automagic = persistent = false;
|
||||
enabled = enable_default = true;
|
||||
shown = show_default = true;
|
||||
uppercase = rightjust = false;
|
||||
zerofilled = button = false;
|
||||
dirty = focusdirty = false;
|
||||
roman = read_only = false;
|
||||
firm = ghost = false;
|
||||
password = false;
|
||||
trim = 3;
|
||||
pipeallowed = FALSE;
|
||||
user = FALSE;
|
||||
pipeallowed = false;
|
||||
user = false;
|
||||
}
|
||||
|
||||
// Certified 100%
|
||||
@ -199,7 +199,6 @@ void TMask_field::TControl_data::reset()
|
||||
_park.cut(0);
|
||||
}
|
||||
|
||||
|
||||
void TMask_field::update_flags(const char* f, bool reset)
|
||||
{
|
||||
_flags.update(f, reset);
|
||||
@ -420,7 +419,7 @@ bool TMask_field::parse_item(TScanner& scanner)
|
||||
_ctl_data._x = scanner.integer();
|
||||
_ctl_data._y = scanner.integer();
|
||||
_ctl_data._prompt = dictionary_translate_prompt(scanner.string(), is_editable() ? 0 : -1);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "FL") // FLAGS
|
||||
@ -428,7 +427,7 @@ bool TMask_field::parse_item(TScanner& scanner)
|
||||
const char* f = scanner.string();
|
||||
if (_flags.update(f) == '\0')
|
||||
_ctl_data._flags << f;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "GR")
|
||||
@ -437,12 +436,12 @@ bool TMask_field::parse_item(TScanner& scanner)
|
||||
_groups = new TBit_array;
|
||||
_groups->set(scanner.line());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
NFCHECK("'%s' Token non riconosciuto nel campo %d: %s",
|
||||
(const char*)scanner.token(), (int)dlg(), (const char*)_ctl_data._prompt);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Certified 100%
|
||||
@ -471,8 +470,8 @@ void TMask_field::set_rect(const RCT& r)
|
||||
void TMask_field::enable(
|
||||
bool on) // @parm Operazione da svolgere:
|
||||
//
|
||||
// @flag TRUE | Abilita il campo (default)
|
||||
// @flag FALSE | Disabilita il campo
|
||||
// @flag true | Abilita il campo (default)
|
||||
// @flag false | Disabilita il campo
|
||||
{
|
||||
_flags.enabled = on;
|
||||
}
|
||||
@ -493,8 +492,8 @@ void TMask_field::enable_default()
|
||||
void TMask_field::show(
|
||||
bool on) // @parm Operazione da svolgere:
|
||||
//
|
||||
// @flag TRUE | Rendere visibile il campo (default)
|
||||
// @flag FALSE | Rendere invisibile il campo
|
||||
// @flag true | Rendere visibile il campo (default)
|
||||
// @flag false | Rendere invisibile il campo
|
||||
{
|
||||
if (_ctl)
|
||||
{
|
||||
@ -523,7 +522,7 @@ void TMask_field::set_dirty(byte d)
|
||||
{
|
||||
if (_flags.dirty == 3)
|
||||
{
|
||||
if (d == FALSE) // Non permette di annullare il dirty dei campi errati
|
||||
if (d == false) // Non permette di annullare il dirty dei campi errati
|
||||
return;
|
||||
}
|
||||
#ifdef DBG
|
||||
@ -632,11 +631,11 @@ const TString & TMask_field::evaluate_field(const char * s) const
|
||||
//
|
||||
// @rdesc Ritorna il risultato:
|
||||
//
|
||||
// @flag TRUE | Se il campo e' da sottoporre a check
|
||||
// @flag FALSE | Se il campo non e' da sottoporre check
|
||||
// @flag true | Se il campo e' da sottoporre a check
|
||||
// @flag false | Se il campo non e' da sottoporre check
|
||||
bool TMask_field::to_check(
|
||||
KEY k, // @parm Tasto da passare al campo come simulazione di inizio controllo
|
||||
bool checkrun) const // @parm Permette di ritornare TRUE se la maschera e' in start_run() mode
|
||||
bool checkrun) const // @parm Permette di ritornare true se la maschera e' in start_run() mode
|
||||
{
|
||||
bool yes = (k == K_TAB && focusdirty()) || (k == K_ENTER && dirty());
|
||||
|
||||
@ -682,7 +681,7 @@ vsprintf(_msg,fmt,argptr);va_end(argptr)
|
||||
|
||||
// @mfunc Crea una error-box relativo al campo (chiama <f error_box>)
|
||||
//
|
||||
// @rdesc Ritorna sempre FALSE
|
||||
// @rdesc Ritorna sempre false
|
||||
bool TMask_field::error_box(
|
||||
const char* fmt, // @parm Formato della stringa da scrivere
|
||||
...) const // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
||||
@ -711,7 +710,7 @@ bool TMask_field::message_box(const char* fmt, ...) const
|
||||
|
||||
// @mfunc Crea una warning-box relativo al campo (chiama <f warning_box>)
|
||||
//
|
||||
// @rdesc Ritorna sempre FALSE
|
||||
// @rdesc Ritorna sempre false
|
||||
bool TMask_field::warning_box(
|
||||
const char* fmt, // @parm Formato della stringa da scrivere
|
||||
...) const // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
|
||||
@ -723,7 +722,7 @@ bool TMask_field::warning_box(
|
||||
|
||||
if (mask().is_sheetmask() && !mask().is_running())
|
||||
{
|
||||
xvt_dm_post_speech(_msg, 1, TRUE);
|
||||
xvt_dm_post_speech(_msg, 1, true);
|
||||
xvtil_statbar_set(_msg);
|
||||
beep(1);
|
||||
}
|
||||
@ -731,7 +730,7 @@ bool TMask_field::warning_box(
|
||||
{
|
||||
mask().post_error_message(_msg, 2);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TMask_field::yesno_box(const char* fmt, ...) const
|
||||
@ -782,7 +781,7 @@ word TGroup_field::class_id() const
|
||||
|
||||
TGroup_field::TGroup_field(TMask* mask) : TMask_field(mask)
|
||||
{
|
||||
_flags.persistent = TRUE;
|
||||
_flags.persistent = true;
|
||||
}
|
||||
|
||||
// _size means _heigth
|
||||
@ -1024,7 +1023,7 @@ bool TOperable_field::do_message(int num)
|
||||
|
||||
TToken_string* mess = message(num);
|
||||
if (mess == NULL || mess->empty())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
TToken_string msg(16, ',');
|
||||
TString256 value;
|
||||
@ -1040,7 +1039,7 @@ bool TOperable_field::do_message(int num)
|
||||
if (isalpha(value[0])) // binary search
|
||||
{
|
||||
int f = 0, l = MAX_CMD-1;
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
cmd = (f+l)>>1;
|
||||
const int cmp = strcmp(value, commands[cmd]);
|
||||
@ -1075,7 +1074,7 @@ bool TOperable_field::do_message(int num)
|
||||
else switch (cmd)
|
||||
{
|
||||
case 0:
|
||||
modify_list(TRUE, mask().field(fld), msg);
|
||||
modify_list(true, mask().field(fld), msg);
|
||||
continue;
|
||||
case 1:
|
||||
mask().field(fld).set_dirty();
|
||||
@ -1088,7 +1087,7 @@ bool TOperable_field::do_message(int num)
|
||||
case 3:
|
||||
value = copy_value(msg, get()); break;
|
||||
case 4:
|
||||
modify_list(FALSE, mask().field(fld), msg); continue;
|
||||
modify_list(false, mask().field(fld), msg); continue;
|
||||
case 5:
|
||||
mask().field(fld).set_dirty(); continue;
|
||||
case 6:
|
||||
@ -1156,7 +1155,7 @@ bool TOperable_field::do_message(int num)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TOperable_field::highlight() const
|
||||
@ -1329,7 +1328,7 @@ void TButton_field::create(WINDOW parent)
|
||||
|
||||
bool TButton_field::on_key(KEY key)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (key == K_SPACE)
|
||||
{
|
||||
if (dlg() != DLG_CANCEL && dlg() != DLG_QUIT)
|
||||
@ -1344,7 +1343,7 @@ bool TButton_field::on_key(KEY key)
|
||||
{
|
||||
TString str = prompt();
|
||||
str.strip("~");
|
||||
xvt_dm_post_speech(str, 7, TRUE);
|
||||
xvt_dm_post_speech(str, 7, true);
|
||||
}
|
||||
|
||||
ok = on_hit();
|
||||
@ -1506,7 +1505,7 @@ bool TEditable_field::parse_item(TScanner& scanner)
|
||||
if (k == "FI") // FIELD
|
||||
{
|
||||
set_field(scanner.line());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (k == "KE") // KEY
|
||||
@ -1515,7 +1514,7 @@ bool TEditable_field::parse_item(TScanner& scanner)
|
||||
_keys = new TBit_array;
|
||||
_keys->set(scanner.line());
|
||||
_keys->set(0L);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (k == "DR") // DRIVENBY
|
||||
@ -1526,7 +1525,7 @@ bool TEditable_field::parse_item(TScanner& scanner)
|
||||
const short id = atoi(tok);
|
||||
add_driver(id);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (k == "CU") // CUSTOM DATA
|
||||
@ -1535,7 +1534,7 @@ bool TEditable_field::parse_item(TScanner& scanner)
|
||||
_userdata = new TToken_string(scanner.string());
|
||||
else
|
||||
_userdata->add(scanner.string());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "VA")
|
||||
@ -1576,14 +1575,14 @@ bool TEditable_field::parse_item(TScanner& scanner)
|
||||
_validate->_parms.add(scanner.operand());
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "WA")
|
||||
{
|
||||
const char* msg = dictionary_translate(scanner.string());
|
||||
set_warning(msg);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return TLoadable_field::parse_item(scanner);
|
||||
@ -1613,7 +1612,7 @@ word TEditable_field::first_key() const
|
||||
const int last = last_key();
|
||||
int i;
|
||||
for (i = 1; i <= last; i++)
|
||||
if (in_key(i) == TRUE)
|
||||
if (in_key(i) == true)
|
||||
break;
|
||||
return (word)i;
|
||||
}
|
||||
@ -1624,8 +1623,8 @@ bool TEditable_field::has_a_common_key(const TMask_field & f) const
|
||||
const int last = last_key();
|
||||
for (int i = 1; i <= last; i++)
|
||||
if (in_key(i) && f.in_key(i))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TEditable_field::test_key_complete(bool normal) const
|
||||
@ -1636,9 +1635,9 @@ bool TEditable_field::test_key_complete(bool normal) const
|
||||
if (in_key(k) && m.key_valid(k))
|
||||
{
|
||||
bool complete = true;
|
||||
for (TEditable_field* e = m.get_key_field(k, TRUE); e; e = m.get_key_field(k, FALSE))
|
||||
for (TEditable_field* e = m.get_key_field(k, true); e; e = m.get_key_field(k, false))
|
||||
{
|
||||
e->set_focusdirty(FALSE);
|
||||
e->set_focusdirty(false);
|
||||
if (e->is_edit())
|
||||
complete &= e->required();
|
||||
}
|
||||
@ -1672,8 +1671,8 @@ void TEditable_field::reset_key(byte key)
|
||||
//
|
||||
// @rdesc Ritorna il risultato dell funzione di validazione:
|
||||
//
|
||||
// @flag TRUE | Se la validata ha avuto successo
|
||||
// @flag FALSE | Se la validata no ha avuto successo
|
||||
// @flag true | Se la validata ha avuto successo
|
||||
// @flag false | Se la validata no ha avuto successo
|
||||
bool TEditable_field::validate(
|
||||
KEY k) // @parm Tasto da passare alla funzione di validazione
|
||||
{
|
||||
@ -1858,8 +1857,8 @@ bool TBoolean_field::parse_item(TScanner& scanner)
|
||||
{
|
||||
if (scanner.key() == "ME")
|
||||
{
|
||||
const bool tf = scanner.integer() != 0; // Message TRUE or FALSE
|
||||
TToken_string* ts = message(tf, TRUE);
|
||||
const bool tf = scanner.integer() != 0; // Message true or false
|
||||
TToken_string* ts = message(tf, true);
|
||||
ts->add(scanner.line().strip_spaces());
|
||||
return true;
|
||||
}
|
||||
@ -1886,18 +1885,18 @@ bool TBoolean_field::on_key(KEY key)
|
||||
get_window_data();
|
||||
set_dirty();
|
||||
on_hit();
|
||||
return TRUE;
|
||||
return true;
|
||||
case K_F2:
|
||||
if (!read_only())
|
||||
{
|
||||
set("");
|
||||
set_dirty();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
default:
|
||||
return TEditable_field::on_key(key);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -2114,7 +2113,7 @@ bool TList_sheet::check(CheckTime t)
|
||||
{
|
||||
switch(field().check_type())
|
||||
{
|
||||
case CHECK_SEARCH: passed = TRUE; break;
|
||||
case CHECK_SEARCH: passed = true; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@ -2130,7 +2129,7 @@ bool TList_sheet::check(CheckTime t)
|
||||
TBrowse::TBrowse(TEdit_field* f, TRelation* r, int key, const char* filter)
|
||||
: TBrowse_button(f),
|
||||
_relation(r), _cursor(new TCursor (r, "", key)),
|
||||
_filter(filter), _secondary(FALSE),
|
||||
_filter(filter), _secondary(false),
|
||||
_custom_filter_handler(NULL)
|
||||
{}
|
||||
|
||||
@ -2138,7 +2137,7 @@ TBrowse::TBrowse(TEdit_field* f, TRelation* r, int key, const char* filter)
|
||||
// Certified 100%
|
||||
TBrowse::TBrowse(TEdit_field* f, TCursor* c)
|
||||
: TBrowse_button(f),
|
||||
_relation(NULL), _cursor(c), _secondary(FALSE),
|
||||
_relation(NULL), _cursor(c), _secondary(false),
|
||||
_custom_filter_handler(NULL)
|
||||
{}
|
||||
|
||||
@ -2198,7 +2197,7 @@ void TBrowse::parse_output(TScanner& scanner)
|
||||
_out_id.add(s);
|
||||
s = scanner.pop();
|
||||
_out_fn.add(s);
|
||||
_secondary = FALSE;
|
||||
_secondary = false;
|
||||
}
|
||||
|
||||
|
||||
@ -2211,19 +2210,19 @@ bool TBrowse::parse_copy(const TString& what, const TBrowse& b)
|
||||
_filter = b.get_filter();
|
||||
if (!field().has_warning() && b.field().has_warning())
|
||||
field().set_warning(b.field().get_warning());
|
||||
if (!all) return TRUE;
|
||||
if (!all) return true;
|
||||
}
|
||||
if (all || what == "IN")
|
||||
{
|
||||
_inp_id = b._inp_id;
|
||||
_inp_fn = b._inp_fn;
|
||||
if (!all) return TRUE;
|
||||
if (!all) return true;
|
||||
}
|
||||
if (all || what == "DI")
|
||||
{
|
||||
_head = b._head;
|
||||
_items = b._items;
|
||||
if (!all) return TRUE;
|
||||
if (!all) return true;
|
||||
}
|
||||
if (all || what == "OU")
|
||||
{
|
||||
@ -2231,7 +2230,7 @@ bool TBrowse::parse_copy(const TString& what, const TBrowse& b)
|
||||
_out_fn = b._out_fn;
|
||||
_secondary = b.field().has_check();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -2424,7 +2423,7 @@ int TBrowse::do_input(
|
||||
return ne;
|
||||
|
||||
TString work(_filter.size());
|
||||
bool filter_update = FALSE;
|
||||
bool filter_update = false;
|
||||
|
||||
for (int i = 0; _filter[i]; i++)
|
||||
{
|
||||
@ -2543,7 +2542,7 @@ void TBrowse::do_output(CheckTime t)
|
||||
}
|
||||
}
|
||||
|
||||
bool hit = FALSE;
|
||||
bool hit = false;
|
||||
if (master)
|
||||
{
|
||||
f.set(sum);
|
||||
@ -2555,7 +2554,7 @@ void TBrowse::do_output(CheckTime t)
|
||||
{
|
||||
f.set(sum);
|
||||
s_checked.set(id);
|
||||
hit = TRUE;
|
||||
hit = true;
|
||||
}
|
||||
}
|
||||
spotted.set(id, hit);
|
||||
@ -2616,13 +2615,13 @@ void TBrowse::do_clear(CheckTime t)
|
||||
|
||||
bool TBrowse::do_link(bool insert)
|
||||
{
|
||||
bool ok = FALSE;
|
||||
bool ok = false;
|
||||
TString app;
|
||||
|
||||
if (_insert[0] == 'M')
|
||||
{
|
||||
TString nm(_insert.mid(1));
|
||||
if (nm.compare("tb", 2, TRUE) == 0) // Programma gestione tabelle
|
||||
if (nm.compare("tb", 2, true) == 0) // Programma gestione tabelle
|
||||
_cursor->file().get_relapp(app);
|
||||
else // Programma generico di browse/edit
|
||||
app.format("ba3 -3 %s %d", (const char*)nm, _cursor->file().num());
|
||||
@ -2736,7 +2735,7 @@ TToken_string& TBrowse::create_siblings(TToken_string& siblings)
|
||||
|
||||
// Considera ricerche sullo stesso file ma con chiave diversa
|
||||
if (c->file().num() == _cursor->file().num() &&
|
||||
(key[c->key()] == FALSE || id == field().dlg()))
|
||||
(key[c->key()] == false || id == field().dlg()))
|
||||
{
|
||||
fn = _out_fn.get(n); // Legge nome del campo su file
|
||||
int pos = _items.get_pos(fn); // Determina header corrispondente
|
||||
@ -2769,7 +2768,7 @@ KEY TBrowse::run()
|
||||
{
|
||||
begin_wait();
|
||||
|
||||
do_input(TRUE);
|
||||
do_input(true);
|
||||
_cursor->read(_isgteq);
|
||||
|
||||
TString caption = _cursor->file().description();
|
||||
@ -2795,10 +2794,10 @@ KEY TBrowse::run()
|
||||
if (_insert[0] == 'M' || _insert[0] == 'R')
|
||||
{
|
||||
const TString& maskname = field().mask().source_file();
|
||||
if (maskname.mid(2,2).compare("tb", 2, TRUE) == 0 && field().in_key(0))
|
||||
if (maskname.mid(2,2).compare("tb", 2, true) == 0 && field().in_key(0))
|
||||
{
|
||||
const char* tabname = _cursor->file().name();
|
||||
if (maskname.mid(4, 3).compare(tabname, 3, TRUE) == 0)
|
||||
if (maskname.mid(4, 3).compare(tabname, 3, true) == 0)
|
||||
buttons = 0;
|
||||
}
|
||||
}
|
||||
@ -2834,10 +2833,10 @@ KEY TBrowse::run()
|
||||
break;
|
||||
case K_CTRL+'G':
|
||||
*_cursor = selected;
|
||||
k = do_link(FALSE) ? K_ENTER : K_ESC;
|
||||
k = do_link(false) ? K_ENTER : K_ESC;
|
||||
break;
|
||||
case K_INS:
|
||||
k = do_link(TRUE) ? K_ENTER : K_ESC;
|
||||
k = do_link(true) ? K_ENTER : K_ESC;
|
||||
break;
|
||||
case K_ENTER:
|
||||
*_cursor = selected;
|
||||
@ -2879,10 +2878,10 @@ void TBrowse::set_cursor(TCursor * c)
|
||||
|
||||
bool TBrowse::check(CheckTime t)
|
||||
{
|
||||
bool passed = TRUE;
|
||||
bool passed = true;
|
||||
|
||||
if (_secondary == TRUE && t != RUNNING_CHECK)
|
||||
return TRUE;
|
||||
if (_secondary == true && t != RUNNING_CHECK)
|
||||
return true;
|
||||
|
||||
CheckType chk = field().check_type();
|
||||
if (chk != CHECK_NONE)
|
||||
@ -2891,7 +2890,7 @@ bool TBrowse::check(CheckTime t)
|
||||
if (chk == CHECK_REQUIRED && (t == STARTING_CHECK || mode == MODE_QUERY))
|
||||
chk = CHECK_NORMAL;
|
||||
|
||||
const int ne = do_input(TRUE);
|
||||
const int ne = do_input(true);
|
||||
if (ne || chk == CHECK_REQUIRED)
|
||||
{
|
||||
passed = _cursor->test() == NOERR;
|
||||
@ -2909,7 +2908,7 @@ bool TBrowse::check(CheckTime t)
|
||||
{
|
||||
if (chk == CHECK_SEARCH)
|
||||
{
|
||||
passed = TRUE;
|
||||
passed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2922,13 +2921,13 @@ bool TBrowse::check(CheckTime t)
|
||||
else
|
||||
{
|
||||
if (chk == CHECK_SEARCH)
|
||||
passed = TRUE;
|
||||
passed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (chk == CHECK_SEARCH)
|
||||
passed = TRUE;
|
||||
passed = true;
|
||||
else
|
||||
{
|
||||
if (t != FINAL_CHECK)
|
||||
@ -2942,7 +2941,7 @@ bool TBrowse::check(CheckTime t)
|
||||
bool TBrowse::empty_check()
|
||||
{
|
||||
if (field().mask().query_mode() || field().check_type() != CHECK_REQUIRED)
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return do_input() > 0;
|
||||
}
|
||||
@ -3076,7 +3075,7 @@ HIDDEN int get_profile_desc(TConfig& cfg, void* jolly)
|
||||
str->add(cfg.get("Description"));
|
||||
p.add(str);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int TProfile_select::get_descriptions(TString_array& a) const
|
||||
@ -3101,7 +3100,7 @@ KEY TProfile_select::run()
|
||||
TMask& m = field().mask();
|
||||
TFilename profname; m.make_profile_name(profname);
|
||||
|
||||
bool running = TRUE;
|
||||
bool running = true;
|
||||
KEY key;
|
||||
while (running)
|
||||
{
|
||||
@ -3122,7 +3121,7 @@ KEY TProfile_select::run()
|
||||
const int num = p.row().get_int(0);
|
||||
TString16 para; para << m.load_profile(num);
|
||||
prompt.set(p.row().get(1));
|
||||
running = FALSE;
|
||||
running = false;
|
||||
}
|
||||
break;
|
||||
case K_CTRL+'r':
|
||||
@ -3134,7 +3133,7 @@ KEY TProfile_select::run()
|
||||
{
|
||||
const int num = p.row().get_int(0);
|
||||
m.save_profile(num, name);
|
||||
running = FALSE;
|
||||
running = false;
|
||||
}
|
||||
else
|
||||
error_box("Esiste gia' un profilo di nome\n%s",
|
||||
@ -3152,7 +3151,7 @@ KEY TProfile_select::run()
|
||||
{
|
||||
TString16 para; para << m.save_profile(-1, name);
|
||||
field().set(name);
|
||||
running = FALSE;
|
||||
running = false;
|
||||
}
|
||||
else
|
||||
error_box("Esiste gia' un profilo di nome\n%s",
|
||||
@ -3173,7 +3172,7 @@ KEY TProfile_select::run()
|
||||
}
|
||||
break;
|
||||
default:
|
||||
running = FALSE;
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3222,7 +3221,7 @@ bool TProfile_select::check(CheckTime ct)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -3275,7 +3274,7 @@ bool TReport_select::check(CheckTime ct)
|
||||
|
||||
TEdit_field::TEdit_field(TMask* mask)
|
||||
: TEditable_field(mask), _check(CHECK_NONE),
|
||||
_forced(FALSE), _check_enabled(FALSE), _browse(NULL)
|
||||
_forced(false), _check_enabled(false), _browse(NULL)
|
||||
{ }
|
||||
|
||||
TEdit_field::~TEdit_field()
|
||||
@ -3358,7 +3357,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
if (scanner.key() == "PI") // PICTURE
|
||||
{
|
||||
_picture = scanner.string();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "CH")
|
||||
@ -3366,10 +3365,10 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
const TString& ct = scanner.popkey();
|
||||
if (ct == "NO") _check = CHECK_NORMAL; else
|
||||
if (ct == "RE") _check = CHECK_REQUIRED; else
|
||||
if (ct == "FO") { _check = CHECK_REQUIRED; _forced = TRUE; } else
|
||||
if (ct == "FO") { _check = CHECK_REQUIRED; _forced = true; } else
|
||||
if (ct == "SE") _check = CHECK_SEARCH;
|
||||
else _check = CHECK_NONE;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "US") // USE
|
||||
@ -3445,7 +3444,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
tablename.insert("MTB", 0);
|
||||
browse()->set_insert(tablename);
|
||||
}
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3454,7 +3453,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
scanner.push();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "CO") // Copyuse
|
||||
@ -3473,7 +3472,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
|
||||
if (_browse)
|
||||
{
|
||||
_check_enabled = TRUE;
|
||||
_check_enabled = true;
|
||||
return browse()->parse_copy(what, *b);
|
||||
}
|
||||
}
|
||||
@ -3488,8 +3487,8 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
NFCHECK("SHEET duplicato nel campo %d", _ctl_data._dlg);
|
||||
#endif
|
||||
_browse = new TList_sheet(this, _ctl_data._prompt, scanner.string());
|
||||
_check_enabled = TRUE;
|
||||
return TRUE;
|
||||
_check_enabled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "FS") // FSELECT
|
||||
@ -3520,7 +3519,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
else
|
||||
#endif
|
||||
sheet()->parse_item(scanner);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "IN")
|
||||
@ -3529,7 +3528,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
_browse->parse_input(scanner);
|
||||
else
|
||||
scanner.line();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "DI")
|
||||
@ -3538,7 +3537,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
browse()->parse_display(scanner);
|
||||
else
|
||||
scanner.line();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "OU")
|
||||
@ -3547,7 +3546,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
_browse->parse_output(scanner);
|
||||
else
|
||||
scanner.line();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "AD")
|
||||
@ -3556,7 +3555,7 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
browse()->parse_insert(scanner);
|
||||
else
|
||||
scanner.line();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (scanner.key() == "ME")
|
||||
@ -3569,8 +3568,8 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
||||
l.ltrim();
|
||||
m = 1;
|
||||
}
|
||||
message(m, TRUE)->add(l);
|
||||
return TRUE;
|
||||
message(m, true)->add(l);
|
||||
return true;
|
||||
}
|
||||
|
||||
return TEditable_field::parse_item(scanner);
|
||||
@ -3776,7 +3775,7 @@ bool TEdit_field::on_hit()
|
||||
|
||||
// @mfunc Mostra un messaggio di errore di default per il campo
|
||||
//
|
||||
// @rdesc Ritorna sempre FALSE
|
||||
// @rdesc Ritorna sempre false
|
||||
bool TEdit_field::default_error_box() const
|
||||
|
||||
// @comm Se il campo non possiede un warning particolare chiama la <f error_box>
|
||||
@ -3797,7 +3796,7 @@ bool TEdit_field::default_error_box() const
|
||||
}
|
||||
else
|
||||
error_box(get_warning());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TEdit_field::autosave(TRelation& r)
|
||||
@ -3814,7 +3813,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
switch(key)
|
||||
{
|
||||
case K_CTRL+K_TAB:
|
||||
set_focusdirty(FALSE);
|
||||
set_focusdirty(false);
|
||||
break;
|
||||
case K_TAB:
|
||||
/*
|
||||
@ -3822,7 +3821,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
set_focusdirty(); // Forza validate
|
||||
*/
|
||||
|
||||
if (to_check(K_TAB, TRUE))
|
||||
if (to_check(K_TAB, true))
|
||||
{
|
||||
if (class_id() == CLASS_EDIT_FIELD) // Altrimenti l'ha gia' fatto
|
||||
{
|
||||
@ -3835,7 +3834,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
{
|
||||
if (has_warning())
|
||||
default_error_box();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
TMask& m = mask();
|
||||
@ -3865,14 +3864,14 @@ bool TEdit_field::on_key(KEY key)
|
||||
else
|
||||
{
|
||||
if (vuoto)
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
else
|
||||
default_error_box();
|
||||
}
|
||||
|
||||
if (ok)
|
||||
{
|
||||
set_focusdirty(FALSE);
|
||||
set_focusdirty(false);
|
||||
if (query && m.is_running() && in_key(0))
|
||||
test_key_complete();
|
||||
}
|
||||
@ -3898,7 +3897,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
{
|
||||
if (has_warning())
|
||||
default_error_box();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mask().query_mode() /* || forced() */)
|
||||
@ -3944,7 +3943,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
|
||||
set_dirty();
|
||||
// Controlla i validate che non vengono fatti da on_hit
|
||||
@ -3966,12 +3965,12 @@ bool TEdit_field::on_key(KEY key)
|
||||
TMask & m = mask();
|
||||
if (m.is_running())
|
||||
{
|
||||
set_focusdirty(FALSE); // Evita doppia esecuzione handlers!
|
||||
set_focusdirty(false); // Evita doppia esecuzione handlers!
|
||||
if (m.query_mode() && in_key(0))
|
||||
test_key_complete();
|
||||
if (m.is_running())
|
||||
{
|
||||
set_focusdirty(FALSE);
|
||||
set_focusdirty(false);
|
||||
send_key(K_TAB, 0); // Passa al campo successivo
|
||||
}
|
||||
}
|
||||
@ -3979,7 +3978,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
return ok;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (_browse == NULL && has_button())
|
||||
@ -4000,7 +3999,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
return true;
|
||||
break;
|
||||
case K_CTRL+K_SPACE:
|
||||
set_dirty(TRUE);
|
||||
set_dirty(true);
|
||||
return handler(K_SPACE);
|
||||
default:
|
||||
break;
|
||||
@ -4012,11 +4011,11 @@ bool TEdit_field::on_key(KEY key)
|
||||
// @mfunc Controlla se il campo ha la necessita' di eseguire una ricerca sul cursore o
|
||||
// sulla tabella associata al momento della sua inizializzazione
|
||||
//
|
||||
// @rdesc Ritorna TRUE se il campo ha un TArray_sheet associato oppure un TCursor_sheet
|
||||
// @rdesc Ritorna true se il campo ha un TArray_sheet associato oppure un TCursor_sheet
|
||||
// con check_type non nullo.
|
||||
bool TEdit_field::has_check() const
|
||||
{
|
||||
bool ok = FALSE;
|
||||
bool ok = false;
|
||||
if (_browse)
|
||||
ok = browse() == NULL || check_type() != CHECK_NONE;
|
||||
return ok;
|
||||
@ -4024,7 +4023,7 @@ bool TEdit_field::has_check() const
|
||||
|
||||
bool TEdit_field::check(CheckTime t)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (check_enabled() || (t == STARTING_CHECK && shown()))
|
||||
{
|
||||
if (_browse && validate_func() != 21)
|
||||
@ -4052,8 +4051,8 @@ void TEdit_field::enable(bool on)
|
||||
void TEdit_field::enable_check(
|
||||
bool on) // @parm Operazione da svolgere
|
||||
//
|
||||
// @flag TRUE | Abilita il check del campo (default)
|
||||
// @flag FALSE | Disabilita il check del campo
|
||||
// @flag true | Abilita il check del campo (default)
|
||||
// @flag false | Disabilita il check del campo
|
||||
{
|
||||
_check_enabled = on;
|
||||
((TField_control*)_ctl)->show_button(on && active());
|
||||
@ -4153,7 +4152,7 @@ const char* TDate_field::win2raw(
|
||||
}
|
||||
else
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
TDate g(TODAY);
|
||||
s.upper();
|
||||
if (s[0] == 'I') // "IERI"
|
||||
@ -4197,7 +4196,7 @@ const char* TDate_field::win2raw(
|
||||
g.set_day(31);
|
||||
} else
|
||||
if (s[0] != 'O') // s != "OGGI"
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
if (ok)
|
||||
s = g.string();
|
||||
}
|
||||
@ -4234,7 +4233,7 @@ bool TDate_field::on_key(KEY key)
|
||||
if (!TDate::isdate(data))
|
||||
{
|
||||
error_box("Data errata o formato non valido");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
set_window_data(data);
|
||||
@ -4282,9 +4281,9 @@ bool TDate_field::autosave(TRelation& r)
|
||||
td = d.string(ANSI);
|
||||
}
|
||||
field()->write(td, r);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -4334,7 +4333,7 @@ bool TReal_field::parse_item(TScanner& scanner)
|
||||
_decimals = _picture.len() - comma - 1;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return TEdit_field::parse_item(scanner);
|
||||
@ -4402,7 +4401,7 @@ bool TReal_field::on_key(KEY key)
|
||||
{
|
||||
if (_ctl->is_edit_key(key))
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
switch (key)
|
||||
{
|
||||
case '.':
|
||||
@ -4626,7 +4625,7 @@ const char* TCurrency_field::raw2win(const char* data) const
|
||||
TCurrency cur(num, value, ZERO, _exchange_undefined, price);
|
||||
|
||||
TString& s = _ctl_data._park;
|
||||
s = cur.string(TRUE);
|
||||
s = cur.string(true);
|
||||
const int extra = s.len() - size();
|
||||
if (extra > 0) s.ltrim(extra);
|
||||
|
||||
@ -4638,12 +4637,12 @@ const char* TCurrency_field::win2raw(const char* data) const
|
||||
TString& str = _ctl_data._park;
|
||||
str = data;
|
||||
str.strip("."); str.replace(',', '.');
|
||||
bool is_formula = FALSE;
|
||||
bool is_formula = false;
|
||||
for (int i = 0; str[i]; i++)
|
||||
{
|
||||
if (strchr("0123456789.", str[i]) == NULL)
|
||||
{
|
||||
is_formula = TRUE;
|
||||
is_formula = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4651,7 +4650,7 @@ const char* TCurrency_field::win2raw(const char* data) const
|
||||
real num;
|
||||
if (is_formula)
|
||||
{
|
||||
TExpression e(str, _numexpr, TRUE);
|
||||
TExpression e(str, _numexpr, true);
|
||||
for (int i = e.numvar()-1; i >= 0; i--)
|
||||
{
|
||||
TMask_field* f = mask().find_by_fieldname(e.varname(i));
|
||||
@ -4686,7 +4685,7 @@ bool TCurrency_field::on_key(KEY key)
|
||||
{
|
||||
if (_ctl->is_edit_key(key))
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
switch (key)
|
||||
{
|
||||
case '-':
|
||||
@ -4768,7 +4767,7 @@ void TList_field::read_item(TScanner& scanner)
|
||||
while (scanner.popkey() == "ME")
|
||||
ts.add(scanner.line().strip_spaces());
|
||||
scanner.push();
|
||||
*message(-1, TRUE) = ts;
|
||||
*message(-1, true) = ts;
|
||||
}
|
||||
|
||||
void TList_field::parse_head(TScanner& scanner)
|
||||
@ -4862,7 +4861,7 @@ void TList_field::add_list()
|
||||
_values.add(vsafe);
|
||||
if (message(0))
|
||||
{
|
||||
*message(_codes.items()-1, TRUE) = *message(0);
|
||||
*message(_codes.items()-1, true) = *message(0);
|
||||
message(0)->cut(0);
|
||||
}
|
||||
}
|
||||
@ -5061,7 +5060,7 @@ bool TList_field::on_key(KEY key)
|
||||
switch(key)
|
||||
{
|
||||
case K_CTRL+K_TAB:
|
||||
set_focusdirty(FALSE);
|
||||
set_focusdirty(false);
|
||||
break;
|
||||
case K_SPACE:
|
||||
get_window_data();
|
||||
@ -5072,9 +5071,9 @@ bool TList_field::on_key(KEY key)
|
||||
current(0);
|
||||
break;
|
||||
default:
|
||||
if (to_check(key, TRUE) || key == K_ENTER)
|
||||
if (to_check(key, true) || key == K_ENTER)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool ok = true;
|
||||
if (validate_func() >= 0)
|
||||
{
|
||||
ok = validate(key);
|
||||
@ -5365,13 +5364,10 @@ bool TZoom_field::on_key( KEY key )
|
||||
// Certified 100%
|
||||
// Aggiusta un valore letto da file in formato RAW
|
||||
const char* TZoom_field::reformat(const char* data) const
|
||||
{
|
||||
return data;
|
||||
}
|
||||
{ return data; }
|
||||
|
||||
const char* TZoom_field::raw2win(const char* data) const
|
||||
{
|
||||
/* Ufficio complicazione affari semplici ai suoi massimi livelli d'espressione
|
||||
TFixed_string str(data);
|
||||
int a_capo = str.find('\n');
|
||||
|
||||
@ -5383,9 +5379,6 @@ const char* TZoom_field::raw2win(const char* data) const
|
||||
_ctl_data._park = str;
|
||||
str[a_capo] = c;
|
||||
return _ctl_data._park;
|
||||
*/
|
||||
TParagraph_string instr(data, size());
|
||||
return instr.get(0);
|
||||
}
|
||||
|
||||
const char* TZoom_field::win2raw(const char* data) const
|
||||
|
@ -2563,7 +2563,7 @@ bool TSpreadsheet::error_box(const char* msg)
|
||||
const int r = _cur_row;
|
||||
const int c = _cur_col;
|
||||
|
||||
if (ANIMATED_BOXES)
|
||||
if (ADVANCED_GRAPHICS && ANIMATED_BOXES)
|
||||
xvt_dm_popup_error(msg);
|
||||
else
|
||||
xvt_dm_post_error(msg);
|
||||
|
@ -7,83 +7,51 @@
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
const char* TObject::class_name() const
|
||||
{
|
||||
return "Object";
|
||||
}
|
||||
{ return "Object"; }
|
||||
|
||||
word TObject::class_id() const
|
||||
{
|
||||
return CLASS_OBJECT;
|
||||
}
|
||||
{ return CLASS_OBJECT; }
|
||||
|
||||
bool TObject::is_kind_of(word cid) const
|
||||
{
|
||||
return cid == CLASS_OBJECT;
|
||||
}
|
||||
|
||||
{ return cid == CLASS_OBJECT; }
|
||||
|
||||
bool TObject::ok() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
{ return true; }
|
||||
|
||||
TObject* TObject::dup() const
|
||||
|
||||
{
|
||||
CHECK(FALSE, "Can't duplicate an Object");
|
||||
CHECK(false, "Can't duplicate an Object");
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
||||
void TObject::print_on(ostream& out) const
|
||||
|
||||
{
|
||||
out << class_name();
|
||||
}
|
||||
|
||||
{ out << class_name(); }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Error Object
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
const char* TError_Object::class_name() const
|
||||
{
|
||||
return "Error_Object";
|
||||
}
|
||||
|
||||
{ return "Error_Object"; }
|
||||
|
||||
word TError_Object::class_id() const
|
||||
{
|
||||
return CLASS_ERROR;
|
||||
}
|
||||
{ return CLASS_ERROR; }
|
||||
|
||||
bool TError_Object::is_kind_of(word cid) const
|
||||
{
|
||||
return cid == CLASS_ERROR || TObject::is_kind_of(cid);
|
||||
}
|
||||
{ return cid == CLASS_ERROR || TObject::is_kind_of(cid); }
|
||||
|
||||
bool TError_Object::ok() const
|
||||
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
{ return false; }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Sortable
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
const char* TSortable::class_name() const
|
||||
{
|
||||
return "Sortable";
|
||||
}
|
||||
{ return "Sortable"; }
|
||||
|
||||
word TSortable::class_id() const
|
||||
{
|
||||
return CLASS_SORTABLE;
|
||||
}
|
||||
{ return CLASS_SORTABLE; }
|
||||
|
||||
bool TSortable::is_kind_of(word cid) const
|
||||
{
|
||||
return cid == CLASS_SORTABLE || TObject::is_kind_of(cid);
|
||||
}
|
||||
{ return cid == CLASS_SORTABLE || TObject::is_kind_of(cid); }
|
||||
|
@ -1858,10 +1858,11 @@ void TRelation_application::ini2mask(TConfig& ini, TMask& m, bool query)
|
||||
|
||||
void TRelation_application::edit_mask2ini()
|
||||
{
|
||||
if (_trans_ini.row(_trans_counter).not_empty())
|
||||
const TString& str = _trans_ini.row(_trans_counter);
|
||||
if (str.full())
|
||||
{
|
||||
TString8 head; head.format("%d", get_relation()->lfile().num());
|
||||
TConfig ini(_trans_ini.row(_trans_counter), head);
|
||||
TConfig ini(str, head);
|
||||
mask2ini(*_mask, ini);
|
||||
}
|
||||
}
|
||||
|
@ -301,6 +301,9 @@ const char* TString::class_name() const
|
||||
word TString::class_id() const
|
||||
{ return CLASS_STRING; }
|
||||
|
||||
bool TString::is_kind_of(word cid) const
|
||||
{ return cid == CLASS_STRING || TObject::is_kind_of(cid); }
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @mfunc Duplica una stringa
|
||||
|
@ -55,6 +55,8 @@ public:
|
||||
virtual const char* class_name() const;
|
||||
// @cmember Ritorna l'identificatore della classe
|
||||
virtual word class_id() const;
|
||||
// @cmember Controlla l'appartenenza ad una classe
|
||||
virtual bool is_kind_of(word cid) const;
|
||||
// @cmember Controlla se si tratta di una stringa valida (diversa da NULL)
|
||||
virtual bool ok() const
|
||||
{ return _str != NULL; }
|
||||
|
@ -1004,6 +1004,38 @@ bool TProp_field::set_property(const char* name, COLOR c, const char* label)
|
||||
return done;
|
||||
}
|
||||
|
||||
bool TProp_field::set_property(const char* name, bool value, const char* label)
|
||||
{
|
||||
bool done = false;
|
||||
const TFixed_string str(value ? "True" : "False");
|
||||
if (label && *label)
|
||||
done = xvt_prop_add(win().win(), "bool", name, str, label) != NULL;
|
||||
else
|
||||
done = set_property(name, str, label);
|
||||
return done;
|
||||
}
|
||||
|
||||
bool TProp_field::has_property(const char* name) const
|
||||
{ return xvt_prop_find(win().win(), name) != NULL; }
|
||||
|
||||
bool TProp_field::enable_property(const char* name, bool on)
|
||||
{
|
||||
WINDOW pg = win().win();
|
||||
XVT_TREEVIEW_NODE node = xvt_prop_find(pg, name);
|
||||
if (node != NULL)
|
||||
xvt_prop_set_read_only(pg, node, !on);
|
||||
return node != NULL;
|
||||
}
|
||||
|
||||
bool TProp_field::remove_property(const char* name)
|
||||
{
|
||||
WINDOW pg = win().win();
|
||||
XVT_TREEVIEW_NODE node = xvt_prop_find(pg, name);
|
||||
if (node != NULL)
|
||||
xvt_prop_remove(pg, node);
|
||||
return node != NULL;
|
||||
}
|
||||
|
||||
const TString& TProp_field::get_property(const char* name) const
|
||||
{
|
||||
WINDOW pg = win().win();
|
||||
@ -1022,6 +1054,9 @@ const TString& TProp_field::get_property(const char* name) const
|
||||
long TProp_field::get_long_property(const char* name) const
|
||||
{ return atol(get_property(name)); }
|
||||
|
||||
bool TProp_field::get_bool_property(const char* name) const
|
||||
{ return strchr("1TXY", get_property(name)[0]) != NULL; }
|
||||
|
||||
COLOR TProp_field::get_color_property(const char* name) const
|
||||
{
|
||||
COLOR col = COLOR_INVALID;
|
||||
@ -1037,6 +1072,33 @@ COLOR TProp_field::get_color_property(const char* name) const
|
||||
return col;
|
||||
}
|
||||
|
||||
bool TProp_field::get_var_property(const char* name, TVariant& var) const
|
||||
{
|
||||
WINDOW pg = win().win();
|
||||
XVT_TREEVIEW_NODE node = xvt_prop_find(pg, name);
|
||||
if (node)
|
||||
{
|
||||
TString8 type;
|
||||
xvt_prop_get_type(pg, node, type.get_buffer(), type.size());
|
||||
|
||||
TString tmp;
|
||||
const int len = xvt_prop_get_data(pg, node, tmp.get_buffer(), tmp.size());
|
||||
if (len > tmp.size())
|
||||
xvt_prop_get_data(pg, node, tmp.get_buffer(len), len);
|
||||
|
||||
switch (toupper(type[0]))
|
||||
{
|
||||
case 'B': var.set(tmp.full() && strchr("1TXY", tmp[0]) != NULL); break;
|
||||
case 'I':
|
||||
case 'L': var.set(atol(tmp)); break;
|
||||
default : var.set(tmp); break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
var.set_null();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TProp_field::current_property(TString& name, TVariant& value) const
|
||||
{
|
||||
name.cut(0);
|
||||
@ -1122,16 +1184,19 @@ TField_window* TProp_field::create_window(int x, int y, int dx, int dy, WINDOW p
|
||||
row->get(2, value); row->get(3, label);
|
||||
if (type.full())
|
||||
{
|
||||
if (type == "BO")
|
||||
xvt_prop_add(pg, "bool", name, value, label); else
|
||||
if (type == "CO")
|
||||
xvt_prop_add(pg, "color", name, value, label); else
|
||||
if (type == "NU" || type == "CU")
|
||||
xvt_prop_add(pg, "long", name, value, label);
|
||||
xvt_prop_add(pg, "long", name, value, label);
|
||||
else
|
||||
xvt_prop_add(pg, "string", name, value, label);
|
||||
}
|
||||
else
|
||||
xvt_prop_add(pg, "", "", "", label);
|
||||
}
|
||||
xvt_prop_fit_columns(pg);
|
||||
xvt_prop_restart(pg);
|
||||
_items.destroy();
|
||||
}
|
||||
|
@ -144,11 +144,18 @@ public:
|
||||
bool set_property(const char* name, const char* value, const char* label = NULL);
|
||||
bool set_property(const char* name, COLOR value, const char* label = NULL);
|
||||
bool set_property(const char* name, long value, const char* label = NULL);
|
||||
bool set_property(const char* name, bool value, const char* label = NULL);
|
||||
|
||||
bool has_property(const char* name) const;
|
||||
bool remove_property(const char* name);
|
||||
bool enable_property(const char* name, bool on = true);
|
||||
bool disable_property(const char* name) { return enable_property(name, false); }
|
||||
|
||||
const TString& get_property(const char* name) const;
|
||||
COLOR get_color_property(const char* name) const;
|
||||
long get_long_property(const char* name) const;
|
||||
const TVariant& get_var_property(const char* name) const;
|
||||
bool get_bool_property(const char* name) const;
|
||||
bool get_var_property(const char* name, TVariant& var) const;
|
||||
|
||||
bool for_each_property(PROP_CALLBACK pcb, void* jolly);
|
||||
bool current_property(TString& name, TVariant& value) const;
|
||||
@ -157,3 +164,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -516,43 +516,23 @@ const char* unesc(
|
||||
return decoded;
|
||||
}
|
||||
|
||||
|
||||
HIDDEN const char* const encryption_key = "QSECOFR-";
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @func Permette di criptare una parola
|
||||
//
|
||||
// @rdesc Ritorna la stringa criptata
|
||||
const char * encode(
|
||||
const char * data) // @parm Stringa da criptare
|
||||
|
||||
// @xref <f decode>
|
||||
const char * encode(const char* data)
|
||||
{
|
||||
char* tmp = get_tmp_string(255).get_buffer();
|
||||
int i;
|
||||
for (i = 0; data[i]; i++)
|
||||
tmp[i] = data[i] + (i < 8 ? encryption_key[i] : data[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
char* tmp = get_tmp_string(strlen(data)).get_buffer();
|
||||
xvt_str_encode(data, tmp, 0);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @func Permette di decodificare una stringa criptata
|
||||
//
|
||||
// @rdesc Ritorna la stringa in chiaro
|
||||
const char * decode(
|
||||
const char * data) // @parm Stringa criptata da tradurre
|
||||
|
||||
// @xref <f encode>
|
||||
const char* decode(const char* data)
|
||||
{
|
||||
char* tmp = get_tmp_string(255).get_buffer();
|
||||
int i;
|
||||
|
||||
for (i = 0; data[i]; i++)
|
||||
tmp[i] = data[i] - (i < 8 ? encryption_key[i] : tmp[i - 8]);
|
||||
tmp[i] = '\0';
|
||||
char* tmp = get_tmp_string(strlen(data)).get_buffer();
|
||||
xvt_str_decode(data, tmp, 0);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,7 @@ int xvtil_statbar_height()
|
||||
|
||||
static bool xvtil_popup_something(int severity, const char* msg)
|
||||
{
|
||||
if (ANIMATED_BOXES && is_power_reseller())
|
||||
if (ADVANCED_GRAPHICS && ANIMATED_BOXES && is_power_reseller())
|
||||
{
|
||||
switch (severity)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user