Corretta formattazione e tolto include inutile
git-svn-id: svn://10.65.10.50/trunk@862 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
615ef83d1f
commit
b0b58660f5
@ -1,75 +1,73 @@
|
||||
|
||||
#include <relapp.h>
|
||||
#include <stdtypes.h>
|
||||
#include <tabutil.h>
|
||||
#include <execp.h>
|
||||
#include <utility.h>
|
||||
#include <tabapp.h>
|
||||
|
||||
void Tab_application::print()
|
||||
{
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
TExternal_app stampa(format("ba3a -1 %s", (const char *) _tabname));
|
||||
#else
|
||||
TExternal_app stampa(format("ba3 -1 %s", (const char *) _tabname));
|
||||
#endif
|
||||
stampa.run();
|
||||
}
|
||||
|
||||
void Tab_application::init_query_mode(TMask& m)
|
||||
{
|
||||
m.send_key(K_SHIFT + K_CTRL + 'e', -GR_MODIFY_PROTECTED);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'e', -GR_RECORD_PROTECTED);
|
||||
}
|
||||
|
||||
void Tab_application::init_modify_mode(TMask& m)
|
||||
{
|
||||
m.send_key(K_SHIFT + K_CTRL + 'd', -GR_MODIFY_PROTECTED);
|
||||
const bool enable = !(_rel->curr().get_bool(FPC));
|
||||
|
||||
m.send_key(K_SHIFT + K_CTRL + 'd' + enable, -GR_RECORD_PROTECTED);
|
||||
}
|
||||
|
||||
bool Tab_application::protected_record(TRectype& rec)
|
||||
{
|
||||
return rec.get_bool(FPC);
|
||||
}
|
||||
|
||||
bool Tab_application::user_create()
|
||||
{
|
||||
if (argc() < 3)
|
||||
return FALSE;
|
||||
|
||||
_tabname = argv(2);
|
||||
|
||||
if (_tabname.empty())
|
||||
return FALSE;
|
||||
|
||||
_tabname.upper();
|
||||
TString16 m, t(_tabname);
|
||||
|
||||
if (t[0] == '%') t.ltrim(1);
|
||||
|
||||
m << "BATB" << t;
|
||||
_msk = new TMask(m) ;
|
||||
|
||||
for (int i = 0; i < _msk->fields(); i++)
|
||||
if (_msk->fld(i).in_group(GR_SEARCH))
|
||||
{
|
||||
set_search_field(_msk->fld(i).dlg());
|
||||
break;
|
||||
}
|
||||
|
||||
_rel = new TRelation(_tabname);
|
||||
set_title(_msk->get_caption());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool Tab_application::user_destroy()
|
||||
{
|
||||
if (_msk) delete _msk;
|
||||
if (_rel) delete _rel;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#include <stdtypes.h>
|
||||
#include <tabutil.h>
|
||||
#include <execp.h>
|
||||
#include <utility.h>
|
||||
#include <tabapp.h>
|
||||
|
||||
void Tab_application::print()
|
||||
{
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
TExternal_app stampa(format("ba3a -1 %s", (const char *) _tabname));
|
||||
#else
|
||||
TExternal_app stampa(format("ba3 -1 %s", (const char *) _tabname));
|
||||
#endif
|
||||
stampa.run();
|
||||
}
|
||||
|
||||
void Tab_application::init_query_mode(TMask& m)
|
||||
{
|
||||
m.send_key(K_SHIFT + K_CTRL + 'e', -GR_MODIFY_PROTECTED);
|
||||
m.send_key(K_SHIFT + K_CTRL + 'e', -GR_RECORD_PROTECTED);
|
||||
}
|
||||
|
||||
void Tab_application::init_modify_mode(TMask& m)
|
||||
{
|
||||
m.send_key(K_SHIFT + K_CTRL + 'd', -GR_MODIFY_PROTECTED);
|
||||
const bool enable = !(_rel->curr().get_bool(FPC));
|
||||
|
||||
m.send_key(K_SHIFT + K_CTRL + 'd' + enable, -GR_RECORD_PROTECTED);
|
||||
}
|
||||
|
||||
bool Tab_application::protected_record(TRectype& rec)
|
||||
{
|
||||
return rec.get_bool(FPC);
|
||||
}
|
||||
|
||||
bool Tab_application::user_create()
|
||||
{
|
||||
if (argc() < 3)
|
||||
return FALSE;
|
||||
|
||||
_tabname = argv(2);
|
||||
|
||||
if (_tabname.empty())
|
||||
return FALSE;
|
||||
|
||||
_tabname.upper();
|
||||
TString16 m, t(_tabname);
|
||||
|
||||
if (t[0] == '%') t.ltrim(1);
|
||||
|
||||
m << "BATB" << t;
|
||||
_msk = new TMask(m) ;
|
||||
|
||||
for (int i = 0; i < _msk->fields(); i++)
|
||||
if (_msk->fld(i).in_group(GR_SEARCH))
|
||||
{
|
||||
set_search_field(_msk->fld(i).dlg());
|
||||
break;
|
||||
}
|
||||
|
||||
_rel = new TRelation(_tabname);
|
||||
set_title(_msk->get_caption());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool Tab_application::user_destroy()
|
||||
{
|
||||
if (_msk) delete _msk;
|
||||
if (_rel) delete _rel;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1,38 +1,38 @@
|
||||
#ifndef __TABAPP_H
|
||||
#define __TABAPP_H
|
||||
|
||||
#ifndef __RELAPP_H
|
||||
#include <relapp.h>
|
||||
#endif
|
||||
|
||||
#define GR_SEARCH 29
|
||||
#define GR_MODIFY_PROTECTED 30
|
||||
#define GR_RECORD_PROTECTED 31
|
||||
|
||||
#define FPC "FPC"
|
||||
|
||||
class Tab_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
TString16 _tabname;
|
||||
|
||||
protected:
|
||||
virtual bool protected_record(TRectype& rec);
|
||||
virtual TMask* get_mask(int mode = NO_MODE) { return _msk;}
|
||||
virtual bool changing_mask(int mode) { return FALSE;}
|
||||
virtual TRelation* get_relation() const { return _rel;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual bool user_create() ;
|
||||
virtual bool user_destroy() ;
|
||||
virtual void print();
|
||||
|
||||
public:
|
||||
Tab_application() : _msk(NULL), _rel(NULL) {}
|
||||
virtual ~Tab_application() {}
|
||||
const TString& get_tabname() const { return _tabname; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __TABAPP_H
|
||||
#define __TABAPP_H
|
||||
|
||||
#ifndef __RELAPP_H
|
||||
#include <relapp.h>
|
||||
#endif
|
||||
|
||||
#define GR_SEARCH 29
|
||||
#define GR_MODIFY_PROTECTED 30
|
||||
#define GR_RECORD_PROTECTED 31
|
||||
|
||||
#define FPC "FPC"
|
||||
|
||||
class Tab_application : public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
TString16 _tabname;
|
||||
|
||||
protected:
|
||||
virtual bool protected_record(TRectype& rec);
|
||||
virtual TMask* get_mask(int mode = NO_MODE) { return _msk;}
|
||||
virtual bool changing_mask(int mode) { return FALSE;}
|
||||
virtual TRelation* get_relation() const { return _rel;}
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual bool user_create() ;
|
||||
virtual bool user_destroy() ;
|
||||
virtual void print();
|
||||
|
||||
public:
|
||||
Tab_application() : _msk(NULL), _rel(NULL) {}
|
||||
virtual ~Tab_application() {}
|
||||
const TString& get_tabname() const { return _tabname; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user