build git 2.17.1
[AROS-Contrib.git] / bgui / gadgets / TreeView / TVInput.c
blobf8697c2c24d4a559351152bc0952c71cc6ab8cef
1 /*
2 * @(#) $Header$
4 * BGUI Tree List View class
6 * (C) Copyright 1999 Manuel Lemos.
7 * (C) Copyright 1996-1999 Nick Christie.
8 * All Rights Reserved.
10 * $Log$
11 * Revision 42.2 2004/06/16 20:16:49 verhaegs
12 * Use METHODPROTO, METHOD_END and REGFUNCPROTOn where needed.
14 * Revision 42.1 2000/05/15 19:29:08 stegerg
15 * replacements for REG macro
17 * Revision 42.0 2000/05/09 22:21:43 mlemos
18 * Bumped to revision 42.0 before handing BGUI to AROS team
20 * Revision 41.11 2000/05/09 20:35:28 mlemos
21 * Bumped to revision 41.11
23 * Revision 1.2 2000/05/09 20:00:27 mlemos
24 * Merged with the branch Manuel_Lemos_fixes.
26 * Revision 1.1.2.2 1999/05/31 01:12:49 mlemos
27 * Made the method functions take the arguments in the apropriate registers.
29 * Revision 1.1.2.1 1999/02/21 04:07:42 mlemos
30 * Nick Christie sources.
36 /************************************************************************
37 *********** TREEVIEW CLASS: GOACTIVE/HANDEINPUT/GOINACTIVE ************
38 ************************************************************************/
40 /************************************************************************
41 ****************************** INCLUDES *******************************
42 ************************************************************************/
44 #include "TreeViewPrivate.h"
45 #include "TVUtil.h"
47 /************************************************************************
48 ************************** LOCAL DEFINITIONS **************************
49 ************************************************************************/
52 /************************************************************************
53 ************************* EXTERNAL REFERENCES *************************
54 ************************************************************************/
57 * Functions from TVUtil are listed in TVUtil.h
60 /************************************************************************
61 ***************************** PROTOTYPES ******************************
62 ************************************************************************/
64 /************************************************************************
65 ***************************** LOCAL DATA ******************************
66 ************************************************************************/
68 /************************************************************************
69 **************************** TV_GOACTIVE() ****************************
70 *************************************************************************
71 * We intercept the goactive msg in order to record the coordinates of
72 * LMB down events and pass them on to the embedded listview.
74 *************************************************************************/
76 METHOD(TV_GoActive, struct gpInput *, gpi)
78 TVData *tv;
79 ULONG rc;
81 tv = (TVData *) INST_DATA(cl,obj);
82 rc = GMR_NOREUSE;
83 tv->tv_GoingActive = TRUE;
84 tv->tv_ImageClicked = NULL;
87 * Refuse to go active if disabled.
90 if (!(((GADPTR) obj)->Flags & GFLG_DISABLED))
92 if (gpi->gpi_IEvent && (gpi->gpi_IEvent->ie_Class == IECLASS_RAWMOUSE) &&
93 (gpi->gpi_IEvent->ie_Code == SELECTDOWN))
95 tv->tv_LastClickX = gpi->gpi_Mouse.X + ((GADPTR) obj)->LeftEdge;
96 tv->tv_LastClickY = gpi->gpi_Mouse.Y + ((GADPTR) obj)->TopEdge;
98 /* debug
99 KPrintF("TV_GoActive: SelectDown: %ld,%ld\n",tv->tv_LastClickX,
100 tv->tv_LastClickY);
104 rc = DoMethodA(tv->tv_Listview,(Msg) gpi);
107 tv->tv_GoingActive = FALSE;
109 return(rc);
111 METHOD_END
113 /************************************************************************
114 ************************** TV_HANDLEINPUT() ***************************
115 *************************************************************************
116 * We intercept this method only to pass it on to the listview.
118 *************************************************************************/
120 METHOD(TV_HandleInput, struct gpInput *, gpi)
122 TVData *tv;
124 tv = (TVData *) INST_DATA(cl,obj);
126 return(DoMethodA(tv->tv_Listview,(Msg) gpi));
128 METHOD_END
130 /************************************************************************
131 *************************** TV_GOINACTIVE() ***************************
132 ************************************************************************/
134 METHOD(TV_GoInactive, struct gpGoInactive *, gpgi)
136 TVData *tv;
138 tv = (TVData *) INST_DATA(cl,obj);
140 return(DoMethodA(tv->tv_Listview,(Msg) gpgi));
142 METHOD_END