Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » bug in gridcrtl
bug in gridcrtl [message #44603] Wed, 15 April 2015 20:50 Go to previous message
aftershock is currently offline  aftershock
Messages: 143
Registered: May 2008
Experienced Member
Hi,

I created a grid control with columns.
I rearranged the order of some of the columns.

result.RemoveColumn ( 0, result.GetColumnCount() - 0 ); failed


void GridCtrl::RemoveColumn(int n, int count)
{
n += fixed_cols;
if(count < 0)
count = total_cols - n;
if(n < fixed_cols || n + count > total_cols)
return;
for(int i = 0; i < total_rows; i++)
items[i].Remove(n, count);

Vector<int> r;
for(int i = 0; i < count; i++)
{
if(edits[hitems[n + i].id].factory)
--genr_ctrls;
r.Add(hitems[n + i].id);
}

///////////BUG is HERE r is not sorted.... that is why Remove fails at assert later on

Upp::Sort(r); // solution

hitems.Remove(n, count);
rowbkp.Remove(r);
summary.Remove(r);
edits.Remove(r);
total_cols -= count;
recalc_cols = true;
valid_cursor = SetCursor0(min(curpos.x, total_cols - 1), curpos.y).IsValid();
Repaint(true);
}

[Updated on: Wed, 15 April 2015 20:55]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: automatic build set up does not start up
Next Topic: Please, look at specialized forums !
Goto Forum:
  


Current Time: Thu Mar 28 22:16:16 CET 2024

Total time taken to generate the page: 0.01283 seconds