File: kxlgetbutton.html

package info (click to toggle)
kxl 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 596 kB
  • sloc: sh: 2,114; ansic: 1,287; makefile: 15
file content (82 lines) | stat: -rw-r--r-- 1,904 bytes parent folder | download | duplicates (8)
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
75
76
77
78
79
80
81
82
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
   <meta name="GENERATOR" content="emacs">
   <meta name="Author" content="kacchan">
   <title>KXL_GetButton</title>
</head>
<body text="#000000" bgcolor="#f0f0dc" link="#3366FF" vlink="#3366FF" alink="#FF0000">

<a href="./kxlgetkey.html">Prev</a>
<a href="./KXL.html">Top</a>
<a href="./kxlinitsound.html">Next</a>
<hr>

<b>Name</b><br><br>
<font size=+2>KXL_GetButton</font><br><br>

<b>Synopsis</b><br>
<pre>KXL_Button -- Get of the position and button number of a mouse cursor is carried out.
</pre><br>

<b>Description</b><br>
<pre>Uint16 KXL_GetButton(Uint16 *left, Uint16 *top);</pre><br>

<b>Arguments</b><br><br>
<table border="1">
<tr><td>left</td><td>Left position of a mouse cursor.</td></tr>
<tr><td>top</td><td>Top position of a mouse cursor.</td></tr>
</table>
<br><br>

<b>Return Value</b><br>
<pre>
Button number.
</pre>
<br>

<b>Exsample</b><br>
<pre>
#include &lt;KXL.h&gt;

int main(void)
{
  Bool flag = False;
  <b>Uint16 left = 0;
  Uint16 top = 0;
  Uint16 no = 0;</b>
  Uint8 buff[64];

  KXL_CreateWindow(100, 100, "kxl.org",
		   KXL_EVENT_EXPOSURE_MASK |
                   KXL_EVENT_BUTTON_PRESS_MASK |
		   KXL_EVENT_KEY_PRESS_MASK);
  
  while (flag == False) {
    while (KXL_CheckEvents() == False);  
    switch (KXL_GetEvents()) {
    case KXL_EVENT_BUTTON_PRESS:
      <b>no = KXL_GetButton(&left, &top);</b>
      break;
    case KXL_EVENT_KEY_PRESS:
      flag = True;
      break;
    }
    KXL_ClearFrameImm(0, 0, 100, 100);
    sprintf(buff, "x:%4d", left);
    KXL_PutText(8, 20, buff);
    sprintf(buff, "y:%4d", top);
    KXL_PutText(8, 40, buff);
    sprintf(buff, "b:%4d", no);
    KXL_PutText(8, 60, buff);
    KXL_UpDateImm(0, 0, 100, 100);
  }
  KXL_DeleteWindow();
  return 0;
}
</pre>


</body>
</html>