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++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » CtrlTab slaves
CtrlTab slaves [message #9403] Sat, 05 May 2007 15:33 Go to next message
idaho is currently offline  idaho
Messages: 6
Registered: April 2007
Location: Frankfurt-am-Main
Promising Member

Hi, everybody!

What exactly a control slave is? The point is I need to add an ArrayCtrl to a dynamically created tab. Constructions like

ArrayCtrl array;
tabCtrl.Add(array, a_dynamically_created_string);


don't seem to work, at least, the newly created tab doesn't show anything.


I did search for the answer in the examples provided with the library but did not find anything.

Thanks for any help.
Re: CtrlTab slaves [message #9404 is a reply to message #9403] Sat, 05 May 2007 16:56 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Do it like this:
ArrayCtrl array;
tabCtrl.Add(array.SizePos(), a_dynamically_created_string);


Re: CtrlTab slaves [message #9405 is a reply to message #9404] Sat, 05 May 2007 17:11 Go to previous messageGo to next message
idaho is currently offline  idaho
Messages: 6
Registered: April 2007
Location: Frankfurt-am-Main
Promising Member

This is what I tried right now. Unfortunately, it doesn't work (i. e. the tab is empty even if I fill the ArrayCtrl with data), or did I miss something?

I created a simple project, with a top window, a tab control, and a button. When button is clicked, the folowing code is fired:

ArrayCtrl array;
	
if (tab.GetCount() == 0)
	tab.Add(array.SizePos(), "test");
else
{
	tab.Add(array.SizePos(), "test");
	tab.Set(tab.GetCount() - 1);
}
array.AddColumn("test1");
array.AddColumn("test2");
array.Add("test1", "test2");


When the second tab is created, and you try to switch to the first tab, an exception is thrown, like, EXCEPTION_ACCESS_VIOLATION.
When a grid control is used, there are no errors but still no result.
Re: CtrlTab slaves [message #9406 is a reply to message #9405] Sat, 05 May 2007 17:18 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Post your full package here if that's not a problem. It would be easier to detect what's wrong.
Re: CtrlTab slaves [message #9407 is a reply to message #9405] Sat, 05 May 2007 17:23 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
The problem is, that you create your ArryCtrl instance on the stack in your method body.
Put that "ArrayCtrl array;" line into the declaration of your class.
Re: CtrlTab slaves [message #9409 is a reply to message #9407] Sat, 05 May 2007 17:54 Go to previous message
idaho is currently offline  idaho
Messages: 6
Registered: April 2007
Location: Frankfurt-am-Main
Promising Member

zsolt is right. When I put
ArrayCtrl array;

into the class declaration, everything works fine, at least for the first tab. Smile When a second tab is created, the "assertion failed" message appears (quite expectedly). But the point is to create a completely new array control for every tab that happens to appear.

I've attached the project.
  • Attachment: tabsTest.zip
    (Size: 1.28KB, Downloaded 269 times)
Previous Topic: howto clean up generated test data?
Next Topic: Quick question on erroneous build
Goto Forum:
  


Current Time: Mon Apr 29 13:09:35 CEST 2024

Total time taken to generate the page: 0.02423 seconds