Kirix Support Forums
Problem with Paste Function
3 posts
• Page 1 of 1
Problem with Paste Function
Hi. On my right-click context menu in a wxWebControl, it always shows that I can paste even when I can't. Is there a way to fix this?
- miclus
- Registered User
- Posts: 10
- Joined: Sat Jul 18, 2009 8:56 pm
Re: Problem with Paste Function
First, create a context menu with "Paste" in an EVT_WEB_SHOWCONTEXTMENU event handler. Then, enable or disable the "Paste" item in this context menu using standard UI update events:
A full example of what you're trying to do is contained in the sample application, provided in the download. Here's an example for immediate reference:
- Code: Select all
evt.Enable(m_browser->CanPaste());
A full example of what you're trying to do is contained in the sample application, provided in the download. Here's an example for immediate reference:
- Code: Select all
// event table
EVT_WEB_SHOWCONTEXTMENU(wxID_WEB, MyFrame::onShowContextMenu)
EVT_UPDATE_UI(ID_Paste, MyFrame::onUpdateUI)
// context handler
void MyFrame::OnShowContextMenu(wxWebEvent& evt)
{
wxMenu menuPopup;
wxString href = evt.GetHref();
// build context menu ...
}
// update handler
void MyFrame::OnUpdateUI(wxUpdateUIEvent& evt)
{
int id = evt.GetId();
switch (id)
{
case ID_Paste:
evt.Enable(m_browser->CanPaste());
break;
}
}
Aaron Williams
Kirix Support Team
Kirix Support Team
-
Aaron - Kirix Support Team
- Posts: 120
- Joined: Fri Dec 16, 2005 3:01 pm
Re: Problem with Paste Function
Hi. I did that from the example application. But, it says I can paste when I can't. I will just right-click inside a page for example, and it lets me select paste.
- miclus
- Registered User
- Posts: 10
- Joined: Sat Jul 18, 2009 8:56 pm
3 posts
· Page 1 of 1
Return to wxWebConnect Questions, Thoughts & Feedback