ROOT
v6-24
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
//////////////////////////////////////////////////////////////////////////
13
// //
14
// TGEventHandler //
15
// //
16
//////////////////////////////////////////////////////////////////////////
17
18
#include "
TGEventHandler.h
"
19
#include "
TGWindow.h
"
20
#include "
TVirtualX.h
"
21
22
ClassImp
(
TGEventHandler
);
23
24
////////////////////////////////////////////////////////////////////////////////
25
/// Handle the event. Returns true if the event has been handled,
26
/// false otherwise.
27
28
Bool_t
TGEventHandler::HandleEvent
(
Event_t
*ev)
29
{
30
return
fWindow
->
HandleEvent
(ev);
31
}
32
33
////////////////////////////////////////////////////////////////////////////////
34
/// Send message (i.e. event) to window w. Message is encoded in one long
35
/// as message type and up to two long parameters.
36
37
void
TGEventHandler::SendMessage
(
const
TGWindow
*w,
Long_t
msg,
Long_t
parm1,
38
Long_t
parm2)
39
{
40
Event_t
event;
41
42
if
(w) {
43
event
.
fType
=
kClientMessage
;
44
event
.fFormat = 32;
45
event
.fHandle =
gROOT_MESSAGE
;
46
47
event
.fWindow = w->
GetId
();
48
event
.fUser[0] = msg;
49
event
.fUser[1] = parm1;
50
event
.fUser[2] = parm2;
51
event
.fUser[3] = 0;
52
event
.fUser[4] = 0;
53
54
gVirtualX
->SendEvent(w->
GetId
(), &event);
55
}
56
}
kClientMessage
@ kClientMessage
Definition
GuiTypes.h:63
Long_t
long Long_t
Definition
RtypesCore.h:54
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:364
TGEventHandler.h
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:27
TGEventHandler::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition
TGEventHandler.cxx:37
TGEventHandler::HandleEvent
virtual Bool_t HandleEvent(Event_t *ev)
Handle the event.
Definition
TGEventHandler.cxx:28
TGEventHandler::fWindow
TGWindow * fWindow
Definition
TGEventHandler.h:35
TGObject::GetId
Handle_t GetId() const
Definition
TGObject.h:47
TGWindow
Definition
TGWindow.h:31
TGWindow::HandleEvent
virtual Bool_t HandleEvent(Event_t *)
Definition
TGWindow.h:104
bool
Event_t
Event structure.
Definition
GuiTypes.h:174
Event_t::fType
EGEventType fType
of event (see EGEventType)
Definition
GuiTypes.h:175
gui
gui
src
TGEventHandler.cxx
ROOT v6-24 - Reference Guide Generated on Tue Aug 22 2023 03:06:28 (GVA Time) using Doxygen 1.9.8