ROOT
v6-30
Reference Guide
Loading...
Searching...
No Matches
TGEventHandler.cxx
Go to the documentation of this file.
1
// @(#)root/gui:$Id: TGEventHandler.cxx
2
// Author: Bertrand Bellenot 29/01/2008
3
4
/*************************************************************************
5
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
/** \class TGEventHandler
13
\ingroup guiwidgets
14
*/
15
16
17
#include "
TGEventHandler.h
"
18
#include "
TGWindow.h
"
19
#include "
TVirtualX.h
"
20
21
ClassImp
(
TGEventHandler
);
22
23
////////////////////////////////////////////////////////////////////////////////
24
/// Handle the event. Returns true if the event has been handled,
25
/// false otherwise.
26
27
Bool_t
TGEventHandler::HandleEvent
(
Event_t
*ev)
28
{
29
return
fWindow
->
HandleEvent
(ev);
30
}
31
32
////////////////////////////////////////////////////////////////////////////////
33
/// Send message (i.e. event) to window w. Message is encoded in one long
34
/// as message type and up to two long parameters.
35
36
void
TGEventHandler::SendMessage
(
const
TGWindow
*
w
,
Longptr_t
msg,
Longptr_t
parm1,
37
Longptr_t
parm2)
38
{
39
Event_t
event
;
40
41
if
(
w
) {
42
event
.fType =
kClientMessage
;
43
event
.fFormat = 32;
44
event
.fHandle =
gROOT_MESSAGE
;
45
46
event
.fWindow =
w
->GetId();
47
event
.fUser[0] = msg;
48
event
.fUser[1] = parm1;
49
event
.fUser[2] = parm2;
50
event
.fUser[3] = 0;
51
event
.fUser[4] = 0;
52
53
gVirtualX
->SendEvent(
w
->GetId(), &
event
);
54
}
55
}
kClientMessage
@ kClientMessage
Definition
GuiTypes.h:63
Longptr_t
long Longptr_t
Definition
RtypesCore.h:82
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:377
TGEventHandler.h
w
winID w
Definition
TGWin32VirtualGLProxy.cxx:39
TGWindow.h
TVirtualX.h
gVirtualX
#define gVirtualX
Definition
TVirtualX.h:338
gROOT_MESSAGE
R__EXTERN Atom_t gROOT_MESSAGE
Definition
TVirtualX.h:40
TGEventHandler
Definition
TGEventHandler.h:22
TGEventHandler::HandleEvent
virtual Bool_t HandleEvent(Event_t *ev)
Handle the event.
Definition
TGEventHandler.cxx:27
TGEventHandler::fWindow
TGWindow * fWindow
Definition
TGEventHandler.h:30
TGEventHandler::SendMessage
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition
TGEventHandler.cxx:36
TGWindow
ROOT GUI Window base class.
Definition
TGWindow.h:23
TGWindow::HandleEvent
virtual Bool_t HandleEvent(Event_t *)
Definition
TGWindow.h:103
bool
Event_t
Event structure.
Definition
GuiTypes.h:174
event
Definition
triangle.c:553
gui
gui
src
TGEventHandler.cxx
ROOT v6-30 - Reference Guide Generated on Sun Dec 1 2024 05:17:39 (GVA Time) using Doxygen 1.9.8