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 » Community » Newbie corner » Help needed to program an array ctrl.
Re: Help needed to program an array ctrl. [message #28473 is a reply to message #28467] Thu, 02 September 2010 21:48 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Yes, I assumed that there is not too much layers, so it will be fast enough to recreate them all every time something changes.

As for your questions:
1) If I wanted to know which Ctrl changed, I would probably use external controls. Then you can assign a Callback1 to each which will pass the row number to the called function. Exactly as you did it in your code Wink You just have a little bug there - if you delete some row, the following have messed up ids (layer_id!=row index). I would suggest you to add an index to the array (AddIndex("id")Wink and store layer_id in it. So you can use that instead of the row number.

2) DUMPC is a debugging macro that dumps the content of container into the log file (Debug > View log file in theide). I put it there just to make sure the layers are updated correctly, there is no deeper meaning into that destructor. I also called it once in the constructor.

The most complicated thing about ArrayCtrl is that it supports a lot of different usage patterns. Actually it should be even able to work with external data source, but I never seen that and the help only says that it is awkward Smile

Unfortunately I can't tell you what is the simplest solution to your problem, I simply don't know. Maybe someone else can give you better advice.

Thinking about it now, I found one more solution. You could create your own Ctrl, representing the whole layer (i.e. including all the Ctrls in a single widget). It would be a little bit more work to create it, but might save a lot of work on handling all the thing separately. But that is just my idea, I never did something like that.

Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Several options: what to use?
Next Topic: Problems in growing up from newbie
Goto Forum:
  


Current Time: Sun Jul 06 06:29:20 CEST 2025

Total time taken to generate the page: 0.02729 seconds