Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » inconsistency causes crash
inconsistency causes crash [message #27183] |
Tue, 29 June 2010 20:46 |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Hi Daniel,
GridCtrl::ItemRect& GridCtrl::ItemRect::Editable(bool b)
{
editable = b;
parent->SyncCtrls(id);
return *this;
}
.....
void GridCtrl::SyncCtrls(int row)
{
//if(!HasCtrls())
// return;
Size sz = GetSize();
genr_ctrls = false;
Vector<int> cols;
for(int i = 1; i < total_cols; i++)
if(edits[hitems[i].id].factory && hitems[i].editable)
cols.Add(i);
if(cols.IsEmpty())
return;
int dy = sby + fixed_height;
int dx = sbx + fixed_width;
Rect r;
int js = row < 0 ? 0 : row;
int je = row < 0 ? total_rows : row + 1;
for(int j = js; j < je; j++)
{
int idy = vitems[j].id;
bool fixed = j < fixed_rows;
bool create = !fixed && vitems[j].editable;
for(int i = 0; i < cols.GetCount(); i++)
{
int c = cols[i];
int idx = hitems[c].id;
int oid = idx;
Item *it = &items[idy][idx];
if(it->isjoined)
{
it = &items[it->idy][it->idx];
idx = it->idx;
}
......
the id in the first function becomes the row number in the second. This causes crashes in my code which I need to workaround (SetRowCount(10) then do my shit then SetRowCount(actual number of rows I want).
Just wanted to be dutiful and report the bug.
Nick
|
|
|
Goto Forum:
Current Time: Fri Sep 20 08:04:58 CEST 2024
Total time taken to generate the page: 0.03048 seconds
|