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 » ArrayCtrl, HeaderCtrl & GridCtrl » How to sort the ArrCtrl [SOLVED]
Re: How to sort the ArrCtrl [message #2272 is a reply to message #2239] Wed, 05 April 2006 16:21 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
fudadmin wrote on Wed, 05 April 2006 03:08


You are not lazy enough once again! Smile 4 Operations!!! and so difficult?! You must avoid such thinking with Ultimate++... Smile

Why not to start with easy things:
arr.Sort(int_col);

P.S. Sorry for the delay - I didn't want you to die so soon..


Only now I have had the chance to try it. I couldn't believe that this line was the solution. I've attached the following method

void Tab1::SortRecord() // body of the callback 
{ arr.Sort(0);
}


to a button and it worked! Surprised .
If I put your line inside the AddPlayer method the array is always sorted. I prefer to see the added recod at the end and then sort when I need. So the decision of a new method... and new button...

This is really the perfect tool for lazy people. I can become mad if I remind the time lost to reinvent the wheel with other tool. I suspect my application ported to U++ will be long maybe 1/5 of the previous one.

But this is not what I wanted! In fact I wanted to click on the 'header' to get an array sorted. So I started to think in a lazy way... to prevent future complain Laughing . After some investigation I got the answer:

void Tab1::SortRecord() 
{ int i;
  i = arr.GetClickColumn();     
  arr.Sort( i );
}


associated to doubleclick event in the constructor

arr.WhenLeftDouble = THISBACK(SortRecord);

This is even better from point of view of lazyness because I do not need to move the mouse up to the header of the array when I am at its bottom (notoriously a very time and energy comsuming task). I hope you agree Smile

Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ArrayCtrl crashes with "embedded" Ctrls referenced by Id [SOLVED]
Next Topic: ArrayCtrl - how to set tooltips? [BY DERIVING...]
Goto Forum:
  


Current Time: Fri Jul 18 07:20:08 CEST 2025

Total time taken to generate the page: 0.04072 seconds