aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/Browse_cpp-source.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/Browse_cpp-source.html1396
1 files changed, 1396 insertions, 0 deletions
diff --git a/docs/doxygen/nel/Browse_cpp-source.html b/docs/doxygen/nel/Browse_cpp-source.html
new file mode 100644
index 00000000..fd2955c2
--- /dev/null
+++ b/docs/doxygen/nel/Browse_cpp-source.html
@@ -0,0 +1,1396 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+ <TITLE>nevrax.org : docs</TITLE>
+ <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
+
+<!-- uplinks -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ </TR>
+</TABLE>
+
+<!-- banner Nevrax -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
+ <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
+</TABLE>
+
+<!-- main table -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+ <!------ Begin Box ------>
+ <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
+ <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
+ <TABLE cellspacing=0 cellpadding=1 border=0>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr>
+ </TABLE>
+ </TD></TR></TABLE></TD></TR></TABLE>
+ <!------ End Box ------>
+
+ </TD>
+ <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+<!-- title -->
+<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
+<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
+</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
+</td></tr></table>
+&nbsp;
+
+<!-- block -->
+<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD>
+ <TD><B>Documentation</B></TD>
+ <TD ALIGN=RIGHT>&nbsp;</td>
+</tr></table>
+<!-- Generated by Doxygen 1.2.2 on Thu May 31 22:01:07 2001 -->
+<center>
+<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
+<hr><h1>Browse.cpp</h1><a href="Browse_cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">// Browse.cpp : implementation file</font>
+00002 <font class="comment">//</font>
+00003
+00004 <font class="preprocessor">#include "<a class="code" href="tile_edit_stdafx_h.html">stdafx.h</a>"</font>
+00005 <font class="comment">//#include "tile_edit_dll.h"</font>
+00006 <font class="preprocessor">#include "<a class="code" href="tile_edit_resource_h.html">resource.h</a>"</font>
+00007 <font class="preprocessor">#include "<a class="code" href="Browse_h.html">Browse.h</a>"</font>
+00008 <font class="preprocessor">#include "<a class="code" href="custom_h.html">custom.h</a>"</font>
+00009 <font class="preprocessor">#include "getval.h"</font>
+00010 <font class="preprocessor">#include &lt;<a class="code" href="tile_bank_h.html">nel/3d/tile_bank.h</a>&gt;</font>
+00011
+00012 <font class="keyword">using</font> <font class="keyword">namespace</font> NL3D;
+00013
+00014 <font class="keyword">extern</font> CTileBank tileBank2;
+00015
+00017 <font class="comment">// Browse dialog</font>
+00018
+<a name="l00019"></a><a class="code" href="class_Browse.html#a0">00019</a> <a class="code" href="class_Browse.html#a0">Browse::Browse</a>(<font class="keywordtype">int</font> nland, <a class="code" href="class_CWnd.html">CWnd</a>* pParent <font class="comment">/*=NULL*/</font>)
+00020 : <a class="code" href="class_CDialog.html">CDialog</a>(<a class="code" href="class_Browse.html">Browse</a>::IDD, pParent)
+00021 {
+00022 <font class="comment">//{{AFX_DATA_INIT(Browse)</font>
+00023 SubGroup0 = FALSE;
+00024 SubGroup1 = FALSE;
+00025 SubGroup2 = FALSE;
+00026 SubGroup3 = FALSE;
+00027 SubGroup4 = FALSE;
+00028 SubGroup5 = FALSE;
+00029 SubGroup6 = FALSE;
+00030 SubGroup7 = FALSE;
+00031 SubGroup10 = FALSE;
+00032 SubGroup11 = FALSE;
+00033 SubGroup8 = FALSE;
+00034 SubGroup9 = FALSE;
+00035 <font class="comment">//}}AFX_DATA_INIT</font>
+00036 land=nland;
+00037 m_128x128=0;
+00038 }
+00039
+00040
+<a name="l00041"></a><a class="code" href="class_Browse.html#b0">00041</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b0">Browse::DoDataExchange</a>(CDataExchange* pDX)<font class="keyword">
+</font>00042 <font class="keyword"></font>{
+00043 CDialog::DoDataExchange(pDX);
+00044 <font class="comment">//{{AFX_DATA_MAP(Browse)</font>
+00045 DDX_Radio(pDX, IDC_128X128, m_128x128);
+00046 DDX_Control(pDX, IDC_VIEW, m_ctrl);
+00047 DDX_Control(pDX, IDC_INFONUM, m_infotexte);
+00048 DDX_Control(pDX, IDC_JOUR, m_rb_jour);
+00049 DDX_Check(pDX, IDC_SUBGROUP0, SubGroup0);
+00050 DDX_Check(pDX, IDC_SUBGROUP1, SubGroup1);
+00051 DDX_Check(pDX, IDC_SUBGROUP2, SubGroup2);
+00052 DDX_Check(pDX, IDC_SUBGROUP3, SubGroup3);
+00053 DDX_Check(pDX, IDC_SUBGROUP4, SubGroup4);
+00054 DDX_Check(pDX, IDC_SUBGROUP5, SubGroup5);
+00055 DDX_Check(pDX, IDC_SUBGROUP6, SubGroup6);
+00056 DDX_Check(pDX, IDC_SUBGROUP7, SubGroup7);
+00057 DDX_Check(pDX, IDC_SUBGROUP10, SubGroup10);
+00058 DDX_Check(pDX, IDC_SUBGROUP11, SubGroup11);
+00059 DDX_Check(pDX, IDC_SUBGROUP8, SubGroup8);
+00060 DDX_Check(pDX, IDC_SUBGROUP9, SubGroup9);
+00061 <font class="comment">//}}AFX_DATA_MAP</font>
+00062 }
+00063
+00064
+<a name="l00065"></a><a class="code" href="Browse_cpp.html#a5">00065</a> <a class="code" href="ViewColumn_cpp.html#a1">BEGIN_MESSAGE_MAP</a>(<a class="code" href="class_Browse.html">Browse</a>, <a class="code" href="class_CDialog.html">CDialog</a>)
+00066 <font class="comment">//{{AFX_MSG_MAP(Browse)</font>
+00067 ON_WM_SIZE()
+00068 ON_BN_CLICKED(IDC_ALPHA, OnAlpha)
+00069 ON_BN_CLICKED(IDC_128X128, OnChangeVariety)
+00070 ON_BN_CLICKED(IDC_JOUR, OnJour)
+00071 ON_BN_CLICKED(IDC_NUIT, OnNuit)
+00072 ON_BN_CLICKED(IDC_OK, OnOk)
+00073 ON_WM_RBUTTONDOWN()
+00074 ON_BN_CLICKED(IDC_OK2, OnUpdateTiles)
+00075 ON_BN_CLICKED(IDC_BATCH_LOAD, OnBatchLoad)
+00076 ON_BN_CLICKED(IDC_SUBGROUP0, OnSubgroup0)
+00077 ON_BN_CLICKED(IDC_SUBGROUP1, OnSubgroup1)
+00078 ON_BN_CLICKED(IDC_SUBGROUP2, OnSubgroup2)
+00079 ON_BN_CLICKED(IDC_SUBGROUP3, OnSubgroup3)
+00080 ON_BN_CLICKED(IDC_SUBGROUP4, OnSubgroup4)
+00081 ON_BN_CLICKED(IDC_SUBGROUP5, OnSubgroup5)
+00082 ON_BN_CLICKED(IDC_SUBGROUP6, OnSubgroup6)
+00083 ON_BN_CLICKED(IDC_SUBGROUP7, OnSubgroup7)
+00084 ON_BN_CLICKED(IDC_ZOOM5, OnChangeVariety)
+00085 ON_BN_CLICKED(IDC_ZOOM6, OnChangeVariety)
+00086 ON_BN_CLICKED(IDCANCEL, OnCancel)
+00087 ON_BN_CLICKED(IDC_CANCEL, OnCancel)
+00088 ON_BN_CLICKED(IDC_DISPLACE, OnChangeVariety)
+00089 ON_BN_CLICKED(IDC_SUBGROUP8, OnSubgroup8)
+00090 ON_BN_CLICKED(IDC_SUBGROUP9, OnSubgroup9)
+00091 ON_BN_CLICKED(IDC_SUBGROUP10, OnSubgroup10)
+00092 ON_BN_CLICKED(IDC_SUBGROUP11, OnSubgroup11)
+00093 <font class="comment">//}}AFX_MSG_MAP</font>
+00094 END_MESSAGE_MAP()
+00095
+00097 <font class="comment">// Browse message handlers</font>
+00098
+00099 BOOL <a class="code" href="class_Browse.html#b1">Browse::PreCreateWindow</a>(CREATESTRUCT&amp; cs)<font class="keyword">
+</font>00100 <font class="keyword"></font>{
+00101 <font class="comment">// TODO: Add your specialized code here and/or call the base class</font>
+00102
+00103 <font class="keywordflow">return</font> CDialog::PreCreateWindow(cs);
+00104 }
+00105
+<a name="l00106"></a><a class="code" href="Browse_cpp.html#a1">00106</a> DWORD thread_id;
+<a name="l00107"></a><a class="code" href="Browse_cpp.html#a2">00107</a> <font class="keywordtype">int</font> thread_actif = 0;
+<a name="l00108"></a><a class="code" href="Browse_cpp.html#a3">00108</a> <a class="code" href="class_Browse.html">Browse</a> *pDialog;
+<a name="l00109"></a><a class="code" href="Browse_cpp.html#a4">00109</a> <font class="keywordtype">int</font> ccount=0;
+00110
+<a name="l00111"></a><a class="code" href="class_Browse.html#b2">00111</a> LRESULT <a class="code" href="class_Browse.html#b2">Browse::WindowProc</a>(UINT message, WPARAM wParam, LPARAM lParam)<font class="keyword">
+</font>00112 <font class="keyword"></font>{
+00113
+00114 <font class="comment">// TODO: Add your specialized code here and/or call the base class</font>
+00115 <font class="keywordflow">if</font> (ccount==0 &amp;&amp; message==WM_PAINT)
+00116 {
+00117 <a class="code" href="class_Browse.html#a1">Init</a>();
+00118 }
+00119 <font class="keywordflow">if</font> (message==WM_KEYUP || message==WM_KEYDOWN)
+00120 {
+00121 RECT parent,client;
+00122 GetWindowRect(&amp;parent); m_ctrl.GetWindowRect(&amp;client);
+00123 <font class="keywordflow">if</font> (m_ctrl.MousePos.x&lt;(client.right - parent.left) &amp;&amp;
+00124 m_ctrl.MousePos.x&gt;0 &amp;&amp;
+00125 m_ctrl.MousePos.y&lt;(client.bottom - client.top) &amp;&amp;
+00126 m_ctrl.MousePos.y&gt;0)
+00127 {
+00128 m_ctrl.SendMessage(message,wParam,lParam);
+00129 }
+00130 }
+00131
+00132 <font class="keywordflow">if</font> (message==WM_MOUSEMOVE)
+00133 {
+00134 m_ctrl.MousePos.x = LOWORD(lParam);
+00135 m_ctrl.MousePos.y = HIWORD(lParam);
+00136
+00137 RECT client, parent;
+00138
+00139 ClientToScreen (&amp;m_ctrl.MousePos);
+00140 m_ctrl.ScreenToClient (&amp;m_ctrl.MousePos);
+00141
+00142 m_ctrl.GetWindowRect(&amp;client);
+00143 GetWindowRect(&amp;parent);
+00144 <font class="keywordflow">if</font> (m_ctrl.MousePos.x&lt;0)
+00145 m_ctrl.MousePos.x=0;
+00146 <font class="keywordflow">if</font> (m_ctrl.MousePos.x&gt;client.right-client.left)
+00147 m_ctrl.MousePos.x=client.right-client.left;
+00148 <font class="keywordflow">if</font> (m_ctrl.MousePos.y&lt;0)
+00149 m_ctrl.MousePos.y=0;
+00150 <font class="keywordflow">if</font> (m_ctrl.MousePos.y&gt;client.bottom-client.top)
+00151 m_ctrl.MousePos.y=client.bottom-client.top;
+00152
+00153 m_ctrl.ClientToScreen (&amp;m_ctrl.MousePos);
+00154 ScreenToClient (&amp;m_ctrl.MousePos);
+00155
+00156 <font class="keywordflow">if</font> (lbutton) <font class="comment">//on dessine le carre de selection</font>
+00157 {
+00158 selection = 1;
+00159 RECT current;
+00160 SIZE size; size.cx = size.cy = 1;
+00161 current.left = OriginalPos.x;
+00162 current.top = OriginalPos.y;
+00163 current.right = m_ctrl.MousePos.x;
+00164 current.bottom = m_ctrl.MousePos.y;
+00165 <font class="keywordflow">if</font> (current.left&gt;current.right) {<font class="keywordtype">int</font> temp = current.left; current.left = current.right; current.right = temp;}
+00166 <font class="keywordflow">if</font> (current.top&gt;current.bottom) {<font class="keywordtype">int</font> temp = current.bottom; current.bottom = current.top; current.top = temp;}
+00167
+00168 CDC *pDC = GetDC();
+00169 m_ctrl.<a class="code" href="class_CTView.html#a18">DrawDragRect</a>(pDC,NULL,size,&amp;last_sel,size); <font class="comment">//on efface l'ancien carre</font>
+00170
+00171 m_ctrl.<a class="code" href="class_CTView.html#a17">UpdateSelection</a>(&amp;current, wParam, m_128x128); <font class="comment">//on affiche les modifes</font>
+00172
+00173 m_ctrl.<a class="code" href="class_CTView.html#a18">DrawDragRect</a>(pDC,&amp;current,size,NULL,size); <font class="comment">//on affiche le nouveau carre</font>
+00174 ::ReleaseDC(*<font class="keyword">this</font>,*pDC);
+00175
+00176 last_sel = current;
+00177 }
+00178 }
+00179 <font class="keywordflow">if</font> (message==WM_DROPFILES)
+00180 {
+00181 m_ctrl.PostMessage(WM_DROPFILES,wParam,lParam);
+00182 }
+00183 <font class="keywordflow">if</font> (message==WM_COMMAND &amp;&amp; !thread_actif)
+00184 {
+00185 <font class="keywordtype">int</font> button = LOWORD(wParam);
+00186 <font class="keywordflow">if</font> (button==IDC_ZOOM1 || button==IDC_ZOOM2 || button==IDC_ZOOM3)
+00187 {
+00188 m_ctrl.Zoom = button - IDC_ZOOM1 +1;
+00189 m_ctrl.<a class="code" href="class_CTView.html#a19">UpdateSize</a>(m_128x128);
+00190 m_ctrl.scrollpos = 0;
+00191 SetScrollPos(SB_VERT,0,<font class="keyword">true</font>);
+00192 m_ctrl.RedrawWindow();
+00193 }
+00194 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (button==IDC_INFONUM)
+00195 {
+00196 m_ctrl.InfoTexte = 1;
+00197 m_ctrl.RedrawWindow();
+00198 }
+00199 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (button==IDC_FILENAME)
+00200 {
+00201 m_ctrl.InfoTexte =2;
+00202 m_ctrl.RedrawWindow();
+00203 }
+00204 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (button==IDC_GROUP)
+00205 {
+00206 m_ctrl.InfoTexte = 3;
+00207 m_ctrl.RedrawWindow();
+00208 }
+00209 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (button&gt;=10 &amp;&amp; button&lt;=15)
+00210 m_ctrl.PostMessage(WM_COMMAND,wParam,lParam);
+00211 }
+00212 <font class="keywordflow">if</font> (message==WM_LBUTTONDOWN)
+00213 {
+00214 <font class="keywordtype">int</font> xPos = LOWORD(lParam); <font class="comment">// horizontal position of cursor </font>
+00215 <font class="keywordtype">int</font> yPos = HIWORD(lParam); <font class="comment">// vertical position of cursor </font>
+00216
+00217 <font class="keywordflow">if</font> (lbutton) <font class="comment">//on dessine le carre de selection</font>
+00218 {
+00219 selection = 1;
+00220 RECT current;
+00221 SIZE size; size.cx = size.cy = 1;
+00222 current.left = OriginalPos.x;
+00223 current.top = OriginalPos.y;
+00224 current.right = m_ctrl.MousePos.x;
+00225 current.bottom = m_ctrl.MousePos.y;
+00226 <font class="keywordflow">if</font> (current.left&gt;current.right) {<font class="keywordtype">int</font> temp = current.left; current.left = current.right; current.right = temp;}
+00227 <font class="keywordflow">if</font> (current.top&gt;current.bottom) {<font class="keywordtype">int</font> temp = current.bottom; current.bottom = current.top; current.top = temp;}
+00228
+00229 CDC *pDC = GetDC();
+00230 m_ctrl.<a class="code" href="class_CTView.html#a18">DrawDragRect</a>(pDC,NULL,size,&amp;last_sel,size); <font class="comment">//on efface l'ancien carre</font>
+00231
+00232 m_ctrl.<a class="code" href="class_CTView.html#a17">UpdateSelection</a>(&amp;current,wParam, m_128x128); <font class="comment">//on affiche les modifes</font>
+00233
+00234 ::ReleaseDC(*<font class="keyword">this</font>,*pDC);
+00235
+00236 last_sel = current;
+00237 }
+00238
+00239 RECT p,rect; p.left = m_ctrl.MousePos.x; p.top = m_ctrl.MousePos.y;
+00240 ClientToScreen(&amp;p);
+00241 m_ctrl.GetClientRect(&amp;rect);
+00242 POINT pt; pt.x = p.left; pt.y = p.top;
+00243 m_ctrl.ScreenToClient(&amp;pt);
+00244 <font class="keywordflow">if</font> (pt.x&gt;=rect.left &amp;&amp; pt.x&lt;rect.right &amp;&amp; pt.y&gt;=rect.top &amp;&amp; pt.y&lt;rect.bottom)
+00245 {
+00246 m_ctrl.SetFocus();
+00247 <font class="keywordtype">int</font> index = m_ctrl.<a class="code" href="class_CTView.html#a14">GetIndex</a>(&amp;pt, m_128x128);
+00248 <font class="keywordflow">if</font> (index!=-1 &amp;&amp; !(wParam&amp;MK_SHIFT)<font class="comment">/* &amp;&amp; !(wParam&amp;MK_CONTROL)*/</font>)
+00249 {
+00250 tilelist::iterator p = m_ctrl.InfoList.Get(index, m_128x128);
+00251 <font class="keywordflow">if</font> (p!=m_ctrl.InfoList.GetLast(m_128x128))
+00252 {
+00253 tilelist::iterator pp = p;
+00254 <font class="keywordflow">if</font> (wParam&amp;MK_CONTROL)
+00255 p-&gt;Selected = p-&gt;Selected?0:7;
+00256 <font class="keywordflow">else</font>
+00257 p-&gt;Selected = 1;
+00258 CDC *pDC = NULL;
+00259 <font class="keywordtype">int</font> indexx=0;
+00260 <font class="keywordflow">for</font> (p=m_ctrl.InfoList.GetFirst(m_128x128);p!=m_ctrl.InfoList.GetLast(m_128x128);++p, indexx++)
+00261 {
+00262 <font class="keywordflow">if</font> (p!=pp &amp;&amp; p-&gt;Selected)
+00263 {
+00264 <font class="keywordflow">if</font> (!(wParam&amp;MK_CONTROL))
+00265 {
+00266 p-&gt;Selected = 0;
+00267 <font class="keywordflow">if</font> (pDC==NULL) pDC = m_ctrl.GetDC();
+00268 m_ctrl.<a class="code" href="class_CTView.html#a4">DrawTile</a>(p,pDC,1,m_128x128);
+00269 }
+00270 }
+00271 <font class="keywordflow">else</font>
+00272 {
+00273 <font class="keywordflow">if</font> (p==pp)
+00274 {
+00275 <font class="keywordflow">if</font> (pDC==NULL) pDC = m_ctrl.GetDC();
+00276 m_ctrl.<a class="code" href="class_CTView.html#a4">DrawTile</a>(p,pDC,1,m_128x128);
+00277 }
+00278 }
+00279 }
+00280 <font class="keywordflow">if</font> (pDC) ::ReleaseDC(*<font class="keyword">this</font>,*pDC);
+00281 }
+00282 }
+00283 <font class="keywordflow">else</font>
+00284 {
+00285 <font class="keywordflow">if</font> (!(wParam&amp;MK_CONTROL) &amp;&amp; !(wParam&amp;MK_SHIFT))
+00286 {
+00287 tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);
+00288 CDC *pDC = NULL;
+00289 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i = 0; i&lt;m_ctrl.InfoList.GetSize(m_128x128); i++)
+00290 {
+00291 <font class="keywordflow">if</font> (p-&gt;Selected)
+00292 {
+00293 <font class="keywordflow">if</font> (pDC==NULL) pDC = m_ctrl.GetDC();
+00294 <font class="comment">//m_ctrl.InfoList.setSelection (i, 0);</font>
+00295 p-&gt;Selected = 0;
+00296 m_ctrl.<a class="code" href="class_CTView.html#a4">DrawTile</a>(p,pDC,1,m_128x128);
+00297 }
+00298 p++;
+00299 }
+00300 <font class="keywordflow">if</font> (pDC) ::ReleaseDC(*<font class="keyword">this</font>,*pDC);
+00301 }
+00302 }
+00303 lbutton = 1;
+00304
+00305 SIZE size; size.cx = size.cy = 1;
+00306
+00307 last_sel.top = xPos;
+00308 last_sel.left = yPos;
+00309 last_sel.bottom = xPos;
+00310 last_sel.right = yPos;
+00311 OriginalPos.x=xPos;
+00312 OriginalPos.y=yPos;
+00313 }
+00314 }
+00315 <font class="keywordflow">if</font> (message==WM_LBUTTONUP || message==WM_NCLBUTTONUP)
+00316 {
+00317 RECT p; p.left = m_ctrl.MousePos.x; p.top = m_ctrl.MousePos.y;
+00318 ClientToScreen(&amp;p);
+00319 POINT pt; pt.x = p.left; pt.y = p.top;
+00320 m_ctrl.ScreenToClient(&amp;pt);
+00321 <font class="keywordtype">int</font> index = m_ctrl.<a class="code" href="class_CTView.html#a14">GetIndex</a>(&amp;pt, m_128x128);
+00322 <font class="keywordflow">if</font> (!selection &amp;&amp; index!=-1)
+00323 {
+00324 <font class="keywordtype">int</font> i = 0;
+00325 }
+00326 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (selection)
+00327 {
+00328 CDC *pDC = GetDC();
+00329 CSize size; size.cx = size.cy = 1;
+00330 m_ctrl.<a class="code" href="class_CTView.html#a18">DrawDragRect</a>(pDC,NULL,size,&amp;last_sel,size);
+00331 ::ReleaseDC(*<font class="keyword">this</font>,*pDC);
+00332 <font class="keywordtype">int</font> index=0;
+00333 <font class="keywordflow">for</font> (tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);p!=m_ctrl.InfoList.GetLast(m_128x128);++p, index++)
+00334 {
+00335 <font class="keywordflow">if</font> (p-&gt;Selected&amp;3)
+00336 {
+00337 p-&gt;Selected=2;
+00338 }
+00339 <font class="keywordflow">else</font>
+00340 p-&gt;Selected = 0;
+00341 }
+00342 }
+00343 selection =0;
+00344 lbutton = 0;
+00345 }
+00346 <font class="keywordflow">if</font> (message==WM_KEYDOWN)
+00347 {
+00348 <font class="keywordtype">int</font> toto = 0;
+00349 }
+00350 <font class="keywordflow">if</font> (message==WM_SIZE &amp;&amp; m_ctrl.count_ )
+00351 {
+00352 <font class="keywordtype">int</font> x = LOWORD(lParam);
+00353 <font class="keywordtype">int</font> y = HIWORD(lParam);
+00354
+00355 <font class="keywordtype">int</font> i = <a class="code" href="nel_patch_mesh_cpp.html#a0">max</a> (1, m_ctrl.<a class="code" href="class_CTView.html#a12">GetNbTileLine</a>());
+00356 <font class="keywordtype">int</font> j = <a class="code" href="nel_patch_mesh_cpp.html#a0">max</a> (1, m_ctrl.<a class="code" href="class_CTView.html#a13">GetNbTileColumn</a>());
+00357 <font class="keywordtype">int</font> pos = m_ctrl.GetScrollPos(SB_VERT);
+00358 <font class="keywordtype">int</font> hview = (m_ctrl.InfoList.GetSize(m_128x128)/i + 1)*(m_ctrl.sizeicon_y + m_ctrl.spacing_y) + m_ctrl.spacing_y;
+00359 m_ctrl.scrollpos = (pos*hview)/SCROLL_MAX;
+00360
+00361 RECT clientrect,rect;
+00362 m_ctrl.GetWindowRect(&amp;clientrect);
+00363 InvalidateRect(NULL,<font class="keyword">false</font>);
+00364 GetWindowRect(&amp;rect);
+00365 m_ctrl.SetWindowPos(NULL, 0, 0, max (100, x - 120), y - 20, SWP_NOMOVE);
+00366 <font class="keywordtype">int</font> iFirst,iLast;
+00367 m_ctrl.<a class="code" href="class_CTView.html#a11">GetVisibility</a>(iFirst, iLast, m_128x128);
+00368 m_ctrl.<a class="code" href="class_CTView.html#a20">UpdateBar</a>(iFirst, iLast, m_128x128);
+00369 <font class="keywordflow">return</font> 0;
+00370 }
+00371 <font class="keywordflow">if</font> (message==WM_VSCROLL || message==WM_MOUSEWHEEL)
+00372 {
+00373 SCROLLINFO inf;
+00374 RECT rect_scroll,rect_clip;
+00375 <font class="keywordtype">int</font> scrollcode,pos;
+00376 inf.fMask = SIF_ALL;
+00377 GetScrollInfo(SB_VERT,&amp;inf);
+00378 m_ctrl.GetClientRect(&amp;rect_scroll);
+00379 <font class="keywordtype">int</font> i = m_ctrl.<a class="code" href="class_CTView.html#a12">GetNbTileLine</a>();
+00380 <font class="keywordtype">int</font> hview = (m_ctrl.InfoList.GetSize(m_128x128)/i + 2)*(m_ctrl.sizeicon_y + m_ctrl.spacing_y) + m_ctrl.spacing_y;
+00381
+00382 <font class="keywordflow">if</font> (message==WM_MOUSEWHEEL)
+00383 {
+00384 <font class="keywordtype">int</font> inc = ((<font class="keywordtype">int</font>)(<font class="keywordtype">short</font>)HIWORD(wParam))/WHEEL_DELTA;
+00385 pos = inf.nPos - inc*(((m_ctrl.sizeicon_y+m_ctrl.spacing_y)*SCROLL_MAX)/(hview - m_ctrl.spacing_y));
+00386 }
+00387 <font class="keywordflow">else</font>
+00388 {
+00389 scrollcode = LOWORD(wParam);
+00390 pos = inf.nTrackPos;
+00391 <font class="keywordflow">switch</font> (scrollcode)
+00392 {
+00393 <font class="keywordflow">case</font> SB_BOTTOM:
+00394 pos = SCROLL_MAX - inf.nPage;
+00395 <font class="keywordflow">break</font>;
+00396 <font class="keywordflow">case</font> SB_PAGEDOWN:
+00397 pos = inf.nPos + inf.nPage;
+00398 <font class="keywordflow">break</font>;
+00399 <font class="keywordflow">case</font> SB_PAGEUP:
+00400 pos = inf.nPos - inf.nPage;
+00401 <font class="keywordflow">break</font>;
+00402 <font class="keywordflow">case</font> SB_LINEUP:
+00403 pos = inf.nPos - (((m_ctrl.sizeicon_y+m_ctrl.spacing_y)*SCROLL_MAX)/(hview - m_ctrl.spacing_y));
+00404 <font class="keywordflow">break</font>;
+00405 <font class="keywordflow">case</font> SB_LINEDOWN:
+00406 pos = inf.nPos + (((m_ctrl.sizeicon_y+m_ctrl.spacing_y)*SCROLL_MAX)/(hview - m_ctrl.spacing_y));
+00407 <font class="keywordflow">break</font>;
+00408 <font class="keywordflow">case</font> SB_TOP:
+00409 pos = 0;
+00410 <font class="keywordflow">break</font>;
+00411 <font class="keywordflow">case</font> SB_THUMBPOSITION:
+00412 <font class="keywordflow">case</font> SB_ENDSCROLL:
+00413 pos = inf.nPos;
+00414 <font class="keywordflow">break</font>;
+00415 }
+00416 }
+00417
+00418 <font class="keywordflow">if</font> (pos&lt;0) pos = 0;
+00419 <font class="keywordflow">if</font> (pos&gt;(SCROLL_MAX - (<font class="keywordtype">int</font>)inf.nPage))
+00420 pos = SCROLL_MAX - inf.nPage;
+00421
+00422 SetScrollPos(SB_VERT,pos,1);
+00423 rect_scroll.bottom -= rect_scroll.top;
+00424 rect_scroll.top = 0;
+00425 rect_clip = rect_scroll;
+00426 <font class="keywordtype">int</font> scroll_pixel = m_ctrl.scrollpos;
+00427 <font class="keywordtype">int</font> old_iFV,old_iLV;
+00428 m_ctrl.<a class="code" href="class_CTView.html#a11">GetVisibility</a>(old_iFV, old_iLV, m_128x128);
+00429 m_ctrl.scrollpos = (pos*hview)/(SCROLL_MAX);
+00430 <font class="keywordtype">int</font> iFV,iLV;
+00431 m_ctrl.<a class="code" href="class_CTView.html#a11">GetVisibility</a>(iFV, iLV, m_128x128);
+00432
+00433 <font class="keywordflow">if</font> (iFV&gt;old_iLV || iLV&lt;old_iFV || scrollcode==SB_PAGEDOWN || scrollcode==SB_PAGEUP)
+00434 {
+00435 m_ctrl.RedrawWindow();
+00436 }
+00437 <font class="keywordflow">else</font>
+00438 {
+00439 scroll_pixel -= m_ctrl.scrollpos;
+00440 <font class="keywordflow">if</font> (scroll_pixel)
+00441 {
+00442 CDC *pDC = m_ctrl.GetDC();
+00443 <font class="keywordflow">if</font> (abs(scroll_pixel)&gt;(rect_clip.bottom - rect_clip.top)) scroll_pixel = 0;
+00444 <font class="keywordflow">else</font> pDC-&gt;ScrollDC(0,scroll_pixel,&amp;rect_scroll,&amp;rect_clip,NULL,NULL);
+00445
+00446 tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);
+00447 CBrush brush (GetSysColor(COLOR_3DFACE));
+00448 <font class="keywordflow">if</font> (scroll_pixel&lt;0)
+00449 {
+00450 rect_scroll.top = rect_scroll.bottom + scroll_pixel;
+00451 pDC-&gt;FillRect(&amp;rect_scroll,&amp;brush);
+00452 <font class="keywordflow">if</font> ((iLV-i)&lt;iFV) i = iLV - iFV;
+00453 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> k = 0;k&lt;old_iLV-i;k++) p++;
+00454 <font class="keywordflow">for</font> (k=old_iLV - i;k&lt;=iLV;k++)
+00455 {
+00456 m_ctrl.<a class="code" href="class_CTView.html#a4">DrawTile</a>(p,pDC,0,m_128x128);
+00457 p++;
+00458 }
+00459 }
+00460 <font class="keywordflow">else</font>
+00461 {
+00462 rect_scroll.bottom = rect_scroll.top + scroll_pixel;
+00463 pDC-&gt;FillRect(&amp;rect_scroll,&amp;brush);
+00464 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> k = 0;k&lt;iFV;k++) p++;
+00465 <font class="keywordflow">for</font> (k = iFV;k&lt;(old_iFV+i);k++)
+00466 {
+00467 m_ctrl.<a class="code" href="class_CTView.html#a4">DrawTile</a>(p,pDC,0,m_128x128);
+00468 p++;
+00469 }
+00470 }
+00471 ::ReleaseDC(m_ctrl,*pDC);
+00472 }
+00473 }
+00474 m_ctrl.lastVBarPos = pos;
+00475 }
+00476 <font class="keywordflow">if</font> (message==WM_CLOSE)
+00477 {
+00478 ccount=0;
+00479 this-&gt;m_ctrl.count_=0;
+00480 <a class="code" href="class_Browse.html#a4">OnDestroy</a>();
+00481 }
+00482 <font class="keywordflow">if</font> (message==WM_LBUTTONDBLCLK)
+00483 {
+00484 m_ctrl.SendMessage(WM_LBUTTONDBLCLK,wParam,lParam);
+00485 }
+00486 pDialog=<font class="keyword">this</font>;
+00487 <font class="keywordflow">return</font> CDialog::WindowProc(message, wParam, lParam);
+00488 }
+00489
+00490
+<a name="l00491"></a><a class="code" href="class_Browse.html#d0">00491</a> <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> <a class="code" href="class_Browse.html#d0">Browse::MyControllingFunction</a>( <font class="keywordtype">void</font>* pParam )<font class="keyword">
+</font>00492 <font class="keyword"></font>{
+00493 thread_actif = 1;
+00494 <a class="code" href="class_Browse.html">Browse</a> *br = (<a class="code" href="class_Browse.html">Browse</a>*)pParam;
+00495 br-&gt;m_ctrl.lockInsertion = 1;
+00496 <font class="keywordtype">int</font> iFV,iLV;
+00497 br-&gt;m_ctrl.GetVisibility(iFV, iLV, br-&gt;m_128x128);
+00498 br-&gt;m_ctrl.UpdateBar(iFV, iLV, br-&gt;m_128x128);
+00499 tilelist::iterator p = br-&gt;m_ctrl.InfoList.GetFirst(br-&gt;m_128x128);
+00500 tilelist::iterator plast = p;
+00501 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0;i&lt;br-&gt;m_ctrl.InfoList.GetSize(br-&gt;m_128x128);i++)
+00502 {
+00503 <font class="keywordtype">int</font> *ld;
+00504 <font class="keywordtype">int</font> rot=0;
+00505 std::string path;
+00506 LPBITMAPINFO pBmp;
+00507 std::vector&lt;NLMISC::CBGRA&gt;* bits;
+00508
+00509 <font class="keywordflow">switch</font> (br-&gt;m_128x128)
+00510 {
+00511 <font class="keywordflow">case</font> 0:
+00512 path = tileBank2.getTile (tileBank2.getTileSet (br-&gt;m_ctrl.InfoList._tileSet)-&gt;getTile128 (i))-&gt;
+00513 getRelativeFileName ((CTile::TBitmap)(br-&gt;m_ctrl.Texture-1));
+00514 <font class="keywordflow">break</font>;
+00515 <font class="keywordflow">case</font> 1:
+00516 path = tileBank2.getTile (tileBank2.getTileSet (br-&gt;m_ctrl.InfoList._tileSet)-&gt;getTile256 (i))-&gt;
+00517 getRelativeFileName ((CTile::TBitmap)(br-&gt;m_ctrl.Texture-1));
+00518 <font class="keywordflow">break</font>;
+00519 <font class="keywordflow">case</font> 2:
+00520 {
+00521 <font class="keywordtype">int</font> index=tileBank2.getTileSet (br-&gt;m_ctrl.InfoList._tileSet)-&gt;getTransition (i)-&gt;getTile();
+00522 <font class="keywordflow">if</font> (index!=-1)
+00523 {
+00524 path = tileBank2.getTile (index)-&gt;getRelativeFileName ((CTile::TBitmap)(br-&gt;m_ctrl.Texture-1));
+00525 <font class="keywordflow">if</font> (br-&gt;m_ctrl.Texture==3)
+00526 rot = tileBank2.getTile (index)-&gt;getRotAlpha ();
+00527 }
+00528 <font class="keywordflow">else</font>
+00529 path = <font class="stringliteral">""</font>;
+00530 }
+00531 <font class="keywordflow">break</font>;
+00532 <font class="keywordflow">case</font> 3:
+00533 <font class="comment">// Get diaplcement filename</font>
+00534 path = tileBank2.getTileSet (br-&gt;m_ctrl.InfoList._tileSet)-&gt;getDisplacementFileName((CTileSet::TDisplacement)i);
+00535 <font class="keywordflow">break</font>;
+00536 }
+00537 std::vector&lt;NLMISC::CBGRA&gt;* pAlpha=NULL;
+00538 <font class="keywordflow">switch</font> (br-&gt;m_ctrl.Texture)
+00539 {
+00540 <font class="keywordflow">case</font> 1:
+00541 ld = &amp;p-&gt;loaded;
+00542 pBmp = &amp;p-&gt;BmpInfo;
+00543 bits = &amp;p-&gt;Bits;
+00544 pAlpha = &amp;p-&gt;alphaBits;
+00545 <font class="keywordflow">break</font>;
+00546 <font class="keywordflow">case</font> 2:
+00547 ld = &amp;p-&gt;nightLoaded;
+00548 pBmp = &amp;p-&gt;nightBmpInfo;
+00549 bits = &amp;p-&gt;nightBits;
+00550 pAlpha = &amp;p-&gt;alphaBits;
+00551 <font class="keywordflow">break</font>;
+00552 <font class="keywordflow">case</font> 3:
+00553 ld = &amp;p-&gt;alphaLoaded;
+00554 pBmp = &amp;p-&gt;alphaBmpInfo;
+00555 bits = &amp;p-&gt;alphaBits;
+00556 <font class="keywordflow">break</font>;
+00557 }
+00558
+00559 <font class="keywordflow">if</font> ((path!=<font class="stringliteral">""</font>) &amp;&amp; <a class="code" href="TileCtrl_h.html#a19">_LoadBitmap</a>(tileBank2.getAbsPath() + path, pBmp, *bits, pAlpha, rot))
+00560 {
+00561 *ld=1;
+00562 <font class="keywordtype">int</font> iFV,iLV; br-&gt;m_ctrl.GetVisibility(iFV, iLV, br-&gt;m_128x128);
+00563 <font class="keywordflow">if</font> (i&lt;=iLV &amp;&amp; i&gt;=iFV)
+00564 {
+00565 CDC *pDC = br-&gt;m_ctrl.GetDC();
+00566 br-&gt;m_ctrl.DrawTile(p,pDC,1,br-&gt;m_128x128);
+00567 ::ReleaseDC(*br,*pDC);
+00568 }
+00569 }
+00570 p++;
+00571 }
+00572 br-&gt;m_ctrl.lockInsertion = 0;
+00573 thread_actif = 0;
+00574 <font class="keywordflow">return</font> 1;
+00575 }
+00576
+<a name="l00577"></a><a class="code" href="class_Browse.html#a2">00577</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a2">Browse::LoadInThread</a>(<font class="keywordtype">void</font>)<font class="keyword">
+</font>00578 <font class="keyword"></font>{
+00579 <font class="keywordflow">if</font> (!thread_actif)
+00580 <a class="code" href="class_Browse.html#d0">MyControllingFunction</a> (<font class="keyword">this</font>);
+00581 }
+00582
+00583
+<a name="l00584"></a><a class="code" href="class_Browse.html#a1">00584</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a1">Browse::Init</a>()<font class="keyword">
+</font>00585 <font class="keyword"></font>{
+00586 UpdateData ();
+00587 lbutton = 0;
+00588 selection = 0;
+00589 control = 0;
+00590 m_ctrl.lockInsertion = 0; oldsel = -1;
+00591 HKEY regkey;
+00592 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> value;
+00593 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> type;
+00594 <font class="keywordtype">int</font> cx=-1,cy=-1,x=-1,y=-1;
+00595 <font class="keywordtype">char</font> sWindowpl[256];
+00596
+00597 <font class="keywordflow">if</font> (RegOpenKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,&amp;regkey)==ERROR_SUCCESS)
+00598 {
+00599 value=256;
+00600 type=REG_SZ;
+00601 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_WNDPL,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;sWindowpl,&amp;value)==ERROR_SUCCESS)
+00602 {
+00603 WINDOWPLACEMENT wndpl;
+00604 sscanf(sWindowpl,<font class="stringliteral">"%d %d %d %d %d %d %d %d %d %d"</font>,
+00605 &amp;wndpl.flags,
+00606 &amp;wndpl.ptMaxPosition.x,&amp;wndpl.ptMaxPosition.y,
+00607 &amp;wndpl.ptMinPosition.x,&amp;wndpl.ptMinPosition.y,
+00608 &amp;wndpl.rcNormalPosition.bottom,&amp;wndpl.rcNormalPosition.left,&amp;wndpl.rcNormalPosition.right,&amp;wndpl.rcNormalPosition.top,
+00609 &amp;wndpl.showCmd);
+00610 wndpl.length = <font class="keyword">sizeof</font>(WINDOWPLACEMENT);
+00611 this-&gt;SetWindowPlacement(&amp;wndpl);
+00612 }
+00613 value=256;
+00614 type=REG_SZ;
+00615 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_LASTPATH,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;sWindowpl,&amp;value)!=ERROR_SUCCESS)
+00616 m_ctrl.LastPath=<font class="stringliteral">""</font>;
+00617 <font class="keywordflow">else</font>
+00618 m_ctrl.LastPath=(<font class="keyword">const</font> <font class="keywordtype">char</font>*)sWindowpl;
+00619 value=4;
+00620 type=REG_DWORD;
+00621 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_BUTTONZOOM,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;m_ctrl.Zoom,&amp;value)!=ERROR_SUCCESS)
+00622 m_ctrl.Zoom = 3;
+00623 value=4;
+00624 type=REG_DWORD;
+00625 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_BUTTONVARIETY,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;m_128x128,&amp;value)!=ERROR_SUCCESS)
+00626 m_128x128 = 0;
+00627 value=4;
+00628 type=REG_DWORD;
+00629 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_BUTTONTEXTURE,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;m_ctrl.Texture,&amp;value)!=ERROR_SUCCESS)
+00630 m_ctrl.Texture = 1;
+00631 value=4;
+00632 type=REG_DWORD;
+00633 <font class="keywordflow">if</font> (RegQueryValueEx(regkey,REGKEY_BUTTONTEXTINFO,0,&amp;type,(<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *)&amp;m_ctrl.InfoTexte,&amp;value)!=ERROR_SUCCESS)
+00634 m_ctrl.InfoTexte = 1;
+00635 RegCloseKey(regkey);
+00636 }
+00637 CButton *button = (CButton*)GetDlgItem(IDC_ZOOM1 + m_ctrl.Zoom -1);
+00638 button-&gt;SetCheck(1);
+00639 button = (CButton*)GetDlgItem(IDC_JOUR + m_ctrl.Texture -1);
+00640 button-&gt;SetCheck(1);
+00641 button = (CButton*)GetDlgItem(IDC_INFONUM + m_ctrl.InfoTexte -1);
+00642 button-&gt;SetCheck(1);
+00643 <font class="keywordflow">if</font> (cx!=-1 &amp;&amp; cy!=-1 &amp;&amp; x!=-1 &amp;&amp; y!=-1) SetWindowPos(0,x,y,cx,cy,0);
+00644
+00645 m_ctrl.<a class="code" href="class_CTView.html#a2">Init</a>(land, m_128x128);
+00646 <a class="code" href="class_SelectionTerritoire.html">SelectionTerritoire</a> *slt = (<a class="code" href="class_SelectionTerritoire.html">SelectionTerritoire</a>*)GetParent();
+00647 ccount=1;
+00648
+00649 RECT rect;
+00650 this-&gt;GetWindowRect(&amp;rect);
+00651 SendMessage(WM_SIZE,rect.right - rect.left,rect.bottom - rect.top); <font class="comment">//force resize</font>
+00652
+00653 <a class="code" href="class_SelectionTerritoire.html">SelectionTerritoire</a> *parent = (<a class="code" href="class_SelectionTerritoire.html">SelectionTerritoire</a>*)GetParent();
+00654
+00655 <font class="comment">// The land </font>
+00656 CTileSet *tileSet=tileBank2.getTileSet (land);
+00657
+00658 <font class="comment">// 128</font>
+00659 m_ctrl.InfoList.theList128.resize (tileSet-&gt;getNumTile128 ());
+00660 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i&lt;tileSet-&gt;getNumTile128 (); i++)
+00661 {
+00662 m_ctrl.InfoList.theList128[i].id=i;
+00663 m_ctrl.InfoList.theList128[i].Selected=0;
+00664 m_ctrl.InfoList.theList128[i].loaded=0;
+00665 m_ctrl.InfoList.theList128[i].nightLoaded=0;
+00666 m_ctrl.InfoList.theList128[i].alphaLoaded=0;
+00667 }
+00668 m_ctrl.InfoList.Reload (0, tileSet-&gt;getNumTile128 (), 0);
+00669
+00670 <font class="comment">// 256</font>
+00671 m_ctrl.InfoList.theList256.resize (tileSet-&gt;getNumTile256 ());
+00672 <font class="keywordflow">for</font> (i=0; i&lt;tileSet-&gt;getNumTile256 (); i++)
+00673 {
+00674 m_ctrl.InfoList.theList256[i].id=i;
+00675 m_ctrl.InfoList.theList256[i].Selected=0;
+00676 m_ctrl.InfoList.theList256[i].loaded=0;
+00677 m_ctrl.InfoList.theList256[i].nightLoaded=0;
+00678 m_ctrl.InfoList.theList256[i].alphaLoaded=0;
+00679 }
+00680 m_ctrl.InfoList.Reload (0, tileSet-&gt;getNumTile256 (), 1);
+00681
+00682 <font class="comment">// Transition</font>
+00683 <font class="keywordflow">for</font> (i=0; i&lt;CTileSet::count; i++)
+00684 {
+00685 m_ctrl.InfoList.theListTransition[i].id=i;
+00686 m_ctrl.InfoList.theListTransition[i].Selected=0;
+00687 m_ctrl.InfoList.theListTransition[i].loaded=0;
+00688 m_ctrl.InfoList.theListTransition[i].nightLoaded=0;
+00689 m_ctrl.InfoList.theListTransition[i].alphaLoaded=0;
+00690 }
+00691 m_ctrl.InfoList.Reload (0, CTileSet::count, 2);
+00692
+00693 <font class="comment">// Displacement</font>
+00694 <font class="keywordflow">for</font> (i=0; i&lt;CTileSet::CountDisplace; i++)
+00695 {
+00696 m_ctrl.InfoList.theListDisplacement[i].id=i;
+00697 m_ctrl.InfoList.theListDisplacement[i].Selected=0;
+00698 m_ctrl.InfoList.theListDisplacement[i].loaded=0;
+00699 m_ctrl.InfoList.theListDisplacement[i].nightLoaded=0;
+00700 m_ctrl.InfoList.theListDisplacement[i].alphaLoaded=0;
+00701 }
+00702 m_ctrl.InfoList.Reload (0, CTileSet::CountDisplace, 3);
+00703
+00704 CString fullpath = parent-&gt;DefautPath + parent-&gt;CurrentTerritory;
+00705
+00706 <a class="code" href="class_Browse.html#a2">LoadInThread</a>();
+00707 UpdateData (FALSE);
+00708
+00709 <a class="code" href="class_Browse.html#b5">OnChangeVariety</a>();
+00710 }
+00711
+00712
+00713
+<a name="l00714"></a><a class="code" href="class_Browse.html#b3">00714</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b3">Browse::OnSize</a>(UINT nType, <font class="keywordtype">int</font> cx, <font class="keywordtype">int</font> cy)<font class="keyword">
+</font>00715 <font class="keyword"></font>{
+00716 CDialog::OnSize(nType, cx, cy);
+00717 }
+00718
+<a name="l00719"></a><a class="code" href="class_Browse.html#b4">00719</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b4">Browse::OnAlpha</a> ()<font class="keyword">
+</font>00720 <font class="keyword"></font>{
+00721 <font class="comment">// TODO: Add your control notification handler code here</font>
+00722 m_ctrl.Texture = 3;
+00723 <a class="code" href="class_Browse.html#a2">LoadInThread</a>();
+00724 m_ctrl.RedrawWindow();
+00725 }
+00726
+<a name="l00727"></a><a class="code" href="class_Browse.html#b6">00727</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b6">Browse::OnJour</a> ()<font class="keyword">
+</font>00728 <font class="keyword"></font>{
+00729 <font class="comment">// TODO: Add your control notification handler code here</font>
+00730 m_ctrl.Texture = 1;
+00731 <a class="code" href="class_Browse.html#a2">LoadInThread</a>();
+00732 m_ctrl.RedrawWindow();
+00733 }
+00734
+<a name="l00735"></a><a class="code" href="class_Browse.html#b7">00735</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b7">Browse::OnNuit</a> ()<font class="keyword">
+</font>00736 <font class="keyword"></font>{
+00737 <font class="comment">// TODO: Add your control notification handler code here</font>
+00738 m_ctrl.Texture = 2;
+00739 <a class="code" href="class_Browse.html#a2">LoadInThread</a>();
+00740 m_ctrl.RedrawWindow();
+00741 }
+00742
+<a name="l00743"></a><a class="code" href="class_Browse.html#b8">00743</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b8">Browse::OnNum</a>()<font class="keyword">
+</font>00744 <font class="keyword"></font>{
+00745 <font class="comment">// TODO: Add your control notification handler code here</font>
+00746 m_ctrl.Sort = 1;
+00747 m_ctrl.SendMessage(WM_PAINT);
+00748 }
+00749
+<a name="l00750"></a><a class="code" href="class_Browse.html#b9">00750</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b9">Browse::OnCancel</a>()<font class="keyword">
+</font>00751 <font class="keyword"></font>{
+00752 <font class="comment">// TODO: Add your control notification handler code here</font>
+00753 <font class="keywordflow">if</font> (thread_actif) <font class="keywordflow">return</font>;
+00754
+00755 <font class="keywordflow">if</font> (::MessageBox (NULL, <font class="stringliteral">"Are you sure you want to cancel?"</font>, <font class="stringliteral">"Cancel"</font>, MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES)
+00756 {
+00757 this-&gt;SendMessage(WM_CLOSE);
+00758 CDialog::OnCancel();
+00759 <font class="comment">/*
+</font>00760 <font class="comment"> EndDialog(0);*/</font>
+00761 }
+00762 }
+00763
+<a name="l00764"></a><a class="code" href="class_Browse.html#a3">00764</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a3">Browse::UpdateAll</a>(<font class="keywordtype">void</font>)<font class="keyword">
+</font>00765 <font class="keyword"></font>{
+00766
+00767 }
+00768
+<a name="l00769"></a><a class="code" href="class_Browse.html#a4">00769</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a4">Browse::OnDestroy</a>()<font class="keyword">
+</font>00770 <font class="keyword"></font>{
+00771 <font class="comment">// TODO: Add your control notification handler code here</font>
+00772 HKEY regkey;
+00773 WINDOWPLACEMENT wndpl;
+00774 this-&gt;GetWindowPlacement(&amp;wndpl);
+00775 <font class="keywordtype">char</font> sWindowpl[256];
+00776 sprintf(sWindowpl,<font class="stringliteral">"%d %d %d %d %d %d %d %d %d %d"</font>,
+00777 wndpl.flags,
+00778 wndpl.ptMaxPosition.x,wndpl.ptMaxPosition.y,
+00779 wndpl.ptMinPosition.x,wndpl.ptMinPosition.y,
+00780 wndpl.rcNormalPosition.bottom,wndpl.rcNormalPosition.left,wndpl.rcNormalPosition.right,wndpl.rcNormalPosition.top,
+00781 wndpl.showCmd);
+00782 <font class="keywordflow">if</font> (RegCreateKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,&amp;regkey)==ERROR_SUCCESS)
+00783 {
+00784 <font class="comment">//int sel = ((CComboBox*)GetDlgItem(IDC_LISTTYPE))-&gt;GetCurSel();</font>
+00785 RegSetValueEx(regkey,REGKEY_WNDPL,0,REG_SZ,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)sWindowpl,strlen(sWindowpl));
+00786 RegSetValueEx(regkey,REGKEY_LASTPATH,0,REG_SZ,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)m_ctrl.LastPath.c_str(),strlen(m_ctrl.LastPath.c_str()));
+00787 RegSetValueEx(regkey,REGKEY_BUTTONZOOM,0,REG_DWORD,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)&amp;m_ctrl.Zoom,4);
+00788 RegSetValueEx(regkey,REGKEY_BUTTONVARIETY,0,REG_DWORD,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)&amp;m_128x128,4);
+00789 RegSetValueEx(regkey,REGKEY_BUTTONTEXTURE,0,REG_DWORD,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)&amp;m_ctrl.Texture,4);
+00790 RegSetValueEx(regkey,REGKEY_BUTTONSORT,0,REG_DWORD,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)&amp;m_ctrl.Sort,4);
+00791 RegSetValueEx(regkey,REGKEY_BUTTONTEXTINFO,0,REG_DWORD,(<font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font>*)&amp;m_ctrl.InfoTexte,4);
+00792 RegCloseKey(regkey);
+00793 }
+00794 }
+00795
+<a name="l00796"></a><a class="code" href="class_Browse.html#b10">00796</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b10">Browse::OnOk</a>()<font class="keyword">
+</font>00797 <font class="keyword"></font>{
+00798 <font class="comment">// TODO: Add your control notification handler code here</font>
+00799 <font class="keywordflow">if</font> (thread_actif) <font class="keywordflow">return</font>;
+00800
+00801 this-&gt;SendMessage(WM_CLOSE);
+00802 EndDialog(1);
+00803 }
+00804
+<a name="l00805"></a><a class="code" href="class_Browse.html#b11">00805</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b11">Browse::OnRButtonDown</a>(UINT nFlags, CPoint point)<font class="keyword">
+</font>00806 <font class="keyword"></font>{
+00807 <font class="comment">// TODO: Add your message handler code here and/or call default</font>
+00808 m_ctrl.PostMessage(WM_RBUTTONDOWN,point.x,point.y);
+00809 CDialog::OnRButtonDown(nFlags, point);
+00810 }
+00811
+<a name="l00812"></a><a class="code" href="class_Browse.html#b12">00812</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b12">Browse::OnSelchangeListtype</a>()<font class="keyword">
+</font>00813 <font class="keyword"></font>{
+00814 }
+00815
+<a name="l00816"></a><a class="code" href="class_Browse.html#b13">00816</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b13">Browse::OnUpdateTiles</a>()<font class="keyword">
+</font>00817 <font class="keyword"></font>{
+00818 <font class="comment">// TODO: Add your control notification handler code here</font>
+00819 <a class="code" href="class_Browse.html#a2">LoadInThread</a>();
+00820 }
+00821
+00822
+<a name="l00823"></a><a class="code" href="class_Browse.html#b5">00823</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b5">Browse::OnChangeVariety</a>()<font class="keyword">
+</font>00824 <font class="keyword"></font>{
+00825 UpdateData();
+00826 m_ctrl.<a class="code" href="class_CTView.html#a19">UpdateSize</a> (m_128x128);
+00827
+00828 <font class="comment">// Enable window</font>
+00829 GetDlgItem (IDC_JOUR)-&gt;EnableWindow (m_128x128!=3);
+00830 GetDlgItem (IDC_NUIT)-&gt;EnableWindow (m_128x128!=3);
+00831 GetDlgItem (IDC_ALPHA)-&gt;EnableWindow (m_128x128==2);
+00832 GetDlgItem (IDC_BATCH_LOAD)-&gt;EnableWindow (m_128x128==2);
+00833
+00834 <font class="keywordflow">if</font> ((m_ctrl.Texture==3)&amp;&amp;(m_128x128!=2))
+00835 {
+00836 m_ctrl.Texture=2;
+00837 ((CButton*)GetDlgItem (IDC_ALPHA))-&gt;SetCheck (0);
+00838 ((CButton*)GetDlgItem (IDC_NUIT))-&gt;SetCheck (1);
+00839 }
+00840
+00841 <font class="keywordflow">if</font> ((m_ctrl.Texture!=1)&amp;&amp;(m_128x128==3))
+00842 {
+00843 m_ctrl.Texture=1;
+00844 ((CButton*)GetDlgItem (IDC_ALPHA))-&gt;SetCheck (0);
+00845 ((CButton*)GetDlgItem (IDC_NUIT))-&gt;SetCheck (0);
+00846 ((CButton*)GetDlgItem (IDC_JOUR))-&gt;SetCheck (1);
+00847 }
+00848
+00849 m_ctrl.Invalidate ();
+00850 UpdateData(FALSE);
+00851 }
+00852
+<a name="l00853"></a><a class="code" href="class_Browse.html#b14">00853</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b14">Browse::OnBatchLoad</a> ()<font class="keyword">
+</font>00854 <font class="keyword"></font>{
+00855 CFileDialog sFile (<font class="keyword">true</font>, NULL, NULL, OFN_ENABLESIZING,
+00856 <font class="stringliteral">"Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||"</font>,NULL);
+00857
+00858 <font class="keywordflow">if</font> (sFile.DoModal()==IDOK)
+00859 {
+00860 <font class="keywordtype">char</font> sDrive[256];
+00861 <font class="keywordtype">char</font> sPath[256];
+00862 <font class="keywordtype">char</font> sName[256];
+00863 <font class="keywordtype">char</font> sExt[256];
+00864 _splitpath (sFile.GetPathName(), sDrive, sPath, sName, sExt);
+00865
+00866 <font class="comment">// look for some numbers..</font>
+00867 <font class="keywordtype">char</font> *sNumber=sName+strlen(sName)-1;
+00868 <font class="keywordflow">while</font> ((sNumber&gt;sName)&amp;&amp;(*sNumber&gt;=<font class="charliteral">'0'</font>)&amp;&amp;(*sNumber&lt;=<font class="charliteral">'9'</font>))
+00869 {
+00870 sNumber--;
+00871 }
+00872 sNumber[1]=0;
+00873
+00874 <font class="keywordtype">bool</font> rotate=<font class="keyword">false</font>;
+00875 <font class="keywordflow">if</font> (::MessageBox (NULL, <font class="stringliteral">"Do you want to use rotation to reuse alpha tiles ?"</font>, <font class="stringliteral">"Import rotated tiles"</font>, MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES)
+00876 rotate=<font class="keyword">true</font>;
+00877
+00878 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0; i&lt;CTileSet::count; i++)
+00879 {
+00880 <font class="keywordflow">if</font> (m_ctrl.Texture==3)
+00881 {
+00882 <font class="comment">// Current transition</font>
+00883 CTileSet::TTransition transition=(CTileSet::TTransition)i;
+00884
+00885 <font class="comment">// Transition to patch</font>
+00886 CTileSetTransition* trans=tileBank2.getTileSet (land)-&gt;getTransition (transition);
+00887 <font class="keywordflow">if</font> (tileBank2.getTile (trans-&gt;getTile())-&gt;getRelativeFileName (CTile::alpha)==<font class="stringliteral">""</font>)
+00888 {
+00889 <font class="comment">// Try to load transition with rotation</font>
+00890 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> rot=0; rot&lt;4; rot++)
+00891 {
+00892 <font class="comment">// Try to load a tile with a file name like /tiletransition0.tga</font>
+00893 <font class="keywordtype">char</font> sName2[256];
+00894 <font class="keywordtype">char</font> sFinal[256];
+00895 sprintf (sName2, <font class="stringliteral">"%s%02d"</font>, sName, (<font class="keywordtype">int</font>)transition);
+00896 _makepath (sFinal, sDrive, sPath, sName2, sExt);
+00897 FILE *pFile=fopen (sFinal, <font class="stringliteral">"rb"</font>);
+00898
+00899 <font class="comment">// Close the file and add the tile if opened</font>
+00900 <font class="keywordflow">if</font> (pFile)
+00901 {
+00902 fclose (pFile);
+00903 m_ctrl.InfoList.setTileTransitionAlpha (i, sFinal, (4-rot)%4);
+00904
+00905 <font class="comment">// End</font>
+00906 <font class="keywordflow">break</font>;
+00907 }
+00908
+00909 <font class="comment">// Rotate the transition</font>
+00910 transition=CTileSet::rotateTransition (transition);
+00911
+00912 <font class="keywordflow">if</font> (!rotate)
+00913 <font class="keywordflow">break</font>;
+00914 }
+00915 }
+00916 }
+00917 <font class="keywordflow">else</font>
+00918 {
+00919 <font class="comment">// Current transition</font>
+00920 CTileSet::TTransition transition=(CTileSet::TTransition)i;
+00921
+00922 <font class="comment">// Transition to patch</font>
+00923 CTileSetTransition* trans=tileBank2.getTileSet (land)-&gt;getTransition (transition);
+00924 <font class="keywordflow">if</font> (tileBank2.getTile (trans-&gt;getTile())-&gt;getRelativeFileName (m_ctrl.Texture==1?CTile::diffuse:CTile::additive)==<font class="stringliteral">""</font>)
+00925 {
+00926 <font class="comment">// Try to load a tile with a file name like /tiletransition0.tga</font>
+00927 <font class="keywordtype">char</font> sName2[256];
+00928 <font class="keywordtype">char</font> sFinal[256];
+00929 sprintf (sName2, <font class="stringliteral">"%s%02d"</font>, sName, (<font class="keywordtype">int</font>)transition);
+00930 _makepath (sFinal, sDrive, sPath, sName2, sExt);
+00931 FILE *pFile=fopen (sFinal, <font class="stringliteral">"rb"</font>);
+00932
+00933 <font class="comment">// Close the file and add the tile if opened</font>
+00934 <font class="keywordflow">if</font> (pFile)
+00935 {
+00936 fclose (pFile);
+00937 m_ctrl.InfoList.setTileTransition (i, sFinal, m_ctrl.Texture==1?CTile::diffuse:CTile::additive);
+00938 }
+00939 }
+00940 }
+00941 }
+00942 m_ctrl.Invalidate ();
+00943
+00944 }
+00945 }
+00946
+<a name="l00947"></a><a class="code" href="class_Browse.html#a5">00947</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a5">Browse::UpdateFlags</a> ()<font class="keyword">
+</font>00948 <font class="keyword"></font>{
+00949 SubGroup0=0;
+00950 SubGroup1=0;
+00951 SubGroup2=0;
+00952 SubGroup3=0;
+00953 SubGroup4=0;
+00954 SubGroup5=0;
+00955 SubGroup6=0;
+00956 SubGroup7=0;
+00957 SubGroup8=0;
+00958 SubGroup9=0;
+00959 SubGroup10=0;
+00960 SubGroup11=0;
+00961
+00962 <font class="comment">// Flags</font>
+00963 uint or=0, and=0xffffffff;
+00964 <font class="keywordtype">bool</font> find=<font class="keyword">false</font>;
+00965
+00966 <font class="comment">// For each </font>
+00967 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0;i&lt;m_ctrl.InfoList.GetSize(m_128x128);i++)
+00968 {
+00969 <font class="comment">// Selected ?</font>
+00970 <font class="keywordflow">if</font> (m_ctrl.InfoList.theList[m_128x128][i].Selected)
+00971 {
+00972 <font class="comment">// Tile index</font>
+00973 sint index;
+00974
+00975 <font class="comment">// get flags</font>
+00976 <font class="keywordflow">switch</font> (m_128x128)
+00977 {
+00978 <font class="keywordflow">case</font> 0:
+00979 <font class="comment">// Tile index</font>
+00980 index=tileBank2.getTileSet (land)-&gt;getTile128 (i);
+00981 <font class="keywordflow">break</font>;
+00982 <font class="keywordflow">case</font> 1:
+00983 <font class="comment">// Tile index</font>
+00984 index=tileBank2.getTileSet (land)-&gt;getTile256 (i);
+00985 <font class="keywordflow">break</font>;
+00986 <font class="keywordflow">case</font> 2:
+00987 <font class="comment">// Tile index</font>
+00988 index=tileBank2.getTileSet (land)-&gt;getTransition (i)-&gt;getTile ();
+00989 <font class="keywordflow">break</font>;
+00990 <font class="keywordflow">case</font> 3:
+00991 <font class="comment">// not found</font>
+00992 index=-1;
+00993 <font class="keywordflow">break</font>;
+00994 <font class="keywordflow">default</font>:
+00995 <a class="code" href="debug_h.html#a6">nlassert</a> (0); <font class="comment">// no!</font>
+00996 }
+00997
+00998 <font class="comment">// valid flags</font>
+00999 <font class="keywordflow">if</font> (index!=-1)
+01000 {
+01001 <font class="comment">// Get flags</font>
+01002 or|=tileBank2.getTile (index)-&gt;getGroupFlags ();
+01003 and&amp;=tileBank2.getTile (index)-&gt;getGroupFlags ();
+01004
+01005 <font class="comment">// Find one</font>
+01006 find=<font class="keyword">true</font>;
+01007 }
+01008 }
+01009 }
+01010
+01011 <font class="comment">// Valid ctrl</font>
+01012 GetDlgItem (IDC_SUBGROUP0)-&gt;EnableWindow (find?TRUE:FALSE);
+01013 GetDlgItem (IDC_SUBGROUP1)-&gt;EnableWindow (find?TRUE:FALSE);
+01014 GetDlgItem (IDC_SUBGROUP2)-&gt;EnableWindow (find?TRUE:FALSE);
+01015 GetDlgItem (IDC_SUBGROUP3)-&gt;EnableWindow (find?TRUE:FALSE);
+01016 GetDlgItem (IDC_SUBGROUP4)-&gt;EnableWindow (find?TRUE:FALSE);
+01017 GetDlgItem (IDC_SUBGROUP5)-&gt;EnableWindow (find?TRUE:FALSE);
+01018 GetDlgItem (IDC_SUBGROUP6)-&gt;EnableWindow (find?TRUE:FALSE);
+01019 GetDlgItem (IDC_SUBGROUP7)-&gt;EnableWindow (find?TRUE:FALSE);
+01020 GetDlgItem (IDC_SUBGROUP8)-&gt;EnableWindow (find?TRUE:FALSE);
+01021 GetDlgItem (IDC_SUBGROUP9)-&gt;EnableWindow (find?TRUE:FALSE);
+01022 GetDlgItem (IDC_SUBGROUP10)-&gt;EnableWindow (find?TRUE:FALSE);
+01023 GetDlgItem (IDC_SUBGROUP11)-&gt;EnableWindow (find?TRUE:FALSE);
+01024
+01025 <font class="comment">// Find at least one tile ?</font>
+01026 <font class="keywordflow">if</font> (find)
+01027 {
+01028 <font class="comment">// Set UI</font>
+01029 SubGroup0=(and&amp;0x1)?1:(or&amp;0x1)?2:0;
+01030 SubGroup1=(and&amp;0x2)?1:(or&amp;0x2)?2:0;
+01031 SubGroup2=(and&amp;0x4)?1:(or&amp;0x4)?2:0;
+01032 SubGroup3=(and&amp;0x8)?1:(or&amp;0x8)?2:0;
+01033 SubGroup4=(and&amp;0x10)?1:(or&amp;0x10)?2:0;
+01034 SubGroup5=(and&amp;0x20)?1:(or&amp;0x20)?2:0;
+01035 SubGroup6=(and&amp;0x40)?1:(or&amp;0x40)?2:0;
+01036 SubGroup7=(and&amp;0x80)?1:(or&amp;0x80)?2:0;
+01037 SubGroup8=(and&amp;0x100)?1:(or&amp;0x100)?2:0;
+01038 SubGroup9=(and&amp;0x200)?1:(or&amp;0x200)?2:0;
+01039 SubGroup10=(and&amp;0x400)?1:(or&amp;0x400)?2:0;
+01040 SubGroup11=(and&amp;0x800)?1:(or&amp;0x800)?2:0;
+01041 }
+01042
+01043 <font class="comment">// Update UI data</font>
+01044 UpdateData (FALSE);
+01045 }
+01046
+<a name="l01047"></a><a class="code" href="class_Browse.html#a6">01047</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#a6">Browse::Flags</a> (<font class="keywordtype">int</font> flagNumber, <font class="keywordtype">bool</font> go)<font class="keyword">
+</font>01048 <font class="keyword"></font>{
+01049 <font class="comment">// For each </font>
+01050 <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i=0;i&lt;m_ctrl.InfoList.GetSize(m_128x128);i++)
+01051 {
+01052 <font class="comment">// Selected ?</font>
+01053 <font class="keywordflow">if</font> (m_ctrl.InfoList.theList[m_128x128][i].Selected)
+01054 {
+01055 <font class="comment">// Tile index</font>
+01056 sint index;
+01057
+01058 <font class="comment">// get flags</font>
+01059 <font class="keywordflow">switch</font> (m_128x128)
+01060 {
+01061 <font class="keywordflow">case</font> 0:
+01062 <font class="comment">// Tile index</font>
+01063 index=tileBank2.getTileSet (land)-&gt;getTile128 (i);
+01064 <font class="keywordflow">break</font>;
+01065 <font class="keywordflow">case</font> 1:
+01066 <font class="comment">// Tile index</font>
+01067 index=tileBank2.getTileSet (land)-&gt;getTile256 (i);
+01068 <font class="keywordflow">break</font>;
+01069 <font class="keywordflow">case</font> 2:
+01070 <font class="comment">// Tile index</font>
+01071 index=tileBank2.getTileSet (land)-&gt;getTransition (i)-&gt;getTile ();
+01072 <font class="keywordflow">break</font>;
+01073 <font class="keywordflow">default</font>:
+01074 <a class="code" href="debug_h.html#a6">nlassert</a> (0); <font class="comment">// no!</font>
+01075 }
+01076
+01077 <font class="comment">// valid flags</font>
+01078 <font class="keywordflow">if</font> (index!=-1)
+01079 {
+01080 <font class="comment">// Get flags</font>
+01081 uint value=tileBank2.getTile (index)-&gt;getGroupFlags ();
+01082
+01083 <font class="comment">// Clear flag</font>
+01084 value&amp;=~(1&lt;&lt;flagNumber);
+01085
+01086 <font class="comment">// Set the flag</font>
+01087 <font class="keywordflow">if</font> (go)
+01088 value|=(1&lt;&lt;flagNumber);
+01089
+01090 <font class="comment">// Setup</font>
+01091 tileBank2.getTile (index)-&gt;setGroupFlags (value);
+01092 }
+01093 }
+01094 }
+01095 }
+01096
+01097
+<a name="l01098"></a><a class="code" href="class_Browse.html#b15">01098</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b15">Browse::OnSubgroup0</a>()<font class="keyword">
+</font>01099 <font class="keyword"></font>{
+01100 <font class="comment">// TODO: Add your control notification handler code here</font>
+01101
+01102 <font class="comment">// Check if clicked</font>
+01103 UpdateData ();
+01104 <font class="keywordflow">if</font> (SubGroup0==2)
+01105 {
+01106 SubGroup0=0;
+01107 UpdateData (FALSE);
+01108 }
+01109
+01110 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup0!=2);
+01111 <font class="keywordflow">if</font> (SubGroup0==0)
+01112 <a class="code" href="class_Browse.html#a6">Flags</a> (0, <font class="keyword">false</font>);
+01113 <font class="keywordflow">if</font> (SubGroup0==1)
+01114 <a class="code" href="class_Browse.html#a6">Flags</a> (0, <font class="keyword">true</font>);
+01115 }
+01116
+<a name="l01117"></a><a class="code" href="class_Browse.html#b16">01117</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b16">Browse::OnSubgroup1</a>()<font class="keyword">
+</font>01118 <font class="keyword"></font>{
+01119 <font class="comment">// TODO: Add your control notification handler code here</font>
+01120
+01121 <font class="comment">// Check if clicked</font>
+01122 UpdateData ();
+01123 <font class="keywordflow">if</font> (SubGroup1==2)
+01124 {
+01125 SubGroup1=0;
+01126 UpdateData (FALSE);
+01127 }
+01128
+01129 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup1!=2);
+01130 <font class="keywordflow">if</font> (SubGroup1==0)
+01131 <a class="code" href="class_Browse.html#a6">Flags</a> (1, <font class="keyword">false</font>);
+01132 <font class="keywordflow">if</font> (SubGroup1==1)
+01133 <a class="code" href="class_Browse.html#a6">Flags</a> (1, <font class="keyword">true</font>);
+01134 }
+01135
+<a name="l01136"></a><a class="code" href="class_Browse.html#b17">01136</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b17">Browse::OnSubgroup2</a>()<font class="keyword">
+</font>01137 <font class="keyword"></font>{
+01138 <font class="comment">// TODO: Add your control notification handler code here</font>
+01139
+01140 <font class="comment">// Check if clicked</font>
+01141 UpdateData ();
+01142 <font class="keywordflow">if</font> (SubGroup2==2)
+01143 {
+01144 SubGroup2=0;
+01145 UpdateData (FALSE);
+01146 }
+01147
+01148 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup2!=2);
+01149 <font class="keywordflow">if</font> (SubGroup2==0)
+01150 <a class="code" href="class_Browse.html#a6">Flags</a> (2, <font class="keyword">false</font>);
+01151 <font class="keywordflow">if</font> (SubGroup2==1)
+01152 <a class="code" href="class_Browse.html#a6">Flags</a> (2, <font class="keyword">true</font>);
+01153 }
+01154
+<a name="l01155"></a><a class="code" href="class_Browse.html#b18">01155</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b18">Browse::OnSubgroup3</a>()<font class="keyword">
+</font>01156 <font class="keyword"></font>{
+01157 <font class="comment">// TODO: Add your control notification handler code here</font>
+01158
+01159 <font class="comment">// Check if clicked</font>
+01160 UpdateData ();
+01161 <font class="keywordflow">if</font> (SubGroup3==2)
+01162 {
+01163 SubGroup3=0;
+01164 UpdateData (FALSE);
+01165 }
+01166
+01167 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup3!=2);
+01168 <font class="keywordflow">if</font> (SubGroup3==0)
+01169 <a class="code" href="class_Browse.html#a6">Flags</a> (3, <font class="keyword">false</font>);
+01170 <font class="keywordflow">if</font> (SubGroup3==1)
+01171 <a class="code" href="class_Browse.html#a6">Flags</a> (3, <font class="keyword">true</font>);
+01172 }
+01173
+<a name="l01174"></a><a class="code" href="class_Browse.html#b19">01174</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b19">Browse::OnSubgroup4</a>()<font class="keyword">
+</font>01175 <font class="keyword"></font>{
+01176 <font class="comment">// TODO: Add your control notification handler code here</font>
+01177
+01178 <font class="comment">// Check if clicked</font>
+01179 UpdateData ();
+01180 <font class="keywordflow">if</font> (SubGroup4==2)
+01181 {
+01182 SubGroup4=0;
+01183 UpdateData (FALSE);
+01184 }
+01185
+01186 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup4!=2);
+01187 <font class="keywordflow">if</font> (SubGroup4==0)
+01188 <a class="code" href="class_Browse.html#a6">Flags</a> (4, <font class="keyword">false</font>);
+01189 <font class="keywordflow">if</font> (SubGroup4==1)
+01190 <a class="code" href="class_Browse.html#a6">Flags</a> (4, <font class="keyword">true</font>);
+01191 }
+01192
+<a name="l01193"></a><a class="code" href="class_Browse.html#b20">01193</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b20">Browse::OnSubgroup5</a>()<font class="keyword">
+</font>01194 <font class="keyword"></font>{
+01195 <font class="comment">// TODO: Add your control notification handler code here</font>
+01196
+01197 <font class="comment">// Check if clicked</font>
+01198 UpdateData ();
+01199 <font class="keywordflow">if</font> (SubGroup5==2)
+01200 {
+01201 SubGroup5=0;
+01202 UpdateData (FALSE);
+01203 }
+01204
+01205 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup5!=2);
+01206 <font class="keywordflow">if</font> (SubGroup5==0)
+01207 <a class="code" href="class_Browse.html#a6">Flags</a> (5, <font class="keyword">false</font>);
+01208 <font class="keywordflow">if</font> (SubGroup5==1)
+01209 <a class="code" href="class_Browse.html#a6">Flags</a> (5, <font class="keyword">true</font>);
+01210 }
+01211
+<a name="l01212"></a><a class="code" href="class_Browse.html#b21">01212</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b21">Browse::OnSubgroup6</a>()<font class="keyword">
+</font>01213 <font class="keyword"></font>{
+01214 <font class="comment">// TODO: Add your control notification handler code here</font>
+01215
+01216 <font class="comment">// Check if clicked</font>
+01217 UpdateData ();
+01218 <font class="keywordflow">if</font> (SubGroup6==2)
+01219 {
+01220 SubGroup6=0;
+01221 UpdateData (FALSE);
+01222 }
+01223
+01224 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup6!=2);
+01225 <font class="keywordflow">if</font> (SubGroup6==0)
+01226 <a class="code" href="class_Browse.html#a6">Flags</a> (6, <font class="keyword">false</font>);
+01227 <font class="keywordflow">if</font> (SubGroup6==1)
+01228 <a class="code" href="class_Browse.html#a6">Flags</a> (6, <font class="keyword">true</font>);
+01229 }
+01230
+<a name="l01231"></a><a class="code" href="class_Browse.html#b22">01231</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b22">Browse::OnSubgroup7</a>()<font class="keyword">
+</font>01232 <font class="keyword"></font>{
+01233 <font class="comment">// TODO: Add your control notification handler code here</font>
+01234
+01235 <font class="comment">// Check if clicked</font>
+01236 UpdateData ();
+01237 <font class="keywordflow">if</font> (SubGroup7==2)
+01238 {
+01239 SubGroup7=0;
+01240 UpdateData (FALSE);
+01241 }
+01242
+01243 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup7!=2);
+01244 <font class="keywordflow">if</font> (SubGroup7==0)
+01245 <a class="code" href="class_Browse.html#a6">Flags</a> (7, <font class="keyword">false</font>);
+01246 <font class="keywordflow">if</font> (SubGroup7==1)
+01247 <a class="code" href="class_Browse.html#a6">Flags</a> (7, <font class="keyword">true</font>);
+01248 }
+01249
+<a name="l01250"></a><a class="code" href="class_Browse.html#b23">01250</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b23">Browse::OnSubgroup8</a>()<font class="keyword">
+</font>01251 <font class="keyword"></font>{
+01252 <font class="comment">// TODO: Add your control notification handler code here</font>
+01253
+01254 <font class="comment">// Check if clicked</font>
+01255 UpdateData ();
+01256 <font class="keywordflow">if</font> (SubGroup8==2)
+01257 {
+01258 SubGroup8=0;
+01259 UpdateData (FALSE);
+01260 }
+01261
+01262 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup8!=2);
+01263 <font class="keywordflow">if</font> (SubGroup8==0)
+01264 <a class="code" href="class_Browse.html#a6">Flags</a> (8, <font class="keyword">false</font>);
+01265 <font class="keywordflow">if</font> (SubGroup8==1)
+01266 <a class="code" href="class_Browse.html#a6">Flags</a> (8, <font class="keyword">true</font>);
+01267 }
+01268
+<a name="l01269"></a><a class="code" href="class_Browse.html#b24">01269</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b24">Browse::OnSubgroup9</a>()<font class="keyword">
+</font>01270 <font class="keyword"></font>{
+01271 <font class="comment">// TODO: Add your control notification handler code here</font>
+01272
+01273 <font class="comment">// Check if clicked</font>
+01274 UpdateData ();
+01275 <font class="keywordflow">if</font> (SubGroup9==2)
+01276 {
+01277 SubGroup9=0;
+01278 UpdateData (FALSE);
+01279 }
+01280
+01281 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup9!=2);
+01282 <font class="keywordflow">if</font> (SubGroup9==0)
+01283 <a class="code" href="class_Browse.html#a6">Flags</a> (9, <font class="keyword">false</font>);
+01284 <font class="keywordflow">if</font> (SubGroup9==1)
+01285 <a class="code" href="class_Browse.html#a6">Flags</a> (9, <font class="keyword">true</font>);
+01286 }
+01287
+<a name="l01288"></a><a class="code" href="class_Browse.html#b25">01288</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b25">Browse::OnSubgroup10</a>()<font class="keyword">
+</font>01289 <font class="keyword"></font>{
+01290 <font class="comment">// TODO: Add your control notification handler code here</font>
+01291
+01292 <font class="comment">// Check if clicked</font>
+01293 UpdateData ();
+01294 <font class="keywordflow">if</font> (SubGroup10==2)
+01295 {
+01296 SubGroup10=0;
+01297 UpdateData (FALSE);
+01298 }
+01299
+01300 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup10!=2);
+01301 <font class="keywordflow">if</font> (SubGroup10==0)
+01302 <a class="code" href="class_Browse.html#a6">Flags</a> (10, <font class="keyword">false</font>);
+01303 <font class="keywordflow">if</font> (SubGroup10==1)
+01304 <a class="code" href="class_Browse.html#a6">Flags</a> (10, <font class="keyword">true</font>);
+01305 }
+01306
+<a name="l01307"></a><a class="code" href="class_Browse.html#b26">01307</a> <font class="keywordtype">void</font> <a class="code" href="class_Browse.html#b26">Browse::OnSubgroup11</a>()<font class="keyword">
+</font>01308 <font class="keyword"></font>{
+01309 <font class="comment">// TODO: Add your control notification handler code here</font>
+01310
+01311 <font class="comment">// Check if clicked</font>
+01312 UpdateData ();
+01313 <font class="keywordflow">if</font> (SubGroup11==2)
+01314 {
+01315 SubGroup11=0;
+01316 UpdateData (FALSE);
+01317 }
+01318
+01319 <a class="code" href="debug_h.html#a6">nlassert</a> (SubGroup11!=2);
+01320 <font class="keywordflow">if</font> (SubGroup11==0)
+01321 <a class="code" href="class_Browse.html#a6">Flags</a> (11, <font class="keyword">false</font>);
+01322 <font class="keywordflow">if</font> (SubGroup11==1)
+01323 <a class="code" href="class_Browse.html#a6">Flags</a> (11, <font class="keyword">true</font>);
+01324 }
+</div></pre>
+
+<!-- footer -->
+<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
+</TD>
+<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>