+ wxString href(link);
+
+ // TODO: This needs to be made platform inde if possible.
+ if (link.GetChar(0) == '?'){
+ wxString cmd = link.BeforeFirst('=');
+ wxString cmdValue = link.AfterFirst('=');
+
+ if(!(cmd.CmpNoCase("?EXTERNAL"))){
+#ifdef __WINDOWS__
+ ShellExecute(this ? (HWND)this->GetHWND() : NULL,NULL,cmdValue.c_str(),NULL,"",SW_SHOWNORMAL);
+#else
+ #error Platform not implemented yet!
+#endif
+ return true;
+ }
+ if (!(cmd.CmpNoCase("?EXECUTE"))){
+ wxMessageBox(cmdValue);
+ return true;
+ }
+ if (!(cmd.CmpNoCase("?VIRTUAL"))){
+ VirtualData& temp = *((VirtualData*)FindCookie(cmdValue));
+ if (&temp) {
+ href = temp.GetHref();
+ }
+ else {
+#ifdef CHECKED
+ wxMessageBox("VIRTUAL LINK ERROR: " + cmdValue + " does not exist.");
+#endif
+ return true;
+ }
+ }
+ }
+
+ // Grab the directory from the string for use in the include preprocessor
+ // make sure we get either type of / or \.
+ int ch = link.Find('\\', true);
+ if (ch == -1) ch = link.Find('/', true);
+ if (ch != -1) {
+ wxFileSystem fs;
+ wxString tmp = link.Mid(0, ch+1);
+ fs.ChangePathTo(incPreprocessor->GetDirectory(), true);
+ fs.ChangePathTo(tmp, true);
+ incPreprocessor->ChangeDirectory(fs.GetPath());
+ }
+
+ // Inform all the applets that the new page is being loaded