-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_test_flex_box_control_8h_source.html
249 lines (247 loc) · 39.2 KB
/
_test_flex_box_control_8h_source.html
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>iPlug 2: TestFlexBoxControl.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 80px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">iPlug2 - C++ Audio Plug-in Framework
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_c70994b0d9919a11b368e677cb7f323c.html">IGraphics</a></li><li class="navelem"><a class="el" href="dir_b13fc9fb79eb1e19d3aa0747e2e621c7.html">Controls</a></li><li class="navelem"><a class="el" href="dir_63c81f22357c66696c5d0f2f825c4b38.html">Test</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">TestFlexBoxControl.h</div></div>
</div><!--header-->
<div class="contents">
<a href="_test_flex_box_control_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> ==============================================================================</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"></span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"></span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> See LICENSE.txt for more info.</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"></span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> ==============================================================================</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">*/</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include "<a class="code" href="_i_control_8h.html">IControl.h</a>"</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include "IGraphicsFlexBox.h"</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">static</span> <span class="keyword">const</span> std::initializer_list<const char*> alignStrs = { <span class="stringliteral">"YGAlignAuto"</span>, <span class="stringliteral">"YGAlignFlexStart"</span>, <span class="stringliteral">"YGAlignCenter"</span>, <span class="stringliteral">"YGAlignFlexEnd"</span>, <span class="stringliteral">"YGAlignStretch"</span>, <span class="stringliteral">"YGAlignBaseline"</span>, <span class="stringliteral">"YGAlignSpaceBetween"</span>, <span class="stringliteral">"YGAlignSpaceAround"</span> };</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="keyword">static</span> <span class="keyword">const</span> std::initializer_list<const char*> dirStrs = { <span class="stringliteral">"YGFlexDirectionColumn"</span>, <span class="stringliteral">"YGFlexDirectionColumnReverse"</span>, <span class="stringliteral">"YGFlexDirectionRow"</span>, <span class="stringliteral">"YGFlexDirectionRowReverse"</span> };</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">static</span> <span class="keyword">const</span> std::initializer_list<const char*> justifyStrs = { <span class="stringliteral">"YGJustifyFlexStart"</span>, <span class="stringliteral">"YGJustifyCenter"</span>, <span class="stringliteral">"YGJustifyFlexEnd"</span>, <span class="stringliteral">"YGJustifySpaceBetween"</span>, <span class="stringliteral">"YGJustifySpaceAround"</span>, <span class="stringliteral">"YGJustifySpaceEvenly"</span> };</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">static</span> <span class="keyword">const</span> std::initializer_list<const char*> wrapStrs = { <span class="stringliteral">"YGWrapNoWrap"</span>, <span class="stringliteral">"YGWrapWrap"</span>, <span class="stringliteral">"YGWrapWrapReverse"</span> };</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="class_test_flex_box_control.html"> 28</a></span><span class="keyword">class </span><a class="code hl_class" href="class_test_flex_box_control.html">TestFlexBoxControl</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_i_control.html">IControl</a></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>{</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_class" href="class_test_flex_box_control.html">TestFlexBoxControl</a>(<span class="keyword">const</span> <a class="code hl_struct" href="struct_i_r_e_c_t.html">IRECT</a>& rect)</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> : <a class="code hl_class" href="class_i_control.html">IControl</a>(rect)</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> mMenu.GetItem(0)->SetSubmenu(<span class="keyword">new</span> <a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a>(<span class="stringliteral">"Align"</span>, alignStrs));</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> mMenu.GetItem(1)->SetSubmenu(<span class="keyword">new</span> <a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a>(<span class="stringliteral">"Direction"</span>, dirStrs));</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> mMenu.GetItem(2)->SetSubmenu(<span class="keyword">new</span> <a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a>(<span class="stringliteral">"Justify"</span>, justifyStrs));</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> mMenu.GetItem(3)->SetSubmenu(<span class="keyword">new</span> <a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a>(<span class="stringliteral">"Wrap"</span>, wrapStrs));</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> mText = <a class="code hl_struct" href="struct_i_text.html">IText</a>(70.f, EVAlign::Middle);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <a class="code hl_function" href="class_i_control.html#ad9b74810f327007322f12f1110e032a6">SetTooltip</a>(<span class="stringliteral">"TestFlexboxControl"</span>);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> }</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="class_test_flex_box_control.html#abb6b2f6cda0543bcec21247cf98a68cd"> 43</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_test_flex_box_control.html#abb6b2f6cda0543bcec21247cf98a68cd">Draw</a>(<a class="code hl_class" href="class_i_graphics.html">IGraphics</a>& g)<span class="keyword"> override</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> g.<a class="code hl_function" href="class_i_graphics.html#a7056c9288ed66e21b8c9f424054677b2">FillRect</a>(COLOR_WHITE, mRootRect);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> WDL_String str;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<7; i++)</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> g.<a class="code hl_function" href="class_i_graphics.html#a7056c9288ed66e21b8c9f424054677b2">FillRect</a>(GetRainbow(i), mItemRects[i]);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> g.<a class="code hl_function" href="class_i_graphics.html#a0a7bba668c103968e96fad159173eff3">DrawRect</a>(COLOR_BLACK, mItemRects[i]);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> str.SetFormatted(2, <span class="stringliteral">"%i"</span>, i);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> g.<a class="code hl_function" href="class_i_graphics.html#a1af84cb75ed09bae3deac0ec32076ddd">DrawText</a>(mText, str.Get(), mItemRects[i]);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <a class="code hl_struct" href="struct_i_r_e_c_t.html">IRECT</a> textRect;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> g.<a class="code hl_function" href="class_i_graphics.html#affe4aae057ddc015587648bbfa3be593">MeasureText</a>(mText.WithSize(14.f), mSettingsStr.Get(), textRect);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_struct" href="struct_i_r_e_c_t.html">IRECT</a> adjusted = mRECT.<a class="code hl_function" href="struct_i_r_e_c_t.html#a433e5b91055541b18ea1fa4849874127">GetCentredInside</a>(textRect);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> g.<a class="code hl_function" href="class_i_graphics.html#a7056c9288ed66e21b8c9f424054677b2">FillRect</a>(COLOR_WHITE.<a class="code hl_function" href="struct_i_color.html#a7466c8367557bd52c8ecca07b07856e3">WithOpacity</a>(0.5f), adjusted);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> g.<a class="code hl_function" href="class_i_graphics.html#a0a7bba668c103968e96fad159173eff3">DrawRect</a>(COLOR_BLACK, adjusted);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> g.<a class="code hl_function" href="class_i_graphics.html#a1af84cb75ed09bae3deac0ec32076ddd">DrawText</a>(mText.WithSize(14.f), mSettingsStr.Get(), adjusted);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="class_test_flex_box_control.html#a2a7ee754322614308ca33502eef7a6d1"> 64</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_test_flex_box_control.html#a2a7ee754322614308ca33502eef7a6d1">OnResize</a>()<span class="keyword"> override</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> DoLayout();</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordtype">void</span> DoLayout()</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> mItemRects.clear();</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<7; i++)</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> mItemRects.push_back(<a class="code hl_struct" href="struct_i_r_e_c_t.html">IRECT</a>());</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_class" href="class_i_flex_box.html">IFlexBox</a> f;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> f.<a class="code hl_function" href="class_i_flex_box.html#a5e6721a6b567693ab7bd1adb7e77789f">Init</a>(mRECT, YGFlexDirection(mDirection), YGJustify(mJustify), YGWrap(mWrap));</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> YGNodeRef r;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<7; i++)</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> r = f.<a class="code hl_function" href="class_i_flex_box.html#a0b8c5f6b6ec5302cc1456c2ba3b88502">AddItem</a>(100.f, 100.f, YGAlign(mAlign));</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> f.<a class="code hl_function" href="class_i_flex_box.html#a1dab1617e81763494e10cf2d5a7f059a">CalcLayout</a>();</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<7; i++)</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> mItemRects[i] = mRECT.<a class="code hl_function" href="struct_i_r_e_c_t.html#a4f76a23dd9a0204a19b4b322dd943a08">Inset</a>(f.<a class="code hl_function" href="class_i_flex_box.html#a44f7afa2b4be660a5a0fa986bfe1896b">GetItemBounds</a>(i));</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> }</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> mRootRect = mRECT.<a class="code hl_function" href="struct_i_r_e_c_t.html#a4f76a23dd9a0204a19b4b322dd943a08">Inset</a>(f.<a class="code hl_function" href="class_i_flex_box.html#add466bc4c876109dbc24d887627e6a73">GetRootBounds</a>());</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> mSettingsStr.SetFormatted(256, <span class="stringliteral">"%s, %s, %s, %s"</span>, alignStrs.begin()[mAlign], dirStrs.begin()[mDirection], justifyStrs.begin()[mJustify], wrapStrs.begin()[mWrap]);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> }</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="class_test_flex_box_control.html#a1b43684fefb77051bdfdff3235780f49"> 99</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_test_flex_box_control.html#a1b43684fefb77051bdfdff3235780f49">OnMouseDown</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keyword">const</span> <a class="code hl_struct" href="struct_i_mouse_mod.html">IMouseMod</a>& mod)<span class="keyword"> override</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> mMenu.GetItem(0)->GetSubmenu()->CheckItemAlone(mAlign);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> mMenu.GetItem(1)->GetSubmenu()->CheckItemAlone(mDirection);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> mMenu.GetItem(2)->GetSubmenu()->CheckItemAlone(mJustify);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> mMenu.GetItem(3)->GetSubmenu()->CheckItemAlone(mWrap);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_function" href="class_i_control.html#a22b976d26b6670a8b84457a999dc7ce5">GetUI</a>()-><a class="code hl_function" href="class_i_graphics.html#a1e810f7c16d23717ad4e9e546f4f522b">CreatePopupMenu</a>(*<span class="keyword">this</span>, mMenu, x, y);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> }</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="class_test_flex_box_control.html#a304f1201ba6fcf728b64dea84d32dee5"> 109</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_test_flex_box_control.html#a304f1201ba6fcf728b64dea84d32dee5">OnPopupMenuSelection</a>(<a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a>* pSelectedMenu, <span class="keywordtype">int</span>)<span class="keyword"> override</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">if</span>(pSelectedMenu) </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordtype">int</span> idx = pSelectedMenu->GetChosenItemIdx();</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">if</span> (strcmp(pSelectedMenu->GetRootTitle(), <span class="stringliteral">"Align"</span>) == 0) { mAlign = idx; }</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span>(strcmp(pSelectedMenu->GetRootTitle(), <span class="stringliteral">"Direction"</span>) == 0) { mDirection = idx; }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span>(strcmp(pSelectedMenu->GetRootTitle(), <span class="stringliteral">"Justify"</span>) == 0) { mJustify = idx; }</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span>(strcmp(pSelectedMenu->GetRootTitle(), <span class="stringliteral">"Wrap"</span>) == 0) { mWrap = idx; }</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> DoLayout();</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <a class="code hl_function" href="class_i_control.html#af8c805c09b1a89f44aec43026fcb1fe7">SetDirty</a>(<span class="keyword">false</span>);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> }</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> WDL_String mSettingsStr;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_class" href="class_i_popup_menu.html">IPopupMenu</a> mMenu {<span class="stringliteral">"FlexBox"</span>, {<span class="stringliteral">"Align"</span>, <span class="stringliteral">"Direction"</span>, <span class="stringliteral">"Justify"</span>, <span class="stringliteral">"Wrap"</span>}};</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_struct" href="struct_i_r_e_c_t.html">IRECT</a> mRootRect;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordtype">int</span> mAlign = YGAlignAuto;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordtype">int</span> mDirection = YGFlexDirectionColumn;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordtype">int</span> mJustify = YGJustifyFlexStart;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordtype">int</span> mWrap = YGWrapNoWrap;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> std::vector<IRECT> mItemRects;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>};</div>
<div class="ttc" id="a_i_control_8h_html"><div class="ttname"><a href="_i_control_8h.html">IControl.h</a></div><div class="ttdoc">This file contains the base IControl implementation, along with some base classes for specific types ...</div></div>
<div class="ttc" id="aclass_i_control_html"><div class="ttname"><a href="class_i_control.html">IControl</a></div><div class="ttdoc">The lowest level base class of an IGraphics control.</div><div class="ttdef"><b>Definition:</b> <a href="_i_control_8h_source.html#l00044">IControl.h:49</a></div></div>
<div class="ttc" id="aclass_i_control_html_a22b976d26b6670a8b84457a999dc7ce5"><div class="ttname"><a href="class_i_control.html#a22b976d26b6670a8b84457a999dc7ce5">IControl::GetUI</a></div><div class="ttdeci">IGraphics * GetUI()</div><div class="ttdef"><b>Definition:</b> <a href="_i_control_8h_source.html#l00472">IControl.h:472</a></div></div>
<div class="ttc" id="aclass_i_control_html_ad9b74810f327007322f12f1110e032a6"><div class="ttname"><a href="class_i_control.html#ad9b74810f327007322f12f1110e032a6">IControl::SetTooltip</a></div><div class="ttdeci">IControl * SetTooltip(const char *str)</div><div class="ttdoc">Set a tooltip for the control.</div><div class="ttdef"><b>Definition:</b> <a href="_i_control_8h_source.html#l00221">IControl.h:221</a></div></div>
<div class="ttc" id="aclass_i_control_html_af8c805c09b1a89f44aec43026fcb1fe7"><div class="ttname"><a href="class_i_control.html#af8c805c09b1a89f44aec43026fcb1fe7">IControl::SetDirty</a></div><div class="ttdeci">virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)</div><div class="ttdoc">Mark the control as dirty, i.e.</div><div class="ttdef"><b>Definition:</b> <a href="_i_control_8cpp_source.html#l00198">IControl.cpp:198</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html"><div class="ttname"><a href="class_i_flex_box.html">IFlexBox</a></div><div class="ttdoc">IFlexBox is a basic C++ helper for Yoga https://yogalayout.com.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8h_source.html#l00021">IGraphicsFlexBox.h:22</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html_a0b8c5f6b6ec5302cc1456c2ba3b88502"><div class="ttname"><a href="class_i_flex_box.html#a0b8c5f6b6ec5302cc1456c2ba3b88502">IFlexBox::AddItem</a></div><div class="ttdeci">YGNodeRef AddItem(float width, float height, YGAlign alignSelf=YGAlignAuto, float grow=0.f, float shrink=1.f, float margin=0.f)</div><div class="ttdoc">Add a flex item, with some parameters.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8cpp_source.html#l00044">IGraphicsFlexBox.cpp:44</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html_a1dab1617e81763494e10cf2d5a7f059a"><div class="ttname"><a href="class_i_flex_box.html#a1dab1617e81763494e10cf2d5a7f059a">IFlexBox::CalcLayout</a></div><div class="ttdeci">void CalcLayout(YGDirection direction=YGDirectionLTR)</div><div class="ttdoc">Calculate the layout, call after add all items.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8cpp_source.html#l00039">IGraphicsFlexBox.cpp:39</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html_a44f7afa2b4be660a5a0fa986bfe1896b"><div class="ttname"><a href="class_i_flex_box.html#a44f7afa2b4be660a5a0fa986bfe1896b">IFlexBox::GetItemBounds</a></div><div class="ttdeci">IRECT GetItemBounds(int nodeIndex) const</div><div class="ttdoc">Get the bounds for a particular flex item.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8cpp_source.html#l00087">IGraphicsFlexBox.cpp:87</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html_a5e6721a6b567693ab7bd1adb7e77789f"><div class="ttname"><a href="class_i_flex_box.html#a5e6721a6b567693ab7bd1adb7e77789f">IFlexBox::Init</a></div><div class="ttdeci">void Init(const IRECT &r, YGFlexDirection direction=YGFlexDirectionRow, YGJustify justify=YGJustifyFlexStart, YGWrap wrap=YGWrapNoWrap, float padding=0.f, float margin=0.f)</div><div class="ttdoc">Initialize the IFlexBox flex container.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8cpp_source.html#l00028">IGraphicsFlexBox.cpp:28</a></div></div>
<div class="ttc" id="aclass_i_flex_box_html_add466bc4c876109dbc24d887627e6a73"><div class="ttname"><a href="class_i_flex_box.html#add466bc4c876109dbc24d887627e6a73">IFlexBox::GetRootBounds</a></div><div class="ttdeci">IRECT GetRootBounds() const</div><div class="ttdoc">Get an IRECT of the root node bounds.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_flex_box_8cpp_source.html#l00079">IGraphicsFlexBox.cpp:79</a></div></div>
<div class="ttc" id="aclass_i_graphics_html"><div class="ttname"><a href="class_i_graphics.html">IGraphics</a></div><div class="ttdoc">The lowest level base class of an IGraphics context.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8h_source.html#l00082">IGraphics.h:86</a></div></div>
<div class="ttc" id="aclass_i_graphics_html_a0a7bba668c103968e96fad159173eff3"><div class="ttname"><a href="class_i_graphics.html#a0a7bba668c103968e96fad159173eff3">IGraphics::DrawRect</a></div><div class="ttdeci">virtual void DrawRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)</div><div class="ttdoc">Draw a rectangle to the graphics context.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8cpp_source.html#l02505">IGraphics.cpp:2505</a></div></div>
<div class="ttc" id="aclass_i_graphics_html_a1af84cb75ed09bae3deac0ec32076ddd"><div class="ttname"><a href="class_i_graphics.html#a1af84cb75ed09bae3deac0ec32076ddd">IGraphics::DrawText</a></div><div class="ttdeci">void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)</div><div class="ttdoc">Draw some text to the graphics context in a specific rectangle.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8cpp_source.html#l00678">IGraphics.cpp:678</a></div></div>
<div class="ttc" id="aclass_i_graphics_html_a1e810f7c16d23717ad4e9e546f4f522b"><div class="ttname"><a href="class_i_graphics.html#a1e810f7c16d23717ad4e9e546f4f522b">IGraphics::CreatePopupMenu</a></div><div class="ttdeci">void CreatePopupMenu(IControl &control, IPopupMenu &menu, const IRECT &bounds, int valIdx=0)</div><div class="ttdoc">Shows a pop up/contextual menu in relation to a rectangular region of the graphics context.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8cpp_source.html#l01968">IGraphics.cpp:1968</a></div></div>
<div class="ttc" id="aclass_i_graphics_html_a7056c9288ed66e21b8c9f424054677b2"><div class="ttname"><a href="class_i_graphics.html#a7056c9288ed66e21b8c9f424054677b2">IGraphics::FillRect</a></div><div class="ttdeci">virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)</div><div class="ttdoc">Fill a rectangular region of the graphics context with a color.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8cpp_source.html#l02577">IGraphics.cpp:2577</a></div></div>
<div class="ttc" id="aclass_i_graphics_html_affe4aae057ddc015587648bbfa3be593"><div class="ttname"><a href="class_i_graphics.html#affe4aae057ddc015587648bbfa3be593">IGraphics::MeasureText</a></div><div class="ttdeci">virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const</div><div class="ttdoc">Measure the rectangular region that some text will occupy.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_8cpp_source.html#l00686">IGraphics.cpp:686</a></div></div>
<div class="ttc" id="aclass_i_popup_menu_html"><div class="ttname"><a href="class_i_popup_menu.html">IPopupMenu</a></div><div class="ttdoc">A class for setting the contents of a pop up menu.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_popup_menu_8h_source.html#l00039">IGraphicsPopupMenu.h:40</a></div></div>
<div class="ttc" id="aclass_test_flex_box_control_html"><div class="ttname"><a href="class_test_flex_box_control.html">TestFlexBoxControl</a></div><div class="ttdoc">Control to test IGraphicsFlexBox.</div><div class="ttdef"><b>Definition:</b> <a href="_test_flex_box_control_8h_source.html#l00028">TestFlexBoxControl.h:29</a></div></div>
<div class="ttc" id="aclass_test_flex_box_control_html_a1b43684fefb77051bdfdff3235780f49"><div class="ttname"><a href="class_test_flex_box_control.html#a1b43684fefb77051bdfdff3235780f49">TestFlexBoxControl::OnMouseDown</a></div><div class="ttdeci">void OnMouseDown(float x, float y, const IMouseMod &mod) override</div><div class="ttdoc">Implement this method to respond to a mouse down event on this control.</div><div class="ttdef"><b>Definition:</b> <a href="_test_flex_box_control_8h_source.html#l00099">TestFlexBoxControl.h:99</a></div></div>
<div class="ttc" id="aclass_test_flex_box_control_html_a2a7ee754322614308ca33502eef7a6d1"><div class="ttname"><a href="class_test_flex_box_control.html#a2a7ee754322614308ca33502eef7a6d1">TestFlexBoxControl::OnResize</a></div><div class="ttdeci">void OnResize() override</div><div class="ttdoc">Called when IControl is constructed or resized using SetRect().</div><div class="ttdef"><b>Definition:</b> <a href="_test_flex_box_control_8h_source.html#l00064">TestFlexBoxControl.h:64</a></div></div>
<div class="ttc" id="aclass_test_flex_box_control_html_a304f1201ba6fcf728b64dea84d32dee5"><div class="ttname"><a href="class_test_flex_box_control.html#a304f1201ba6fcf728b64dea84d32dee5">TestFlexBoxControl::OnPopupMenuSelection</a></div><div class="ttdeci">void OnPopupMenuSelection(IPopupMenu *pSelectedMenu, int) override</div><div class="ttdoc">Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptU...</div><div class="ttdef"><b>Definition:</b> <a href="_test_flex_box_control_8h_source.html#l00109">TestFlexBoxControl.h:109</a></div></div>
<div class="ttc" id="aclass_test_flex_box_control_html_abb6b2f6cda0543bcec21247cf98a68cd"><div class="ttname"><a href="class_test_flex_box_control.html#abb6b2f6cda0543bcec21247cf98a68cd">TestFlexBoxControl::Draw</a></div><div class="ttdeci">void Draw(IGraphics &g) override</div><div class="ttdoc">Draw the control to the graphics context.</div><div class="ttdef"><b>Definition:</b> <a href="_test_flex_box_control_8h_source.html#l00043">TestFlexBoxControl.h:43</a></div></div>
<div class="ttc" id="astruct_i_color_html_a7466c8367557bd52c8ecca07b07856e3"><div class="ttname"><a href="struct_i_color.html#a7466c8367557bd52c8ecca07b07856e3">IColor::WithOpacity</a></div><div class="ttdeci">IColor WithOpacity(float alpha) const</div><div class="ttdoc">Returns a new IColor with a different opacity.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l00263">IGraphicsStructs.h:263</a></div></div>
<div class="ttc" id="astruct_i_mouse_mod_html"><div class="ttname"><a href="struct_i_mouse_mod.html">IMouseMod</a></div><div class="ttdoc">Used to manage mouse modifiers i.e.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l01695">IGraphicsStructs.h:1696</a></div></div>
<div class="ttc" id="astruct_i_r_e_c_t_html"><div class="ttname"><a href="struct_i_r_e_c_t.html">IRECT</a></div><div class="ttdoc">Used to manage a rectangular area, independent of draw class/platform.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l00748">IGraphicsStructs.h:749</a></div></div>
<div class="ttc" id="astruct_i_r_e_c_t_html_a433e5b91055541b18ea1fa4849874127"><div class="ttname"><a href="struct_i_r_e_c_t.html#a433e5b91055541b18ea1fa4849874127">IRECT::GetCentredInside</a></div><div class="ttdeci">IRECT GetCentredInside(const IRECT &sr) const</div><div class="ttdoc">Get a rectangle the size of sr but with the same center point as this rectangle.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l01586">IGraphicsStructs.h:1586</a></div></div>
<div class="ttc" id="astruct_i_r_e_c_t_html_a4f76a23dd9a0204a19b4b322dd943a08"><div class="ttname"><a href="struct_i_r_e_c_t.html#a4f76a23dd9a0204a19b4b322dd943a08">IRECT::Inset</a></div><div class="ttdeci">IRECT Inset(const IRECT &rhs) const</div><div class="ttdoc">Offsets the input IRECT based on the parent.</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l00914">IGraphicsStructs.h:914</a></div></div>
<div class="ttc" id="astruct_i_text_html"><div class="ttname"><a href="struct_i_text.html">IText</a></div><div class="ttdoc">IText is used to manage font and text/text entry style for a piece of text on the UI,...</div><div class="ttdef"><b>Definition:</b> <a href="_i_graphics_structs_8h_source.html#l00661">IGraphicsStructs.h:662</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>