Corrette le create delle TApplication
git-svn-id: svn://10.65.10.50/trunk@736 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
74197d129b
commit
034dfd861c
@ -515,6 +515,7 @@ bool TMenu_application::check_user()
|
|||||||
|
|
||||||
bool TMenu_application::create()
|
bool TMenu_application::create()
|
||||||
{
|
{
|
||||||
|
TApplication::create();
|
||||||
if (!check_user()) return FALSE;
|
if (!check_user()) return FALSE;
|
||||||
set_perms();
|
set_perms();
|
||||||
test_temp();
|
test_temp();
|
||||||
|
@ -32,6 +32,5 @@ MENUBAR MENU_BAR(4)
|
|||||||
|
|
||||||
MENU MENU_BAR(4)
|
MENU MENU_BAR(4)
|
||||||
SUBMENU MENU_FILE "~File"
|
SUBMENU MENU_FILE "~File"
|
||||||
ITEM BAR_ITEM(1) "~Attiva"
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <utility.h>
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
#include <utility.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
#include <xvtility.h>
|
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
#include "ba1100.h"
|
#include "ba1100.h"
|
||||||
@ -101,6 +100,8 @@ void BA1100_application::print()
|
|||||||
bool BA1100_application::create() // initvar e arrmask
|
bool BA1100_application::create() // initvar e arrmask
|
||||||
|
|
||||||
{
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
_firm = get_firm();
|
_firm = get_firm();
|
||||||
|
|
||||||
if (argc() > 2)
|
if (argc() > 2)
|
||||||
@ -127,7 +128,7 @@ bool BA1100_application::destroy() // releasev e arrmask
|
|||||||
if (_firm) set_firm(_firm);
|
if (_firm) set_firm(_firm);
|
||||||
if (_browse != NULL) delete _browse;
|
if (_browse != NULL) delete _browse;
|
||||||
if (_mask != NULL) delete _mask;
|
if (_mask != NULL) delete _mask;
|
||||||
return TRUE ;
|
return TApplication::destroy() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <xvtility.h>
|
|
||||||
#include <utility.h>
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <mask.h>
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <sheet.h>
|
#include <mask.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
|
#include <sheet.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
#include <utility.h>
|
||||||
#include <validate.h>
|
#include <validate.h>
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
@ -53,6 +51,8 @@ HIDDEN bool seq_handler(TMask_field& f, KEY key)
|
|||||||
bool BA1300_application::create() // initvar e arrmask
|
bool BA1300_application::create() // initvar e arrmask
|
||||||
|
|
||||||
{
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
_firm = get_firm();
|
_firm = get_firm();
|
||||||
|
|
||||||
if (argc() > 2)
|
if (argc() > 2)
|
||||||
@ -75,7 +75,7 @@ bool BA1300_application::destroy() // releasev e arrmask
|
|||||||
if (_firm) set_firm(_firm);
|
if (_firm) set_firm(_firm);
|
||||||
if (_testsheet != NULL) delete _testsheet;
|
if (_testsheet != NULL) delete _testsheet;
|
||||||
if (_mask != NULL) delete _mask;
|
if (_mask != NULL) delete _mask;
|
||||||
return TRUE ;
|
return TApplication::destroy() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray_sheet * BA1300_application::field_sheet(TMask * m)
|
TArray_sheet * BA1300_application::field_sheet(TMask * m)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#define UBYTEMASK 0xFF00
|
#define UBYTEMASK 0xFF00
|
||||||
#define MAXAUT 49
|
#define MAXAUT 49
|
||||||
|
|
||||||
enum kt { _user_key, _aga_key, _prassi_key};
|
enum KeyType { _user_key, _aga_key, _prassi_key};
|
||||||
|
|
||||||
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
#define BITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
|
||||||
#define BITSET(w,p,v) ((v) ? ((w) |= (0x0001 << (p))) : ((w) &= (~(0x0001 << (p)))))
|
#define BITSET(w,p,v) ((v) ? ((w) |= (0x0001 << (p))) : ((w) &= (~(0x0001 << (p)))))
|
||||||
@ -26,15 +26,16 @@ class TAttivazione_moduli : public TApplication
|
|||||||
{
|
{
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
|
|
||||||
kt _key_type;
|
KeyType _key_type;
|
||||||
word _serno;
|
word _serno;
|
||||||
word _port;
|
word _port;
|
||||||
|
|
||||||
virtual bool create() ;
|
virtual bool create() ;
|
||||||
virtual bool destroy() ;
|
virtual bool destroy() ;
|
||||||
bool menu(MENU_TAG);
|
virtual bool use_files() const { return FALSE; }
|
||||||
void generate_key();
|
virtual bool menu(MENU_TAG);
|
||||||
|
|
||||||
|
void generate_key();
|
||||||
static void keyext(const TString & s, word * v);
|
static void keyext(const TString & s, word * v);
|
||||||
static bool user_hnd(TMask_field & f, KEY k);
|
static bool user_hnd(TMask_field & f, KEY k);
|
||||||
static bool decode_hnd(TMask_field & f, KEY k);
|
static bool decode_hnd(TMask_field & f, KEY k);
|
||||||
@ -45,7 +46,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
HIDDEN TAttivazione_moduli& app() { return (TAttivazione_moduli &) main_app(); }
|
HIDDEN TAttivazione_moduli& app() { return (TAttivazione_moduli &)main_app(); }
|
||||||
|
|
||||||
|
|
||||||
void TAttivazione_moduli::generate_key()
|
void TAttivazione_moduli::generate_key()
|
||||||
@ -293,6 +294,10 @@ bool TAttivazione_moduli::create()
|
|||||||
if (user() != "PRASSI")
|
if (user() != "PRASSI")
|
||||||
return error_box("Utente non abilitato all'uso di questo programma");
|
return error_box("Utente non abilitato all'uso di questo programma");
|
||||||
|
|
||||||
|
disable_menu_item(M_FILE_NEW);
|
||||||
|
disable_menu_item(M_FILE_REVERT);
|
||||||
|
disable_menu_item(M_FILE_PG_SETUP);
|
||||||
|
|
||||||
_msk = new TMask("ba1500a") ;
|
_msk = new TMask("ba1500a") ;
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
if (Hl_Port(AGAADR) != 0)
|
if (Hl_Port(AGAADR) != 0)
|
||||||
@ -314,6 +319,7 @@ bool TAttivazione_moduli::create()
|
|||||||
HL_LOGOUT();
|
HL_LOGOUT();
|
||||||
HL_LOGIN(USERADR, DONT_CARE, REFKEY, VERKEY);
|
HL_LOGIN(USERADR, DONT_CARE, REFKEY, VERKEY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (_key_type)
|
switch (_key_type)
|
||||||
{
|
{
|
||||||
case _user_key:
|
case _user_key:
|
||||||
|
@ -381,6 +381,7 @@ bool BA3200_application::preprocess_print(int file, int counter)
|
|||||||
set_headers();
|
set_headers();
|
||||||
set_footers();
|
set_footers();
|
||||||
set_translations();
|
set_translations();
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BA3200_application::user_destroy()
|
bool BA3200_application::user_destroy()
|
||||||
|
34
ba/ba5.cpp
34
ba/ba5.cpp
@ -1,6 +1,4 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <date.h>
|
|
||||||
#include <lffiles.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
@ -29,8 +27,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TSoci_sheet::TSoci_sheet(bool fis)
|
TSoci_sheet::TSoci_sheet(bool fis)
|
||||||
: TArray_sheet(-1,-1, 0, 0, "Soci", fis ? PHYSICAL_HEAD : JURASSIC_HEAD),
|
: TArray_sheet(-1,-1, 0, 0, "Soci", fis ? PHYSICAL_HEAD : JURASSIC_HEAD),
|
||||||
_physical(fis)
|
_physical(fis)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const char* TSoci_sheet::lastcode()
|
const char* TSoci_sheet::lastcode()
|
||||||
@ -40,8 +38,8 @@ const char* TSoci_sheet::lastcode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TSoci_sheet::add_socio(const TString& codice,
|
void TSoci_sheet::add_socio(const TString& codice,
|
||||||
const TString& ragione,
|
const TString& ragione,
|
||||||
int elem)
|
int elem)
|
||||||
{
|
{
|
||||||
if (elem == -1 && codice == lastcode()) return;
|
if (elem == -1 && codice == lastcode()) return;
|
||||||
|
|
||||||
@ -54,8 +52,8 @@ void TSoci_sheet::add_socio(const TString& codice,
|
|||||||
t.add(ragione.mid(30));
|
t.add(ragione.mid(30));
|
||||||
} else t.add(ragione);
|
} else t.add(ragione);
|
||||||
|
|
||||||
if (elem < 0) add(t);
|
if (elem < 0) add(t);
|
||||||
else row(elem) = t;
|
else row(elem) = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -162,7 +160,7 @@ bool TQuery_application::create()
|
|||||||
|
|
||||||
create_files();
|
create_files();
|
||||||
create_masks();
|
create_masks();
|
||||||
dispatch_e_menu(MENU_ITEM(1));
|
dispatch_e_menu(MENU_ITEM(1));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -183,7 +181,7 @@ bool TQuery_application::menu(MENU_TAG m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char* head(const TRectype& r, const char* name,
|
const char* head(const TRectype& r, const char* name,
|
||||||
const char* title)
|
const char* title)
|
||||||
{
|
{
|
||||||
if (title == NULL) title = name;
|
if (title == NULL) title = name;
|
||||||
|
|
||||||
@ -225,7 +223,7 @@ bool TQuery_application::do_query()
|
|||||||
|
|
||||||
TToken_string& t = (TToken_string&) s.row(i);
|
TToken_string& t = (TToken_string&) s.row(i);
|
||||||
|
|
||||||
t.restart();
|
t.restart();
|
||||||
cur_codice = t.get();
|
cur_codice = t.get();
|
||||||
anag.zero();
|
anag.zero();
|
||||||
anag.put("TIPOA", query.tipo());
|
anag.put("TIPOA", query.tipo());
|
||||||
@ -271,14 +269,14 @@ bool TQuery_application::do_query()
|
|||||||
row.add(soci.get("CODDITTA"));
|
row.add(soci.get("CODDITTA"));
|
||||||
ditte.put("CODDITTA", row.get(1));
|
ditte.put("CODDITTA", row.get(1));
|
||||||
if (_ditte->read() != NOERR)
|
if (_ditte->read() != NOERR)
|
||||||
row.add("Ditta assente");
|
row.add("Ditta assente");
|
||||||
else
|
else
|
||||||
row.add(ditte.get("RAGSOC"));
|
row.add(ditte.get("RAGSOC"));
|
||||||
row.add(soci.get("CODCAR"));
|
row.add(soci.get("CODCAR"));
|
||||||
row.add(soci.get("RICQUAL"));
|
row.add(soci.get("RICQUAL"));
|
||||||
row.add(soci.get("Q740"));
|
row.add(soci.get("Q740"));
|
||||||
row.add(soci.get("QUATTPREV"));
|
row.add(soci.get("QUATTPREV"));
|
||||||
row.add(soci.get("PERCQUAZ"));
|
row.add(soci.get("PERCQUAZ"));
|
||||||
|
|
||||||
d.add(row);
|
d.add(row);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ public:
|
|||||||
|
|
||||||
bool TConversione_archivi::create()
|
bool TConversione_archivi::create()
|
||||||
{
|
{
|
||||||
|
TApplication::create();
|
||||||
|
|
||||||
if (argc() < 3)
|
if (argc() < 3)
|
||||||
{
|
{
|
||||||
_error = 101;
|
_error = 101;
|
||||||
@ -170,4 +172,3 @@ int main(int argc,char** argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user