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 » U++ Widgets - General questions or Mixed problems » DropList / DropGrid
DropList / DropGrid [message #41459] Thu, 19 December 2013 09:17 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I have a question about saving memory with DropList or DropGrid controls. Using the ArrayCtrl I can use an external data source with SetVirtualCount. This is fast and efficient, I love it.

However, can this be done with the controls as described above too? I'd use DropGrid because it looks very nice, but I have to know if it is possible to use an external data source. I tried SetDropLines and SetConvert but this does not seem to work properly.

I need to save my data in a Vector, and if I add the same data to my drop control, I am using unneeded memory.

Regards,
crydev
Re: DropList / DropGrid [message #41496 is a reply to message #41459] Sun, 22 December 2013 23:21 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I have found something out myself using the code of the control. However, it still doesn't work.

this->mExecutablePages.ListObject().AddRowNumColumn("Page").SetConvert(Single<IndexBasedValueConvert<GetMemoryPageForDropList>>());
this->mExecutablePages.ListObject().SetVirtualCount(mExecutablePagesList.GetCount());


I figured that using the underlying ArrayCtrl maybe it was possible to mangle the displayed values the way I want. However, it doesn't work. Why doesn't it? Is there a way it will work?
Re: DropList / DropGrid [message #41519 is a reply to message #41496] Wed, 25 December 2013 07:01 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello.

crydev wrote on Sun, 22 December 2013 23:21

I figured that using the underlying ArrayCtrl maybe it was possible to mangle the displayed values the way I want. However, it doesn't work. Why doesn't it? Is there a way it will work?

It doesn't work, because PopUpTable already have added column for DropList. Moreover, the DropList uses keys for values based on Index<Value> container, which adds memory consumption in your case.

To solve this, I created VirtualDropList class based on DropList methods and following example, which you could find in attachments:

index.php?t=getfile&id=4386&private=0

[Updated on: Wed, 25 December 2013 23:08]

Report message to a moderator

Re: DropList / DropGrid [message #41529 is a reply to message #41459] Wed, 25 December 2013 15:38 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks a lot Sender Ghost!

This is exactly what I was looking for. I see how you made use of a SetCount method to create a virtual DropList.

Regards,
crydev
Re: DropList / DropGrid [message #41530 is a reply to message #41529] Wed, 25 December 2013 22:31 Go to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
crydev wrote on Wed, 25 December 2013 15:38

This is exactly what I was looking for. I see how you made use of a SetCount method to create a virtual DropList.

You are right, there is a need to use SetVirtualCount method of ArrayCtrl for external data. The attached archive was updated for above message.

Thanks for attention.

[Updated on: Thu, 26 December 2013 00:23]

Report message to a moderator

Previous Topic: Creating a disasm control
Next Topic: Controls4U - Internet Explorer ActiveX
Goto Forum:
  


Current Time: Thu Mar 28 14:06:17 CET 2024

Total time taken to generate the page: 0.01417 seconds