dlangui/events.html

486 lines
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>DlangUI - cross platform GUI library for D programming language - dlangui.core.events</title>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>DlangUI</h1>
<h2>Cross Platform GUI for D programming language</h2>
</header>
<section id="downloads" class="clearfix">
<a href="index.html" id="home" class="button"><span>Home</span></a>
<a href="api.html" id="home" class="button"><span>API Docs</span></a>
<a href="screenshots.html" id="home" class="button"><span>Screenshots</span></a>
<a href="https://github.com/buggins/dlangui/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
<!--a href="https://github.com/buggins/dlangui/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a-->
<a href="https://github.com/buggins/dlangui" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
<hr>
<section id="main_content">
<h1>dlangui.core.events</h1>
<!-- Generated by Ddoc from src\dlangui\core\events.d -->
This module contains dlangui event types declarations.
<br><br>
<b>Synopsis:</b><br>
<pre class="d_code"><font color=blue>import</font> dlangui.core.<u>events</u>;
</pre>
<br><br>
<b>License:</b><br>
Boost License 1.0
<br><br>
<b>Authors:</b><br>
Vadim Lopatin, coolreader.org@gmail.com<br><br>
<dl><dt><big><a name="Accelerator"></a>struct <u>Accelerator</u>;
</big></dt>
<dd>keyboard accelerator (key + modifiers)<br><br>
<dl><dt><big><a name="Accelerator.label"></a>@property dstring <u>label</u>();
</big></dt>
<dd>returns accelerator text description<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="Action"></a>class <u>Action</u>;
</big></dt>
<dd>UI action<br><br>
<dl><dt><big><a name="Action.stringParam"></a>@property string <u>stringParam</u>();
</big></dt>
<dd>additional string parameter<br><br>
</dd>
<dt><big><a name="Action.longParam"></a>@property long <u>longParam</u>();
</big></dt>
<dd>additional long parameter<br><br>
</dd>
<dt><big><a name="Action.objectParam"></a>@property Object <u>objectParam</u>();
</big></dt>
<dd>additional custom (Object) parameter<br><br>
</dd>
<dt><big><a name="Action.this"></a>this(Action <i>a</i>);
</big></dt>
<dd>deep copy constructor<br><br>
</dd>
<dt><big><a name="Action.clone"></a>@property Action <u>clone</u>();
</big></dt>
<dd>deep copy<br><br>
</dd>
<dt><big><a name="Action.this"></a>this(int <i>id</i>);
</big></dt>
<dd>create action only with ID<br><br>
</dd>
<dt><big><a name="Action.this"></a>this(int <i>id</i>, uint <i>keyCode</i>, uint <i>keyFlags</i> = 0);
</big></dt>
<dd>action with accelerator, w/o label<br><br>
</dd>
<dt><big><a name="Action.this"></a>this(int <i>id</i>, dstring <i>label</i>, string <i>iconResourceId</i> = null, uint <i>keyCode</i> = 0, uint <i>keyFlags</i> = 0);
</big></dt>
<dd>action with <i>label</i>, icon, and accelerator<br><br>
</dd>
<dt><big><a name="Action.accelerators"></a>@property Accelerator[] <u>accelerators</u>();
</big></dt>
<dd>returs array of <u>accelerators</u><br><br>
</dd>
<dt><big><a name="Action.acceleratorText"></a>@property dstring <u>acceleratorText</u>();
</big></dt>
<dd>returns text description for first accelerator of action; <b>null</b> if no accelerators<br><br>
</dd>
<dt><big><a name="Action.checkAccelerator"></a>bool <u>checkAccelerator</u>(uint <i>keyCode</i>, uint <i>keyFlags</i>);
</big></dt>
<dd>returns <b>true</b> if accelerator matches provided key code and flags<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="MouseAction"></a>enum <u>MouseAction</u>: ubyte;
</big></dt>
<dd>mouse action<br><br>
<dl><dt><big><a name="MouseAction.Cancel"></a><u>Cancel</u></big></dt>
<dd>button down handling is cancelled<br><br>
</dd>
<dt><big><a name="MouseAction.ButtonDown"></a><u>ButtonDown</u></big></dt>
<dd>button is down<br><br>
</dd>
<dt><big><a name="MouseAction.ButtonUp"></a><u>ButtonUp</u></big></dt>
<dd>button is up<br><br>
</dd>
<dt><big><a name="MouseAction.Move"></a><u>Move</u></big></dt>
<dd>mouse pointer is moving<br><br>
</dd>
<dt><big><a name="MouseAction.FocusIn"></a><u>FocusIn</u></big></dt>
<dd>pointer is back inside widget while button is down after FocusOut<br><br>
</dd>
<dt><big><a name="MouseAction.FocusOut"></a><u>FocusOut</u></big></dt>
<dd>pointer moved outside of widget while button was down (if handler returns <b>true</b>, Move events will be sent even while pointer is outside widget)<br><br>
</dd>
<dt><big><a name="MouseAction.Wheel"></a><u>Wheel</u></big></dt>
<dd>scroll wheel movement<br><br>
</dd>
<dt><big><a name="MouseAction.Leave"></a><u>Leave</u></big></dt>
<dd>pointer left widget which has before processed Move message, while button was not down<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="MouseFlag"></a>enum <u>MouseFlag</u>: ushort;
</big></dt>
<dd>mouse flag bits<br><br>
<dl><dt><big><a name="MouseFlag.LButton"></a><u>LButton</u></big></dt>
<dd>Left mouse button is down<br><br>
</dd>
<dt><big><a name="MouseFlag.MButton"></a><u>MButton</u></big></dt>
<dd>Middle mouse button is down<br><br>
</dd>
<dt><big><a name="MouseFlag.RButton"></a><u>RButton</u></big></dt>
<dd>Right mouse button is down<br><br>
</dd>
<dt><big><a name="MouseFlag.XButton1"></a><u>XButton1</u></big></dt>
<dd>X1 mouse button is down<br><br>
</dd>
<dt><big><a name="MouseFlag.XButton2"></a><u>XButton2</u></big></dt>
<dd>X2 mouse button is down<br><br>
</dd>
<dt><big><a name="MouseFlag.Control"></a><u>Control</u></big></dt>
<dd>Ctrl key is down<br><br>
</dd>
<dt><big><a name="MouseFlag.Shift"></a><u>Shift</u></big></dt>
<dd><u>Shift</u> key is down<br><br>
</dd>
<dt><big><a name="MouseFlag.Alt"></a><u>Alt</u></big></dt>
<dd><u>Alt</u> key is down<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="MouseButton"></a>enum <u>MouseButton</u>: ubyte;
</big></dt>
<dd>mouse button<br><br>
<dl><dt><big><a name="MouseButton.None"></a><u>None</u></big></dt>
<dd>no button<br><br>
</dd>
<dt><big><a name="MouseButton.Left"></a><u>Left</u></big></dt>
<dd>left mouse button<br><br>
</dd>
<dt><big><a name="MouseButton.Right"></a><u>Right</u></big></dt>
<dd>right mouse button<br><br>
</dd>
<dt><big><a name="MouseButton.Middle"></a><u>Middle</u></big></dt>
<dd>right mouse button<br><br>
</dd>
<dt><big><a name="MouseButton.XButton1"></a><u>XButton1</u></big></dt>
<dd>additional mouse button 1<br><br>
</dd>
<dt><big><a name="MouseButton.XButton2"></a><u>XButton2</u></big></dt>
<dd>additional mouse button 2<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="ButtonDetails"></a>struct <u>ButtonDetails</u>;
</big></dt>
<dd>mouse button state details<br><br>
<dl><dt><big><a name="ButtonDetails._downTs"></a>long <u>_downTs</u>;
</big></dt>
<dd>Clock.currStdTime() for down event of this button (0 if button is up).<br><br>
</dd>
<dt><big><a name="ButtonDetails._upTs"></a>long <u>_upTs</u>;
</big></dt>
<dd>Clock.currStdTime() for up event of this button (0 if button is still down).<br><br>
</dd>
<dt><big><a name="ButtonDetails._downX"></a>short <u>_downX</u>;
</big></dt>
<dd>x coordinates of down event<br><br>
</dd>
<dt><big><a name="ButtonDetails._downY"></a>short <u>_downY</u>;
</big></dt>
<dd>y coordinates of down event<br><br>
</dd>
<dt><big><a name="ButtonDetails._downFlags"></a>ushort <u>_downFlags</u>;
</big></dt>
<dd>mouse button flags when down event occured<br><br>
</dd>
<dt><big><a name="ButtonDetails.down"></a>void <u>down</u>(short <i>x</i>, short <i>y</i>, ushort <i>flags</i>);
</big></dt>
<dd>update for button <u>down</u><br><br>
</dd>
<dt><big><a name="ButtonDetails.up"></a>void <u>up</u>(short <i>x</i>, short <i>y</i>, ushort <i>flags</i>);
</big></dt>
<dd>update for button <u>up</u><br><br>
</dd>
<dt><big><a name="ButtonDetails.downDuration"></a>@property int <u>downDuration</u>();
</big></dt>
<dd>returns button down state duration in hnsecs (1/10000 of second).<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="MouseEvent"></a>class <u>MouseEvent</u>;
</big></dt>
<dd>mouse event<br><br>
<dl><dt><big><a name="MouseEvent.button"></a>@property MouseButton <u>button</u>();
</big></dt>
<dd><u>button</u> which caused ButtonUp or ButtonDown action<br><br>
</dd>
<dt><big><a name="MouseEvent.action"></a>@property MouseAction <u>action</u>();
</big></dt>
<dd><u>action</u><br><br>
</dd>
<dt><big><a name="MouseEvent.flags"></a>@property ushort <u>flags</u>();
</big></dt>
<dd><u>flags</u> (buttons and keys state)<br><br>
</dd>
<dt><big><a name="MouseEvent.wheelDelta"></a>@property short <u>wheelDelta</u>();
</big></dt>
<dd>delta for Wheel event<br><br>
</dd>
<dt><big><a name="MouseEvent.x"></a>@property short <u>x</u>();
</big></dt>
<dd><u>x</u> coordinate of mouse pointer (relative to window client area)<br><br>
</dd>
<dt><big><a name="MouseEvent.y"></a>@property short <u>y</u>();
</big></dt>
<dd><u>y</u> coordinate of mouse pointer (relative to window client area)<br><br>
</dd>
<dt><big><a name="MouseEvent.trackingWidget"></a>@property Widget <u>trackingWidget</u>();
</big></dt>
<dd>get event tracking widget to override<br><br>
</dd>
<dt><big><a name="MouseEvent.track"></a>void <u>track</u>(Widget <i>w</i>);
</big></dt>
<dd>override mouse tracking widget<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="KeyAction"></a>enum <u>KeyAction</u>: uint;
</big></dt>
<dd>KeyEvent action<br><br>
<dl><dt><big><a name="KeyAction.KeyDown"></a><u>KeyDown</u></big></dt>
<dd>key is pressed<br><br>
</dd>
<dt><big><a name="KeyAction.KeyUp"></a><u>KeyUp</u></big></dt>
<dd>key is released<br><br>
</dd>
<dt><big><a name="KeyAction.Text"></a><u>Text</u></big></dt>
<dd>text is entered<br><br>
</dd>
<dt><big><a name="KeyAction.Repeat"></a><u>Repeat</u></big></dt>
<dd>repeated key down<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="KeyFlag"></a>enum <u>KeyFlag</u>: uint;
</big></dt>
<dd>KeyEvent flags<br><br>
<dl><dt><big><a name="KeyFlag.Control"></a><u>Control</u></big></dt>
<dd>Ctrl key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.Shift"></a><u>Shift</u></big></dt>
<dd><u>Shift</u> key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.Alt"></a><u>Alt</u></big></dt>
<dd><u>Alt</u> key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.RControl"></a><u>RControl</u></big></dt>
<dd>Right Ctrl key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.RShift"></a><u>RShift</u></big></dt>
<dd>Right Shift key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.RAlt"></a><u>RAlt</u></big></dt>
<dd>Right Alt key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.LControl"></a><u>LControl</u></big></dt>
<dd>Left Ctrl key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.LShift"></a><u>LShift</u></big></dt>
<dd>Left Shift key is down<br><br>
</dd>
<dt><big><a name="KeyFlag.LAlt"></a><u>LAlt</u></big></dt>
<dd>Left Alt key is down<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="KeyCode"></a>enum <u>KeyCode</u>: uint;
</big></dt>
<dd>Key code constants<br><br>
</dd>
<dt><big><a name="KeyEvent"></a>class <u>KeyEvent</u>;
</big></dt>
<dd>keyboard event<br><br>
<dl><dt><big><a name="KeyEvent.action"></a>@property KeyAction <u>action</u>();
</big></dt>
<dd>key <u>action</u> (KeyDown, KeyUp, Text, Repeat)<br><br>
</dd>
<dt><big><a name="KeyEvent.keyCode"></a>@property uint <u>keyCode</u>();
</big></dt>
<dd>key code<br><br>
</dd>
<dt><big><a name="KeyEvent.flags"></a>@property uint <u>flags</u>();
</big></dt>
<dd><u>flags</u> (shift, ctrl, alt...)<br><br>
</dd>
<dt><big><a name="KeyEvent.text"></a>@property dstring <u>text</u>();
</big></dt>
<dd>entered <u>text</u>, for Text action<br><br>
</dd>
<dt><big><a name="KeyEvent.this"></a>this(KeyAction <i>action</i>, uint <i>keyCode</i>, uint <i>flags</i>, dstring <i>text</i> = null);
</big></dt>
<dd>create key event<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="ScrollAction"></a>enum <u>ScrollAction</u>: ubyte;
</big></dt>
<dd>scroll bar / slider action<br><br>
<dl><dt><big><a name="ScrollAction.PageUp"></a><u>PageUp</u></big></dt>
<dd>space above indicator pressed<br><br>
</dd>
<dt><big><a name="ScrollAction.PageDown"></a><u>PageDown</u></big></dt>
<dd>space below indicator pressed<br><br>
</dd>
<dt><big><a name="ScrollAction.LineUp"></a><u>LineUp</u></big></dt>
<dd>up/left button pressed<br><br>
</dd>
<dt><big><a name="ScrollAction.LineDown"></a><u>LineDown</u></big></dt>
<dd>down/right button pressed<br><br>
</dd>
<dt><big><a name="ScrollAction.SliderPressed"></a><u>SliderPressed</u></big></dt>
<dd>slider pressed<br><br>
</dd>
<dt><big><a name="ScrollAction.SliderMoved"></a><u>SliderMoved</u></big></dt>
<dd>dragging in progress<br><br>
</dd>
<dt><big><a name="ScrollAction.SliderReleased"></a><u>SliderReleased</u></big></dt>
<dd>dragging finished<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="ScrollEvent"></a>class <u>ScrollEvent</u>;
</big></dt>
<dd>slider/scrollbar event<br><br>
<dl><dt><big><a name="ScrollEvent.position"></a>@property void <u>position</u>(int <i>newPosition</i>);
</big></dt>
<dd>change <u>position</u> in event handler to update slider <u>position</u><br><br>
</dd>
<dt><big><a name="ScrollEvent.defaultUpdatePosition"></a>int <u>defaultUpdatePosition</u>();
</big></dt>
<dd>default update position for actions like PageUp/PageDown, LineUp/LineDown<br><br>
</dd>
</dl>
</dd>
<dt><big><a name="keyName"></a>string <u>keyName</u>(uint <i>keyCode</i>);
</big></dt>
<dd>converts key code to key name<br><br>
</dd>
</dl>
</section>
<footer>
Dlangui is maintained by <a href="https://github.com/buggins">buggins</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</div>
</div>
</body>
</html>