config.cpp Migliorato controllo sulla validita' del parametro section
golem.cpp Aggiunta funzione edit_url golem.h Aggiunta funzione edit_url isam.h Tolti #include inutili relapp.cpp Migliorata indentazione sheet.cpp Aggiunto parametro al costruttore dei TArray_sheet Migliorata gestione sheet in genere: supportata la modalita' a tutto schermo e le testate su piu' righe come i normali sheet sheet.h Aggiunto metodo TSheet::force_update(int r = -1) Incredibile ma prima non c'era strings.cpp Trasformato in CHECK un controllo in modo DBG viswin.cpp Usata la fantastica edit_url al posto della mitica goto_url git-svn-id: svn://10.65.10.50/trunk@5693 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
859668a090
commit
6bd2505bbc
@ -434,13 +434,13 @@ bool TConfig::set(
|
||||
// implementare un array.
|
||||
// <nl>Il paragrafo passato in <p section> diventa quello attivo.
|
||||
|
||||
if (section)
|
||||
if (section && *section)
|
||||
set_paragraph(section);
|
||||
|
||||
const bool itwas = exist(var, index);
|
||||
|
||||
if (itwas && !force)
|
||||
warning_box("Tentativo di ridefinizione simbolo: %s(%d)", var, index);
|
||||
error_box("Tentativo di ridefinizione simbolo: %s(%d)", var, index);
|
||||
else
|
||||
{
|
||||
TString256 vvar(var); if (index >= 0) vvar << '(' << index << ')';
|
||||
|
@ -210,6 +210,33 @@ bool goto_url(const char* url)
|
||||
return retflag;
|
||||
}
|
||||
|
||||
bool edit_url(const char* url)
|
||||
{
|
||||
bool retflag = FALSE;
|
||||
|
||||
HINSTANCE hinst = ShellExecute(NULL, "edit", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
DWORD winst = DWORD((DWORD*)hinst);
|
||||
UINT error = UINT(winst); // Tutto 'sto giro per evitare un warning
|
||||
if (error <= 32)
|
||||
{
|
||||
TFilename app;
|
||||
if (fexist(url) && file2app(".wri", app))
|
||||
{
|
||||
app << ' ' << url;
|
||||
error = WinExec(app, SW_SHOWNORMAL);
|
||||
if (error > 32)
|
||||
retflag = TRUE;
|
||||
}
|
||||
else
|
||||
retflag = goto_url(url);
|
||||
}
|
||||
else
|
||||
retflag = TRUE;
|
||||
|
||||
return retflag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool print_url(const char* url)
|
||||
{
|
||||
|
@ -6,6 +6,7 @@
|
||||
#endif
|
||||
|
||||
bool goto_url(const char* url);
|
||||
bool edit_url(const char* url);
|
||||
bool print_url(const char* url);
|
||||
|
||||
class TMail_message : public TString
|
||||
|
@ -1,18 +1,6 @@
|
||||
#ifndef __ISAM_H
|
||||
#define __ISAM_H
|
||||
|
||||
#ifndef __SYSFLD_H
|
||||
#include <sysfld.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ASSOC_H
|
||||
#include <assoc.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SYSFLD_H
|
||||
#include <sysfld.h>
|
||||
#endif
|
||||
|
||||
#ifndef FOXPRO
|
||||
|
||||
#ifndef __REAL_H
|
||||
|
@ -829,11 +829,12 @@ bool TRelation_application::remove()
|
||||
const int max = m.fields();
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
if (m.fld(i).is_sheet()) {
|
||||
if (m.fld(i).is_sheet())
|
||||
{
|
||||
TSheet_field& f = (TSheet_field& )m.fld(i);
|
||||
if (f.record()&& !f.external_record())
|
||||
err|=f.record()->remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return err == NOERR;
|
||||
}
|
||||
|
@ -118,12 +118,26 @@ TSheet_control::TSheet_control(
|
||||
int i = 0;
|
||||
int f_width = NUMBER_WIDTH; // Stima larghezza colonne fisse
|
||||
int max_width = f_width; // Stima larghezza della colonna piu' grande
|
||||
int lines_in_header = 1;
|
||||
|
||||
for (const char* h = header.get(); h; h = header.get(), i++)
|
||||
{
|
||||
CHECKD(i < MAX_COL, "Tu meni calumns in scit: ", i);
|
||||
_type[i] = ' ';
|
||||
TString testa(h);
|
||||
|
||||
char* t = testa.get_buffer();
|
||||
for (int c = 0; t[c]; c++)
|
||||
{
|
||||
if (t[c] == '\\' && (t[c+1] == 'n' || t[c+1] == 'r'))
|
||||
{
|
||||
t[c] = '\n';
|
||||
strcpy(t+c+1, t+c+2);
|
||||
}
|
||||
if (t[c] == '\n')
|
||||
lines_in_header = 2;
|
||||
}
|
||||
|
||||
const int at = testa.find('@');
|
||||
int v = testa.len(); // Video width
|
||||
if (at >= 0)
|
||||
@ -188,7 +202,7 @@ TSheet_control::TSheet_control(
|
||||
listdef->app_data = (long)this;
|
||||
|
||||
XI_LIST_DEF* l = listdef->v.list;
|
||||
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font());
|
||||
l->min_heading_height = xi_button_calc_height_font_id(xvt_default_font()) * lines_in_header;
|
||||
l->max_lines_in_cell = lines_in_cell;
|
||||
l->sizable_columns = TRUE;
|
||||
l->movable_columns = TRUE;
|
||||
@ -932,11 +946,11 @@ TSheet::TSheet(short x, short y, short dx, short dy,
|
||||
set_handler(DLG_USER, tutti_handler);
|
||||
}
|
||||
|
||||
if (buttons & 0x1) add_button(DLG_LINK, "~Gestione", K_CTRL+'G');
|
||||
if (buttons & 0x2) add_button(DLG_NEWREC, "~Nuovo", K_INS, BMP_NEWREC, BMP_NEWRECDN);
|
||||
if (buttons & 0x4) add_button(DLG_DELREC, "Elimina", K_DEL, BMP_DELREC, BMP_DELRECDN);
|
||||
if (buttons & 0x8) add_button(DLG_QUIT, "Fine", K_ESC);
|
||||
else add_button(DLG_CANCEL, "Annulla", K_ESC);
|
||||
if (buttons & 0x01) add_button(DLG_LINK, "~Gestione", K_CTRL+'G');
|
||||
if (buttons & 0x02) add_button(DLG_NEWREC, "~Nuovo", K_INS, BMP_NEWREC, BMP_NEWRECDN);
|
||||
if (buttons & 0x04) add_button(DLG_DELREC, "Elimina", K_DEL, BMP_DELREC, BMP_DELRECDN);
|
||||
if (buttons & 0x08) add_button(DLG_QUIT, "Fine", K_ESC);
|
||||
else add_button(DLG_CANCEL, "Annulla", K_ESC);
|
||||
}
|
||||
|
||||
TSheet::~TSheet()
|
||||
@ -1003,6 +1017,11 @@ void TSheet::repos_buttons() const
|
||||
}
|
||||
}
|
||||
|
||||
void TSheet::force_update(int r)
|
||||
{
|
||||
_sheet->update(r);
|
||||
}
|
||||
|
||||
void TSheet::start_run()
|
||||
{
|
||||
const bool on = items() > 0 && _sheet->one_enabled();
|
||||
@ -1019,8 +1038,7 @@ void TSheet::start_run()
|
||||
_parked = -1;
|
||||
|
||||
repos_buttons();
|
||||
|
||||
_sheet->update();
|
||||
force_update();
|
||||
|
||||
if (on)
|
||||
{
|
||||
@ -1162,10 +1180,15 @@ bool TSheet::tutti_handler(TMask_field& f, KEY k)
|
||||
// TArray_sheet
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
TArray_sheet::TArray_sheet(short x, short y, short dx, short dy,
|
||||
const char* caption, const char* head, byte buttons)
|
||||
: TSheet(x, y, dx, dy, caption, head, buttons)
|
||||
{
|
||||
TArray_sheet::TArray_sheet(short x, short y, short dx, short dy, const char* caption,
|
||||
const char* head, byte buttons, short sht_y)
|
||||
: TSheet(x, y, dx, dy, caption, head, buttons, sht_y)
|
||||
{
|
||||
if (dx == 0)
|
||||
{
|
||||
TToken_string cap(caption);
|
||||
add_tag_buttons(cap);
|
||||
}
|
||||
}
|
||||
|
||||
// Certified 90%
|
||||
@ -1180,7 +1203,7 @@ bool TArray_sheet::destroy(int i)
|
||||
|
||||
// @mfunc Aggiunge un elemento allo sheet
|
||||
//
|
||||
// @rdesc Ritorna il numero di elemnti presenti nello sheet
|
||||
// @rdesc Ritorna il numero di elementi presenti nello sheet
|
||||
long TArray_sheet::add(
|
||||
const TToken_string& s) // @parm Oggetto da aggiungere
|
||||
// @parm const TToken_string | *s | Oggetto da aggiungere passato per indirizzo
|
||||
|
@ -94,8 +94,12 @@ public:
|
||||
// @cmember Ritorna il numero di elementi attivati (vedi <mf TBit_array::ones>)
|
||||
long checked() const;
|
||||
|
||||
// @cmember Forza l'aggiornamento di una o tutte le righe visibili
|
||||
void force_update(int r = -1);
|
||||
|
||||
// @cmember Costruttore
|
||||
TSheet(short x, short y, short dx, short dy, const char* title, const char* head, byte buttons = 0, short sht_y = 0);
|
||||
TSheet(short x, short y, short dx, short dy, const char* title,
|
||||
const char* head, byte buttons = 0, short sht_y = 0);
|
||||
|
||||
// @cmember Distruttore
|
||||
virtual ~TSheet();
|
||||
@ -132,7 +136,8 @@ protected:
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember Costruttore
|
||||
TArray_sheet(short x, short y, short dx, short dy, const char* caption, const char* head, byte buttons = 0);
|
||||
TArray_sheet(short x, short y, short dx, short dy, const char* caption,
|
||||
const char* head, byte buttons = 0, short sht_y = 0);
|
||||
// @cmember Ritorna il contenuto dello sheet
|
||||
TString_array& rows_array()
|
||||
{ return _data; }
|
||||
|
@ -1216,11 +1216,7 @@ const TFilename& TFilename::temp(
|
||||
free(t);
|
||||
}
|
||||
|
||||
#ifdef DBG
|
||||
if (fexist(_str))
|
||||
yesnofatal_box("Il file temporaneo '%s' esiste gia'", _str);
|
||||
#endif
|
||||
|
||||
CHECKS(!fexist(_str), "Il file temporaneo esiste gia': ", _str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -2239,7 +2239,7 @@ bool TViswin::call_editor()
|
||||
if (_txt.write (newfilename, _isselection ? &p1 : NULL,
|
||||
_isselection ? &p2 : NULL))
|
||||
{
|
||||
ok = goto_url(newfilename);
|
||||
ok = ::edit_url(newfilename);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user