Patch level : 12.0 no-patch
Files correlati : Commento : Aggiunta definizione di COLL_GOLEM mask : Inizializzato nome del file di salvataggio dei valori di una maschera msksheet : Aggiunta disable_column prefix : aggiunta configdir aggiunta definizione di RDOC_ORIGINAL_QTAROW sheet : corretta add_button utility : aggiunta get_system:dir xml : aggiunte getenclosedtext e setenclosedtext
This commit is contained in:
parent
46829986ab
commit
4810b211ab
@ -75,6 +75,7 @@
|
||||
#define DOC_G1 "G1"
|
||||
#define DOC_DATAAGG "DATAAGG"
|
||||
#define DOC_UTENTE "UTENTE"
|
||||
#define DOC_COLL_GOLEM "COLL_GOLEM"
|
||||
#define DOC_DOCEVASO "DOCEVASO"
|
||||
#define DOC_CONTROEURO "CONTROEURO"
|
||||
#define DOC_CODCMS "CODCMS"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <xinclude.h>
|
||||
|
||||
#include <applicat.h>
|
||||
#include <controls.h>
|
||||
#include <config.h>
|
||||
#include <browfile.h>
|
||||
@ -71,6 +72,9 @@ void TMask::init_mask()
|
||||
_msg_key = 0;
|
||||
_test_fld = -1;
|
||||
_last_test = -1;
|
||||
_workfile = configdir();
|
||||
_workfile.add(source_file());
|
||||
_workfile.ext("sav");
|
||||
|
||||
_toolwin = _toolbar = _notebook = _single = NULL_WIN;
|
||||
memset(_pagewin, 0, sizeof(_pagewin)); // Azzero lista pagine
|
||||
@ -90,11 +94,11 @@ WINDOW TMask::curr_win() const
|
||||
return page_win(_page > 0 && _page < _pages ? _page : 0);
|
||||
}
|
||||
|
||||
TMask::TMask() : _mask_num(0), _sheet_first_selection_row(-1)
|
||||
TMask::TMask() : _mask_num(0), _sheet_first_selection_row(-1), _lastpos(0L)
|
||||
{ init_mask(); }
|
||||
|
||||
TMask::TMask(const char* title, int pages, int cols, int rows,
|
||||
int xpos, int ypos, WINDOW parent) : _mask_num(0)
|
||||
int xpos, int ypos, WINDOW parent) : _mask_num(0), _lastpos(0L)
|
||||
{
|
||||
init_mask();
|
||||
if (pages > 1)
|
||||
@ -319,7 +323,7 @@ void TMask::set_default_tab_buttons()
|
||||
}
|
||||
|
||||
TMask::TMask(const char* maskname, int num, int max)
|
||||
: _mask_num(num), _sheet(NULL)
|
||||
: _mask_num(num), _sheet(NULL), _lastpos(0L)
|
||||
{
|
||||
if (maskname && *maskname)
|
||||
read_mask(maskname, num, max);
|
||||
@ -2509,7 +2513,7 @@ bool TMask::save(
|
||||
{
|
||||
FILE* f = fopen(_workfile, append ? "a" : "w");
|
||||
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return yesnofatal_box("Non posso aprire %s ", (const char*) _workfile);
|
||||
|
||||
const int max = fields();
|
||||
@ -2542,12 +2546,15 @@ bool TMask::load(
|
||||
{
|
||||
FILE* f = fopen(_workfile, "r");
|
||||
|
||||
if (f == NULL) return false;
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
if (reset) _lastpos = 0;
|
||||
fseek(f, _lastpos, SEEK_SET);
|
||||
|
||||
TToken_string t(256);
|
||||
char* buffer = t.get_buffer();
|
||||
while (fgets(buffer, t.size(), f) != NULL && t != "[EOM]")
|
||||
|
||||
while (fgets(buffer, t.size(), f) != nullptr && t != "[EOM]")
|
||||
{
|
||||
if (t.not_empty())
|
||||
{
|
||||
|
@ -243,12 +243,13 @@ public:
|
||||
int cid2index(short cid) const;
|
||||
// @cmember Abilita/disabilita una colonna dello spreadsheet (vedi <mf TSpreadsheet::enable_column>)
|
||||
void enable_column(int col, bool on = true);
|
||||
// @cmember Disabilita una colonna dello spreadsheet (vedi <mf TSpreadsheet::enable_column>)
|
||||
void disable_column(int col) { enable_column(col, false); }
|
||||
|
||||
// @cmember Abilita/disabilita una cella dello spreadsheet (vedi <mf TSpreadsheet::enable_cell>)
|
||||
void enable_cell(int row, int column, bool on = true);
|
||||
// @cmember Disabilta una cella dello spreadsheet (chiama <mf TSheet_field::enable>)
|
||||
void disable_cell(int row, int column)
|
||||
{ enable_cell(row, column, false); }
|
||||
void disable_cell(int row, int column) { enable_cell(row, column, false); }
|
||||
// @cmember Controlla se una cella e' disabilitata (vedi <mf TSpreadsheet::cell_disabled>)
|
||||
bool cell_disabled(int row, int column) const;
|
||||
// @cmember Controlla se una cella e' disabilitata (vedi <mf TSpreadsheet::cell_disabled>)
|
||||
@ -272,8 +273,7 @@ public:
|
||||
// @cmember Abilita/disabilita una riga dello spreadsheet (vedi <mf TSpreadsheet::enable_cell>)
|
||||
void enable_row(int row, bool on = true);
|
||||
// @cmember Disabilta una riga dello spreadsheet (chiama <mf TSheet_field::enable>)
|
||||
void disable_row(int row)
|
||||
{ enable_row(row, false); }
|
||||
void disable_row(int row) { enable_row(row, false); }
|
||||
// @cmember Controlla se una riga e' disabilitata (tutte le sue celle sono disabilitate)
|
||||
bool row_enabled(int row);
|
||||
// @cmember Permette di invertire la posizione di due righe
|
||||
|
@ -1266,10 +1266,23 @@ const char* firm2dir(long codditta)
|
||||
}
|
||||
|
||||
TString& path = get_tmp_string(_MAX_PATH);
|
||||
|
||||
xvt_fsys_build_pathname(path.get_buffer(), "", __ptprf, firm, NULL, NULL);
|
||||
return path;
|
||||
}
|
||||
|
||||
const char* configdir()
|
||||
{
|
||||
TString& path = get_tmp_string(_MAX_PATH);
|
||||
TFilename dir(firm2dir(-1));
|
||||
|
||||
dir.add("config"); // + Directory config
|
||||
if (!dir.exist()) // Creala se necessario
|
||||
make_dir(dir);
|
||||
path = dir;
|
||||
return path;
|
||||
}
|
||||
|
||||
int safely_close_closeable_isamfiles()
|
||||
{
|
||||
int f = 0;
|
||||
|
@ -230,6 +230,7 @@ public:
|
||||
|
||||
|
||||
const char* firm2dir(long codditta);
|
||||
const char* configdir();
|
||||
int safely_close_closeable_isamfiles();
|
||||
|
||||
TPrefix& prefix_init();
|
||||
|
@ -86,4 +86,5 @@
|
||||
#define RDOC_TIPOCON "TIPOCON" // Con questo campo capisco a quale sottocategoria conai si riferisce la riga autogenerata
|
||||
#define RDOC_PERESCONAI "PERESCONAI"
|
||||
#define RDOC_ORIGINAL_ROWS "ORIGROWS"
|
||||
#define RDOC_ORIGINAL_QTAROWS "ORIGQTAROWS"
|
||||
#endif
|
||||
|
@ -131,10 +131,10 @@ public:
|
||||
// @cmember Legge tutto l'array dal file
|
||||
virtual int read(TRectype* r);
|
||||
// @cmember Aggiorna il file (se <p re> == TRUE allora viene aggiornato il record se esisteva)
|
||||
virtual int write(bool re = FALSE) const;
|
||||
virtual int write(bool re = false) const;
|
||||
// @cmember Aggiorna il record sul file
|
||||
virtual int rewrite() const
|
||||
{ return write(TRUE); }
|
||||
{ return write(true); }
|
||||
// @cmember Cancella tutti i record dal file
|
||||
virtual int remove() const;
|
||||
|
||||
|
@ -1083,17 +1083,24 @@ void TSheet::add_button(
|
||||
short bmp_up, // @parm Bitmap normale
|
||||
short bmp_dn) // @parm Bitmap premuta
|
||||
{
|
||||
if (id > 0 && bmp_up <= 0)
|
||||
int pos = -1;
|
||||
|
||||
if (id > 0)
|
||||
pos = id2pos(id);
|
||||
if (pos < 0)
|
||||
{
|
||||
if (toolwin() == NULL_WIN)
|
||||
create_bar(-2); // Forza la creazione della bottom bar
|
||||
TButton_field& butt = TMask::add_button(id, MAX_PAGES, caption, 0, -1, 11, 2);
|
||||
butt.set_exit_key(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
TButton_tool& butt = add_button_tool(id, caption, bmp_up);
|
||||
butt.set_exit_key(key);
|
||||
if (id > 0 && bmp_up <= 0)
|
||||
{
|
||||
if (toolwin() == NULL_WIN)
|
||||
create_bar(-2); // Forza la creazione della bottom bar
|
||||
TButton_field& butt = TMask::add_button(id, MAX_PAGES, caption, 0, -1, 11, 2);
|
||||
butt.set_exit_key(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
TButton_tool& butt = add_button_tool(id, caption, bmp_up);
|
||||
butt.set_exit_key(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,15 +126,15 @@ public:
|
||||
virtual bool set(unsigned int column, const TVariant& var);
|
||||
|
||||
virtual unsigned int columns() const;
|
||||
virtual const TRecordset_column_info& column_info(unsigned int column) const;
|
||||
virtual const TRecordset_column_info& column_info(const char* colunmn) const;
|
||||
virtual const TVariant& get(unsigned int column) const;
|
||||
virtual const TVariant& get(const char* colunmn) const;
|
||||
virtual const TRecordset_column_info & column_info(unsigned int column) const;
|
||||
virtual const TRecordset_column_info & column_info(const char* colunmn) const;
|
||||
virtual const TVariant & get(unsigned int column) const;
|
||||
virtual const TVariant & get(const char * colunmn) const;
|
||||
virtual bool exist(const char* column) const { return find_column(column) >= 0; }
|
||||
|
||||
public:
|
||||
bool create_field(const char* name, int pos, int len, TFieldtypes t = _alfafld,
|
||||
bool required = false, const TVariant& def = NULL_VARIANT);
|
||||
bool create_field(const char * name, int pos, int len, TFieldtypes t = _alfafld,
|
||||
bool required = false, const TVariant & def = NULL_VARIANT);
|
||||
|
||||
int record_length() const { return _info._width; }
|
||||
int key_length() const { return _key._width; }
|
||||
|
@ -366,6 +366,14 @@ bool input_filename(TFilename& file)
|
||||
return good;
|
||||
}
|
||||
|
||||
const char * get_system_dir(TSystem_dirs what)
|
||||
{
|
||||
TString & dir = get_tmp_string(_MAX_PATH);
|
||||
|
||||
xvt_fsys_get_sys_dir((int)what, (char *) (const char *) dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
bool sirio_codesigning(const TFilename& filename, bool verify)
|
||||
{
|
||||
const char * const default_sign = R"("C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\signtool.exe" sign /a /s MY /n "Sirio Informatica e Sistemi SPA" /t http://timestamp.verisign.com/scripts/timstamp.dll /v)";
|
||||
|
@ -29,6 +29,8 @@ bool sirio_codesigning(const TFilename& filename, bool verify = false);
|
||||
#define SIRIOSIGN(filename) sirio_codesigning((const TFilename&)((filename)), false)
|
||||
#define SIRIOSIGN_VERIFY(filename) sirio_codesigning((const TFilename&)((filename)), true)
|
||||
|
||||
typedef enum { desktop_dir = 0, documents_dir, exec_dir, install_dir, temp_dir } TSystem_dirs;
|
||||
|
||||
template<typename T> void safe_delete(T*& a)
|
||||
{
|
||||
delete a;
|
||||
@ -57,6 +59,7 @@ bool fmove(const char* orig, const char* dest, bool append = false, bool advance
|
||||
bool fexist(const char* file);
|
||||
long fsize(const char* file);
|
||||
bool dexist(const char* file);
|
||||
void log_message(const char* fmt, ...);
|
||||
|
||||
time_t atime(const char* file); // access time
|
||||
time_t ctime(const char* file); // creation time
|
||||
@ -68,14 +71,13 @@ TDate aldate(const char* file); // creation date
|
||||
TDate cldate(const char* file);// modification date
|
||||
TDate mldate(const char* file);// access date
|
||||
|
||||
inline struct tm modificationlocaltime(const char* file); void log_message(const char* fmt, ...);
|
||||
|
||||
bool make_dir(const char* dir);
|
||||
bool remove_file(const char* file);
|
||||
int remove_files(const char* mask, bool subdirs);
|
||||
int count_files(const char* dir, bool subdirs);
|
||||
int list_files(const char* mask, TString_array& result);
|
||||
bool input_filename(TFilename& file);
|
||||
const char * get_system_dir(TSystem_dirs what);
|
||||
|
||||
const char* encode(const char* data);
|
||||
const char* decode(const char* data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user