THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/06/2012 at 13:11, xxxxxxxx wrote:
I just noticed the forum supports YouTube videos. That's cool!
Here's a video showing what I'm doing with the Multi text box gui:fibU-B-yzK4
This is the code I used to make it:
LONG myDialog::Message(const BaseContainer &msg, BaseContainer &result)
String allWords; //This will hold the entire text in the textbox
String lastWord; //This will hold the last word that is typed into a text box
LONG length = text.GetLength();
LONG pos = NULL; //The variable that will hold the postion of the string
Bool lastSpace = text.FindLast(" ",&pos, -1); //Find the last blank space and store it's position in the string
if(pos>0) //If there is at least one empty space found
String lw = text.SubStr(pos+1, length - pos); //Grab the last word (sub string)
lastWord = lw;
if (lastWord == "doc.")
LONG editX, editY, editW, editH; //Create variables to position the popup GUI
if(GetItemDim(1028, &editX, &editY, &editW, &editH)) //Queries a dialog control for its current size and position in pixels
BaseContainer entries; //Create a container to store the popup entries
entries.SetString(FIRST_POPUP_ID+1, "SetActiveDocument(BaseDocument* doc)");
entries.SetString(FIRST_POPUP_ID+2, "LoadDocument(const Filename& name, SCENEFILTER loadflags, BaseThread* thread)");
//Add more entries as needed
LONG mypopup = ShowPopupMenu(NULL, editX, editY+(editH+300), entries); //Creates & positions the popup GUI
popupText += entries.GetString(mypopup); //Increment(step/loop) through each popup entry and get each value
SetString(1001, allWords + popupText); //Adds the user selected popup text into the textbox
I was able to write this in R12.
I'm still a learner, and the code is probably not very good. But there's already just enough text handling code in the SDK's to at least create this kind of thing in a basic form. Even from a relative newbie like me.
But anything the developers can think of to make writing this kind of thing easier and more robust would be very cool.