#ifndef __PE1401_H #define __PE1401_H #ifndef __ISAM_H #include #endif #ifndef __TREE_H #include #endif #ifndef __TREECTRL_H #include #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