void Subscription::HandleCancelWrapper() { LOG_TRACE("Entering function %s", __FUNCTION__); LOG_DEBUG("%s cancelling subscription", GetSubscriber().GetString().c_str()); try { m_activity->RemoveSubscription(shared_from_this()); /* Any specialized implementation for the specific Subscription type */ HandleCancel(); } catch (const std::exception& except) { LOG_ERROR(MSGID_SUBSCRIPTION_CANCEL_FAIL, 1, PMLOGKS("SUBSCRIBER",GetSubscriber().GetString().c_str() ), "Unhandled exception \"%s\" occurred while cancelling subscription", except.what()); } catch (...) { LOG_ERROR(MSGID_SUBSCRIPTION_CANCEL_ERR,1, PMLOGKS("SUBSCRIBER",GetSubscriber().GetString().c_str() ), "Unhandled exception of unknown type occurred cancelling subscription"); } }
static bool HandleCast(CHAR_DATA * ch, int, int, void *, int, EchoAffect *, void * tag) { HandleCancel(ch, tag); return true; }
static bool HandlePositionChange(CHAR_DATA * ch, int newPos, EchoAffect *, void * tag) { HandleCancel(ch, tag); return true; }
static bool HandleMove(CHAR_DATA * ch, ROOM_INDEX_DATA *, EchoAffect *, void * tag) { HandleCancel(ch, tag); return true; }
MsgResult CBaseBrushNameDlg::Message(Msg* pMessage) { // A message from the dialog or its gadgets? if (IS_OUR_DIALOG_MSG(pMessage)) { DialogMsg* pMsg = (DialogMsg*) pMessage; switch (pMsg->DlgMsg) { case DIM_CREATE: InitGadgetText(); break; case DIM_TEXT_CHANGED: // Disable the OK/Apply button if there's no document or entered text. EnableGadget(_R(IDOK), !GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0).IsEmpty() && Document::GetSelected() != 0); break; case DIM_LFT_BN_CLICKED: // enter messages when the edit box has the focus get cast to this if (pMsg->GadgetID == _R(ID_CC_HELP_BUTTON)) break; case DIM_COMMIT: { // Check name for validity. String_256 strEnter = GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0); UINT32 nErrID = IsValid(strEnter); if (nErrID != 0) { // Invalid, reinitialise. InformError(nErrID); if (nErrID == _R(IDS_BRUSHNAME_INVALID)) { String_32 s(strEnter); InitGadgetText(&s, FALSE); } else InitGadgetText(NULL); break; } else { // Entry is valid, try committing it. String_32 FinalString(strEnter); if (DoCommit(strEnter)) { // Don't close, reinitialise (dialog is modeless). InitGadgetText(); pMsg->DlgMsg = DIM_NONE; // stop base class closing it break; } else { // Close(); // End(); - base class will close break; } } } break; case DIM_CANCEL: HandleCancel(); // base class will close break; default: break; } } // Has the document been switched or closed? else if (MESSAGE_IS_A(pMessage, DocChangingMsg)) { DocChangingMsg* pMsg = (DocChangingMsg*) pMessage; if (pMsg->State == DocChangingMsg::SELCHANGED) EnableGadget(_R(IDOK), pMsg->pNewDoc != 0); } // Pass everything on to the base class . . . return DialogOp::Message(pMessage); }