THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/09/2004 at 22:23, xxxxxxxx wrote:
Cinema 4D Version: 8.503
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
So, I can drag and drop objects onto the EditText in a dialog, but how do you get the text if the user types it in? Using Command(id,msg) and the EditText IDs does NOT work. Not only is there no activation, but no text entry at all.
I'm getting some results with Message(msg) using msg->GetId() == BFM_ACTION, but it is called for each keystroke. How do I know when the text entry is finished?
On 14/09/2004 at 04:27, xxxxxxxx wrote:
Are you sure the command doesn´t work? It worked fine for me afai can remember.
On 14/09/2004 at 07:42, xxxxxxxx wrote:
Here's the code - you'll probably recognize most of it :). ID_DROPIT is a button, the other two are EditTexts. Like this, no text entry is possible, only drag-n-drop.
if (msg->GetId() == BFM_DRAGRECEIVE)
if(CheckDropArea(ID_DRAGOBJECT, msg, TRUE, TRUE))
object = GetDragObject(msg);
else if(CheckDropArea(ID_DRAGTARGET, msg, TRUE, TRUE))
target = GetDragObject(msg);
if (id == ID_DROPIT)
if (!object) return;
if (target) DropToTarget();
object = NULL;
target = NULL;
else if (id == ID_DRAGOBJECT)
if (!(object = GetActiveDocument()->FindObject(GetString(ID_DRAGOBJECT))))
else if (id == ID_DRAGTARGET)
if (!(target = GetActiveDocument()->FindObject(GetString(ID_DRAGTARGET))))
On 14/09/2004 at 07:58, xxxxxxxx wrote:
This seems to be the problem. This will only return TRUE or FALSE and not the string. You need to pass a variable to store the resulting string.
So Sth like this:
if (!(object = GetActiveDocument()->FindObject(name)))
It´s a bit "unhandy" that it works that way but that´s how it is unfortunately. I´d rather like to see the String be returned and optionally pass a boolean variable, but I cannot change this.
On 14/09/2004 at 08:46, xxxxxxxx wrote:
This is COFFEE.
That's not what I see in the docs and examples:
[string] GetString([int] id);
is what is given for GeBaseDialog::GetString().
If I use GetString(ID, name), C4D responds with "Too many parameters" every time that I type.
Now, maybe I'm not getting something here. I know that one usually retrieves information such as text in an editbox after the dialog is closed by the user. But this is an asynchronous dialog, so I need to get the string when the user hits Enter, Tab, or changes focus. Obviously, this is not how Command() works in this situation. I haven't found any code that would outline how this is done. Maybe I should just check the EditText strings when the operation is called?
On 14/09/2004 at 10:03, xxxxxxxx wrote:
Upps, sorry my fault. I thought it was C++. Hmm, well it should work then just like this. Are you sure that the field has a value? I just tried it with a simple dialog and GetString(id) works fine for me.
On 14/09/2004 at 12:32, xxxxxxxx wrote:
I just get the strings when ID_DROPIT is called and it appears to work both ways (dnd and kb entry).