THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/02/2005 at 03:39, xxxxxxxx wrote:
Cinema 4D Version: 8.x
Platform: Mac ; Mac OSX ;
Language(s) : C.O.F.F.E.E ;
Using Resedit, I can add a List Box to my dialog. What is it supposed to do? I want to create a way to show a list of names, with a vertical scroll bar on the right. Is this the way to do it? I can't find any references to List Box in my COFFEE docs.
Thank you in advance for any help.
On 22/02/2005 at 05:53, xxxxxxxx wrote:
You get an empty box, you have to provide the contents and peanuts.
To add contents programmatically, use AddItem().
To do so in the Resource, see "ComboBox" in the COFFEE docs.
On 22/02/2005 at 06:37, xxxxxxxx wrote:
Thank you Robert.
I assumed I would had to populate it with data, of course
But, is it considered a ComboBox, internally? And I must also find out how to read what item is clicked inside it.
On 22/02/2005 at 06:50, xxxxxxxx wrote:
Ok, in the COFFEE documents I have this:
[bool] AddItem( [int] id, [int] subid, [string] name);
But the explanation is the following:
Adds an item to the RadioGroup, ComboBox or PopupButton with the specified id. Returns TRUE if successful.
It only talks about the id, not about the subid. WHY, OH WHY does the documentation is sooooo incomplete?!?
On 22/02/2005 at 06:55, xxxxxxxx wrote:
Yes, it is a ComboBox internally.
In your dialog Command() function, you check for the id of the ComboBox and GetItem(id). That's my guess, anyway, since I can't find an example.
On 22/02/2005 at 07:00, xxxxxxxx wrote:
Right, the id is that of the ComboBox. The subid is the id of the item to add (each item must have an id for reference). The name is the text that will be displayed.
You think the COFFEE docs are bad, try XPresso!
On 22/02/2005 at 07:12, xxxxxxxx wrote:
But I simply want to add strings to the List View. What is the ID of the item? How can I set it? I'm typing:
But nothing is showing.
On 22/02/2005 at 07:33, xxxxxxxx wrote:
Whatever you want the ID to be (as long as the IDs don't collide with those already used in the dialog - must be unique in that sense). I usually start a set of dialog IDs (for gadgets) at a certain number, 4000 or 5000. You can enum-erate them. You can declare a starting number for the ComboBox items (if they are to be variable) and add to that as you add to the list:
for (each item in list x)
ID_CB_TEXT1 = 5001,
AddItem(SCRIPT_LISTBOX, ID_CB_TEXT1, "Text 1");
AddItem(SCRIPT_LISTBOX, ID_CB_TEXT2, "Text 2");
or something similar.
Make sure that you add items after you LoadResource()/AddComboBox(). The ComboBox must exist before you can AddItem()s to it.
On 22/02/2005 at 07:52, xxxxxxxx wrote:
Well, I'm using a List View, not a ComboBox but I believe it should be the same. And, after doing, for example...
AddItem(SCRIPT_LISTBOX, 5001, "Text 1");
I get no error, but I also still have an empty List View box. I'm making the AddItem command in the Init of my dialog. Is it the correct place?
On 22/02/2005 at 08:08, xxxxxxxx wrote:
Oh, Robert, about the Xpresso documentation, I know it is "slim". Luckily I "assisted" to the whole development of Xpresso so, I have not much problems with it
But COFFEE... we should really get better docs. Sometimes I'm forced to go to the C++ docs and extrapulate. Oh, and LOTS of trial&error; testing.
On 22/02/2005 at 09:08, xxxxxxxx wrote:
How are you adding a ListView (don't see it in the docs)? Is this a MultiLineEditText? I don't use ResEdit often - only in those sticky situations where grouping doesn't seem to be right.
On 22/02/2005 at 09:14, xxxxxxxx wrote:
Adding? I simply defined it in Resedit so it appears when I load my dialog. The dialog is like this:
And the List View is the rectangle above the "Refresh list" button.
On 22/02/2005 at 10:01, xxxxxxxx wrote:
Right, but is a ListView the same as a MultiLineEditText? Nope, it isn't after checking. But there is no ListView in the COFFEE docs (whatsoever). I did a text search on the entire HTML docs and nada.
With that in mind, you are back to T&E; or maybe checking the latest docs to see if they included it in there. Or complaining about it - ResEdit can be used for both COFFEE and C++ dialog resources, so COFFEE either supports ListView or it doesn't.
On 22/02/2005 at 10:46, xxxxxxxx wrote:
The problem is that... this is the place to complain about it, isn't it?
And, since no one else is shinning a light on it, I don't know where else should I direct my complains to.
The C++ resorces are way more complex as I have to have a BaseContainer for the internal ListView layout and another BaseContainer for the items to add to the ListView.
Come on, I simply want to add strings to a list. How complex could this be?
Oh, and thank you very much for your help, so far, Robert.
On 22/02/2005 at 11:09, xxxxxxxx wrote:
Rui, thanks for the compliment.
If AddItem() is not working, then I don't know if there is a way to do it programmatically in COFFEE. As you say, the ListView class in C++ has similar methods to ComboBox in COFFEE but utilizing BaseContainers, but there is no ListView class in COFFEE, so there's no way to connect the dialog element to your code. There isn't even a way to add a ListView to a dialog from within COFFEE (except through a dialog resource, obviously).
You could experiment with different SetXXX() methods using the ListView ID and see if something gets through. I checked on BaseContainer, but there are a limited set of classes (none dialog related) which Set/Get them.
My only other suggestion is to try a scrollable group with one column (rows, that is) of text buttons. Then use LayoutFlushGroup() and LayoutChanged() to append/insert/remove list 'items' (i.e.: text buttons). This would be similar to the C++ example that creates a DynamicGroup.
On 22/02/2005 at 11:17, xxxxxxxx wrote:
Maybe thats the way to go, Robert. I will try it tomorrow (its already late here and I must go home). I'll let you know of my (in)success
On 22/02/2005 at 11:46, xxxxxxxx wrote:
listviews are not supported in COFFEE afaik. It´s a customdatatype that cannot be access via COFFEE.
On 22/02/2005 at 13:57, xxxxxxxx wrote:
That's why I suggested a dynamic scrollgroup with buttons. There is no other way to get 'text' in there without borders, but still have clickable 'text'. This is not as pretty, but it beats designing a ListView interface within a GeUserArea!
And, just to let you know, Rui, it does work. The question is how you are adding/removing items from the list. With Buttons there are some things to consider: no multiselect, select equals whatever action is going to be done will be done immediately, removing buttons (items) might require that you initiate a state, then click on buttons to remove them and then change the state. If you can figure out a way to receive messages when a StaticText is click over, you can make it more like a ListView, but it will require more support.
On 22/02/2005 at 14:41, xxxxxxxx wrote:
That means I will have to rethink my whole layout and philosophy
But I guess that is the way it will have to be. Darn! COFFEE is so limited