Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl crashes with "embedded" Ctrls referenced by Id [SOLVED]
ArrayCtrl crashes with "embedded" Ctrls referenced by Id [SOLVED] [message #2256] |
Wed, 05 April 2006 13:50  |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
Try this code:
#include <CtrlLib/CtrlLib.h>
GUI_APP_MAIN
{
TopWindow w;
ArrayCtrl arr;
EditString editName, editSurName;
Option editAvail;
arr.SetRect(50,50,550,350);
w.Add(arr);
editName.SetRect(90,10,150,20);
w.Add(editName);
editSurName.SetRect(315,10,150,20);
w.Add(editSurName);
editAvail.SetRect(550,10,150,20);
w.Add(editAvail);
arr.AddColumn("ID","ID",3);
arr.AddColumn("Name", "Name", 20);
arr.AddColumn("SurName", "SurName", 20);
arr.AddColumn("Avail" "Avail?", 3).Ctrls<Option>(); //10
arr.Add("1","Luigi","Forlano", true);
arr.Add("2","Diego","Maradona", false);
arr.Add("3","Paolo","Maldini", false);
arr.Add("4","Roberto","Carlos", false);
arr.Add("5","David","Beckham", false);
editName <<= arr.Get(0,"Name");
// editName <<= arr.Get(0,"name"); //crash when Id "not in list"!!!
editSurName <<= arr.Get(0,"SurName");
// editAvail <<= arr.Get(0,"Avail"); //should work or at least must not crash!!!
editAvail <<= arr.Get(0,3); //works only this way
w.Run();
}
?bugs?
[Updated on: Mon, 01 May 2006 20:22] Report message to a moderator
|
|
|
|
|
Re: ArrayCtrl crashes with "embedded" Ctrls referenced by Id [message #2259 is a reply to message #2257] |
Wed, 05 April 2006 14:12   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Wed, 05 April 2006 12:59 | Well.... before trying to fix that...
fudadmin wrote on Wed, 05 April 2006 07:50 | Try this code:
#include <CtrlLib/CtrlLib.h>
arr.AddColumn("ID","ID",3);
arr.AddColumn("Name", "Name", 20);
arr.AddColumn("SurName", "SurName", 20);
arr.AddColumn("Avail" "Avail?", 3).Ctrls<Option>(); //10
?bugs?
|
... where is the comma after "Avail"?
Mirek
|
That means, this one is my bug...
|
|
|
|
|
|
Re: ArrayCtrl crashes with "embedded" Ctrls referenced by Id [message #2264 is a reply to message #2262] |
Wed, 05 April 2006 14:43   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Wed, 05 April 2006 13:22 |
fudadmin wrote on Wed, 05 April 2006 08:16 | but what about this one?
// editName <<= arr.Get(0,"name"); //crash when Id "not in list"!!!
|
What do you expect?
This should by all means crash! (Well, I hope it fails on ASSERT, does not it?).
Mirek
|
And if I want to connect the same ArrayCtrl to different sources and fill columns names and get values dynamically that means I need to my own checking or...?
[Updated on: Wed, 05 April 2006 14:43] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 10:43:53 CEST 2025
Total time taken to generate the page: 0.01094 seconds
|