campo-sirio/ba/ba8301.h

117 lines
2.8 KiB
C
Raw Normal View History

#ifndef __AUTOMASK_H
#include <automask.h>
#endif
#ifndef __TREE_H
#include <tree.h>
#endif
#ifndef __REPORT_H
#include <report.h>
#endif
///////////////////////////////////////////////////////////
// TReport_tree
///////////////////////////////////////////////////////////
class TReport_tree : public TBidirectional_tree
{
TReport& _report;
TString8 _curr;
protected:
virtual bool get_description(TString& str) const;
virtual TImage* image(bool selected) const;
virtual void node2id(const TObject* node, TString& id) const;
int curr_level() const;
public:
virtual bool goto_root();
virtual bool goto_firstson();
virtual bool goto_rbrother();
virtual bool goto_node(const TString &id);
virtual bool has_son() const;
virtual bool has_rbrother() const;
virtual TObject* curr_node() const { return (TObject*)&_curr; }
virtual bool has_root() const;
virtual bool has_father() const;
virtual bool has_lbrother() const;
virtual bool goto_father();
virtual bool goto_lbrother();
TReport_section& curr_section() const;
bool goto_node(char type, int level);
int image_height() const;
TReport_tree(TReport& r) : _report(r) { goto_root(); }
};
void describe_section(char type, int level, TString& str);
///////////////////////////////////////////////////////////
// TReport_drawer
///////////////////////////////////////////////////////////
class TReport_drawer : public TWindowed_field
{
protected:
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
public:
void set_report_section(TReport_section& sec);
TReport_section& curr_section();
TReport_drawer(TMask* m) : TWindowed_field(m) { }
};
///////////////////////////////////////////////////////////
// TReport_field_mask
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// TReport_base_mask
///////////////////////////////////////////////////////////
class TReport_base_mask : public TAutomask
{
TReport_font _font;
bool _font_changed;
protected:
TReport& _report;
char _halign, _valign;
COLOR _fgcolor, _bgcolor;
virtual void update();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
void set_font_info(const TReport_font& font);
bool get_font_info(TReport_font& font) const;
TReport_base_mask(const char* name, TReport& rep);
};
class TReport_field_mask : public TReport_base_mask
{
TReport_field& _rf;
protected:
void vedo_non_vedo();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
virtual void update();
public:
void set_num(short id, long n);
long get_num(short id) const;
void set_field(const TReport_field& rf);
void get_field(TReport_field& rf) const;
TReport_field_mask(TReport_field& rf);
};
const TString& num2str(int num);
short str2num(const TString& str);