/
wdclick.c
74 lines (69 loc) · 1.98 KB
/
wdclick.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* CFLIB, a GEM library for ATARI/TOS
* Copyright (C) 1999, 2000 Christian Felsch
*
* Modified for FreeMiNT CVS by Frank Naumann <fnaumann@freemint.de>
*
* Please send suggestions, patches or bug reports to me or
* the MiNT mailing list.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "wdial.h"
_WORD click_wdial(_WORD clicks, _WORD x, _WORD y, _WORD kshift, _WORD mbutton)
{
_WORD wh;
_WORD ret = TRUE, cont;
_WORD obj;
WDIALOG *wd;
(void)kshift;
wh = wind_find(x, y);
wd = get_wdial(wh);
if (wd != NULL && wd->mode == WD_OPEN)
{
if (mbutton == 1)
{
obj = cf_objc_find(wd->tree, ROOT, MAX_DEPTH, x, y);
if (obj > -1)
{
cont = form_button(wd->tree, obj, clicks, &wd->next_obj);
if (cont && (get_flag(wd->tree, wd->next_obj, OF_EDITABLE)))
{
objc_edit(wd->tree, wd->edit_obj, 0, &wd->edit_idx, ED_END);
wd->edit_obj = wd->next_obj;
if (gl_magx)
objc_edit(wd->tree, wd->edit_obj, x, &wd->edit_idx, ED_CRSR);
else
objc_edit(wd->tree, wd->edit_obj, 0, &wd->edit_idx, ED_INIT);
}
else if (!cont)
{
if (clicks == 2)
wd->next_obj |= 0x8000;
wdial_call_cb(wd);
}
}
else
Bconout(2, 7);
}
else if (mbutton == 2) /* Rechtsklick ignorieren */
ret = TRUE;
}
else
ret = FALSE;
return ret;
}