[GB.DBUS.TRAYICON]
* NEW: Add TrayIcon MiddleClick event. [GB.QT4] * NEW: Add TrayIcon MiddleClick event. [GB.QT5] * NEW: Add TrayIcon MiddleClick event. [GB.GTK] * NEW: Add TrayIcon MiddleClick event. [GB.GTK3] * NEW: Add TrayIcon MiddleClick event. git-svn-id: svn://localhost/gambas/trunk@7169 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
27cf0ca10a
commit
eb2b172425
7 changed files with 31 additions and 7 deletions
|
@ -213,13 +213,13 @@ End
|
|||
|
||||
Public Sub org_kde_StatusNotifierItem_SecondaryActivate((X) As Integer, (Y) As Integer)
|
||||
|
||||
Debug
|
||||
GetParent()._MiddleClick()
|
||||
|
||||
End
|
||||
|
||||
Public Sub org_kde_StatusNotifierItem_XAyatanaSecondaryActivate((Foo) As Integer)
|
||||
|
||||
Debug
|
||||
GetParent()._MiddleClick()
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -48,3 +48,9 @@ Public Sub Menu5_Click()
|
|||
Debug
|
||||
|
||||
End
|
||||
|
||||
Public Sub TrayIcon1_MiddleClick()
|
||||
|
||||
Debug
|
||||
|
||||
End
|
||||
|
|
|
@ -11,6 +11,7 @@ Public Const _DefaultEvent As String = "Click"
|
|||
Public Enum Horizontal, Vertical
|
||||
|
||||
Event Click
|
||||
Event MiddleClick
|
||||
Event Scroll(Delta As Float, Orientation As Integer)
|
||||
|
||||
Property Name As String
|
||||
|
@ -288,3 +289,9 @@ Public Sub _AboutToShow(hMenu As Menu) As Boolean
|
|||
Return True
|
||||
|
||||
End
|
||||
|
||||
Public Sub _MiddleClick()
|
||||
|
||||
Raise MiddleClick
|
||||
|
||||
End
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "gmouse.h"
|
||||
|
||||
DECLARE_EVENT(EVENT_Click);
|
||||
DECLARE_EVENT(EVENT_MiddleClick);
|
||||
DECLARE_EVENT(EVENT_Scroll);
|
||||
|
||||
static void cb_destroy(gTrayIcon *sender)
|
||||
|
@ -43,9 +44,12 @@ static void cb_destroy(gTrayIcon *sender)
|
|||
GB.Unref(POINTER(&_object));
|
||||
}
|
||||
|
||||
static void cb_click(gTrayIcon *sender)
|
||||
static void cb_click(gTrayIcon *sender, int button)
|
||||
{
|
||||
GB.Raise(sender->hFree, EVENT_Click, 0);
|
||||
if (button == 1)
|
||||
GB.Raise(sender->hFree, EVENT_Click, 0);
|
||||
else if (button == 2)
|
||||
GB.Raise(sender->hFree, EVENT_MiddleClick, 0);
|
||||
}
|
||||
|
||||
static void cb_menu(gTrayIcon *sender)
|
||||
|
@ -321,6 +325,7 @@ GB_DESC TrayIconDesc[] =
|
|||
GB_PROPERTY("Tag", "v", TrayIcon_Tag),
|
||||
|
||||
GB_EVENT("Click", NULL, NULL, &EVENT_Click),
|
||||
GB_EVENT("MiddleClick", NULL, NULL, &EVENT_MiddleClick),
|
||||
GB_EVENT("Scroll", NULL, "(Delta)f(Orientation)i", &EVENT_Scroll),
|
||||
|
||||
GB_METHOD("_unknown", "v", TrayIcon_unknown, "."),
|
||||
|
|
|
@ -62,8 +62,8 @@ static gboolean cb_button_press(GtkStatusIcon *plug, GdkEventButton *event, gTra
|
|||
{
|
||||
gMouse::validate();
|
||||
gMouse::setMouse((int)event->x, (int)event->y, (int)event->x_root, (int)event->y_root, event->button, event->state);
|
||||
if (event->type == GDK_BUTTON_PRESS && event->button == 1)
|
||||
data->onClick(data);
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
data->onClick(data, event->button);
|
||||
/*else if (event->type == GDK_2BUTTON_PRESS)
|
||||
data->onDoubleClick(data);*/
|
||||
gMouse::invalidate();
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
int loopLevel() { return _loopLevel; }
|
||||
|
||||
//"Events"
|
||||
void (*onClick)(gTrayIcon *sender);
|
||||
void (*onClick)(gTrayIcon *sender, int button);
|
||||
void (*onScroll)(gTrayIcon *sender);
|
||||
void (*onMenu)(gTrayIcon *sender);
|
||||
void (*onDestroy)(gTrayIcon *sender);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "ctrayicon.h"
|
||||
|
||||
DECLARE_EVENT(EVENT_Click);
|
||||
DECLARE_EVENT(EVENT_MiddleClick);
|
||||
DECLARE_EVENT(EVENT_Scroll);
|
||||
|
||||
static QList<CTRAYICON *> _list;
|
||||
|
@ -372,6 +373,10 @@ void TrayIconManager::activated(QSystemTrayIcon::ActivationReason reason)
|
|||
GB.Raise(THIS, EVENT_Click, 0);
|
||||
break;
|
||||
|
||||
case QSystemTrayIcon::MiddleClick:
|
||||
GB.Raise(THIS, EVENT_MiddleClick, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -439,6 +444,7 @@ GB_DESC TrayIconDesc[] =
|
|||
GB_PROPERTY("Tag", "v", TrayIcon_Tag),
|
||||
|
||||
GB_EVENT("Click", NULL, NULL, &EVENT_Click),
|
||||
GB_EVENT("MiddleClick", NULL, NULL, &EVENT_MiddleClick),
|
||||
GB_EVENT("Scroll", NULL, "(Delta)f(Orientation)i", &EVENT_Scroll),
|
||||
|
||||
GB_METHOD("_unknown", "v", TrayIcon_unknown, "."),
|
||||
|
|
Loading…
Reference in a new issue