THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/02/2005 at 04:34, xxxxxxxx wrote:
Cinema 4D Version:
Language(s) : C.O.F.F.E.E ;
I'm still wondering in my quest for including a list view inside a dialog, using COFFEE, of course.
What I want is a simple list of strings with a vertical scroll bar on the right.
It has to be able to detect what string was clicked and should be able to be created dynamically (as in, adding new strings or recreating the while list).
Anyone wants to join forces to create such a thing?
Or, is there already any way to do it?
On 23/02/2005 at 05:10, xxxxxxxx wrote:
Ok, I have a user area defined by Resedit, in a resource dialog.
How do I add it a ScrollGroup? I know I must do it in COFFEE, not with Resedit. But, how to add a ScrollGroup to a User Area that is already defined as a resource?
On 23/02/2005 at 10:33, xxxxxxxx wrote:
I may be out of my area here, but I don't think that's possible. Now you know why I create my dialogs programmatically within CreateLayout() and do not use dialog resources. ;0)
Here's the code of my quick scrollgroup with buttons. Maybe it will help you, maybe not. Note that LayoutLVGroup() should be called whenever you want to update the list display.
ID_START = 4000,
ID_LVITEMBASE = 5000
// CLASS: List View Dialog
class LVDialog : GeDialog
a = new(array,10);
a = "Item 1";
a = "Item 2";
a = "Item 3";
a = "Item 4";
a = "Item 5";
a = "Item 6";
a = "Item 7";
a = "Item 8";
a = "Item 9";
a = "Item 10";
// Layout Dialog GUI
AddScrollGroupBegin(ID_LVSGROUP, BFH_CENTER|BFV_SCALEFIT, SCROLLGROUP_VERT|SCROLLGROUP_HORIZ|SCROLLGROUP_AUTOVERT|SCROLLGROUP_AUTOHORIZ);
// Relayout LV Group
// Create ListView Group of Buttons
for (x = 0; x < 10; x++)
if (id >= ID_LVITEMBASE)
On 24/02/2005 at 06:33, xxxxxxxx wrote:
I decided to go "the hard" way and try to code my layout in COFFEE. But, another problem showed his uggly head:
I have to have a way to re-create my list whenever I want. So, if I code the dialog in COFFEE, I have to set the list at the beginning. But then, when I want to update it, how can I do it? I can't re-generate the dialog again and again. In your code, you already know you want 10 buttons. I may have 10 items in the list at first, but then after a while, when I refresh it, I may have more or less items.
So, how to do it?!?
On 24/02/2005 at 08:41, xxxxxxxx wrote:
In C++, I use simple "linked list" classes (head/tail in a 'parent' class) :
class SomeItem *prev, *next;
With this, I can insert, append, remove, and then update.
COFFEE doesn't have 'pointers', so this is a problem. If you know that your list isn't going to be very large, you could allocate an array, like I did, but to some maximum size. Then keep a counter of items. This makes removal and insertion fun though - you will need to shuffle the array elements for these operations. Better to make a 'list' class containing the array to encapsulate all of the operations.
Or you could derive your item class from BaseList2D and get all of that functionality (at a size cost assuredly).