msksheet.cpp Corretta gestione focus
real.cpp Corretta string con i long double git-svn-id: svn://10.65.10.50/trunk@2057 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
28806b097d
commit
187fdac4fc
@ -458,18 +458,18 @@ int TSpreadsheet::row2rec(int& row)
|
|||||||
if (row < 0)
|
if (row < 0)
|
||||||
{
|
{
|
||||||
row = 0;
|
row = 0;
|
||||||
r = (int)rec[row]-1;
|
r = (int)rec[row] /* -1 */;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (row >= rows)
|
if (row >= rows)
|
||||||
{
|
{
|
||||||
row = rows-1;
|
row = rows-1;
|
||||||
r = (int)rec[row]+1;
|
r = (int)rec[row] /* +1 */;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
r = (int)rec[row];
|
r = (int)rec[row];
|
||||||
|
|
||||||
CHECKD(r >= 0 && r <= items(), "Sheet line out of range: ", row);
|
CHECKD(r >= 0 && r < items(), "Sheet line out of range: ", row);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -809,7 +809,7 @@ void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
|||||||
{
|
{
|
||||||
notify_change();
|
notify_change();
|
||||||
_cell_dirty = TRUE;
|
_cell_dirty = TRUE;
|
||||||
_edit_field->set_focusdirty();
|
_edit_field->set_dirty();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_BUTTON:
|
case XIE_BUTTON:
|
||||||
@ -1921,19 +1921,22 @@ bool TSheet_field::on_key(KEY k)
|
|||||||
{
|
{
|
||||||
if (!test_focus_change())
|
if (!test_focus_change())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
}
|
||||||
if (k == K_ROWEDIT )
|
|
||||||
|
if (k == K_TAB && !focusdirty() && items() > 0)
|
||||||
{
|
{
|
||||||
if ( items( ) )
|
select(0);
|
||||||
{
|
}
|
||||||
_sheet->select( _sheet->items( ) - 1 );
|
|
||||||
XI_EVENT xie;
|
if (k == K_ROWEDIT && items() > 0)
|
||||||
xie.type = XIE_DBL_CELL;
|
{
|
||||||
xie.v.xi_obj = NULL;
|
select(items()-1);
|
||||||
_sheet->list_handler( &xie );
|
XI_EVENT xie;
|
||||||
return TRUE;
|
xie.type = XIE_DBL_CELL;
|
||||||
}
|
xie.v.xi_obj = NULL;
|
||||||
};
|
_sheet->list_handler( &xie );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
return TMask_field::on_key(k);
|
return TMask_field::on_key(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,47 +123,29 @@ char *real::string (
|
|||||||
// <p picture>.
|
// <p picture>.
|
||||||
|
|
||||||
{
|
{
|
||||||
if (dec != UNDEFINED)
|
TString16 fmt("%");
|
||||||
{
|
if (pad != ' ') fmt << '0';
|
||||||
if (len != 0)
|
if (len != 0) fmt << len;
|
||||||
sprintf(__string, "%*.*Lf", len, dec, _dec);
|
if (dec != UNDEFINED) fmt << '.' << dec;
|
||||||
else
|
fmt << "Lf";
|
||||||
sprintf(__string, "%.*Lf", dec, _dec);
|
sprintf(__string, fmt, _dec);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (len != 0)
|
|
||||||
sprintf(__string, "%*Lf", len, _dec);
|
|
||||||
else
|
|
||||||
sprintf(__string, "%Lf", _dec);
|
|
||||||
|
|
||||||
if (strchr(__string, '.') != NULL)
|
if (len == 0 && dec == UNDEFINED && strchr(__string, '.') != NULL)
|
||||||
|
{
|
||||||
|
int cut = strlen (__string);
|
||||||
|
for (int i = cut-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
int cut = strlen (__string);
|
if (__string[i] == '0')
|
||||||
for (int i = cut-1; i >= 0; i--)
|
cut--;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (__string[i] == '0')
|
if(__string[i] == '.')
|
||||||
cut--;
|
cut--;
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
if(__string[i] == '.')
|
|
||||||
cut--;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
__string[cut] = '\0';
|
|
||||||
}
|
}
|
||||||
|
__string[cut] = '\0';
|
||||||
}
|
}
|
||||||
const int lun = strlen (__string);
|
|
||||||
if (lun < len)
|
|
||||||
{
|
|
||||||
const int delta = len - lun;
|
|
||||||
for (int i = lun; i >= 0; i--)
|
|
||||||
__string[i + delta] = __string[i];
|
|
||||||
for (i = 0; i < delta; i++)
|
|
||||||
__string[i] = pad;
|
|
||||||
}
|
|
||||||
|
|
||||||
return __string;
|
return __string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user