Project

General

Profile

Actions

Support #2670

closed

Disable Browser's context menu in a WTableView

Added by Anonymous about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
Start date:
02/12/2014
Due date:
% Done:

0%

Estimated time:

Description

I'd like to show a custom context menu in a WTableView instead of the browser's menu.

I successfully added a WPopupMenu to the table

m_TableView->mouseWentDown().connect(this, &MyWebApp::HandleTableMouseEvent);

and

void MyWebApp::HandleTableMouseEvent( Wt::WModelIndex index, Wt::WMouseEvent event )
{
    if(event.button() == Wt::WMouseEvent::RightButton)
    {
        auto coord = event.document();
        auto pm= new Wt::WpopupMenu();
        pm->popup(Wt::WPoint(coord.x,coord.y));         
    }
}

However, the browser's context menu appears as well when I right click, which is undesired.

I tried the method described in here without success, although it seems to work with other widgets such as the WTreeTableView.

Any idea how I could fix this?


Files

WTableView_DisableContextMenu.cpp (1.86 KB) WTableView_DisableContextMenu.cpp Roel Standaert, 03/11/2014 06:19 PM
Actions #1

Updated by Anonymous about 10 years ago

Not even a RTFM? :(

Actions #2

Updated by Koen Deforche about 10 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
  • Target version set to 3.3.2

Hey Mike,

We are a little caught up with getting a release out... sorry for the long delay.

And no, this is not a case of RTFM :-)

Regards,

koen

Actions #3

Updated by Roel Standaert about 10 years ago

Hey,

I tested it with the supplied file, and it seems to work fine in all the browsers that I tested. I tested it with Wt 3.3.2 RC2.

Do you have this problem with the example code I supplied? What browser are you using? Is there anything that you do differently?

Regards,

Roel

Actions #4

Updated by Koen Deforche about 10 years ago

  • Target version deleted (3.3.2)
Actions #5

Updated by Anonymous about 10 years ago

Hey,

I tested the source file you provided with Wt 3.3.1 and the browser context menu showed up as well. (Like the example in my first post)

However, when I run it with Wt 3.3.2 only the custom popup menu shows up. I guess I'll just switch to 3.3.2 .

Thanks for your response!

Cheers,

Mike

Actions #6

Updated by Koen Deforche about 10 years ago

  • Status changed from Feedback to Resolved
  • Target version set to 3.3.2
Actions #7

Updated by Koen Deforche almost 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF