Detecting mouse events in the SQL grid

From: Kari Karkkainen <kari_karkkainen(at)yahoo(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Detecting mouse events in the SQL grid
Date: 2013-02-17 20:21:03
Message-ID: 1361132463.34806.YahooMailNeo@web122105.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi,

I'm trying to add some additional mouse event detection into the SQL grid, but I'm not succeeding. Besides pgAdmin, also wxWidgets is new to me, so I'm probably missing something obvious...

The grid was already detecting EVT_MOUSEWHEEL, so I tried to use that as my guideline:

In ctlSQLGrid.h for the ctlSQLGrid class I added two private functions on the bottom:
private:
void OnCopy(wxCommandEvent &event);
void OnMouseWheel(wxMouseEvent &event);
void OnMouseLeftDown(wxMouseEvent &event);
void OnMouseLeftUp(wxMouseEvent &event);

In ctlSQLGrid.cpp I added two events:
BEGIN_EVENT_TABLE(ctlSQLGrid, wxGrid)
EVT_MENU(MNU_COPY, ctlSQLGrid::OnCopy)
EVT_MOUSEWHEEL(ctlSQLGrid::OnMouseWheel)
EVT_LEFT_DOWN(ctlSQLGrid::OnMouseLeftDown)
EVT_LEFT_UP(ctlSQLGrid::OnMouseLeftUp)
END_EVENT_TABLE()

An then in ctlSQLGrid.cpp I defined the functions e.g. like this:
void ctlSQLGrid::OnMouseLeftUp(wxMouseEvent &event)
{
SetTotals();
}

However, I never hit these functions by clicking the mouse, and I don't understand why. Would really appreciate any advice.

Thanks,
KariK

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2013-02-18 15:39:36 Re: Patch: Auto-generate search_path statement for selected schema in query editor
Previous Message Florian Klaar 2013-02-11 20:22:27 Re: Patch: Auto-generate search_path statement for selected schema in query editor