git-svn-id: svn://10.65.10.50/branches/R_10_00@23190 c028cbd2-c16b-5b4b-a496-9718f37d4682

This commit is contained in:
guy 2016-04-15 08:17:28 +00:00
parent 86448985ed
commit db4a70fcd3
28 changed files with 246 additions and 439 deletions

View File

@ -1168,12 +1168,7 @@ bool TAlex_virtual_machine::execute(const TBytecode& bc)
bool TAlex_virtual_machine::compile(const char* cmd, TBytecode& bc)
{
#ifdef LINUX
string s(cmd);
istringstream instr(s);
#else
istrstream instr((char*)cmd, (size_t)strlen(cmd));
#endif
istrstream instr((const char*)cmd, strlen(cmd));
return compile(instr, bc);
}

View File

@ -1,6 +1,7 @@
#include <about.h>
#include <applicat.h>
#include <colors.h>
#include <config.h>
#include <dongle.h>
#include <extcdecl.h>
#include <isam.h>
@ -369,8 +370,14 @@ const char* TApplication::get_module_name() const
{
const TDongle& d = dongle();
const TString4 modname = _name.left(2);
const word aut = d.module_name2code(modname);
module = d.module_code2desc(aut);
word aut = d.module_name2code(modname);
if (aut = 0xFFFF && modname == "ps")
{
aut = 0;
module = TR("Personalizzazioni");
}
else
module = d.module_code2desc(aut);
bool ok = module.full();
if (ok && aut > 0 && check_autorization())
ok = has_module(aut) && dongle().login(modname);

View File

@ -1,3 +1,4 @@
#pragma once
#ifndef __APPLICATION_H
#define __APPLICATION_H
@ -5,8 +6,8 @@
#include <diction.h>
#endif
#ifndef __ASSOC_H
#include <assoc.h>
#ifndef __CONFIG_H
#include <config.h>
#endif
#define MSG_AI "AI" // message auto_insert (relapp)

View File

@ -1,310 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// ASECard Memory SDK Header File
//
// LICENSE AGREEMENT:
// 1. COPYRIGHTS AND TRADEMARKS
// The ASECard Memory SDK and its documentation are copyright (C) 2003 ,
// by Athena Smartcard Solution Inc.. All rights reserved.
//
// ASECard is a trademark of Athena Smartcard Solutions Inc.. All other trademarks, brands, and product
// names used in this guide are trademarks of their respective owners.
//
// 2. Title & Ownership
// THIS IS A LICENSE AGREEMENT AND NOT AN AGREEMENT FOR SALE.
// The Code IS NOT FOR SALE and is and shall remain in Athena's sole property.
// All right, title and interest in and to the Code, including associated
// intellectual property rights, in and to the Code are and will remain with Athena.
//
// 3. Disclaimer of Warranty
// THE CODE CONSTITUTES A CODE SAMPLE AND IS NOT A COMPLETE PRODUCT AND MAY CONTAIN
// DEFECTS, AND PRODUCE UNINTENDED OR ERRONEOUS RESULTS. THE CODE IS PROVIDED "AS IS",
// WITHOUT WARRANTY OF ANY KIND. Athena DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE.
// The entire risk arising out of the use or performance of the Code remains with you.
//
// 4. No Liability For Damages
// Without derogating from the above, in no event shall Athena be liable for any damages
// whatsoever (including, without limitation, damages for loss of business profits, business
// interruption, loss of business information, or other pecuniary loss) arising out of the
// use of or inability to use the Code, even if Athena has been advised of the possibility
// of such damages. Your sole recourse in the event of any dissatisfaction with the Code is
// to stop using it and return it.
/////////////////////////////////////////////////////////////////////////////
#ifndef ASEMEMCARDS_H
#define ASEMEMCARDS_H
#define ASEMEM_API __stdcall
/***************************************************/
/* Card Errors */
/***************************************************/
/*
* No error was encountered.
*/
#define ASEMEM_S_SUCCESS 0x0
/*
* The smart card does not support the current function.
*/
#define ASEMEM_E_FUNCTION_NOT_SUPPORTED 0x20
/*
* The smart card has been removed, so that further communication is not possible.
*/
#define ASEMEM_E_REMOVED_CARD 0x21
/*
* The smart card is unpowered, so that further communication is not possible.
*/
#define ASEMEM_E_UNPOWERED_CARD 0x22
/*
* Smartcard is not supported.
*/
#define ASEMEM_E_UNSUPPORTED_CARD 0x23
/*
* The supplied password is incorrect.
*/
#define ASEMEM_E_PASSWORD_VERIFICATION_FAILED 0x24
/*
* The card cannot be accessed because the maximum number
* of password verification attempts has been reached.
*/
#define ASEMEM_E_PASSWORD_BLOCKED 0x25
/*
* The supplied handle is invalid.
*/
#define ASEMEM_E_INVALID_HANDLE 0x26
/*
* One or more of the supplied parameters are invalid.
*/
#define ASEMEM_E_INVALID_PARAMETER 0x27
/*
* The operation requires a smart card, but no smart card is currently in the device.
*/
#define ASEMEM_E_NO_SMARTCARD 0x28
/*
* The smart card has been reset.
*/
#define ASEMEM_E_RESET_CARD 0x29
/*
* The smart card cannot be accessed because of other outstanding connections.
*/
#define ASEMEM_E_SHARING_VIOLATION 0x2A
/*
* The specified reader name is not recognized.
*/
#define ASEMEM_E_UNKNOWN_READER 0x2B
/*
* No smart card reader is available.
*/
#define ASEMEM_E_NO_READERS_AVAILABLE 0x2C
/*
* The data buffer is too small for the returned data.
*/
#define ASEMEM_E_INSUFFICIENT_BUFFER 0x2D
/*
* The smart card resource manager has shut down.
*/
#define ASEMEM_E_SERVICE_STOPPED 0x2E
/*
* The user-specified timeout value has expired.
*/
#define ASEMEM_E_TIMEOUT 0x2F
/*
* Address out of range
*/
#define ASEMEM_E_NO_MEMORY 0x30
/*
* An unknown error has occurred.
*/
#define ASEMEM_E_UNKNOWN_ERROR 0x31
/***************************************************/
/* Card Types */
/***************************************************/
#define ASEMEM_CARD_TYPE_UNKNOWN 0x0
#define ASEMEM_CARD_TYPE_2BUS 0x10
#define ASEMEM_CARD_TYPE_3BUS 0x11
#define ASEMEM_CARD_TYPE_I2C 0x12
#define ASEMEM_CARD_TYPE_XI2C 0x13
/***************************************************/
/* Card State */
/***************************************************/
#define ASEMEM_CARD_IN 0x1
#define ASEMEM_CARD_OUT 0x2
/***************************************************/
/* Protected State */
/***************************************************/
/* DATA Read */
#define ASEMEM_DATA_PROTECTED 0x0
#define ASEMEM_DATA_NOT_PROTECTED 0x1
/* WRITE Mode */
#define ASEMEM_WRITE_AND_PROTECT_MODE 0x1
#define ASEMEM_WRITE_MODE 0x0
/***************************************************/
/* Card Timeout */
/***************************************************/
/* Infinite timeout */
#define INFINITE_WAIT_TIME 0xFFFFFFFF
/***************************************************/
/* 2BUS and 3BUS password length */
/***************************************************/
#define ASEMEM_2BUS_PASSWORD_LENGTH 0x3
#define ASEMEM_3BUS_PASSWORD_LENGTH 0x2
/***************************************************/
/* Connect Modes */
/***************************************************/
/* This application is willing to share the card with other applications.*/
#define ASEMEM_SHARE_SHARED 0x0
/* This application is not willing to share the card with other applications.*/
#define ASEMEM_SHARE_EXCLUSIVE 0x1
/* Work in XI2C mode*/
#define ASEMEM_XI2C 0x2
/***************************************************/
/* Cards Adress */
/***************************************************/
/* All data size of 2BUS card*/
#define ASEMEM_2BUS_DATA_SIZE 256
/* Protected data size of 2BUS card*/
#define ASEMEM_2BUS_PROTECTED_DATA_SIZE 32
/* All data size of 3BUS card*/
#define ASEMEM_3BUS_DATA_SIZE 1021
/* Protected data size of 3BUS card*/
#define ASEMEM_3BUS_PROTECTED_DATA_SIZE 1021
/***************************************************/
/* Disconnect Modes */
/***************************************************/
/* Don't do anything special */
#define ASEMEM_LEAVE_CARD 0x2
/* Reset the card */
#define ASEMEM_RESET_CARD 0x4
/* Power down the card */
#define ASEMEM_UNPOWER_CARD 0x6
/***************************************************/
/* Data Types */
/***************************************************/
/* Card handle */
typedef void * ASEMEM_HANDLE;
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************/
/* ASECard Memory Functions */
/***************************************************/
/*
* ASEListReaders - returns the list of all connected readers in a multi string and
* its length. If readerList param is NULL the function will return the expected
* length of readerList.
*
* In parameters: readerList (If NULL).
* Out parameters: readerList, length.
*/
unsigned long ASEMEM_API ASEListReaders(char * readersList, unsigned long * length);
/*
* ASEWaitForCardEvent - waits for card status IN or OUT depends on inOut parameter.
* The functionwaits the amount of Ms spcified in timeOut on reader.
*
* In parameters: reader, inOut, timeOut.
* Out parameters:
*/
unsigned long ASEMEM_API ASEWaitForCardEvent(char * reader, unsigned char inOut, unsigned long timeOut);
/*
* ASEMemConnect - connect to the card in reader. the function returns,
* on success, hCard and cardType.
*
* In parameters: reader, connectMode.
* Out parameters: hCard, cardType.
*/
unsigned long ASEMEM_API ASEMemConnect(ASEMEM_HANDLE * hCard, char * reader, unsigned long connectMode, unsigned long * cardType);
/*
* ASEMemDisconnect - disconnect a card by card handle at specific mode:leave card,
* reset card or unpower card.
*
* In parameters: hCard, mode.
* Out parameters:
*/
unsigned long ASEMEM_API ASEMemDisconnect(ASEMEM_HANDLE hCard, char mode);
/*
* ASEMemWrite - writeBuffer to a card from address lenWrite long.
* It can write or write and protect depend
* on protect parameter.
*
* In parameters: hCard, address, writeBuffer, lenWrite, protect.
* Out parameters:
*/
unsigned long ASEMEM_API ASEMemWrite(ASEMEM_HANDLE hCard, unsigned long address, unsigned char * writeBuffer, unsigned long lenWrite, char protect);
/*
* ASEMemRead - reads from a card from address lenRead long.
* If protReadBuffer or ReadBuffer are
* NULL this type of reading will not take place.
*
* In parameters: hCard, address, ReadBuffer, protReadBuffer, lenRead.
* Out parameters:
*/
unsigned long ASEMEM_API ASEMemRead(ASEMEM_HANDLE hCard, unsigned long address, unsigned char * readBuffer, unsigned char * protReadBuffer, unsigned long lenRead);
/*
* ASEMemVerifyPassword - verify card's password supported only by 2BUS and 3BUS cards.
* User should supply password and its length. Returns number of left attempts.
*
* In parameters: hCard, password, length.
* Out parameters: attempts.
*/
unsigned long ASEMEM_API ASEMemVerifyPassword(ASEMEM_HANDLE hCard, unsigned char * password, unsigned long length, int * attempts);
/*
* ASEMemChangePassword - verify card's password if it is not verified yet then change
* password. Supported only by 2BUS and 3BUS cards. User should supply oldPassword,
* newPassword and length.
* If the password is not verified and the oldPassword fails verify the password will
* not be changed.
* If the password was verified change will succeed even if oldPassword is wrong.
* Returns number of left attempts.
*
* In parameters: hCard, oldPassword, newPassword, length.
* Out parameters: attempts.
*/
unsigned long ASEMEM_API ASEMemChangePassword(ASEMEM_HANDLE hCard,unsigned char * oldPassword, unsigned char * newPassword, unsigned long length, int * attempts);
#ifdef __cplusplus
}
#endif
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -58,6 +58,7 @@
#define CLASS_PROP_FIELD 255
#define CLASS_MVC_FIELD 256
#define CLASS_TREELIST_FIELD 257
#define CLASS_METROLIST_FIELD 258
#define CLASS_TOOL_FIELD 280
#define CLASS_BUTTON_TOOL 281

View File

@ -1798,7 +1798,11 @@ TPushbutton_control::TPushbutton_control(WINDOW win, short cid,
{
const bool drawable = bmp_up > 0;
create(win, cid, left, top, width, height, flags, text, WC_PUSHBUTTON, NULL, drawable);
set_bmp(bmp_up, bmp_dn);
if (bmp_up > 10000 && height >= 2)
set_icon(bmp_up, bmp_dn);
else
set_bmp(bmp_up, bmp_dn);
}
TPushbutton_control::~TPushbutton_control()

View File

@ -1,5 +1,6 @@
#include <xvt.h>
#include <config.h>
#include <dongle.h>
#include <execp.h>
#include <recarray.h>

View File

@ -161,10 +161,10 @@ void TEval_stack::push(bool b)
if (_sp < _data.items())
{
_sp++;
peek_real() = b ? 1.0 : 0.0;
peek_real() = b ? UNO : ZERO;
}
else
TStack::push(new TValue(b ? real(1.0) : ZERO));
TStack::push(new TValue(b ? UNO : ZERO));
}
void TEval_stack::push(int n)
@ -240,6 +240,23 @@ TString& TEval_stack::peek_string()
return o.string();
}
TTypeexp TEval_stack::top1_type() const
{
return count() > 0 ? ((const TValue&)peek(0)).type() : _mixexpr;
}
TTypeexp TEval_stack::top2_type() const
{
if (count() >= 2)
{
const TValue& o1 = (const TValue&)peek(0);
const TValue& o2 = (const TValue&)peek(1);
if (o1.type() == o2.type())
return o1.type();
}
return _mixexpr;
}
///////////////////////////////////////////////////////////
// TExpression
///////////////////////////////////////////////////////////
@ -259,7 +276,7 @@ TExpression::TExpression(TTypeexp type, bool ignore_err)
{
_ignore_error=ignore_err;
_error=0;
_dirty = FALSE;
_dirty = false;
_type = type;
_code.clear();
}
@ -275,8 +292,7 @@ TExpression::TExpression(const TExpression & expr)
TObject* TExpression::dup() const
{
TExpression* o = new TExpression(*this);
return o;
return new TExpression(*this);
}
const real & TExpression::as_real()
@ -316,7 +332,7 @@ void TExpression::setvar(const char* varname, const real& val)
if (_var.getnum(varname) != val)
{
_var.set(varname, val);
_dirty = TRUE;
_dirty = true;
}
}
@ -325,7 +341,7 @@ void TExpression::setvar(int varnum, const real& val)
if (_var.getnum(varnum) != val)
{
_var.set(varnum, val);
_dirty = TRUE;
_dirty = true;
}
}
@ -356,7 +372,10 @@ bool TExpression::print_error(const char* msg) const
static bool str2date(const TString& s, TDate& d)
{
if (s.blank() || s == "0")
{
d = 0L;
return true;
}
if (TDate::isdate(s))
{
@ -486,17 +505,26 @@ void TExpression::eval()
}
break;
case _equal:
if (type == _strexpr)
if (evalstack.top2_type() == _numexpr)
{
const TString & s2 = evalstack.pop_string();
const TString & s1 = evalstack.pop_string();
evalstack.push(s1 == s2);
const real & r2 = evalstack.pop_real();
real& r1 = evalstack.peek_real();
r1 = (r1 == r2) ? UNO : ZERO;
}
else
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 == r2) ? 1.0 : 0.0;
if (type == _strexpr)
{
const TString & s2 = evalstack.pop_string();
const TString & s1 = evalstack.pop_string();
evalstack.push(s1 == s2);
}
else
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 == r2) ? UNO : ZERO;
}
}
break;
case _match:
@ -517,7 +545,7 @@ void TExpression::eval()
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 != r2) ? 1.0 : 0.0;
r1 = (r1 != r2) ? UNO : ZERO;
}
break;
case _lt:
@ -531,7 +559,7 @@ void TExpression::eval()
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 < r2) ? 1.0 : 0.0;
r1 = (r1 < r2) ? UNO : ZERO;
}
break;
case _gt:
@ -545,7 +573,7 @@ void TExpression::eval()
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 > r2) ? 1.0 : 0.0;
r1 = (r1 > r2) ? UNO : ZERO;
}
break;
case _lteq:
@ -559,7 +587,7 @@ void TExpression::eval()
{
const real& r2 = evalstack.pop_real();
real& r1 = evalstack.peek_real();
r1 = (r1 <= r2) ? 1.0 : 0.0;
r1 = (r1 <= r2) ? UNO : ZERO;
}
break;
case _gteq:
@ -573,7 +601,7 @@ void TExpression::eval()
{
const real & r2 = evalstack.pop_real();
real & r1 = evalstack.peek_real();
r1 = (r1 >= r2) ? 1.0 : 0.0;
r1 = (r1 >= r2) ? UNO : ZERO;
}
break;
case _userfunc:
@ -743,14 +771,31 @@ void TExpression::eval()
}
}
break;
case _bool:
{
if (evalstack.top1_type() == _numexpr)
{
real& r1 = evalstack.peek_real();
if (!r1.is_zero()) r1 = UNO;
}
else
{
const TString& s = evalstack.pop_string();
if (s.full() && strchr("1SXY", s[0]))
evalstack.push(UNO);
else
evalstack.push(ZERO);
}
}
break;
case _ansi:
{
TString& s = evalstack.peek_string();
if (!s.empty())
{
const TDate d(s);
s = d.string(ANSI);
}
TDate d;
if (str2date(s, d))
s = d.string(ANSI);
else
s.cut(0);
}
break;
case _num:
@ -867,17 +912,17 @@ HIDDEN char _tok[81];
TCodesym TExpression::tok2fun(const char* tok) const
{
const int MAX_TOK = 34;
HIDDEN const char* fnstr[MAX_TOK] = { "ANSI", "BETWEEN","CEIL", "CF_CHECK","COS",
"EXP", "EXP10", "IF", "LEFT", "LEN",
const int MAX_TOK = 35;
HIDDEN const char* fnstr[MAX_TOK] = { "ANSI", "BETWEEN","BOOL", "CEIL", "CF_CHECK",
"COS", "EXP", "EXP10", "IF", "LEFT", "LEN",
"LOG", "LOG10", "MAX", "MID", "MIN",
"NUM", "PERC", "PI_CHECK","POW", "RIGHT",
"ROUND", "SCON2PERC", "SCORP","SIN", "SQR", "SQRT",
"STR", "SUBSTR", "TAN", "TRIM", "TRUNC",
"UPPER", "YEAR", "ZEROFILL" };
HIDDEN TCodesym fntok[MAX_TOK] = { _ansi, _between, _ceil, _cfcheck, _cos,
_exp, _exp10, _if, _left, _len,
HIDDEN TCodesym fntok[MAX_TOK] = { _ansi, _between, _bool, _ceil, _cfcheck,
_cos, _exp, _exp10, _if, _left, _len,
_log, _log10, _max, _mid, _min,
_num, _perc, _picheck, _pow, _right,
_round, _scon2perc,_scorp, _sin, _sqr,
@ -1200,6 +1245,7 @@ TCodesym TExpression::__factor(TCodesym startsym)
case _len:
case _year:
case _scon2perc:
case _bool:
sym = __function(1);
_code.add(startsym);
break;

View File

@ -1,3 +1,4 @@
#pragma once
#ifndef __EXPR_H
#define __EXPR_H
@ -77,14 +78,16 @@ enum TCodesym {
_picheck, // @emem controlla la partita IVA (+stato)
_year, // @emem estrae l'anno da una data
_zerofill, // @emem riepie di zeri l'inizio di una stringa
_scon2perc // @emem converte una espressione in percentuale di sconto
_scon2perc, // @emem converte una espressione in percentuale di sconto
_bool, // @emem converte una espressione in booleano (0 o 1)
};
// @doc INTERNAL
// @enum TTypeexp | Tipi di espressioni definiti
enum TTypeexp {
_numexpr, // @emem Espressione numerica
_strexpr } ; // @emem Espressione in lettere
_strexpr, // @emem Espressione in lettere
_mixexpr } ;
// @doc INTERNAL
@ -380,12 +383,15 @@ public:
real& peek_real();
TString& pop_string();
TString& peek_string();
void push(bool b);
void push(int n);
void push(const real& r);
void push(const TString& s);
void push(const char* s);
TTypeexp top1_type() const;
TTypeexp top2_type() const;
};
// @doc EXTERNAL

View File

@ -4,12 +4,72 @@
#include <lffiles.h>
#include <utility.h>
#include <config.h>
#include <prefix.h>
#include <extcdecl.h>
#define BLOCKLEN 512
#define INVFLD 255
// @doc EXTERNAL
// @class TFile | Classe per la definizione dei metodi che comprendono tutte le
// procedure per l'accesso fisico di basso livello ai file.
//
// @base public | TObject
class TFile : public TObject
// @author:(INTERNAL) Alessandro
// @access:(INTERNAL) Private Member
{
// @cmember:(INTERNAL) Descrittore del file
SecDef* _file;
// @cmember:(INTERNAL) Lunghezza del record
int _len;
// @cmember:(INTERNAL) Offset iniziale del file in settori
int _base;
// @access Public Member
public:
// @cmember Apre il file specificato
void open(const char* name, TFilelock lockmode = _manulock);
// @cmember Controlla se il file specificato e' corretto (TRUE se non vi sono errori)
bool verify(const char* name);
// @cmember Crea il file specificato
void create(const char* name, TRecnotype nrecord = 10);
// @cmember Cambia le dimensioni di un file
void chsize(const char* name, TRecnotype nrecord);
// @cmember Chiude il file
void close();
// @cmember Elimina il file specificato
void unlink(const char* name);
// @cmember Legge un record dal file
void read(char* record, TRecnotype recnum, TReclock lock = _nolock);
// @cmember Scrive un record sul file
void write(char* record, TRecnotype recnum, TReclock lock = _nolock);
// @cmember Ritorna lo stato di errore del file
int status() const ;
// @cmember Ritorna l'offset di base
int& base()
{ return _base; }
// @cmember Ritorna la lunghezza del record
int& len()
{ return _len; }
// @cmember Controlla che non vi siano errori nel file aperto (TRUE se tutto normale)
bool ok() const
{ return status() == NOERR; }
// @cmember Controlla se vi sono errori nel file aperto (TRUE se non ci sono errori)
bool error() const
{ return status() != NOERR; }
// @cmember Costruttore
TFile(int lenrec = 0, int base = 0);
// @cmember Distruttore
virtual ~TFile();
};
TFile::TFile (int lenrec, int base)
{
_file = new SecDef;
@ -131,7 +191,7 @@ TDir::TDir(const TDir& d)
TDir::~TDir ()
{ }
const char *TDir::name () const
const char* TDir::name () const
{
return _dir.SysName;
}
@ -280,6 +340,11 @@ void TDir::get (
_com = _dir.SysName[0] != '$';
}
void TDir::get_ext(int nfile)
{
_dir = prefix().get_filedes(nfile);
}
// @doc EXTERNAL
// @mfunc Aggiorna il file indicato con i parametri passati

View File

@ -10,72 +10,13 @@
#endif
#ifndef __CONFIG_H
#include <config.h>
class TConfig;
#endif
#define DESCPAR "FieldDescr"
#define DESCTAB "TabDescr"
#define DESCDIR "recdesc"
// @doc EXTERNAL
// @class TFile | Classe per la definizione dei metodi che comprendono tutte le
// procedure per l'accesso fisico di basso livello ai file.
//
// @base public | TObject
class TFile : public TObject
// @author:(INTERNAL) Alex
// @access:(INTERNAL) Private Member
{
// @cmember:(INTERNAL) Descrittore del file
SecDef* _file;
// @cmember:(INTERNAL) Lunghezza del record
int _len;
// @cmember:(INTERNAL) Offset iniziale del file in settori
int _base;
// @access Public Member
public:
// @cmember Apre il file specificato
void open(const char* name, TFilelock lockmode = _manulock);
// @cmember Controlla se il file specificato e' corretto (TRUE se non vi sono errori)
bool verify(const char* name);
// @cmember Crea il file specificato
void create(const char* name, TRecnotype nrecord = 10);
// @cmember Cambia le dimensioni di un file
void chsize(const char* name, TRecnotype nrecord);
// @cmember Chiude il file
void close();
// @cmember Elimina il file specificato
void unlink(const char* name);
// @cmember Legge un record dal file
void read(char* record, TRecnotype recnum, TReclock lock = _nolock);
// @cmember Scrive un record sul file
void write(char* record, TRecnotype recnum, TReclock lock = _nolock);
// @cmember Ritorna lo stato di errore del file
int status() const ;
// @cmember Ritorna l'offset di base
int& base()
{ return _base; }
// @cmember Ritorna la lunghezza del record
int& len()
{ return _len; }
// @cmember Controlla che non vi siano errori nel file aperto (TRUE se tutto normale)
bool ok() const
{ return status() == NOERR; }
// @cmember Controlla se vi sono errori nel file aperto (TRUE se non ci sono errori)
bool error() const
{ return status() != NOERR; }
// @cmember Costruttore
TFile(int lenrec = 0, int base = 0);
// @cmember Distruttore
virtual ~TFile();
};
// @doc EXTERNAL
@ -83,9 +24,7 @@ public:
//
// @base public | TObject
class TDir : public TObject
// @author:(INTERNAL) Sandro
// @author:(INTERNAL) Alessandro
// @access:(INTERNAL) Private Member
{
@ -102,6 +41,9 @@ public:
void get(int nfile, TReclock lock = _nolock, TDirtype dirtype = _nordir, TDirop op = _nordirop);
// @cmember Aggiorna il file indicato con i parametri passati
void put(int nfile, TDirtype dirtype = _nordir, TDirop op = _nordirop);
// @cmember load external isamfile info
void get_ext(int nfile);
// @cmember Azzera i parametri del file selezionato
void zero();
@ -148,8 +90,8 @@ public:
// @cmember Ritorna il numero di file presenti nella directory <p dirtype>
int items(TDirtype dirtype = _nordir) const;
// @cmember Ritorna il descrittore del file "dir.gen"
const FileDes& filedesc() const { return _dir; }
FileDes& filedesc() { return _dir; }
//const FileDes& filedesc() const { return _dir; }
//FileDes& filedesc() { return _dir; }
// @cmember Controlla se il file appartiene ai dati comuni. Valido solo se
// la get e' stata effettuata con _sysdirop
bool is_com() const { return _com; }
@ -158,7 +100,7 @@ public:
bool is_firm() const { return !_com; }
// @cmember Controlle se il file e' valido (nome esistente e dimensione
// diversa da 0)
bool is_valid() { return name()[0] > ' ' && len() > 0; }
bool is_valid() const { return name()[0] > ' ' && len() > 0; }
// @cmember Controlla se il file e' attivato dalla chiave hardware.
// Valido solo se prefhnd e settato a ""
bool is_active() const;
@ -183,8 +125,7 @@ public:
// @base public | TSortable
class TTrec : public TSortable
// @author:(INTERNAL) Sandro
// @author:(INTERNAL) Alessandro
// @access:(INTERNAL) Private Member
{

View File

@ -2,6 +2,7 @@
#define WIN32_EXTRA_LEAN
#define XVT_INCL_NATIVE
#include <config.h>
#include <controls.h>
#include <diction.h>
#include <golem.h>

View File

@ -189,6 +189,7 @@
#define LF_LVRCONDV 169
#define LF_CONTACT 170
#define LF_IVADIFF 171
#define LF_RMOVANAC 172
#define LF_EXTERNAL 1000 // Files with id >= are considered to be externals

View File

@ -1,6 +1,7 @@
#include <xinclude.h>
#include <controls.h>
#include <config.h>
#include <browfile.h>
#include <colors.h>
#include <diction.h>
@ -1360,7 +1361,7 @@ WINDOW TMask::create_book(bool single)
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
wd.wtype = WC_NOTEBK;
wd.ctlcolors = xcc;
wd.v.ctl.flags = CTL_FLAG_TAB_DEFAULT | CTL_FLAG_TAB_TOP;
wd.v.ctl.flags = CTL_FLAG_TAB_DEFAULT | CTL_FLAG_TAB_TOP | (CAMPI_SCAVATI ? 0 : WSF_NO_TASKBAR);
xvt_vobj_get_client_rect(parent, &wd.rct);
_notebook = xvt_ctl_create_def(&wd, parent, long(this));
xvt_pane_add(parent, _notebook, "_MainNoteBook_", 0, 0);
@ -1425,7 +1426,7 @@ WINDOW TMask::create_bar(int height)
w = create_interface(win(), 0, height, 0, 0, "", this); // Bottom bar
else
{
const long flags = TOOL_TEXT ? CTL_FLAG_PASSWORD : 0;
const long flags = (TOOL_TEXT ? CTL_FLAG_PASSWORD : 0) | (CAMPI_SCAVATI ? 0 : WSF_NO_TASKBAR);
w = xvt_toolbar_create(-1, 0, 0, -1, TOOL_SIZE, flags, win()); // Top bar
XVT_COLOR_COMPONENT cc[4]; memset(cc, 0, sizeof(cc));
cc[0].type = XVT_COLOR_BLEND; cc[0].color = MASK_BACK_COLOR;

View File

@ -547,7 +547,7 @@ TSpreadsheet::TSpreadsheet(
l->active_back_color = FOCUS_BACK_COLOR;
l->white_space_color = MASK_DARK_COLOR;
l->rule_color = MASK_DARK_COLOR;
// Definizione della prima colonna (numero di riga)
word attr = XI_ATR_RJUST;
if (sheet_mask().id2pos(FIRST_FIELD-1) >= 0)
@ -614,6 +614,9 @@ TSpreadsheet::TSpreadsheet(
coldef->v.column->center_heading = true;
if (flags & XI_ATR_SELECTABLE)
coldef->v.column->icon_mode = XIM_ICON_HAS_PRIORITY;
if (l->max_lines_in_cell > 1 && acqua == CLASS_EDIT_FIELD && v_width[i] > 20)
coldef->v.column->wrap_text = TRUE;
}
// Create the whole thing!

View File

@ -1,4 +1,5 @@
#include <applicat.h>
#include <config.h>
#include <expr.h>
#include <golem.h>
#include <netsock.h>

View File

@ -1,4 +1,5 @@
#include <codeb.h>
#include <config.h>
#include <diction.h>
#include <dongle.h>
#include <extcdecl.h>

View File

@ -2652,7 +2652,8 @@ size_t TReport::get_usr_words(TString_array& words) const
"GET_ID", "GET_ID_NEXT", "GET_ID_PREV",
"GET_POS", "GET_SIZE", "HIDE", "ISAM_READ",
"RUN_FORM", "SET_BACK_COLOR", "SET_FORE_COLOR",
"SET_POS", "SET_SIZE", "SET_TEXT_COLOR", "SHOW", "TABLE_READ", "GET_FIRM_DATA", NULL
"SET_POS", "SET_SIZE", "SET_TEXT_COLOR", "SHOW", "TABLE_READ", "GET_FIRM_DATA",
"EVALUATE", NULL
};
size_t i;
for (i = 0; name[i] != NULL; i++)
@ -3331,6 +3332,12 @@ bool TReport::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
case 19: // GET_FIRM_DATA
msg_firm(stack);
break;
case 20: // EVALUATE
{
TVariant& var = stack.peek();
evaluate(var.as_string(), var, _nullfld);
}
break;
default:
return false;
}

View File

@ -898,7 +898,7 @@ int TBook::compute_text_frame(const TString& tmp, const TReport_font& font, TRep
}
if (good_len == 0) // Puo' succedere per linee senza spazi o con parole lunghissime
{
for (good_len = row.len() * max_row_width / w + 1; good_len > 0; good_len--)
for (good_len = row.len(); good_len > 0; good_len--)
{
const int pix = xvt_dwin_get_text_width(w, row, good_len);
if (pix < max_row_width)

View File

@ -1,5 +1,6 @@
#include <sqlset.h>
#include <config.h>
#include <diction.h>
#include <relation.h>
#include <progind.h>

View File

@ -1,4 +1,5 @@
#include <applicat.h>
#include <config.h>
#include <scanner.h>
#include <tabmod.h>

View File

@ -687,7 +687,7 @@ long TOutlook_window::handler(WINDOW win, EVENT* ep)
switch (ep->type)
{
case E_CONTROL:
if (ep->v.ctl.ci.type == WC_OUTLOOKBAR)
if (ep->v.ctl.ci.type == WC_OUTLOOKBAR || ep->v.ctl.ci.type == WC_METROBAR)
{
owner().on_key(K_SPACE);
return 0L;
@ -717,18 +717,33 @@ void TOutlook_window::clear()
TOutlook_window::TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TOutlook_field* owner)
: TControl_host_window(x, y, dx, dy, parent, owner)
{
XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc));
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = PROMPT_COLOR;
xcc[2].type = XVT_COLOR_HIGHLIGHT; xcc[2].color = MASK_LIGHT_COLOR;
XVT_COLOR_COMPONENT xcc[8]; memset(xcc, 0, sizeof(xcc));
WIN_DEF wd[2]; memset(&wd, 0, sizeof(wd));
wd->wtype = WC_OUTLOOKBAR;
wd->v.ctl.ctrl_id = owner->dlg();
wd->v.ctl.font_id = xvtil_default_font(true); // Fat font
wd->rct = resize_rect(x, y, dx, dy, wd->wtype, parent);
wd->ctlcolors = xcc;
if (owner->metro_style())
{
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = PROMPT_COLOR;
xcc[2].type = XVT_COLOR_HIGHLIGHT; xcc[2].color = MASK_LIGHT_COLOR;
xcc[3].type = XVT_COLOR_BORDER; xcc[3].color = MASK_DARK_COLOR;
wd->wtype = WC_METROBAR;
wd->v.ctl.font_id = xvtil_default_font(false); // thin font for Metro
}
else
{
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = PROMPT_COLOR;
xcc[2].type = XVT_COLOR_HIGHLIGHT; xcc[2].color = MASK_LIGHT_COLOR;
wd->wtype = WC_OUTLOOKBAR;
wd->v.ctl.font_id = xvtil_default_font(true); // Fat font for Outlook
}
_ctrl = xvt_ctl_create_def(wd, win(), 0);
}
@ -798,6 +813,13 @@ bool TOutlook_field::on_key(KEY key)
return TWindowed_field::on_key(key);
}
word TMetrolist_field::class_id() const
{ return CLASS_METROLIST_FIELD; }
bool TMetrolist_field::is_kind_of(word cid) const
{ return cid == CLASS_METROLIST_FIELD || TOutlook_field::is_kind_of(cid); }
///////////////////////////////////////////////////////////
// TSlider_window
///////////////////////////////////////////////////////////

View File

@ -79,9 +79,6 @@ 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);
@ -90,6 +87,9 @@ protected: // TWindowed_field
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
public:
virtual word class_id() const;
virtual bool is_kind_of(word cid) const;
int add_item(short icon, const char* text, int flags);
void create(short dlg, int x, int y, int dx, int dy, WINDOW parent);
void clear();
@ -97,11 +97,22 @@ public:
int items() const;
virtual void set(const char* data);
virtual const TString& get() const;
virtual bool metro_style() const { return false; }
TOutlook_field(TMask* m) : TWindowed_field(m) { }
virtual ~TOutlook_field() { }
};
class TMetrolist_field : public TOutlook_field
{
public:
virtual word class_id() const;
virtual bool is_kind_of(word cid) const;
virtual bool metro_style() const { return true; }
TMetrolist_field(TMask* m) : TOutlook_field(m) { }
};
class TSlider_field : public TWindowed_field
{
short _buddy;

View File

@ -1,5 +1,6 @@
#include <browfile.h>
#include <colors.h>
#include <config.h>
#include <controls.h>
#include <execp.h>
#include <golem.h>

View File

@ -372,7 +372,6 @@ WINDOW cur_win()
DRAW_CTOOLS TWindow::_ct;
bool TWindow::_ctools_saved;
TWindow::TWindow()
: _win(NULL_WIN), _lastkey(0),
_base_char_width(0L), _open(FALSE), _modal(FALSE),