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:
alex 1995-01-12 18:36:44 +00:00
parent 615ef83d1f
commit b0b58660f5
2 changed files with 111 additions and 113 deletions

View File

@ -1,75 +1,73 @@
#include <stdtypes.h>
#include <relapp.h> #include <tabutil.h>
#include <stdtypes.h> #include <execp.h>
#include <tabutil.h> #include <utility.h>
#include <execp.h> #include <tabapp.h>
#include <utility.h>
#include <tabapp.h> void Tab_application::print()
{
void Tab_application::print() #if XVT_OS == XVT_OS_WIN
{ TExternal_app stampa(format("ba3a -1 %s", (const char *) _tabname));
#if XVT_OS == XVT_OS_WIN #else
TExternal_app stampa(format("ba3a -1 %s", (const char *) _tabname)); TExternal_app stampa(format("ba3 -1 %s", (const char *) _tabname));
#else #endif
TExternal_app stampa(format("ba3 -1 %s", (const char *) _tabname)); stampa.run();
#endif }
stampa.run();
} void Tab_application::init_query_mode(TMask& m)
{
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);
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)
{
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', -GR_MODIFY_PROTECTED);
const bool enable = !(_rel->curr().get_bool(FPC)); m.send_key(K_SHIFT + K_CTRL + 'd' + enable, -GR_RECORD_PROTECTED);
}
m.send_key(K_SHIFT + K_CTRL + 'd' + enable, -GR_RECORD_PROTECTED);
} bool Tab_application::protected_record(TRectype& rec)
{
bool Tab_application::protected_record(TRectype& rec) return rec.get_bool(FPC);
{ }
return rec.get_bool(FPC);
} bool Tab_application::user_create()
{
bool Tab_application::user_create() if (argc() < 3)
{ return FALSE;
if (argc() < 3)
return FALSE; _tabname = argv(2);
_tabname = argv(2); if (_tabname.empty())
return FALSE;
if (_tabname.empty())
return FALSE; _tabname.upper();
TString16 m, t(_tabname);
_tabname.upper();
TString16 m, t(_tabname); if (t[0] == '%') t.ltrim(1);
if (t[0] == '%') t.ltrim(1); m << "BATB" << t;
_msk = new TMask(m) ;
m << "BATB" << t;
_msk = new TMask(m) ; for (int i = 0; i < _msk->fields(); i++)
if (_msk->fld(i).in_group(GR_SEARCH))
for (int i = 0; i < _msk->fields(); i++) {
if (_msk->fld(i).in_group(GR_SEARCH)) set_search_field(_msk->fld(i).dlg());
{ break;
set_search_field(_msk->fld(i).dlg()); }
break;
} _rel = new TRelation(_tabname);
set_title(_msk->get_caption());
_rel = new TRelation(_tabname);
set_title(_msk->get_caption()); return TRUE;
}
return TRUE;
} bool Tab_application::user_destroy()
{
bool Tab_application::user_destroy() if (_msk) delete _msk;
{ if (_rel) delete _rel;
if (_msk) delete _msk; return TRUE;
if (_rel) delete _rel; }
return TRUE;
}

View File

@ -1,38 +1,38 @@
#ifndef __TABAPP_H #ifndef __TABAPP_H
#define __TABAPP_H #define __TABAPP_H
#ifndef __RELAPP_H #ifndef __RELAPP_H
#include <relapp.h> #include <relapp.h>
#endif #endif
#define GR_SEARCH 29 #define GR_SEARCH 29
#define GR_MODIFY_PROTECTED 30 #define GR_MODIFY_PROTECTED 30
#define GR_RECORD_PROTECTED 31 #define GR_RECORD_PROTECTED 31
#define FPC "FPC" #define FPC "FPC"
class Tab_application : public TRelation_application class Tab_application : public TRelation_application
{ {
TMask* _msk; TMask* _msk;
TRelation* _rel; TRelation* _rel;
TString16 _tabname; TString16 _tabname;
protected: protected:
virtual bool protected_record(TRectype& rec); virtual bool protected_record(TRectype& rec);
virtual TMask* get_mask(int mode = NO_MODE) { return _msk;} virtual TMask* get_mask(int mode = NO_MODE) { return _msk;}
virtual bool changing_mask(int mode) { return FALSE;} virtual bool changing_mask(int mode) { return FALSE;}
virtual TRelation* get_relation() const { return _rel;} virtual TRelation* get_relation() const { return _rel;}
virtual void init_query_mode(TMask& m); virtual void init_query_mode(TMask& m);
virtual void init_modify_mode(TMask& m); virtual void init_modify_mode(TMask& m);
virtual bool user_create() ; virtual bool user_create() ;
virtual bool user_destroy() ; virtual bool user_destroy() ;
virtual void print(); virtual void print();
public: public:
Tab_application() : _msk(NULL), _rel(NULL) {} Tab_application() : _msk(NULL), _rel(NULL) {}
virtual ~Tab_application() {} virtual ~Tab_application() {}
const TString& get_tabname() const { return _tabname; } const TString& get_tabname() const { return _tabname; }
}; };
#endif #endif