Patch level : 2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

colors.*     Aggiunta funzione per calcolo distanza tra colori per
             gestione trasparenze in menu principale
dongle.cpp   Corretta gestione chiave Eutron normale (non SV)
image.cpp    Migliorata gestion etrasparenze
progind.cpp  Corretta gestione messaggi su piu' righe
relapp.cpp   Corretta traduzione messaggi di richiesta salvataggio
validate.cpp Sostituita TFixed_string errata con la corretta const TString&


git-svn-id: svn://10.65.10.50/trunk@11123 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-05-13 15:12:54 +00:00
parent 2b86a6c841
commit ffccf3bbea
7 changed files with 37 additions and 34 deletions

View File

@ -49,7 +49,22 @@ COLOR blend_colors(COLOR col1, COLOR col2, double perc)
return RGB2COLOR(r, g, b);
}
unsigned int color_distance(COLOR col1, COLOR col2)
{
if ((col1 & 0x00FFFFFF) == (col2 & 0x00FFFFFF))
return 0;
const int r1 = XVT_COLOR_GET_RED(col1);
const int g1 = XVT_COLOR_GET_GREEN(col1);
const int b1 = XVT_COLOR_GET_BLUE(col1);
const int r2 = XVT_COLOR_GET_RED(col2);
const int g2 = XVT_COLOR_GET_GREEN(col2);
const int b2 = XVT_COLOR_GET_BLUE(col2);
const int r = abs(r1-r2);
const int g = abs(g1-b2);
const int b = abs(b1-b2);
return (r > g && r > b) ? r : (g > b ? g : b);
}
class TColor_row_mask : public TMask
{

View File

@ -12,6 +12,7 @@
COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue);
COLOR choose_color(COLOR col = COLOR_BLACK, WINDOW win = NULL_WIN);
COLOR blend_colors(COLOR col1, COLOR col2, double perc = 0.5);
unsigned int color_distance(COLOR col1, COLOR col2);
extern COLOR MASK_BACK_COLOR;
extern COLOR MASK_LIGHT_COLOR;

View File

@ -156,13 +156,7 @@ const TString& TDongle::administrator(TString* pwd)
TConfig ini("install.ini", "Main");
_admin = ini.get("Administrator");
if (_admin.empty())
{
#ifdef XVAGA
_admin = "ADMIN";
#else
_admin = "PRASSI";
#endif
}
else
_admin = ::decode(_admin);
_admpwd = ini.get("Password");
@ -367,7 +361,7 @@ bool TDongle::eutron_login(bool test_all_keys)
"AGA.CAMPO", "25EBAI" };
TDongleType types[4] = { _aga_dongle, _prassi_dongle,
_user_dongle, _developer_dongle };
for (int k = test_all_keys ? 0 : 3; k < 4; k++)
for (int k = test_all_keys ? 0 : 2; k < 4; k++)
{
const unsigned char* pwd = (const unsigned char*)::encode(labels[k]);
ok = xvt_dongle_sl_login((const unsigned char*)labels[k], pwd) != 0;

View File

@ -283,8 +283,8 @@ void TImage::convert_transparent_color(COLOR transparent)
short dx, dy; xvt_image_get_dimensions(_image, &dx, &dy);
for (short y = 0; y < dy; y++) for (short x = 0; x < dx; x++)
{
const COLOR c = get_pixel(x, y) & 0x00FFFFFF;
if (c == trans)
const COLOR c = get_pixel(x, y);
if (color_distance(c, trans) < 8)
set_pixel(x, y, transparent);
}
}

View File

@ -1,17 +1,12 @@
#include "xvt.h"
#include "xinclude.h"
#include <colors.h>
#include <diction.h>
#include <progind.h>
#include <controls.h>
#include <urldefid.h>
#ifndef INCL_XI
extern "C"
{
void xi_draw_3d_rect (WINDOW win, RCT* rctp, BOOLEAN well, int height,
COLOR color_light, COLOR color_ctrl, COLOR color_dark);
}
#endif
word TIndwin::measure_text(TToken_string& s, word& maxlen) const
{
word lines = 0;
@ -142,7 +137,7 @@ void TIndwin::update_bar()
if (CAMPI_SCAVATI)
{
// Rettangolo scavato
xi_draw_3d_rect(w, &r, TRUE, 2,
xi_draw_3d_rect((XinWindow)w, (XinRect*)&r, TRUE, 2,
MASK_LIGHT_COLOR, MASK_BACK_COLOR, MASK_DARK_COLOR);
b.left += 2; b.right -= 2;
b.top += 2; b.bottom -= 2;
@ -191,11 +186,11 @@ void TIndwin::update_bar()
{
// Rettangolo in rilievo
b.right = b.left + int((r.right-r.left)*prc);
xi_draw_3d_rect(w, &b, FALSE, 2,
xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, FALSE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
// Rettangolo scavato
b.left = b.right; b.right = r.right;
xi_draw_3d_rect(w, &b, TRUE, 2,
xi_draw_3d_rect((XinWindow)w, (XinRect*)&b, TRUE, 2,
BTN_LIGHT_COLOR, BTN_BACK_COLOR, BTN_DARK_COLOR);
char n[8]; sprintf(n, "%d%%", int(prc * 100.0 + 0.5));

View File

@ -934,7 +934,7 @@ bool TRelation_application::save(bool check_dirty)
static bool was_dirty = FALSE;
int pos = _mask->id2pos(DLG_SAVEREC);
if (pos < 0 || !(_mask->fld(pos).shown() && _mask->fld(pos).enabled()))
if (pos < 0 || !_mask->fld(pos).active())
return TRUE;
int err = NOERR;
@ -943,11 +943,10 @@ bool TRelation_application::save(bool check_dirty)
{
const int dirty = _mask->dirty();
const char* ms = (mode == MODE_MOD) ? "le modifiche" : "i dati inseriti";
if (mode == MODE_QUERY)
{
const bool cont = !dirty || yesno_box("Annullare %s?", ms);
const char* ms = (mode == MODE_MOD) ? TR("Annullare le modifiche?") : TR("Annullare i dati inseriti?");
const bool cont = !dirty || yesno_box(ms);
return cont;
}
@ -974,16 +973,15 @@ bool TRelation_application::save(bool check_dirty)
if (_mask->field(dirty).is_edit())
w = _mask->efield(dirty).get_warning();
if (w.empty())
w = "Campo inconsistente";
w << ": si desidera ";
w = "Campo inconsistente: ";
switch (last)
{
case K_ESC:
w << "annullare?"; break;
w << TR("si desidera annullare?"); break;
case K_QUIT:
w << "uscire?"; break;
w << TR("si desidera uscire?"); break;
default:
w << "continuare?"; break;
w << TR("si desidera continuare?"); break;
}
k = yesno_box(w) ? K_NO : K_ESC;
if (k == K_ESC)
@ -992,7 +990,7 @@ bool TRelation_application::save(bool check_dirty)
else k = K_ESC;
}
else
k = yesnocancel_box("Registrare %s?", ms);
k = yesnocancel_box("Si desidera registrare?");
if (k == K_ESC || k == K_NO)
{
@ -1062,10 +1060,10 @@ bool TRelation_application::save(bool check_dirty)
mask2mail(*_mask);
break;
case _isreinsert:
warning_box("Esiste gia' un elemento con la stessa chiave");
warning_box(TR("Esiste gia' un elemento con la stessa chiave"));
break;
default:
error_box("Impossibile registrare i dati: errore %d", err);
error_box(FR("Impossibile registrare i dati: errore %d"), err);
break;
}
return err == NOERR;

View File

@ -50,10 +50,10 @@ HIDDEN bool _expr_val(TMask_field& f, KEY)
HIDDEN bool _emptycopy_val(TMask_field& f, KEY)
{
if (f.get().empty())
if (f.empty())
{
const short id = atoi(get_val_param(0));
const TFixed_string val(f.mask().get(id));
const TString& val = f.mask().get(id);
if (val.not_empty())
{
f.set(val);