332 lines
15 KiB
HTML
332 lines
15 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
||
|
<title>Gewi::GButton class Reference</title>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||
|
</head><body>
|
||
|
<!-- Generated by Doxygen 1.3 -->
|
||
|
<center>
|
||
|
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
|
||
|
<hr><h1>Gewi::GButton Class Reference</h1><code>#include <<a class="el" href="GewiButton_8h-source.html">GewiButton.h</a>></code>
|
||
|
<p>
|
||
|
Inherits <a class="el" href="classGewi_1_1GWidget.html">Gewi::GWidget</a>.
|
||
|
<p>
|
||
|
Inherited by <a class="el" href="classGewi_1_1GTextButton.html">Gewi::GTextButton</a>.
|
||
|
<p>
|
||
|
<a href="classGewi_1_1GButton-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
|
||
|
<a class="el" href="classGewi_1_1GButton.html">GButton</a> simple button widget, derived from <a class="el" href="classGewi_1_1GWidget.html">GWidget</a>.
|
||
|
<p>
|
||
|
<table border=0 cellpadding=0 cellspacing=0>
|
||
|
<tr><td></td></tr>
|
||
|
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
|
||
|
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a0">GButton</a> (<a class="el" href="classGewi_1_1GContainer.html">GContainer</a> *parent=NULL)</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Simple constructor for <a class="el" href="classGewi_1_1GButton.html">GButton</a>.</em> <a href="#a0"></a><em></em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a1">Create</a> (float x, float y, float width, float height, <a class="el" href="namespaceGewi.html#a2">ResourceID</a> normalImg, <a class="el" href="namespaceGewi.html#a2">ResourceID</a> pressImg, <a class="el" href="namespaceGewi.html#a17">GButtonType</a> type=GBT_PRESS)</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">GButton's create function, must be called to set up actual button.</em> <a href="#a1"></a><em></em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a2">Message</a> (SDL_Event *rawEvent, <a class="el" href="namespaceGewi.html#a18">GewiEvent</a> event, Uint16 mouseX, Uint16 mouseY, char ch)</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Overload of Message, used to recieve messages.</em> <a href="#a2"></a><em></em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a3">Show</a> ()</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Draws this button to the screen.</em> <a href="#a3"></a><em></em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a4">IsPressed</a> ()</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Returns button state.</em> <a href="#a4"></a><em></em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#a5">SetState</a> (bool pressed)</td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Sets button state (pressed/unpressed).</em> <a href="#a5"></a><em></em><br><br></td></tr>
|
||
|
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
|
||
|
<tr><td nowrap align=right valign=top><a name="n0" doxytag="Gewi::GButton::rPressed"></a>
|
||
|
bool </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#n0">rPressed</a></td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Boolean holding if button is currently pressed or not.</em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top><a name="n1" doxytag="Gewi::GButton::rType"></a>
|
||
|
<a class="el" href="namespaceGewi.html#a17">GButtonType</a> </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#n1">rType</a></td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Enum for type of button.</em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top><a name="n2" doxytag="Gewi::GButton::rNormalImage"></a>
|
||
|
<a class="el" href="namespaceGewi.html#a2">ResourceID</a> </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#n2">rNormalImage</a></td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Resource ID for the non-pressed image.</em><br><br></td></tr>
|
||
|
<tr><td nowrap align=right valign=top><a name="n3" doxytag="Gewi::GButton::rPressedImage"></a>
|
||
|
<a class="el" href="namespaceGewi.html#a2">ResourceID</a> </td><td valign=bottom><a class="el" href="classGewi_1_1GButton.html#n3">rPressedImage</a></td></tr>
|
||
|
<tr><td> </td><td><em class="mdesc">Resource ID for the pressed (or hover) image.</em><br><br></td></tr>
|
||
|
</table>
|
||
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
||
|
<a name="a0" doxytag="Gewi::GButton::GButton"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> Gewi::GButton::GButton </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="md" nowrap valign="top"><a class="el" href="classGewi_1_1GContainer.html">GContainer</a> * </td>
|
||
|
<td class="mdname1" valign="top" nowrap> <em>parent</em> = NULL </td>
|
||
|
<td class="md" valign="top"> ) </td>
|
||
|
<td class="md" nowrap></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Constructor for <a class="el" href="classGewi_1_1GButton.html">GButton</a>, can take a parent. <dl compact><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign=top><em>parent</em> </td><td>Pointer to <a class="el" href="classGewi_1_1GContainer.html">GContainer</a> derived class to be the parent. Default value is NULL which means no parent. </td></tr>
|
||
|
</table>
|
||
|
</dl>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
|
<a name="a1" doxytag="Gewi::GButton::Create"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> void Gewi::GButton::Create </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="md" nowrap valign="top">float </td>
|
||
|
<td class="mdname" nowrap> <em>x</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>float </td>
|
||
|
<td class="mdname" nowrap> <em>y</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>float </td>
|
||
|
<td class="mdname" nowrap> <em>width</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>float </td>
|
||
|
<td class="mdname" nowrap> <em>height</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap><a class="el" href="namespaceGewi.html#a2">ResourceID</a> </td>
|
||
|
<td class="mdname" nowrap> <em>normalImg</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap><a class="el" href="namespaceGewi.html#a2">ResourceID</a> </td>
|
||
|
<td class="mdname" nowrap> <em>pressImg</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap><a class="el" href="namespaceGewi.html#a17">GButtonType</a> </td>
|
||
|
<td class="mdname" nowrap> <em>type</em> = GBT_PRESS</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td class="md">) </td>
|
||
|
<td class="md" colspan="2"><code> [virtual]</code></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Every widget has a create function which must be called to define the button's appearance and settings. <dl compact><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign=top><em>x</em> </td><td>X position of widget within it's container (entire screen if no parent) </td></tr>
|
||
|
<tr><td valign=top><em>y</em> </td><td>Y position of widget within it's container (entire screen if no parent) </td></tr>
|
||
|
<tr><td valign=top><em>width</em> </td><td>Width of widget. </td></tr>
|
||
|
<tr><td valign=top><em>height</em> </td><td>Height of widget. </td></tr>
|
||
|
<tr><td valign=top><em>normalImg</em> </td><td>Image for button when not pressed. </td></tr>
|
||
|
<tr><td valign=top><em>pressImg</em> </td><td>Image for button when pressed (or hovered if type is GBT_HOVER). </td></tr>
|
||
|
<tr><td valign=top><em>type</em> </td><td>GButtonType, either the default, GBT_PRESS (normal button), or GBT_HOVER (a button which responds to the hovering mouse). </td></tr>
|
||
|
</table>
|
||
|
</dl>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<a name="a2" doxytag="Gewi::GButton::Message"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> void Gewi::GButton::Message </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="md" nowrap valign="top">SDL_Event * </td>
|
||
|
<td class="mdname" nowrap> <em>rawEvent</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap><a class="el" href="namespaceGewi.html#a18">GewiEvent</a> </td>
|
||
|
<td class="mdname" nowrap> <em>event</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>Uint16 </td>
|
||
|
<td class="mdname" nowrap> <em>mouseX</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>Uint16 </td>
|
||
|
<td class="mdname" nowrap> <em>mouseY</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="md" nowrap>char </td>
|
||
|
<td class="mdname" nowrap> <em>ch</em></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td class="md">) </td>
|
||
|
<td class="md" colspan="2"><code> [virtual]</code></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Recieves and processes a message, required overload for all widgets. <dl compact><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign=top><em>rawEvent</em> </td><td>SDL_Event of original message, may be needed if more information is available on event. (May be NULL). </td></tr>
|
||
|
<tr><td valign=top><em>event</em> </td><td>GewiEvent enum, description of event recieved. </td></tr>
|
||
|
<tr><td valign=top><em>mouseX</em> </td><td>Mouse x position in event, if not mouse event may be incorrect. </td></tr>
|
||
|
<tr><td valign=top><em>mouseY</em> </td><td>Mouse y position in event, if not mouse event may be incorrect. </td></tr>
|
||
|
<tr><td valign=top><em>ch</em> </td><td>Character pressed in event, may be 0 if not a keypress event. </td></tr>
|
||
|
</table>
|
||
|
</dl>
|
||
|
|
||
|
<p>
|
||
|
Implements <a class="el" href="classGewi_1_1GWidget.html#a6">Gewi::GWidget</a>. </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<a name="a3" doxytag="Gewi::GButton::Show"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> void Gewi::GButton::Show </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="mdname1" valign="top" nowrap> </td>
|
||
|
<td class="md" valign="top"> ) </td>
|
||
|
<td class="md" nowrap><code> [virtual]</code></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Draws widget to the screen, required overload for all widgets.
|
||
|
<p>
|
||
|
Implements <a class="el" href="classGewi_1_1GWidget.html#a7">Gewi::GWidget</a>.
|
||
|
<p>
|
||
|
Reimplemented in <a class="el" href="classGewi_1_1GTextButton.html#a2">Gewi::GTextButton</a>. </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<a name="a4" doxytag="Gewi::GButton::IsPressed"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> bool Gewi::GButton::IsPressed </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="mdname1" valign="top" nowrap> </td>
|
||
|
<td class="md" valign="top"> ) </td>
|
||
|
<td class="md" nowrap></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Returns true if buttons is pressed, false otherwise. (GBT_HOVER can only be pressed once, after that they stay down.) <dl compact><dt><b>Returns:</b></dt><dd>button pressed state </dd></dl>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<a name="a5" doxytag="Gewi::GButton::SetState"></a><p>
|
||
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md">
|
||
|
<table cellpadding="0" cellspacing="0" border="0">
|
||
|
<tr>
|
||
|
<td class="md" nowrap valign="top"> void Gewi::GButton::SetState </td>
|
||
|
<td class="md" valign="top">( </td>
|
||
|
<td class="md" nowrap valign="top">bool </td>
|
||
|
<td class="mdname1" valign="top" nowrap> <em>pressed</em> </td>
|
||
|
<td class="md" valign="top"> ) </td>
|
||
|
<td class="md" nowrap></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<table cellspacing=5 cellpadding=0 border=0>
|
||
|
<tr>
|
||
|
<td>
|
||
|
|
||
|
</td>
|
||
|
<td>
|
||
|
|
||
|
<p>
|
||
|
Sets button to pressed (true) or unpressed (false). <dl compact><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign=top><em>pressed</em> </td><td>true means pressed, false means unpressed. </td></tr>
|
||
|
</table>
|
||
|
</dl>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<hr>The documentation for this class was generated from the following files:<ul>
|
||
|
<li>/include/<a class="el" href="GewiButton_8h-source.html">GewiButton.h</a><li>/src/<a class="el" href="GewiButton_8cpp.html">GewiButton.cpp</a></ul>
|
||
|
<hr><address style="align: right;"><small>Generated on Mon Jun 16 03:27:18 2003 for Gewi by
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img src="doxygen.png" alt="doxygen" align="middle" border=0
|
||
|
width=110 height=53></a>1.3 </small></address>
|
||
|
</body>
|
||
|
</html>
|