Patch level : 2.0 488

Files correlati     : librerie
Ricompilazione Demo : [ ]
Commento            :

Correzione di errori gia' segnalati nei rispettivi moduli


git-svn-id: svn://10.65.10.50/trunk@11206 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-06-03 12:58:47 +00:00
parent 6750ac76bb
commit 3be2f51b01
8 changed files with 39 additions and 60 deletions

View File

@ -93,8 +93,6 @@ bool yesno_box(
//
// @flag 1 | Se viene premuto il taso SI
// @flag 0 | Se viene premuto il taso NO
//
// @xref <m yesnocancel_box> <m yesnofatal_box>
{
buildmsg();
ASK_RESPONSE r = xvt_dm_post_ask("Si", "No", NULL, msg);

View File

@ -678,7 +678,7 @@ bool TFile_text::_autoload(TRecord_text& rec, TCursor& cur , TTracciato_record&
{
TTracciato_campo& tc = tr.get(i);
const TFieldref& field = tc.field();
if (field.name().empty())
if (field.name().not_empty())
campo = field.read(rel);
const TString& message = tc.message();

View File

@ -1,5 +1,4 @@
#include <time.h>
#include <stdio.h>
#include <xvt.h>
#include <controls.h>
#include <browfile.h>
@ -724,51 +723,24 @@ void TMask::handler(WINDOW win, EVENT* ep)
if (_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)
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
if (menu)
if (menu != NULL)
{
const PNT& p = ep->v.mouse.where;
RCT cr; xvt_vobj_get_client_rect(win, &cr);
XVT_POPUP_ALIGNMENT pa = XVT_POPUP_CENTER;
if (p.h < cr.right / 3)
pa = XVT_POPUP_LEFT_ALIGN;
else
if (p.h > 2 * cr.right / 3)
pa = XVT_POPUP_RIGHT_ALIGN;
xvt_menu_popup(menu->child, win, p, pa, NULL);
xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, NULL);
xvt_res_free_menu_tree(menu);
}
#else
ASK_RESPONSE r = xvt_dm_post_ask("Annulla", "Ripristina", "Salva",
"Ordinamento delle colonne");
if (r == RESP_2)
sht.reset_columns_order();
if (r == RESP_2 || r == RESP_3)
sht.save_columns_order();
#endif
}
return;
}
if (ep->type == E_COMMAND)
if (ep->type == E_COMMAND && _last_sheet != NULL)
{
switch (ep->v.cmd.tag)
{
case M_EDIT_UNDO:
if (_last_sheet)
_last_sheet->reset_columns_order();
case M_EDIT_CLIPBOARD:
if (_last_sheet)
_last_sheet->save_columns_order();
break;
case M_EDIT_SEARCH:
if (_last_sheet)
_last_sheet->on_key(K_F11);
break;
default:
break;
case BROWSE_BAR+1: _last_sheet->save_columns_order(); break;
case BROWSE_BAR+2: _last_sheet->reset_columns_order(); break;
case BROWSE_BAR+3: _last_sheet->on_key(K_F11); break;
default: break;
}
return;
}

View File

@ -2587,7 +2587,7 @@ void TSheet_field::force_update(
int TSheet_field::items() const
{
TSpreadsheet* s = (TSpreadsheet*)_ctl;
return (int)s->items();
return (int)s->items();
}
int TSheet_field::selected() const

View File

@ -1312,14 +1312,11 @@ void TRelation_application::main_loop()
const bool trovato = _mask->query_mode() && test_key(1, FALSE) && find(1);
if (trovato)
{
modify_mode();
if (is_transaction())
{
_curr_transaction=TRANSACTION_MODIFY;
// _curr_trans_mode = TM_INTERACTIVE; // Siamo sicuri???
}
else
warning_box("Elemento gia' presente");
warning_box(TR("Elemento gia' presente"));
modify_mode();
}
else
insert_mode();

View File

@ -1095,12 +1095,13 @@ bool TCursor::filtercursor(TRecnotype recno)
file().readat(recno);
if (update_relation())
{
const int handle = file().handle();
const char *s0 = DB_index_getkey(handle);
// memorizzo la chiave prima di eventuali spostamenti
const TString s0(DB_index_getkey(file().handle()));
_if->update(-filter_limit());
if (_nkey != DB_tagget(handle))
DB_tagselect(handle, _nkey);
// ripristino la chiave dopo eventuali spostamenti
const int handle = file().handle();
if (recno != DB_index_recno(handle))
DB_index_go(handle, s0, recno);
}
@ -1200,7 +1201,12 @@ bool TCursor::ok() const
}
if (update_relation())
{
const TRecnotype old = file().recno();
_if->update();
if (DB_recno(file().handle()) != old)
file().readat(old);
}
if ((_filterfunction ? _filterfunction(_if) : TRUE ) &&
(_fexpr ? __evalcondition(*_if, _fexpr, _frefs) : TRUE))

View File

@ -982,7 +982,7 @@ void TViswin::paint_row (long j)
{
set_font(PRINT_FONT, st, PRINT_HEIGHT);
set_color(fg, bg);
printat (X_OFFSET+pos, row, "%s", cp);
stringat(X_OFFSET+pos, row, cp);
}
pos += strlen (cp);
}

View File

@ -759,7 +759,6 @@ PNT TWindow::log2dev(long x, long y) const
pnt.v = (int)y;
if (!_pixmap)
{
// pnt.h *= CHARX;
pnt.h = char2pixel(pnt.h);
pnt.v *= CHARY;
}
@ -781,8 +780,7 @@ void TWindow::stringat(short x, short y, const char* str)
{
PNT pnt = log2dev(x,y);
pnt.v += BASEY;
xvt_dwin_draw_text(win(), pnt.h, pnt.v, (char *)str, -1);
xvt_dwin_draw_text(win(), pnt.h, pnt.v, str, -1);
}
// @doc EXTERNAL
@ -794,13 +792,21 @@ void TWindow::printat(
const char* fmt, // @parm Formato che deve essere dato al testo
...) // @parmvar Uno o piu' parametri corrispondenti ai codici in <p fmt>
{
TString str(256);
char* tmp = str.get_buffer();
va_list argptr;
va_start(argptr, fmt);
vsprintf(tmp, fmt, argptr);
va_end(argptr);
stringat(x, y, tmp);
if (fmt && *fmt)
{
if (strchr(fmt, '%') != NULL)
{
TString256 str; // TString str(256);
char* tmp = str.get_buffer();
va_list argptr;
va_start(argptr, fmt);
vsprintf(tmp, fmt, argptr);
va_end(argptr);
stringat(x, y, tmp);
}
else
stringat(x, y, fmt);
}
}
void TWindow::line(short x0, short y0, short x1, short y1)