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 1 | Se viene premuto il taso SI
// @flag 0 | Se viene premuto il taso NO // @flag 0 | Se viene premuto il taso NO
//
// @xref <m yesnocancel_box> <m yesnofatal_box>
{ {
buildmsg(); buildmsg();
ASK_RESPONSE r = xvt_dm_post_ask("Si", "No", NULL, msg); 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); TTracciato_campo& tc = tr.get(i);
const TFieldref& field = tc.field(); const TFieldref& field = tc.field();
if (field.name().empty()) if (field.name().not_empty())
campo = field.read(rel); campo = field.read(rel);
const TString& message = tc.message(); const TString& message = tc.message();

View File

@ -1,5 +1,4 @@
#include <time.h> #include <xvt.h>
#include <stdio.h>
#include <controls.h> #include <controls.h>
#include <browfile.h> #include <browfile.h>
@ -724,51 +723,24 @@ void TMask::handler(WINDOW win, EVENT* ep)
if (_last_sheet) 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); MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
if (menu) if (menu != NULL)
{ {
const PNT& p = ep->v.mouse.where; const PNT& p = ep->v.mouse.where;
RCT cr; xvt_vobj_get_client_rect(win, &cr); xvt_menu_popup(menu->child, win, p, XVT_POPUP_CENTER, NULL);
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_res_free_menu_tree(menu); 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; return;
} }
if (ep->type == E_COMMAND) if (ep->type == E_COMMAND && _last_sheet != NULL)
{ {
switch (ep->v.cmd.tag) switch (ep->v.cmd.tag)
{ {
case M_EDIT_UNDO: case BROWSE_BAR+1: _last_sheet->save_columns_order(); break;
if (_last_sheet) case BROWSE_BAR+2: _last_sheet->reset_columns_order(); break;
_last_sheet->reset_columns_order(); case BROWSE_BAR+3: _last_sheet->on_key(K_F11); break;
case M_EDIT_CLIPBOARD: default: break;
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;
} }
return; return;
} }

View File

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

View File

@ -1095,12 +1095,13 @@ bool TCursor::filtercursor(TRecnotype recno)
file().readat(recno); file().readat(recno);
if (update_relation()) if (update_relation())
{ {
const int handle = file().handle(); // memorizzo la chiave prima di eventuali spostamenti
const char *s0 = DB_index_getkey(handle); const TString s0(DB_index_getkey(file().handle()));
_if->update(-filter_limit()); _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)) if (recno != DB_index_recno(handle))
DB_index_go(handle, s0, recno); DB_index_go(handle, s0, recno);
} }
@ -1200,7 +1201,12 @@ bool TCursor::ok() const
} }
if (update_relation()) if (update_relation())
{
const TRecnotype old = file().recno();
_if->update(); _if->update();
if (DB_recno(file().handle()) != old)
file().readat(old);
}
if ((_filterfunction ? _filterfunction(_if) : TRUE ) && if ((_filterfunction ? _filterfunction(_if) : TRUE ) &&
(_fexpr ? __evalcondition(*_if, _fexpr, _frefs) : 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_font(PRINT_FONT, st, PRINT_HEIGHT);
set_color(fg, bg); set_color(fg, bg);
printat (X_OFFSET+pos, row, "%s", cp); stringat(X_OFFSET+pos, row, cp);
} }
pos += strlen (cp); pos += strlen (cp);
} }

View File

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