Corretti errori PR e iniziato supporto XI
git-svn-id: svn://10.65.10.50/trunk@2479 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
aba2659298
commit
a51c0254eb
@ -347,8 +347,10 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
}
|
}
|
||||||
|
|
||||||
RCT rct = resize_rect(x, y, dx, dy, WO_TE, parent);
|
RCT rct = resize_rect(x, y, dx, dy, WO_TE, parent);
|
||||||
rct.bottom -= 12;
|
#ifndef XI_FU_MULTIPLE
|
||||||
rct.right -= 28;
|
// rct.bottom -= 12 ;
|
||||||
|
// rct.right -= 28;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((f_width+max_width)*CHARX > rct.right)
|
if ((f_width+max_width)*CHARX > rct.right)
|
||||||
fixed_columns = 1;
|
fixed_columns = 1;
|
||||||
@ -359,6 +361,18 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
itfdef->v.itf->automatic_back_color = FALSE;
|
itfdef->v.itf->automatic_back_color = FALSE;
|
||||||
itfdef->v.itf->back_color = MASK_BACK_COLOR;
|
itfdef->v.itf->back_color = MASK_BACK_COLOR;
|
||||||
|
|
||||||
|
#ifdef XI_FU_MULTIPLE
|
||||||
|
const short work_dx = ((rct.right - rct.left) * XI_FU_MULTIPLE) / CHARX - 3 * XI_FU_MULTIPLE;
|
||||||
|
const short work_dy = ((rct.bottom - rct.top ) * XI_FU_MULTIPLE) / CHARY - 2 * XI_FU_MULTIPLE - 6;
|
||||||
|
|
||||||
|
XI_OBJ_DEF* listdef = xi_add_list_def(itfdef, LIST_CID,
|
||||||
|
0, 0, work_dy, //rct.bottom-rct.top,
|
||||||
|
XI_ATR_ENABLED | XI_ATR_VISIBLE,
|
||||||
|
NORMAL_COLOR, NORMAL_BACK_COLOR, // normal
|
||||||
|
NORMAL_COLOR, DISABLED_BACK_COLOR, // disabled
|
||||||
|
COLOR_RED, // active
|
||||||
|
LIST_CID);
|
||||||
|
#else
|
||||||
XI_OBJ_DEF* listdef = xi_add_list_def(itfdef, LIST_CID,
|
XI_OBJ_DEF* listdef = xi_add_list_def(itfdef, LIST_CID,
|
||||||
0, 0, rct.bottom-rct.top,
|
0, 0, rct.bottom-rct.top,
|
||||||
XI_ATR_ENABLED | XI_ATR_VISIBLE,
|
XI_ATR_ENABLED | XI_ATR_VISIBLE,
|
||||||
@ -366,12 +380,17 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
NORMAL_COLOR, DISABLED_BACK_COLOR, // disabled
|
NORMAL_COLOR, DISABLED_BACK_COLOR, // disabled
|
||||||
COLOR_RED, // active
|
COLOR_RED, // active
|
||||||
LIST_CID);
|
LIST_CID);
|
||||||
|
#endif
|
||||||
listdef->v.list->sizable_columns = TRUE;
|
listdef->v.list->sizable_columns = TRUE;
|
||||||
listdef->v.list->movable_columns = TRUE;
|
listdef->v.list->movable_columns = TRUE;
|
||||||
listdef->v.list->scroll_bar = TRUE;
|
listdef->v.list->scroll_bar = TRUE;
|
||||||
listdef->v.list->scroll_bar_button = TRUE;
|
listdef->v.list->scroll_bar_button = TRUE;
|
||||||
listdef->v.list->fixed_columns = fixed_columns;
|
listdef->v.list->fixed_columns = fixed_columns;
|
||||||
|
#ifdef XI_FU_MULTIPLE
|
||||||
|
listdef->v.list->width = work_dx;
|
||||||
|
#else
|
||||||
listdef->v.list->width = rct.right-rct.left;
|
listdef->v.list->width = rct.right-rct.left;
|
||||||
|
#endif
|
||||||
listdef->v.list->min_cell_height = CHARY;
|
listdef->v.list->min_cell_height = CHARY;
|
||||||
listdef->v.list->min_heading_height = CHARY;
|
listdef->v.list->min_heading_height = CHARY;
|
||||||
listdef->v.list->white_space_color = MASK_DARK_COLOR;
|
listdef->v.list->white_space_color = MASK_DARK_COLOR;
|
||||||
@ -380,9 +399,14 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
if (sheet_mask().id2pos(FIRST_FIELD -1) != -1)
|
if (sheet_mask().id2pos(FIRST_FIELD -1) != -1)
|
||||||
attr |= XI_ATR_SELECTABLE;
|
attr |= XI_ATR_SELECTABLE;
|
||||||
|
|
||||||
|
#ifdef XI_FU_MULTIPLE
|
||||||
|
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0, NUMBER_WIDTH * XI_FU_MULTIPLE, NUMBER_WIDTH+1,
|
||||||
|
attr & XI_ATR_SELECTABLE ? "X" : "");
|
||||||
|
#else
|
||||||
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0, NUMBER_WIDTH, NUMBER_WIDTH+1,
|
XI_OBJ_DEF* coldef = xi_add_column_def(listdef, 0, attr, 0, NUMBER_WIDTH, NUMBER_WIDTH+1,
|
||||||
attr & XI_ATR_SELECTABLE ? "X" : "");
|
attr & XI_ATR_SELECTABLE ? "X" : "");
|
||||||
|
|
||||||
|
#endif
|
||||||
coldef->v.column->heading_platform = TRUE;
|
coldef->v.column->heading_platform = TRUE;
|
||||||
coldef->v.column->column_platform = TRUE;
|
coldef->v.column->column_platform = TRUE;
|
||||||
|
|
||||||
@ -422,8 +446,13 @@ TSpreadsheet::TSpreadsheet(
|
|||||||
if (f->active()) flags |= XI_ATR_ENABLED | XI_ATR_FOCUSBORDER | XI_ATR_AUTOSELECT;
|
if (f->active()) flags |= XI_ATR_ENABLED | XI_ATR_FOCUSBORDER | XI_ATR_AUTOSELECT;
|
||||||
else _column_disabled.set(i);
|
else _column_disabled.set(i);
|
||||||
|
|
||||||
|
#ifdef XI_FU_MULTIPLE
|
||||||
|
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i] * XI_FU_MULTIPLE, m_width[i],
|
||||||
|
(char*)(const char*)testo);
|
||||||
|
#else
|
||||||
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i], m_width[i],
|
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i], m_width[i],
|
||||||
(char*)(const char*)testo);
|
(char*)(const char*)testo);
|
||||||
|
#endif
|
||||||
coldef->v.column->heading_platform = TRUE;
|
coldef->v.column->heading_platform = TRUE;
|
||||||
coldef->v.column->center_heading = TRUE;
|
coldef->v.column->center_heading = TRUE;
|
||||||
}
|
}
|
||||||
@ -602,17 +631,24 @@ int TSpreadsheet::find_enabled_column(int rec, int colonna, int direction) const
|
|||||||
// riga (da 0), colonna (0 = numero, 1 = prima cella, ...)
|
// riga (da 0), colonna (0 = numero, 1 = prima cella, ...)
|
||||||
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||||
{
|
{
|
||||||
xvt_scr_set_focus_vobj(win());
|
const bool has_focus = mask().focus_field().dlg() == _owner->dlg();
|
||||||
mask().set_focus_win(win(), FALSE);
|
if (has_focus)
|
||||||
|
{
|
||||||
|
xvt_scr_set_focus_vobj(win());
|
||||||
|
mask().set_focus_win(win(), FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
const int rec = row2rec(riga);
|
const int rec = row2rec(riga);
|
||||||
colonna = find_enabled_column(rec, colonna, +1);
|
colonna = find_enabled_column(rec, colonna, +1);
|
||||||
|
|
||||||
if (colonna > 0)
|
if (colonna > 0)
|
||||||
{
|
{
|
||||||
XI_OBJ cell;
|
if (has_focus)
|
||||||
XI_MAKE_CELL(&cell, _list, riga, colonna);
|
{
|
||||||
xi_set_focus(&cell);
|
XI_OBJ cell;
|
||||||
|
XI_MAKE_CELL(&cell, _list, riga, colonna);
|
||||||
|
xi_set_focus(&cell);
|
||||||
|
}
|
||||||
|
|
||||||
_edit_field = col2field(_cur_col = colonna);
|
_edit_field = col2field(_cur_col = colonna);
|
||||||
if (rec != _cur_rec)
|
if (rec != _cur_rec)
|
||||||
@ -723,7 +759,7 @@ void TSpreadsheet::update(
|
|||||||
const long* handle = xi_get_list_info(_list, &num);
|
const long* handle = xi_get_list_info(_list, &num);
|
||||||
|
|
||||||
int first = 0, last = 0;
|
int first = 0, last = 0;
|
||||||
bool scroll = items() == 0 || !_owner->mask().is_running();
|
bool scroll = items() == 0; // || !_owner->mask().is_running();
|
||||||
if (!scroll)
|
if (!scroll)
|
||||||
{
|
{
|
||||||
xi_get_visible_rows(_list, &first, &last);
|
xi_get_visible_rows(_list, &first, &last);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user