GuiMLText control modification
by Alex Huck · in Torque Game Engine · 10/27/2006 (10:54 am) · 0 replies
Hi all, I'm trying to update my guiMLText's tag, what I'm trying to do is allow me to allow me to use a different format other than (the" www" and "com" format) to allow anything I type in there to be taken to my default browser, and entered into to address bar there.
For example with the current you can't have something like I assume it doesn't work because it parses the ":" in "Mailto:" thinking it is a different parameter, and since has only has one parameter (URL) it returns just the literal text ""...
Here's what I have done so far:
I also made all :'s into |'s for consistency
After compiling with that code change, the change worked, the tag used | instead of :, but it still wouldn't accept mailto: commands. How do I parse it to open anything (Whether it has www. or .com in it or not) in my browser?
Follow up question... where in that code does it tell Windows to start up my default browser with the url in the tag as the start-up address?
Furthermore, can someone explain how I should have approached these questions my self so I can try to figure out these questions on my own without resorting to asking trivial questions on the forum. I'm trying to develop the "Programming big projects / Torque mindset", the "What file should I go to to find the code I'm looking for" mindset :)
Many thanks,
--Alex Huck
For example with the current you can't have something like
Here's what I have done so far:
if(!dStrnicmp(str +1, "a|", 2)) // Note: Modified a: to become a| So I can use :'s elsewhere in the url
{
idx = 3;
if(!scanforchar(str, idx, '>'))
goto textemit;
mCurURL = (URL *) mViewChunker.alloc(sizeof(URL));
mCurURL->mouseDown = false;
mCurURL->textStart = mScanPos + 3;
mCurURL->len = idx - 3;
mCurURL->noUnderline = false;
//if the URL is a "gamelink", don't underline...
if (!dStrnicmp(str + 3, "gamelink", 8))
mCurURL->noUnderline = true;
mScanPos += idx + 1;
continue;
}I also made all :'s into |'s for consistency
After compiling with that code change, the change worked, the tag used | instead of :, but it still wouldn't accept mailto: commands. How do I parse it to open anything (Whether it has www. or .com in it or not) in my browser?
Follow up question... where in that code does it tell Windows to start up my default browser with the url in the tag as the start-up address?
Furthermore, can someone explain how I should have approached these questions my self so I can try to figure out these questions on my own without resorting to asking trivial questions on the forum. I'm trying to develop the "Programming big projects / Torque mindset", the "What file should I go to to find the code I'm looking for" mindset :)
Many thanks,
--Alex Huck
About the author