Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl sorting and segfaults
GridCtrl sorting and segfaults [message #16669] |
Mon, 07 July 2008 09:38  |
Sami
Messages: 6 Registered: July 2008
|
Promising Member |
|
|
Hi,
I clear the view and add completely new items into the GridCtrl. This messes up the current sorting. How do I re-sort, using the current settings the newly refreshed view? Also how do I manually set (for example) sorting enabled for the first column?
When I do not use debug mode, I get crash at LanguageInfo::Compare(WString,WString) (which I hacked by converting to String and doing strcmp) when I click GridCtrl header to sort a column containing c-strings (char *).
Thanks for the great library.
[Updated on: Mon, 07 July 2008 09:41] Report message to a moderator
|
|
|
Re: GridCtrl sorting and segfaults [message #16675 is a reply to message #16669] |
Mon, 07 July 2008 12:27   |
Oblivion
Messages: 1204 Registered: August 2007
|
Senior Contributor |
|
|
Quote: |
When I do not use debug mode, I get crash at LanguageInfo::Compare(WString,WString) (which I hacked by converting to String and doing strcmp) when I click GridCtrl header to sort a column containing c-strings (char *).
|
Why did you hack it? There are other solutions.
LanguageInfo::Compare(String a, String b)
LanguageInfo::Compare(WString a, WString b)
LanguageInfo::Compare(const char *a, const char *b);
LanguageInfo::Compare(const wchar *a, const wchar *b);
LanguageInfo::Compare(const wchar *a, const wchar *b, int a_length, int b_length)
Also, you can convert a String to WString using (and vice versa);
Upp::String WString.ToString();
WString String.ToWString();
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 07 July 2008 12:28] Report message to a moderator
|
|
|
|
Re: GridCtrl sorting and segfaults [message #16681 is a reply to message #16669] |
Mon, 07 July 2008 17:20   |
|
As for bug - test case please Right now there is now method to resort but it's a good idea and I will add it. I also consider adding AutoSort what would solve your second problem. Excpect it after rc2, which will be released today.
|
|
|
|
Re: GridCtrl sorting and segfaults [message #16684 is a reply to message #16682] |
Mon, 07 July 2008 19:15  |
|
Quote: |
Admittedly I have spent time trying to figure out how to solve the resort(), because my app practically depends on it. Sorry if this sounds too annoying, but what "after" means? This week, or later? Just asking to decide should I invest more time on studying the code.
|
I mean it should be in rc3 or final. Most probably it will be added in this week. I'm using a grid a lot (what a suprise ) so I'm in grid code quite often.
Quote: |
Yet another thing. I noticed there are quite large memory requirements in the control. What are the exact memory requirements?
|
Grid uses Vector<Vector<Value>> to store values. There are also 2 more vectors for storing rows and columns information. So it eats memory proportionaly to rows count.
Please tell how many columns/rows you have and what kind of Values do you use (also please write grid memory occupation size). Maybe memory usage grows as a result of some operations sequence?
|
|
|
Goto Forum:
Current Time: Tue Apr 29 01:44:26 CEST 2025
Total time taken to generate the page: 0.03285 seconds
|