campo-sirio/pe/pe1401.h
guy 7c4407fcae Aggiunta colonna prezzi in articoli per preventivazione
git-svn-id: svn://10.65.10.50/branches/R_10_00@22895 c028cbd2-c16b-5b4b-a496-9718f37d4682
2013-09-11 09:49:46 +00:00

65 lines
1.9 KiB
C++

#ifndef __PE1401_H
#define __PE1401_H
#ifndef __ISAM_H
#include <isam.h>
#endif
#ifndef __TREE_H
#include <tree.h>
#endif
#ifndef __TREECTRL_H
#include <treectrl.h>
#endif
///////////////////////////////////////////////////////////
// TPreventivo_tree
///////////////////////////////////////////////////////////
enum TPreventivo_level { pl_documento = 0, pl_fase1 = 1, pl_fase2, pl_fase3, pl_fase4, pl_distinta=10, pl_dettaglio, pl_misura };
class TPreventivo_tree : public TObject_tree
{
TTree_field& _owner;
TString4 _strFasi, _strDist, _strDett, _strMisu;
private:
bool add_lastson(TObject* obj);
bool add_lastson(const TObject& obj) { return add_lastson(obj.dup()); }
protected:
bool goto_last_fase(TPreventivo_level level);
bool goto_last_dist();
public:
virtual bool could_have_son() const;
virtual bool get_description(TString& str) const;
virtual TFieldtypes get_var(const TString& name, TVariant& var) const;
virtual TImage* image(bool sel) const;
const TString& tipo_fasi() const { return _strFasi; }
const TString& tipo_dist() const { return _strDist; }
const TString& tipo_dett() const { return _strDett; }
const TString& tipo_misu() const { return _strMisu; }
TPreventivo_level level(const TRectype& rec) const;
TPreventivo_level level() const;
TPreventivo_level last_fase_level() const;
TRectype* new_row(TPreventivo_level level) const;
TRectype* curr_row() const { return (TRectype*)curr_node(); }
TTree_field& owner() const { return _owner; }
TRectype* dist(const TString& fase, int n, bool create = false);
TRectype* dett(const TString& dist, int n, bool create = false);
TRectype* misu(const TString& dist, int n, bool create = false);
bool ricalcola(real& costo, real& prezzo);
TPreventivo_tree(TTree_field& owner);
bool append_row(const TRectype& rec);
};
#endif