default.url Corretto CORSOR in CURSOR

expr.cpp        Corretta esecuzione del token _lteq
mask.cpp        Modificata gestione popup menu
maskfld.cpp     Corretta do_output e do_clear
msksheet.cpp    Tolte righe di commento obsolete
relation.cpp    Modificato uso della clessidra
utility.cpp     Cambiata indentazione


git-svn-id: svn://10.65.10.50/trunk@3903 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-11-15 14:19:37 +00:00
parent a341853e58
commit bf0b92ea09
8 changed files with 55 additions and 65 deletions

View File

@ -122,7 +122,7 @@ image BMP_FAX QRESDIR"fax.bmp"
#transparent $$$ #transparent $$$
XI_CURSOR_RESIZE CURSOR DISCARDABLE RESDIR/resize.cur XI_CURSOR_RESIZE CURSOR DISCARDABLE RESDIR/resize.cur
XI_CURSOR_HAND CURSOR DISCARDABLE RESDIR/hand.cur XI_CURSOR_HAND CURSOR DISCARDABLE RESDIR/hand.cur
XI_CURSOR_VRESIZE CORSOR DISCARDABLE RESDIR/vresize.cur XI_CURSOR_VRESIZE CURSOR DISCARDABLE RESDIR/vresize.cur
COMBO_ICON ICON DISCARDABLE RESDIR/combo.ico COMBO_ICON ICON DISCARDABLE RESDIR/combo.ico
ICO_SEARCH ICON DISCARDABLE RESDIR/search.ico ICO_SEARCH ICON DISCARDABLE RESDIR/search.ico
ICO_CHECK_ON ICON DISCARDABLE RESDIR/checkon.ico ICO_CHECK_ON ICON DISCARDABLE RESDIR/checkon.ico

View File

@ -477,7 +477,7 @@ void TExpression::eval()
if (type == _strexpr) if (type == _strexpr)
{ {
const TString & s2 = evalstack.pop_string(); const TString & s2 = evalstack.pop_string();
const TString & s1 = evalstack.peek_string(); const TString & s1 = evalstack.pop_string();
evalstack.push(real(s1 <= s2 ? 1.0 : 0.0)); evalstack.push(real(s1 <= s2 ? 1.0 : 0.0));
} }
else else

View File

@ -88,6 +88,10 @@ void TMask::init_mask()
memset(_pagewin, 0, sizeof(_pagewin)); memset(_pagewin, 0, sizeof(_pagewin));
} }
TMask::TMask()
: _mask_num(0)
{ init_mask(); }
TMask::TMask(const char* title, int pages, int cols, int rows, TMask::TMask(const char* title, int pages, int cols, int rows,
int xpos, int ypos) int xpos, int ypos)
@ -155,7 +159,7 @@ void TMask::read_mask(
} }
if (_pages <= 0) if (_pages <= 0)
fatal_box("Impossibile leggere la maschera %s", name); fatal_box("Impossibile leggere la maschera %s : %d", name, num);
if (_pages > 1 || toolwin()) if (_pages > 1 || toolwin())
add_tag_buttons(captions); add_tag_buttons(captions);
@ -631,7 +635,7 @@ void TMask::handler(WINDOW win, EVENT* ep)
{ {
TSheet_field& sht = (TSheet_field&)*_last_sheet; TSheet_field& sht = (TSheet_field&)*_last_sheet;
#if (XVT_PTK_VERSION_MAJOR > 4) || (XVT_PTK_VERSION_MAJOR == 4 && XVT_PTK_VERSION_MINOR >= 50) #if (XVT_PTK_VERSION_MAJOR > 4) || (XVT_PTK_VERSION_MAJOR == 4 && XVT_PTK_VERSION_MINOR >= 50)
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR); MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR+1);
if (menu) if (menu)
{ {
const PNT& p = ep->v.mouse.where; const PNT& p = ep->v.mouse.where;
@ -643,7 +647,7 @@ void TMask::handler(WINDOW win, EVENT* ep)
if (p.h > 2 * cr.right / 3) if (p.h > 2 * cr.right / 3)
pa = XVT_POPUP_RIGHT_ALIGN; pa = XVT_POPUP_RIGHT_ALIGN;
xvt_menu_popup(menu->child, win, p, pa, NULL); xvt_menu_popup(menu, win, p, pa, NULL);
xvt_res_free_menu_tree(menu); xvt_res_free_menu_tree(menu);
} }
#else #else

View File

@ -147,7 +147,7 @@ protected:
int curr_page() const int curr_page() const
{ return _page; } { return _page; }
// @cmember Costruttore (crea una maschera vuota) // @cmember Costruttore (crea una maschera vuota)
TMask() { init_mask();} TMask();
// @access Public Member // @access Public Member
public: public:

View File

@ -1979,30 +1979,26 @@ int TBrowse::do_input(
return ne; return ne;
} }
static TBit_array s_checked;
static short s_checking = 0;
void TBrowse::do_output(CheckTime t) void TBrowse::do_output(CheckTime t)
{ {
static TBit_array _checked;
static short _checking = 0;
if (t == FINAL_CHECK) if (t == FINAL_CHECK)
return; return;
bool master; const bool master = s_checking == 0;
if (_checking == 0) if (master)
{ {
master = TRUE; s_checking = field().dlg();
_checking = field().dlg(); s_checked.reset();
_checked.reset();
// Rendo intoccabili i campi del MIO output // Rendo intoccabili i campi del MIO output
for (const char* fld = _out_id.get(0); fld && *fld; fld = _out_id.get()) for (const char* fld = _out_id.get(0); fld && *fld; fld = _out_id.get())
{ {
const short id = field().atodlg(fld); const short id = field().atodlg(fld);
_checked.set(id); s_checked.set(id);
} }
} }
else
master = FALSE;
TString sum; TString sum;
TToken_string flds(24, '+'); TToken_string flds(24, '+');
@ -2033,35 +2029,31 @@ void TBrowse::do_output(CheckTime t)
} }
} }
const bool changing = f.get() != sum; bool hit = FALSE;
if (changing) if (master)
{ {
bool hit = FALSE; f.set(sum);
if (master) hit = id != s_checking; // Il mio handler viene fatto nella on_key
{ }
f.set(sum); else
hit = id != _checking; // Il mio handler viene fatto nella on_key {
} if (!s_checked[id])
else
{
if (!_checked[id])
{
f.set(sum);
_checked.set(id);
hit = TRUE;
}
}
if (hit)
{ {
f.check(); f.set(sum);
f.on_hit(); s_checked.set(id);
hit = TRUE;
} }
}
if (hit)
{
f.check();
f.on_hit();
} }
} }
} }
if (master) if (master)
_checking = 0; s_checking = 0;
} }
@ -2071,15 +2063,13 @@ void TBrowse::do_clear()
{ {
const short id = field().atodlg(fld); const short id = field().atodlg(fld);
TMask_field& f = field(atoi(fld)); TMask_field& f = field(atoi(fld));
if (f.field() == NULL && _inp_id.get_pos(fld) < 0) if (f.field() == NULL && field().dlg() != id &&
!s_checked[id] && _inp_id.get_pos(fld) < 0)
{ {
const bool hit = f.get().not_empty();
f.reset(); f.reset();
if (field().dlg() != id && hit) s_checked.set(id);
{ f.on_hit();
f.on_hit(); f.check();
f.check();
}
} }
} }
} }

View File

@ -17,10 +17,6 @@ extern "C" {
#include <msksheet.h> #include <msksheet.h>
#include <urldefid.h> #include <urldefid.h>
///////////////////////////////////////////////////////////
// TRow_property
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// TSpreadsheet // TSpreadsheet
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////

View File

@ -1056,15 +1056,13 @@ bool TCursor::changed()
TRecnotype TCursor::update() TRecnotype TCursor::update()
{ {
main_app().begin_wait(); begin_wait();
file().setkey(_nkey); file().setkey(_nkey);
if (file().curr().empty()) file().curr().zero(); if (file().curr().empty()) file().curr().zero();
file().read(_isgteq); file().read(_isgteq);
const TRecnotype totrec = buildcursor(file().recno()); const TRecnotype totrec = buildcursor(file().recno());
main_app().end_wait();
isdef* fh = file().filehnd(); isdef* fh = file().filehnd();
const TRecnotype eod = DB_reccount(fh->fhnd); const TRecnotype eod = DB_reccount(fh->fhnd);
@ -1072,6 +1070,8 @@ TRecnotype TCursor::update()
_filename = fh->d->SysName; _filename = fh->d->SysName;
_lastkrec = DB_changed(fh->fhnd); _lastkrec = DB_changed(fh->fhnd);
end_wait();
return totrec; return totrec;
} }
@ -1544,7 +1544,7 @@ int TSorted_cursor::filtercursor(int pagecnt, TRecnotype* page)
s.cut(s.len()-1); s.cut(s.len()-1);
TFieldref f(s,0); TFieldref f(s,0);
TString sf=f.read(*relation()); TString sf=f.read(*relation());
TRectype& frec = file(f.file()).curr(); TRectype& frec = file(f.file()).curr();
TFieldtypes fld_type = frec.type(f.name()); TFieldtypes fld_type = frec.type(f.name());
if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI! if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI!
{ {

View File

@ -131,7 +131,7 @@ bool make_dir(
// @doc EXTERNAL // @doc EXTERNAL
// @func Ritorna la lista dei file il cui nome corrisponde alla stringa (con caratteri // @func Ritorna la lista dei file il cui nome corrisponde alla stringa (con caratteri
// jolly) passata. // jolly) passata.
// //
// @rdesc Ritorna il numero di file che soddisfano la condizione passata (numero di elementi // @rdesc Ritorna il numero di file che soddisfano la condizione passata (numero di elementi
// della token string) // della token string)
@ -320,9 +320,9 @@ const char *esc(
// @comm Viene utilizzata soprattuto in UNIX. // @comm Viene utilizzata soprattuto in UNIX.
{ {
const char *s1 = s; const char *s1 = s;
char *s2 = __tmp_string; char *s2 = __tmp_string;
int base; int base;
while (*s1) while (*s1)
{ {
@ -332,13 +332,13 @@ const char *esc(
switch (tolower(*s1)) switch (tolower(*s1))
{ {
case 'b' : *s2++ = '\b'; break; case 'b' : *s2++ = '\b'; break;
case 'e' : *s2++ = '\033'; break; case 'e' : *s2++ = '\033'; break;
case 'f' : *s2++ = '\f'; break; case 'f' : *s2++ = '\f'; break;
case 'n' : *s2++ = '\n'; break; case 'n' : *s2++ = '\n'; break;
case 'r' : *s2++ = '\r'; break; case 'r' : *s2++ = '\r'; break;
case 't' : *s2++ = '\t'; break; case 't' : *s2++ = '\t'; break;
default : default :
{ {
if (isdigit(*s1)) if (isdigit(*s1))
{ {
if (*s1 == '0') if (*s1 == '0')