Example #1
0
bool RocketMenuPlugin::GoBack(Rocket::Core::Context *context, bool notify_delegate) {
    ContextData *cd = GetContextData(context);
    if (cd->current_document != NULL) {
        Rocket::Core::Variant *attr = cd->current_document->GetAttribute("parent");
        if (attr != NULL) {
            Rocket::Core::String menu_id = attr->Get<Rocket::Core::String>();
            if (cd->current_document->HasAttribute("closecmd") && notify_delegate) {
                Rocket::Core::String closecmd;
                cd->current_document->GetAttribute("closecmd")->GetInto(closecmd);
                cd->current_document->RemoveAttribute("closecmd");
                m_delegate->DoCommand(cd->current_document, closecmd);
                cd->current_document->SetAttribute("closecmd", closecmd);
            }
            ShowDocument(context, menu_id, false);
            return true;
        }
    }
    return false;
}
int JVMP_ExecuteShmRequest(JVMP_ShmRequest* req)
{
  int vendor, funcno, id, *pid;
  char sign[40], *buf, *status, *url, *target;
  int  len, argc, *pargc;

  if (!req) return 0;
  vendor = JVMP_GET_VENDOR(req->func_no);
  if (vendor != WFNetscape4VendorID) return 0;
  funcno = JVMP_GET_EXT_FUNCNO(req->func_no);
  switch(funcno)
    {
	case 2:
	  sprintf(sign, "Iia[0]");
	  len = 0; pargc = &argc;
	  JVMP_DecodeRequest(req, 0, sign, &id, &pargc, &buf);
	  pargc = &argc;
	  PutParams(id, &buf, pargc, &len);
	  sprintf(sign, "Iia[%d]", len);
	  JVMP_EncodeRequest(req, sign, id, pargc, buf);
	  free(buf);
	  break;
	case 3:
	  sprintf(sign, "IS");
	  JVMP_DecodeRequest(req, 1, sign, &id, &status);
	  req->retval = ShowStatus(id, status);
	  free(status);
	  break;
	case 4:
	  sprintf(sign, "ISS");
	  JVMP_DecodeRequest(req, 1, sign, &id, &url, &target);
	  req->retval = ShowDocument(id, url, target);
	  free(url); free(target);
	default:
	  return 0;
	}
  return 1;
}
Example #3
0
void RocketMenuPlugin::DoItemAction(ItemAction action, Rocket::Core::Element *e) {
    if (!e->IsClassSet("disabled")) {
        switch (action) {
        case ItemActionEnter: {
            if (e->HasAttribute("submenu")) {
                bool backlink = !e->HasAttribute("noref");
                Rocket::Core::String submenu;
                e->GetAttribute("submenu")->GetInto(submenu);
                ShowDocument(e->GetContext(), submenu, backlink);
            }
            if (e->HasAttribute("command") && m_delegate != NULL) {
                Rocket::Core::String command;
                e->GetAttribute("command")->GetInto(command);
                m_delegate->DoCommand(e, command);
            }
            if (e->HasAttribute("options")) {
                ActivateNextOption(e);
            }
            RequestKeyForKeyChooser(e);
            break;
        }
        case ItemActionLeft:
            if (e->HasAttribute("options")) {
                ActivatePreviousOption(e);
            }
            break;
        case ItemActionRight:
            if (e->HasAttribute("options")) {
                ActivateNextOption(e);
            }
            break;
        case ItemActionClear: {
            ClearMenuItem(e);
            break;
        }
        }
    }
}
Example #4
0
//---------------------------------------------------------------------------------------
void WelcomeWindow::OnNewInLenmus(wxHyperlinkEvent& event)
{
    wxString sDoc = "release_notes.htm";
    ShowDocument(sDoc);
}