Patch level : 2.1 nopatch

Files correlati     : agalib.lib
Ricompilazione Demo : [ ]
Commento            :

applicat.cpp Trasformato "NONE" in TR("nessuna")
mask.cpp     Migliorato messaggio di campo mancante (specifica il nome della maschera)
maskfld.cpp  Aggiunta possibilita' di "resizare" i TWindowed_field
tree.cpp     Trasformati tutti i TRUE in true


git-svn-id: svn://10.65.10.50/trunk@11805 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-03-04 14:05:55 +00:00
parent 69c8f45fde
commit 518d0c9868
4 changed files with 92 additions and 89 deletions

View File

@ -93,7 +93,7 @@ TInfo_mask::TInfo_mask()
case 1: prot = "Hardlock"; break;
case 2: prot = "Eutron"; break;
case 3: prot = campoini.get("Dongle", "Server"); break;
default: prot = "NONE"; break;
default: prot = TR("Nessuna"); break;
}
add_row(TR("Versione"), versione);

View File

@ -195,7 +195,7 @@ void TMask::read_mask(
}
if (_pages <= 0)
fatal_box("Impossibile leggere la maschera %s : %d", name, num);
fatal_box("Impossibile leggere la maschera %s : %d", (const char*)_source_file, num);
if (_pages > 1 || toolwin())
add_tag_buttons(captions);
@ -589,7 +589,7 @@ TMask_field& TMask::field(short id) const
int pos = id2pos(id);
if (pos < 0)
{
yesnofatal_box("Il campo %d non esiste", id);
yesnofatal_box("Non esiste il campo %d sulla maschera %s", id, (const char*)_source_file);
pos = 0;
}
return fld(pos);

View File

@ -2560,11 +2560,10 @@ bool TBrowse::check(CheckTime t)
if (_secondary == TRUE && t != RUNNING_CHECK)
return TRUE;
if (field().check_type() != CHECK_NONE)
CheckType chk = field().check_type();
if (chk != CHECK_NONE)
{
const TMaskmode mode = (TMaskmode)field().mask().mode();
CheckType chk = field().check_type();
if (chk == CHECK_REQUIRED && (t == STARTING_CHECK || mode == MODE_QUERY))
chk = CHECK_NORMAL;
@ -3636,8 +3635,10 @@ const char* TDate_field::win2raw(
if (m <= 0 || y <= 0)
{
const TDate oggi(TODAY);
if (m <= 0) m = oggi.month();
if (y <= 0) y = oggi.year();
if (m <= 0)
m = oggi.month();
if (y <= 0)
y = oggi.year();
}
if (y < 100)
y += (y <= 10) ? 2000 : 1900;
@ -4927,9 +4928,10 @@ RCT& TWindowed_field::get_rect(RCT& r) const
return r;
}
void TWindowed_field::set_rect(const RCT&)
void TWindowed_field::set_rect(const RCT& r)
{
CHECK(NULL, "Can't resize windowed field by now!");
if (_win)
xvt_vobj_move(_win->win(), (RCT*)&r);
}
short TWindowed_field::dlg() const

View File

@ -18,7 +18,7 @@ HIDDEN bool callback_expand_node(TTree& node, void* jolly, word when)
{
if (when == SCAN_PRE_ORDER)
node.expand();
return FALSE;
return false;
}
HIDDEN bool callback_find_father(TTree& node, void* jolly, word when)
@ -36,11 +36,11 @@ HIDDEN bool callback_find_father(TTree& node, void* jolly, word when)
if (father_and_son.objptr(0))
{
father_and_son.add(myself, 0);
return TRUE;
return true;
}
}
return FALSE;
return false;
}
HIDDEN bool callback_find_brother(TTree& node, void* jolly, word when)
@ -58,10 +58,10 @@ HIDDEN bool callback_find_brother(TTree& node, void* jolly, word when)
if (brother_and_sister.objptr(0))
{
brother_and_sister.add(myself, 0);
return TRUE;
return true;
}
}
return FALSE;
return false;
}
///////////////////////////////////////////////////////////
@ -73,9 +73,9 @@ bool TTree::scan_depth_first(NODE_HANDLER nh, void* jolly, word flags)
if ((flags & 0x7) == 0)
flags |= SCAN_PRE_ORDER;
bool test_myself = TRUE;
bool test_myself = true;
if ((flags & SCAN_IGNORING_LEAVES) && !has_son())
test_myself = FALSE;
test_myself = false;
TString myself;
curr_id(myself);
@ -83,34 +83,34 @@ bool TTree::scan_depth_first(NODE_HANDLER nh, void* jolly, word flags)
if (test_myself)
{
if ((flags & SCAN_PRE_ORDER) && nh(*this, jolly, SCAN_PRE_ORDER))
return TRUE;
return true;
const bool stop = (flags & SCAN_IGNORING_UNEXPANDED) && !expanded();
if (!stop && goto_firstson())
{
if (scan_depth_first(nh, jolly, flags))
return TRUE;
return true;
goto_node(myself);
}
if ((flags & SCAN_IN_ORDER) && nh(*this, jolly, SCAN_IN_ORDER))
return TRUE;
return true;
}
if (goto_rbrother())
{
if (scan_depth_first(nh, jolly, flags))
return TRUE;
return true;
goto_node(myself);
}
if (test_myself)
{
if ((flags & SCAN_POST_ORDER) && nh(*this, jolly, SCAN_POST_ORDER))
return TRUE;
return true;
}
return FALSE;
return false;
}
bool TTree::scan_breadth_first(NODE_HANDLER nh, void* jolly, word flags)
@ -118,14 +118,14 @@ bool TTree::scan_breadth_first(NODE_HANDLER nh, void* jolly, word flags)
if ((flags & 0x7) == 0)
flags |= SCAN_PRE_ORDER;
bool test_myself = TRUE;
bool test_myself = true;
if ((flags & SCAN_IGNORING_LEAVES) && !has_son())
test_myself = FALSE;
test_myself = false;
if (test_myself)
{
if ((flags & SCAN_PRE_ORDER) && nh(*this, jolly, SCAN_PRE_ORDER))
return TRUE;
return true;
}
TString myself;
@ -134,27 +134,27 @@ bool TTree::scan_breadth_first(NODE_HANDLER nh, void* jolly, word flags)
if (goto_rbrother())
{
if (scan_breadth_first(nh, jolly, flags))
return TRUE;
return true;
goto_node(myself);
}
if (test_myself)
{
if ((flags & SCAN_IN_ORDER) && nh(*this, jolly, SCAN_IN_ORDER))
return TRUE;
return true;
const bool stop = (flags & SCAN_IGNORING_UNEXPANDED) && !expanded();
if (!stop && goto_firstson())
{
if (scan_breadth_first(nh, jolly, flags))
return TRUE;
return true;
goto_node(myself);
}
if ((flags & SCAN_POST_ORDER) && nh(*this, jolly, SCAN_POST_ORDER))
return TRUE;
return true;
}
return FALSE;
return false;
}
bool TTree::has_root() const
@ -300,41 +300,41 @@ bool TBidirectional_tree::scan_depth_first(NODE_HANDLER nh, void* jolly, word fl
if ((flags & 0x7) == 0)
flags |= SCAN_PRE_ORDER;
bool test_myself = TRUE;
bool test_myself = true;
if ((flags & SCAN_IGNORING_LEAVES) && !has_son())
test_myself = FALSE;
test_myself = false;
if (test_myself)
{
if ((flags & SCAN_PRE_ORDER) && nh(*this, jolly, SCAN_PRE_ORDER))
return TRUE;
return true;
const bool stop = (flags & SCAN_IGNORING_UNEXPANDED) && !expanded();
if (!stop && goto_firstson())
{
if (scan_depth_first(nh, jolly, flags))
return TRUE;
return true;
goto_father();
}
if ((flags & SCAN_IN_ORDER) && nh(*this, jolly, SCAN_IN_ORDER))
return TRUE;
return true;
}
if (goto_rbrother())
{
if (scan_depth_first(nh, jolly, flags))
return TRUE;
return true;
goto_lbrother();
}
if (test_myself)
{
if ((flags & SCAN_POST_ORDER) && nh(*this, jolly, SCAN_POST_ORDER))
return TRUE;
return true;
}
return FALSE;
return false;
}
bool TBidirectional_tree::scan_breadth_first(NODE_HANDLER nh, void* jolly, word flags)
@ -342,39 +342,39 @@ bool TBidirectional_tree::scan_breadth_first(NODE_HANDLER nh, void* jolly, word
if ((flags & 0x7) == 0)
flags |= SCAN_PRE_ORDER;
bool test_myself = TRUE;
bool test_myself = true;
if ((flags & SCAN_IGNORING_LEAVES) && !has_son())
test_myself = FALSE;
test_myself = false;
if (test_myself)
{
if ((flags & SCAN_PRE_ORDER) && nh(*this, jolly, SCAN_PRE_ORDER))
return TRUE;
return true;
}
if (goto_rbrother())
{
if (scan_breadth_first(nh, jolly, flags))
return TRUE;
return true;
goto_lbrother();
}
if (test_myself)
{
if ((flags & SCAN_IN_ORDER) && nh(*this, jolly, SCAN_IN_ORDER))
return TRUE;
return true;
const bool stop = (flags & SCAN_IGNORING_UNEXPANDED) && !expanded();
if (!stop && goto_firstson())
{
if (scan_breadth_first(nh, jolly, flags))
return TRUE;
return true;
goto_father();
}
if ((flags & SCAN_POST_ORDER) && nh(*this, jolly, SCAN_POST_ORDER))
return TRUE;
return true;
}
return FALSE;
return false;
}
bool TBidirectional_tree::goto_node(const TString &id)
@ -399,7 +399,7 @@ bool TObject_tree::expand()
{
bool ok = _current && _current->_son && !_current->_expanded && enabled();
if (ok)
_current->_expanded = TRUE;
_current->_expanded = true;
return ok;
}
@ -407,7 +407,7 @@ bool TObject_tree::shrink()
{
bool ok = _current && _current->_expanded;
if (ok)
_current->_expanded = FALSE;
_current->_expanded = false;
return ok;
}
@ -418,7 +418,7 @@ void TObject_tree::node2id(const TObject* node, TString& id) const
bool TObject_tree::goto_node(const TString& node)
{
bool ok = TRUE;
void* p = NULL;
if (node.not_empty())
{
#ifdef DBG_TREE
@ -428,13 +428,14 @@ bool TObject_tree::goto_node(const TString& node)
return goto_root();
}
#endif
void* p;
sscanf(node, "%p", &p);
_current = (TTree_node*)p;
}
else
bool ok = true;
if (p == NULL)
ok = goto_root();
else
_current = (TTree_node*)p;
return ok;
}
@ -489,7 +490,7 @@ bool TObject_tree::set_object(TObject* obj)
bool TObject_tree::set_object(const TObject& obj)
{
bool ok = FALSE;
bool ok = false;
if (_current)
{
TObject* ptr = obj.dup();
@ -509,7 +510,7 @@ bool TObject_tree::create_root()
bool TObject_tree::add_son(TObject* obj)
{
bool ok = FALSE;
bool ok = false;
if (_root)
{
TTree_node*& curson = _current->_son;
@ -541,7 +542,7 @@ bool TObject_tree::add_son(const TObject& obj)
bool TObject_tree::add_brother(TObject* obj)
{
bool ok = FALSE;
bool ok = false;
if (goto_father())
ok = add_son(obj);
else
@ -559,7 +560,7 @@ bool TObject_tree::add_brother(const TObject& obj)
bool TObject_tree::add_rbrother(TObject* obj)
{
bool ok = FALSE;
bool ok = false;
if (has_father())
{
TTree_node* newbrother = new TTree_node;
@ -588,7 +589,7 @@ bool TObject_tree::add_rbrother(const TObject& obj)
bool TObject_tree::add_lbrother(TObject* obj)
{
bool ok = FALSE;
bool ok = false;
if (has_father())
{
if (_current->_lbrother == NULL)
@ -620,7 +621,7 @@ bool TObject_tree::add_lbrother(const TObject& obj)
bool TObject_tree::kill_node()
{
bool ok = FALSE;
bool ok = false;
if (_current)
{
TTree_node* cur = _current;
@ -663,7 +664,7 @@ bool TObject_tree::kill_node()
delete to_be_killed;
ok = TRUE;
ok = true;
}
return ok;
}
@ -737,9 +738,9 @@ public:
}
virtual bool ok() const { return _valid; }
void reset() { _valid = FALSE; }
void reset() { _valid = false; }
TNode_info() : _valid(FALSE) { }
TNode_info() : _valid(false) { }
virtual ~TNode_info() { }
};
@ -846,7 +847,7 @@ public:
};
/* int TTree_window::_row_height = CHARY+2; */
bool TTree_window::_tree_locked = FALSE;
bool TTree_window::_tree_locked = false;
const int TABX = 3;
@ -969,7 +970,7 @@ bool TTree_window::callback_draw_node(TTree& node, void* jolly, word when)
TNode_info& ni = (*ui->_node_info)[ry];
node.curr_id(ni._id);
ni._valid = TRUE;
ni._valid = true;
ni._startx = ui->_x;
ni._endx = ui->_x + text_len + 2;
ni._enabled = is_enabled;
@ -982,7 +983,7 @@ bool TTree_window::callback_draw_node(TTree& node, void* jolly, word when)
else
{
ni._plusx = 0;
ni._expanded = FALSE;
ni._expanded = false;
}
}
ui->_y++;
@ -995,10 +996,10 @@ bool TTree_window::callback_draw_node(TTree& node, void* jolly, word when)
{
ui->_x -= TABX;
if (ui->_y > ui->_lasty)
return TRUE;
return true;
}
return FALSE;
return false;
}
void TTree_window::draw_plus_minus()
@ -1020,8 +1021,8 @@ void TTree_window::draw_plus_minus()
}
if (spudorato)
{
ni._expandable = FALSE;
ni._expanded = FALSE;
ni._expandable = false;
ni._expanded = false;
ni._plusx = 0;
continue;
}
@ -1068,11 +1069,11 @@ void TTree_window::update_header()
{
if (_headlines > 0)
{
autoscroll(FALSE);
autoscroll(false);
set_brush(MASK_BACK_COLOR);
bar(0,-_headlines,columns(),0);
autoscroll(TRUE);
set_opaque_text(FALSE);
autoscroll(true);
set_opaque_text(false);
for (int i = 0; i < _headlines; i++)
stringat(2, int(origin().y+i-_headlines), _header.get(i));
}
@ -1098,7 +1099,7 @@ void TTree_window::update()
ui._node_info = &_node_info;
ui._curr_info = &_curr_info;
bool ok = FALSE;
bool ok = false;
if (_first_line > 0)
{
const long index = origin().y - _first_line;
@ -1118,7 +1119,7 @@ void TTree_window::update()
}
_node_info.reset();
set_opaque_text(TRUE);
set_opaque_text(true);
word flags = SCAN_PRE_ORDER | SCAN_IN_ORDER | SCAN_IGNORING_UNEXPANDED;
if (_hide_leaves) flags |= SCAN_IGNORING_LEAVES;
@ -1152,7 +1153,7 @@ bool TTree_window::select_current()
// Salta al nodo correntemente selezionato
bool TTree_window::goto_selected()
{
bool ok = FALSE;
bool ok = false;
if (_tree)
ok = _tree->goto_node(_curr_info._id);
return ok;
@ -1172,7 +1173,7 @@ int TTree_window::info2index(const TNode_info& info) const
bool TTree_window::index2info(long index, TNode_info& ni)
{
bool ok = FALSE;
bool ok = false;
const int last = _node_info.last();
if (index == -1)
@ -1197,7 +1198,7 @@ bool TTree_window::index2info(long index, TNode_info& ni)
if (ok && _hide_leaves && !_tree->has_son())
{
_tree->goto_node(ni._id); // Ritorno al padre perche' ignoro le foglie
ok = FALSE;
ok = false;
}
if (!ok)
{
@ -1224,7 +1225,7 @@ bool TTree_window::index2info(long index, TNode_info& ni)
bool TTree_window::on_key(KEY key)
{
if (_tree == NULL || _tree_locked)
return FALSE;
return false;
if (key == K_RIGHT)
{
@ -1246,15 +1247,15 @@ bool TTree_window::on_key(KEY key)
if (key == K_UP || key == K_DOWN)
{
_tree_locked = TRUE;
_tree_locked = true;
int index = info2index(_curr_info);
if (key == K_UP)
index--;
else
index++;
bool ok = FALSE;
bool scroll = FALSE;
bool ok = false;
bool scroll = false;
TNode_info ni;
if (index2info(index, ni))
@ -1279,14 +1280,14 @@ bool TTree_window::on_key(KEY key)
}
}
_tree_locked = FALSE;
_tree_locked = false;
if (!scroll)
return TRUE;
return true;
}
if (key == K_ENTER)
{
_tree_locked = TRUE;
_tree_locked = true;
if (_tree->goto_node(_curr_info._id))
{
if (_tree->has_son())
@ -1306,7 +1307,7 @@ bool TTree_window::on_key(KEY key)
}
owner().on_key(K_CTRL + K_SPACE);
}
_tree_locked = FALSE;
_tree_locked = false;
}
return TField_window::on_key(key);
@ -1320,7 +1321,7 @@ void TTree_window::handler(WINDOW win, EVENT* ep)
case E_MOUSE_DOWN:
if (_tree && !_tree_locked)
{
_tree_locked = TRUE;
_tree_locked = true;
const TPoint lp = dev2log(ep->v.mouse.where);
const int c = (int)lp.x;
const int r = (int)lp.y;
@ -1352,7 +1353,7 @@ void TTree_window::handler(WINDOW win, EVENT* ep)
force_update();
}
}
_tree_locked = FALSE;
_tree_locked = false;
}
break;
default:
@ -1364,7 +1365,7 @@ void TTree_window::handler(WINDOW win, EVENT* ep)
TTree_window::TTree_window(int x, int y, int dx, int dy,
WINDOW parent, TTree_field* owner)
: TField_window(x, y, dx, dy, parent, owner), _tree(NULL),
_hide_leaves(FALSE), _headlines(0)
_hide_leaves(false), _headlines(0)
{
set_row_height(-1); // Compute default row height
}