|
| 1 | +<!-- HTML header for doxygen 1.8.6--> |
| 2 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | +<head> |
| 5 | +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 6 | +<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 7 | +<meta name="generator" content="Doxygen 1.8.6-nimbuskit"/> |
| 8 | +<title>NimbusKit: Button Utilities</title> |
| 9 | +<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 | +<script type="text/javascript" src="jquery.js"></script> |
| 11 | +<script type="text/javascript" src="dynsections.js"></script> |
| 12 | +<link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 | +<script type="text/javascript" src="resize.js"></script> |
| 14 | +<script type="text/javascript" src="navtree.js"></script> |
| 15 | +<script type="text/javascript"> |
| 16 | + $(document).ready(initResizable); |
| 17 | + $(window).load(resizeHeight); |
| 18 | +</script> |
| 19 | +<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 20 | +<link href="appledocs.css" rel="stylesheet" type="text/css"/> |
| 21 | +<link href="nimbuskit.css" rel="stylesheet" type="text/css" /> |
| 22 | +<script type="text/javascript"> |
| 23 | + var _gaq = _gaq || []; |
| 24 | + _gaq.push(['_setAccount', 'UA-24278774-1']); |
| 25 | + _gaq.push(['_setDomainName', 'nimbuskit.info']); |
| 26 | + _gaq.push(['_trackPageview']); |
| 27 | + (function() { |
| 28 | + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
| 29 | + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
| 30 | + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| 31 | + })(); |
| 32 | +</script> |
| 33 | +</head> |
| 34 | +<body> |
| 35 | +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 36 | +<div id="titlearea"> |
| 37 | +<a href="index.html"><img style="float:left" src="nimbus128.png" width="80" height="80" /></a> |
| 38 | +<table cellspacing="0" cellpadding="0"> |
| 39 | + <tbody> |
| 40 | + <tr style="height: 56px;"> |
| 41 | + <td style="padding-left: 0.5em;"> |
| 42 | + <div id="projectname">NimbusKit |
| 43 | +  <span id="projectnumber">1.2.1 - <a href="http://github.com/jverkoey/nimbus">Fork Nimbus on Github</a> - <a href="http://wiki.nimbuskit.info/">Visit the Nimbus Wiki</a></span> |
| 44 | + </div> |
| 45 | + <div id="projectbrief">The iOS framework that grows only as fast as its documentation</div> |
| 46 | + </td> |
| 47 | + </tr> |
| 48 | + </tbody> |
| 49 | +</table> |
| 50 | +</div> |
| 51 | +<!-- end header part --> |
| 52 | +<!-- Generated by Doxygen 1.8.6-nimbuskit --> |
| 53 | +</div><!-- top --> |
| 54 | +<div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | + <div id="nav-tree"> |
| 56 | + <div id="nav-tree-contents"> |
| 57 | + <div id="nav-sync" class="sync"></div> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + <div id="splitbar" style="-moz-user-select:none;" |
| 61 | + class="ui-resizable-handle"> |
| 62 | + </div> |
| 63 | +</div> |
| 64 | +<script type="text/javascript"> |
| 65 | +$(document).ready(function(){initNavTree('Button-Utilities.html','');}); |
| 66 | +</script> |
| 67 | +<div id="doc-content"> |
| 68 | +<div class="header"> |
| 69 | + <div class="summary"> |
| 70 | +<a href="#func-members">Functions</a> </div> |
| 71 | + <div class="headertitle"> |
| 72 | +<div class="title">Button Utilities<div class="ingroups"><a class="el" href="NimbusCore.html">Nimbus Core</a></div></div> </div> |
| 73 | +</div><!--header--> |
| 74 | +<div class="contents"> |
| 75 | +<table class="memberdecls"> |
| 76 | +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 77 | +Functions</h2></td></tr> |
| 78 | +<tr class="memitem:gNIApplyImageSelectorToButton"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="Button-Utilities.html#gNIApplyImageSelectorToButton">NIApplyImageSelectorToButton</a> (SEL selector, id target, UIButton *button)</td></tr> |
| 79 | +<tr class="separator:gNIApplyImageSelectorToButton"><td class="memSeparator" colspan="2"> </td></tr> |
| 80 | +<tr class="memitem:gNIApplyBackgroundImageSelectorToButton"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="Button-Utilities.html#gNIApplyBackgroundImageSelectorToButton">NIApplyBackgroundImageSelectorToButton</a> (SEL selector, id target, UIButton *button)</td></tr> |
| 81 | +<tr class="separator:gNIApplyBackgroundImageSelectorToButton"><td class="memSeparator" colspan="2"> </td></tr> |
| 82 | +<tr class="memitem:gNIApplyTitleColorSelectorToButton"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="Button-Utilities.html#gNIApplyTitleColorSelectorToButton">NIApplyTitleColorSelectorToButton</a> (SEL selector, id target, UIButton *button)</td></tr> |
| 83 | +<tr class="separator:gNIApplyTitleColorSelectorToButton"><td class="memSeparator" colspan="2"> </td></tr> |
| 84 | +</table> |
| 85 | +<a name="details" id="details"></a><h2 class="groupheader">Overview</h2> |
| 86 | +<p>For manipulating UIButton objects. </p> |
| 87 | +<p>The methods provided here make it possible to specify different properties for different button states in a scalable way. For example, you can define a stylesheet class that has a number of class methods that return the various properties for buttons.</p> |
| 88 | +<div class="fragment"><div class="line"><span class="keyword">@implementation </span>Stylesheet</div> |
| 89 | +<div class="line"></div> |
| 90 | +<div class="line">+ (UIImage *)backgroundImageForButtonWithState:(UIControlState)state {</div> |
| 91 | +<div class="line"> <span class="keywordflow">if</span> (state & UIControlStateHighlighted) {</div> |
| 92 | +<div class="line"> <span class="keywordflow">return</span> [UIImage imageNamed:@"button_highlighted"];</div> |
| 93 | +<div class="line"></div> |
| 94 | +<div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (state == UIControlStateNormal) {</div> |
| 95 | +<div class="line"> <span class="keywordflow">return</span> [UIImage imageNamed:@"button"];</div> |
| 96 | +<div class="line"> }</div> |
| 97 | +<div class="line"> <span class="keywordflow">return</span> nil;</div> |
| 98 | +<div class="line">}</div> |
| 99 | +<div class="line"></div> |
| 100 | +<div class="line"><span class="keyword">@end</span></div> |
| 101 | +<div class="line"></div> |
| 102 | +<div class="line"><span class="comment">// The result of the implementation above will set the background images for the button's</span></div> |
| 103 | +<div class="line"><span class="comment">// highlighted and default states.</span></div> |
| 104 | +<div class="line"><a class="code" href="Button-Utilities.html#gNIApplyBackgroundImageSelectorToButton">NIApplyBackgroundImageSelectorToButton</a>(<span class="keyword">@selector</span>(backgroundImageForButtonWithState:),</div> |
| 105 | +<div class="line"> [Stylesheet <span class="keyword">class</span>],</div> |
| 106 | +<div class="line"> button);</div> |
| 107 | +</div><!-- fragment --> <h2 class="groupheader">Function Documentation</h2> |
| 108 | +<a class="anchor" id="gNIApplyImageSelectorToButton"></a> |
| 109 | +<div class="memitem"> |
| 110 | + <h3 class="memname">NIApplyImageSelectorToButton</h3> |
| 111 | +<div class="memdoc"> |
| 112 | + |
| 113 | +<p class="abstract">Sets the images for a button's states. </p> |
| 114 | +<div class="declaration"> |
| 115 | +void NIApplyImageSelectorToButton;</td></tr> |
| 116 | +</div> |
| 117 | +<h5>Discussion</h5> |
| 118 | +<dl class="params"><dt>Parameters</dt><dd> |
| 119 | + <table class="params"> |
| 120 | + <tr><td class="paramname">selector</td><td>A selector of the form: (UIImage *)imageWithControlState:(UIControlState)controlState </td></tr> |
| 121 | + <tr><td class="paramname">target</td><td>The target upon which the selector will be invoked. </td></tr> |
| 122 | + <tr><td class="paramname">button</td><td>The button object whose properties should be modified. </td></tr> |
| 123 | + </table> |
| 124 | + </dd> |
| 125 | +</dl> |
| 126 | + |
| 127 | +</div> |
| 128 | +</div> |
| 129 | +<a class="anchor" id="gNIApplyBackgroundImageSelectorToButton"></a> |
| 130 | +<div class="memitem"> |
| 131 | + <h3 class="memname">NIApplyBackgroundImageSelectorToButton</h3> |
| 132 | +<div class="memdoc"> |
| 133 | + |
| 134 | +<p class="abstract">Sets the background images for a button's states. </p> |
| 135 | +<div class="declaration"> |
| 136 | +void NIApplyBackgroundImageSelectorToButton;</td></tr> |
| 137 | +</div> |
| 138 | +<h5>Discussion</h5> |
| 139 | +<dl class="params"><dt>Parameters</dt><dd> |
| 140 | + <table class="params"> |
| 141 | + <tr><td class="paramname">selector</td><td>A selector of the form: (UIImage *)backgroundImageWithControlState:(UIControlState)controlState </td></tr> |
| 142 | + <tr><td class="paramname">target</td><td>The target upon which the selector will be invoked. </td></tr> |
| 143 | + <tr><td class="paramname">button</td><td>The button object whose properties should be modified. </td></tr> |
| 144 | + </table> |
| 145 | + </dd> |
| 146 | +</dl> |
| 147 | + |
| 148 | +</div> |
| 149 | +</div> |
| 150 | +<a class="anchor" id="gNIApplyTitleColorSelectorToButton"></a> |
| 151 | +<div class="memitem"> |
| 152 | + <h3 class="memname">NIApplyTitleColorSelectorToButton</h3> |
| 153 | +<div class="memdoc"> |
| 154 | + |
| 155 | +<p class="abstract">Sets the title colors for a button's states. </p> |
| 156 | +<div class="declaration"> |
| 157 | +void NIApplyTitleColorSelectorToButton;</td></tr> |
| 158 | +</div> |
| 159 | +<h5>Discussion</h5> |
| 160 | +<dl class="params"><dt>Parameters</dt><dd> |
| 161 | + <table class="params"> |
| 162 | + <tr><td class="paramname">selector</td><td>A selector of the form: (UIColor *)colorWithControlState:(UIControlState)controlState </td></tr> |
| 163 | + <tr><td class="paramname">target</td><td>The target upon which the selector will be invoked. </td></tr> |
| 164 | + <tr><td class="paramname">button</td><td>The button object whose properties should be modified. </td></tr> |
| 165 | + </table> |
| 166 | + </dd> |
| 167 | +</dl> |
| 168 | + |
| 169 | +</div> |
| 170 | +</div> |
| 171 | +</div><!-- contents --> |
| 172 | +</div><!-- doc-content --> |
| 173 | +<!-- HTML footer for doxygen 1.8.6--> |
| 174 | +<!-- start footer part --> |
| 175 | +<script type="text/javascript" src="widget.js"></script> |
| 176 | +</body> |
| 177 | +</html> |
0 commit comments