Patch level : 10.0
Files correlati : agalib Ricompilazione Demo : [ ] Commento : Aggiunti file dimenticati dal commit precedente git-svn-id: svn://10.65.10.50/trunk@16069 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a8b4b2d1dc
commit
59555b0205
83
include/treectrl.h
Executable file
83
include/treectrl.h
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
#ifndef __TREECTRL_H
|
||||||
|
#define __TREECTRL_H
|
||||||
|
|
||||||
|
#ifndef __MASKFLD_H
|
||||||
|
#include "maskfld.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
virtual void set(const char* data);
|
||||||
|
virtual const TString& get() const;
|
||||||
|
|
||||||
|
TOutlook_field(TMask* m) : TWindowed_field(m) { }
|
||||||
|
virtual ~TOutlook_field() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -22,10 +22,14 @@ HIDDEN int get_int_val_param(int i)
|
|||||||
HIDDEN const TString& get_fld_val_param(const TMask_field& f, int i)
|
HIDDEN const TString& get_fld_val_param(const TMask_field& f, int i)
|
||||||
{
|
{
|
||||||
const short id = f.atodlg(get_val_param(i));
|
const short id = f.atodlg(get_val_param(i));
|
||||||
|
if (id == THIS_FIELD)
|
||||||
|
return f.get();
|
||||||
|
|
||||||
const TMask& m = f.mask();
|
const TMask& m = f.mask();
|
||||||
const int pos = id > 0 ? m.id2pos(id) : -1;
|
const int pos = id > 0 ? m.id2pos(id) : -1;
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
return m.fld(pos).get();
|
return m.fld(pos).get();
|
||||||
|
|
||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +68,7 @@ HIDDEN bool _emptycopy_val(TMask_field& f, KEY)
|
|||||||
{
|
{
|
||||||
if (f.empty())
|
if (f.empty())
|
||||||
{
|
{
|
||||||
const short id = atoi(get_val_param(0));
|
const TString& val = get_fld_val_param(f, 0);
|
||||||
const TString& val = f.mask().get(id);
|
|
||||||
if (val.not_empty())
|
if (val.not_empty())
|
||||||
{
|
{
|
||||||
f.set(val);
|
f.set(val);
|
||||||
@ -497,7 +500,7 @@ HIDDEN bool _fixlen_val(TMask_field& f, KEY)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
const TString& s = f.get();
|
const TString& s = f.get();
|
||||||
const int length = atoi(get_val_param(0));
|
const int length = get_int_val_param(0);
|
||||||
const bool ok = s.len() == length;
|
const bool ok = s.len() == length;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
f.error_box(FR("La lunghezza del campo deve essere %d"), length);
|
f.error_box(FR("La lunghezza del campo deve essere %d"), length);
|
||||||
@ -618,15 +621,15 @@ HIDDEN bool _strcalc_val(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
HIDDEN bool _onereq_val(TMask_field& f, KEY k)
|
HIDDEN bool _onereq_val(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k != K_ENTER) return true;
|
if (k != K_ENTER|| f.mask().mode() == MODE_QUERY)
|
||||||
const TMask& m = f.mask();
|
return true;
|
||||||
if (m.mode() == MODE_QUERY) return true;
|
|
||||||
const int nparms = get_val_param_count();
|
const int nparms = get_val_param_count();
|
||||||
|
|
||||||
for (int i = 0; i < nparms ; i++)
|
for (int i = 0; i < nparms ; i++)
|
||||||
{
|
{
|
||||||
const char* s = m.get(atoi(get_val_param(i)));
|
const TString& s = get_fld_val_param(f, i);
|
||||||
if (*s) return true;
|
if (s.full())
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user