2008-01-31 15:18:01 +00:00
|
|
|
#ifndef __TREECTRL_H
|
|
|
|
#define __TREECTRL_H
|
|
|
|
|
|
|
|
#ifndef __MASKFLD_H
|
|
|
|
#include "maskfld.h"
|
|
|
|
#endif
|
|
|
|
|
2008-02-14 16:39:04 +00:00
|
|
|
// Native control host window: autresizes its unique child control
|
|
|
|
class TControl_host_window : public TField_window
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
WINDOW _ctrl;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void handler(WINDOW win, EVENT* ep);
|
|
|
|
TControl_host_window(int x, int y, int dx, int dy,
|
|
|
|
WINDOW parent, TWindowed_field* owner);
|
|
|
|
};
|
|
|
|
|
2008-01-31 15:18:01 +00:00
|
|
|
class TGolem_client_field : public TWindowed_field
|
|
|
|
{
|
|
|
|
TGolem_field* _driver;
|
|
|
|
|
|
|
|
protected: // TObject
|
|
|
|
virtual word class_id() const;
|
|
|
|
virtual bool is_kind_of(word cid) const;
|
|
|
|
|
|
|
|
protected: // TWindowed_field
|
|
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
virtual bool parse_item(TScanner& scan);
|
|
|
|
|
|
|
|
public:
|
|
|
|
TGolem_field* driver() const { return _driver; }
|
|
|
|
virtual bool on_hit();
|
|
|
|
|
|
|
|
TGolem_client_field(TMask* m);
|
|
|
|
virtual ~TGolem_client_field();
|
|
|
|
};
|
|
|
|
|
|
|
|
// Implemented in tree.cpp
|
|
|
|
class TTree;
|
|
|
|
|
|
|
|
class TTree_field : public TWindowed_field
|
|
|
|
{
|
|
|
|
protected: // TObject
|
|
|
|
virtual word class_id() const;
|
|
|
|
virtual bool is_kind_of(word cid) const;
|
|
|
|
|
|
|
|
protected: // TWindowed_field
|
|
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
|
|
|
|
public:
|
|
|
|
TTree* tree() const;
|
|
|
|
void set_tree(TTree* t);
|
|
|
|
|
|
|
|
void hide_leaves(bool yes = true);
|
|
|
|
void show_leaves(bool yes = true) { hide_leaves(!yes); }
|
|
|
|
bool select_current();
|
|
|
|
bool goto_selected();
|
|
|
|
|
|
|
|
void set_header(const char* head);
|
|
|
|
void set_row_height(int rh);
|
|
|
|
|
|
|
|
TTree_field(TMask* m) : TWindowed_field(m) { }
|
|
|
|
virtual ~TTree_field() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
class TOutlook_field : public TWindowed_field
|
|
|
|
{
|
|
|
|
TString4 _str; // Current selection
|
|
|
|
|
|
|
|
protected: // TMask_field
|
|
|
|
virtual word class_id() const;
|
|
|
|
virtual bool is_kind_of(word cid) const;
|
|
|
|
|
|
|
|
virtual const TString& get_window_data();
|
|
|
|
virtual void set_window_data(const char* data);
|
|
|
|
virtual bool on_key(KEY key);
|
|
|
|
|
|
|
|
protected: // TWindowed_field
|
|
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
|
|
|
|
public:
|
|
|
|
int add_item(short icon, const char* text, int flags);
|
|
|
|
void create(short dlg, int x, int y, int dx, int dy, WINDOW parent);
|
2008-12-17 11:42:23 +00:00
|
|
|
void clear();
|
2008-01-31 15:18:01 +00:00
|
|
|
|
2008-12-17 11:42:23 +00:00
|
|
|
int items() const;
|
2008-01-31 15:18:01 +00:00
|
|
|
virtual void set(const char* data);
|
|
|
|
virtual const TString& get() const;
|
|
|
|
|
|
|
|
TOutlook_field(TMask* m) : TWindowed_field(m) { }
|
|
|
|
virtual ~TOutlook_field() { }
|
|
|
|
};
|
|
|
|
|
2008-05-15 14:59:21 +00:00
|
|
|
class TSlider_field : public TWindowed_field
|
|
|
|
{
|
|
|
|
short _buddy;
|
|
|
|
real _range_min, _range_max;
|
|
|
|
|
|
|
|
protected: // TMask_field
|
|
|
|
virtual word class_id() const;
|
|
|
|
virtual bool is_kind_of(word cid) const;
|
|
|
|
|
|
|
|
virtual const TString& get_window_data();
|
|
|
|
virtual void set_window_data(const char* data);
|
|
|
|
|
|
|
|
protected: // TWindowed_field
|
|
|
|
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
|
|
|
|
virtual bool parse_item(TScanner& scanner);
|
|
|
|
|
|
|
|
const char* get_buddy() const;
|
|
|
|
void set_buddy(const char* b) const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void set(const char* data);
|
|
|
|
virtual const TString& get() const;
|
|
|
|
virtual bool on_hit();
|
|
|
|
|
|
|
|
void set_range(const real& mi, const real& ma);
|
|
|
|
void set_range(int mi, int ma);
|
|
|
|
void range(real& mi, real& ma);
|
|
|
|
|
|
|
|
TSlider_field(TMask* m);
|
|
|
|
virtual ~TSlider_field() { }
|
|
|
|
};
|
|
|
|
|
2008-01-31 15:18:01 +00:00
|
|
|
#endif
|