Patch level : 10.0

Files correlati     : ca0
Ricompilazione Demo : [ ]
Commento            :
Migliorata efficienza costruzione alberi di commesse e fasi


git-svn-id: svn://10.65.10.50/trunk@20633 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-06-28 09:29:01 +00:00
parent 1a738edfec
commit b63eb4e087

@ -2,6 +2,7 @@
#include <modaut.h>
#include <tree.h>
#include <treectrl.h>
#include <urldefid.h>
#include <mov.h>
#include <pconti.h>
@ -720,6 +721,7 @@ class TAnal_tree : public TBidirectional_tree
protected:
virtual void node2id(const TObject* node, TString& id) const;
virtual bool could_have_son() const;
virtual bool has_son() const;
virtual bool has_father() const;
virtual bool goto_firstson();
@ -729,6 +731,7 @@ protected:
virtual bool goto_father();
virtual bool goto_lbrother();
virtual bool get_description(TString& desc) const;
virtual TImage* image(bool selected) const;
protected:
void update_curr();
@ -1124,18 +1127,20 @@ bool TAnal_tree::goto_root()
}
bool TAnal_tree::has_father() const
{
//se sono sul file delle fasi e queste sono legate, allora ho sicuramente un padre
if (_father_curs && !_is_father)
return true;
return TBidirectional_tree::has_father();
}
{ return _curr.level() > 1; }
bool TAnal_tree::could_have_son() const
{ return _curr.level() < max_level(); }
bool TAnal_tree::has_son() const
{
if (!could_have_son())
return false;
if (_is_father && _father_curs)
{
const TMultilevel_code_info& fci = ca_multilevel_code_info(_father_curs->file().num());
const int father_logic = _father_curs->file().num(); // LF_COMMESSE o LF_CDC
const TMultilevel_code_info& fci = ca_multilevel_code_info(father_logic);
const int son_lev = _curr.level() + 1;
if (son_lev > fci.levels())
{
@ -1145,6 +1150,7 @@ bool TAnal_tree::has_son() const
return fasi.read(_isgteq) == NOERR && fasi.get(FASI_CODCMSFAS) == _curr._key;
}
}
return TBidirectional_tree::has_son();
}
@ -1318,6 +1324,14 @@ bool TAnal_tree::get_description(TString& desc) const
return ok;
}
TImage* TAnal_tree::image(bool selected) const
{
short bmp_id = BMP_FILE;
if (has_son())
bmp_id = selected ? BMP_DIRDN : BMP_DIR;
return get_res_image(bmp_id);
}
TAnal_tree::TAnal_tree(int logicnum) : _curs(NULL), _father_curs(NULL), _is_father(false)
{
TString select;