Scelta iniziale per listbox, correzioni sheet
git-svn-id: svn://10.65.10.50/trunk@2835 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c6e723f14c
commit
5f2d283e22
@ -1547,12 +1547,23 @@ void TDropDownList::select(int i, bool force)
|
||||
|
||||
void TDropDownList::select_by_initial(char c)
|
||||
{
|
||||
int next = _selected < _values.items() - 1 ? _selected + 1 : 0;
|
||||
int first = -1;
|
||||
for (int i = 0; i < _values.items(); i++)
|
||||
if (toupper(*(_values.get(i))) == toupper(c))
|
||||
{
|
||||
first = i;
|
||||
break;
|
||||
}
|
||||
if (first == -1) return;
|
||||
for (i = next; i < _values.items(); i++)
|
||||
if (toupper(*(_values.get(i))) == toupper(c))
|
||||
{
|
||||
select(i);
|
||||
break;
|
||||
}
|
||||
if (i == _values.items() && first > -1)
|
||||
select(first);
|
||||
}
|
||||
|
||||
void TDropDownList::select_by_ofs(int i)
|
||||
|
@ -299,7 +299,7 @@ void TSheet_control::update(long n)
|
||||
bool scroll_first = items() == 0; // || !owner().mask().is_running();
|
||||
if (!scroll_first)
|
||||
{
|
||||
int first, last;
|
||||
int first = 0, last = 0;
|
||||
xi_get_visible_rows(_obj, &first, &last);
|
||||
n = handle[first];
|
||||
scroll_first = n > items();
|
||||
@ -308,7 +308,7 @@ void TSheet_control::update(long n)
|
||||
if (scroll_first)
|
||||
xi_scroll(_obj, XI_SCROLL_FIRST);
|
||||
else
|
||||
xi_scroll_rec(_obj, handle[first], NORMAL_COLOR, XI_ATR_ENABLED | XI_ATR_AUTOSELECT, 0);
|
||||
xi_scroll_rec(_obj, n, NORMAL_COLOR, XI_ATR_ENABLED | XI_ATR_AUTOSELECT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user