Hi Carsten,
I added some methods and now I can use this code:
PopupMenu* pPopup=
mpPostIt->DocView()->GetViewFrame()->GetDispatcher()->Popup(0,
this,&rCEvt.GetMousePosPixel());
pPopup->SetItemText(FN_DELETE_NOTE_AUTHOR, rtl::OUString::createFromAscii("
wie gehts"));
pPopup->Execute(this,aPos);
But before the execute, the old string is set again, I guess from
SfxBindings::Update and some cache. Any way to prevent that? Something I
have to call?
Shouldn't this not be executed, if I use SetItemText explicitly?
Best regards
Max
Maximilian Odendahl schrieb:
Hi,
calling my PopupMenu works fine with the call
GetViewFrame()->GetDispatcher()->ExecutePopup,
but now I would like to change one item string before showing the menu
dynamically. As far as I can see in the code, it is not possible to get a
pointer to this to be shown popup, change an item string, and then show
it myself, so sth. like
PopupMenu* pMenu = GetViewFrame()->GetDispatcher()->Popup();
pMenu->SetItemText(FN_HI,"what's up");
pMenu->Executge(pWin,Pos);
If my observation is true, could sth. like that be added to the
framework? Any other way to do this?
Hi Maximilian,
Of course you can adapt the code to fulfill your requirements. I am not
aware of any other way, excluding the context menu interceptor. So feel
free to make your proposed changes and send a patch to me for review.
Regards,
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]