00001
00002
00003
00004 #include "stdafx.h"
00005
00006 #include "resource.h"
00007 #include "Browse.h"
00008 #include "custom.h"
00009 #include "getval.h"
00010 #include <nel/3d/tile_bank.h>
00011
00012 using namespace NL3D;
00013
00014 extern CTileBank tileBank2;
00015
00017
00018
00019 Browse::Browse(int nland, CWnd* pParent )
00020 : CDialog(Browse::IDD, pParent)
00021 {
00022
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
00036 land=nland;
00037 m_128x128=0;
00038 }
00039
00040
00041 void Browse::DoDataExchange(CDataExchange* pDX)
00042 {
00043 CDialog::DoDataExchange(pDX);
00044
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
00062 }
00063
00064
00065 BEGIN_MESSAGE_MAP(Browse, CDialog)
00066
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
00094 END_MESSAGE_MAP()
00095
00097
00098
00099 BOOL Browse::PreCreateWindow(CREATESTRUCT& cs)
00100 {
00101
00102
00103 return CDialog::PreCreateWindow(cs);
00104 }
00105
00106 DWORD thread_id;
00107 int thread_actif = 0;
00108 Browse *pDialog;
00109 int ccount=0;
00110
00111 LRESULT Browse::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
00112 {
00113
00114
00115 if (ccount==0 && message==WM_PAINT)
00116 {
00117 Init();
00118 }
00119 if (message==WM_KEYUP || message==WM_KEYDOWN)
00120 {
00121 RECT parent,client;
00122 GetWindowRect(&parent); m_ctrl.GetWindowRect(&client);
00123 if (m_ctrl.MousePos.x<(client.right - parent.left) &&
00124 m_ctrl.MousePos.x>0 &&
00125 m_ctrl.MousePos.y<(client.bottom - client.top) &&
00126 m_ctrl.MousePos.y>0)
00127 {
00128 m_ctrl.SendMessage(message,wParam,lParam);
00129 }
00130 }
00131
00132 if (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 (&m_ctrl.MousePos);
00140 m_ctrl.ScreenToClient (&m_ctrl.MousePos);
00141
00142 m_ctrl.GetWindowRect(&client);
00143 GetWindowRect(&parent);
00144 if (m_ctrl.MousePos.x<0)
00145 m_ctrl.MousePos.x=0;
00146 if (m_ctrl.MousePos.x>client.right-client.left)
00147 m_ctrl.MousePos.x=client.right-client.left;
00148 if (m_ctrl.MousePos.y<0)
00149 m_ctrl.MousePos.y=0;
00150 if (m_ctrl.MousePos.y>client.bottom-client.top)
00151 m_ctrl.MousePos.y=client.bottom-client.top;
00152
00153 m_ctrl.ClientToScreen (&m_ctrl.MousePos);
00154 ScreenToClient (&m_ctrl.MousePos);
00155
00156 if (lbutton)
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 if (current.left>current.right) {int temp = current.left; current.left = current.right; current.right = temp;}
00166 if (current.top>current.bottom) {int temp = current.bottom; current.bottom = current.top; current.top = temp;}
00167
00168 CDC *pDC = GetDC();
00169 m_ctrl.DrawDragRect(pDC,NULL,size,&last_sel,size);
00170
00171 m_ctrl.UpdateSelection(¤t, wParam, m_128x128);
00172
00173 m_ctrl.DrawDragRect(pDC,¤t,size,NULL,size);
00174 ::ReleaseDC(*this,*pDC);
00175
00176 last_sel = current;
00177 }
00178 }
00179 if (message==WM_DROPFILES)
00180 {
00181 m_ctrl.PostMessage(WM_DROPFILES,wParam,lParam);
00182 }
00183 if (message==WM_COMMAND && !thread_actif)
00184 {
00185 int button = LOWORD(wParam);
00186 if (button==IDC_ZOOM1 || button==IDC_ZOOM2 || button==IDC_ZOOM3)
00187 {
00188 m_ctrl.Zoom = button - IDC_ZOOM1 +1;
00189 m_ctrl.UpdateSize(m_128x128);
00190 m_ctrl.scrollpos = 0;
00191 SetScrollPos(SB_VERT,0,true);
00192 m_ctrl.RedrawWindow();
00193 }
00194 else if (button==IDC_INFONUM)
00195 {
00196 m_ctrl.InfoTexte = 1;
00197 m_ctrl.RedrawWindow();
00198 }
00199 else if (button==IDC_FILENAME)
00200 {
00201 m_ctrl.InfoTexte =2;
00202 m_ctrl.RedrawWindow();
00203 }
00204 else if (button==IDC_GROUP)
00205 {
00206 m_ctrl.InfoTexte = 3;
00207 m_ctrl.RedrawWindow();
00208 }
00209 else if (button>=10 && button<=15)
00210 m_ctrl.PostMessage(WM_COMMAND,wParam,lParam);
00211 }
00212 if (message==WM_LBUTTONDOWN)
00213 {
00214 int xPos = LOWORD(lParam);
00215 int yPos = HIWORD(lParam);
00216
00217 if (lbutton)
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 if (current.left>current.right) {int temp = current.left; current.left = current.right; current.right = temp;}
00227 if (current.top>current.bottom) {int temp = current.bottom; current.bottom = current.top; current.top = temp;}
00228
00229 CDC *pDC = GetDC();
00230 m_ctrl.DrawDragRect(pDC,NULL,size,&last_sel,size);
00231
00232 m_ctrl.UpdateSelection(¤t,wParam, m_128x128);
00233
00234 ::ReleaseDC(*this,*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(&p);
00241 m_ctrl.GetClientRect(&rect);
00242 POINT pt; pt.x = p.left; pt.y = p.top;
00243 m_ctrl.ScreenToClient(&pt);
00244 if (pt.x>=rect.left && pt.x<rect.right && pt.y>=rect.top && pt.y<rect.bottom)
00245 {
00246 m_ctrl.SetFocus();
00247 int index = m_ctrl.GetIndex(&pt, m_128x128);
00248 if (index!=-1 && !(wParam&MK_SHIFT))
00249 {
00250 tilelist::iterator p = m_ctrl.InfoList.Get(index, m_128x128);
00251 if (p!=m_ctrl.InfoList.GetLast(m_128x128))
00252 {
00253 tilelist::iterator pp = p;
00254 if (wParam&MK_CONTROL)
00255 p->Selected = p->Selected?0:7;
00256 else
00257 p->Selected = 1;
00258 CDC *pDC = NULL;
00259 int indexx=0;
00260 for (p=m_ctrl.InfoList.GetFirst(m_128x128);p!=m_ctrl.InfoList.GetLast(m_128x128);++p, indexx++)
00261 {
00262 if (p!=pp && p->Selected)
00263 {
00264 if (!(wParam&MK_CONTROL))
00265 {
00266 p->Selected = 0;
00267 if (pDC==NULL) pDC = m_ctrl.GetDC();
00268 m_ctrl.DrawTile(p,pDC,1,m_128x128);
00269 }
00270 }
00271 else
00272 {
00273 if (p==pp)
00274 {
00275 if (pDC==NULL) pDC = m_ctrl.GetDC();
00276 m_ctrl.DrawTile(p,pDC,1,m_128x128);
00277 }
00278 }
00279 }
00280 if (pDC) ::ReleaseDC(*this,*pDC);
00281 }
00282 }
00283 else
00284 {
00285 if (!(wParam&MK_CONTROL) && !(wParam&MK_SHIFT))
00286 {
00287 tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);
00288 CDC *pDC = NULL;
00289 for (int i = 0; i<m_ctrl.InfoList.GetSize(m_128x128); i++)
00290 {
00291 if (p->Selected)
00292 {
00293 if (pDC==NULL) pDC = m_ctrl.GetDC();
00294
00295 p->Selected = 0;
00296 m_ctrl.DrawTile(p,pDC,1,m_128x128);
00297 }
00298 p++;
00299 }
00300 if (pDC) ::ReleaseDC(*this,*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 if (message==WM_LBUTTONUP || message==WM_NCLBUTTONUP)
00316 {
00317 RECT p; p.left = m_ctrl.MousePos.x; p.top = m_ctrl.MousePos.y;
00318 ClientToScreen(&p);
00319 POINT pt; pt.x = p.left; pt.y = p.top;
00320 m_ctrl.ScreenToClient(&pt);
00321 int index = m_ctrl.GetIndex(&pt, m_128x128);
00322 if (!selection && index!=-1)
00323 {
00324 int i = 0;
00325 }
00326 else if (selection)
00327 {
00328 CDC *pDC = GetDC();
00329 CSize size; size.cx = size.cy = 1;
00330 m_ctrl.DrawDragRect(pDC,NULL,size,&last_sel,size);
00331 ::ReleaseDC(*this,*pDC);
00332 int index=0;
00333 for (tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);p!=m_ctrl.InfoList.GetLast(m_128x128);++p, index++)
00334 {
00335 if (p->Selected&3)
00336 {
00337 p->Selected=2;
00338 }
00339 else
00340 p->Selected = 0;
00341 }
00342 }
00343 selection =0;
00344 lbutton = 0;
00345 }
00346 if (message==WM_KEYDOWN)
00347 {
00348 int toto = 0;
00349 }
00350 if (message==WM_SIZE && m_ctrl.count_ )
00351 {
00352 int x = LOWORD(lParam);
00353 int y = HIWORD(lParam);
00354
00355 int i = max (1, m_ctrl.GetNbTileLine());
00356 int j = max (1, m_ctrl.GetNbTileColumn());
00357 int pos = m_ctrl.GetScrollPos(SB_VERT);
00358 int 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(&clientrect);
00363 InvalidateRect(NULL,false);
00364 GetWindowRect(&rect);
00365 m_ctrl.SetWindowPos(NULL, 0, 0, max (100, x - 120), y - 20, SWP_NOMOVE);
00366 int iFirst,iLast;
00367 m_ctrl.GetVisibility(iFirst, iLast, m_128x128);
00368 m_ctrl.UpdateBar(iFirst, iLast, m_128x128);
00369 return 0;
00370 }
00371 if (message==WM_VSCROLL || message==WM_MOUSEWHEEL)
00372 {
00373 SCROLLINFO inf;
00374 RECT rect_scroll,rect_clip;
00375 int scrollcode,pos;
00376 inf.fMask = SIF_ALL;
00377 GetScrollInfo(SB_VERT,&inf);
00378 m_ctrl.GetClientRect(&rect_scroll);
00379 int i = m_ctrl.GetNbTileLine();
00380 int hview = (m_ctrl.InfoList.GetSize(m_128x128)/i + 2)*(m_ctrl.sizeicon_y + m_ctrl.spacing_y) + m_ctrl.spacing_y;
00381
00382 if (message==WM_MOUSEWHEEL)
00383 {
00384 int inc = ((int)(short)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 else
00388 {
00389 scrollcode = LOWORD(wParam);
00390 pos = inf.nTrackPos;
00391 switch (scrollcode)
00392 {
00393 case SB_BOTTOM:
00394 pos = SCROLL_MAX - inf.nPage;
00395 break;
00396 case SB_PAGEDOWN:
00397 pos = inf.nPos + inf.nPage;
00398 break;
00399 case SB_PAGEUP:
00400 pos = inf.nPos - inf.nPage;
00401 break;
00402 case SB_LINEUP:
00403 pos = inf.nPos - (((m_ctrl.sizeicon_y+m_ctrl.spacing_y)*SCROLL_MAX)/(hview - m_ctrl.spacing_y));
00404 break;
00405 case SB_LINEDOWN:
00406 pos = inf.nPos + (((m_ctrl.sizeicon_y+m_ctrl.spacing_y)*SCROLL_MAX)/(hview - m_ctrl.spacing_y));
00407 break;
00408 case SB_TOP:
00409 pos = 0;
00410 break;
00411 case SB_THUMBPOSITION:
00412 case SB_ENDSCROLL:
00413 pos = inf.nPos;
00414 break;
00415 }
00416 }
00417
00418 if (pos<0) pos = 0;
00419 if (pos>(SCROLL_MAX - (int)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 int scroll_pixel = m_ctrl.scrollpos;
00427 int old_iFV,old_iLV;
00428 m_ctrl.GetVisibility(old_iFV, old_iLV, m_128x128);
00429 m_ctrl.scrollpos = (pos*hview)/(SCROLL_MAX);
00430 int iFV,iLV;
00431 m_ctrl.GetVisibility(iFV, iLV, m_128x128);
00432
00433 if (iFV>old_iLV || iLV<old_iFV || scrollcode==SB_PAGEDOWN || scrollcode==SB_PAGEUP)
00434 {
00435 m_ctrl.RedrawWindow();
00436 }
00437 else
00438 {
00439 scroll_pixel -= m_ctrl.scrollpos;
00440 if (scroll_pixel)
00441 {
00442 CDC *pDC = m_ctrl.GetDC();
00443 if (abs(scroll_pixel)>(rect_clip.bottom - rect_clip.top)) scroll_pixel = 0;
00444 else pDC->ScrollDC(0,scroll_pixel,&rect_scroll,&rect_clip,NULL,NULL);
00445
00446 tilelist::iterator p = m_ctrl.InfoList.GetFirst(m_128x128);
00447 CBrush brush (GetSysColor(COLOR_3DFACE));
00448 if (scroll_pixel<0)
00449 {
00450 rect_scroll.top = rect_scroll.bottom + scroll_pixel;
00451 pDC->FillRect(&rect_scroll,&brush);
00452 if ((iLV-i)<iFV) i = iLV - iFV;
00453 for (int k = 0;k<old_iLV-i;k++) p++;
00454 for (k=old_iLV - i;k<=iLV;k++)
00455 {
00456 m_ctrl.DrawTile(p,pDC,0,m_128x128);
00457 p++;
00458 }
00459 }
00460 else
00461 {
00462 rect_scroll.bottom = rect_scroll.top + scroll_pixel;
00463 pDC->FillRect(&rect_scroll,&brush);
00464 for (int k = 0;k<iFV;k++) p++;
00465 for (k = iFV;k<(old_iFV+i);k++)
00466 {
00467 m_ctrl.DrawTile(p,pDC,0,m_128x128);
00468 p++;
00469 }
00470 }
00471 ::ReleaseDC(m_ctrl,*pDC);
00472 }
00473 }
00474 m_ctrl.lastVBarPos = pos;
00475 }
00476 if (message==WM_CLOSE)
00477 {
00478 ccount=0;
00479 this->m_ctrl.count_=0;
00480 OnDestroy();
00481 }
00482 if (message==WM_LBUTTONDBLCLK)
00483 {
00484 m_ctrl.SendMessage(WM_LBUTTONDBLCLK,wParam,lParam);
00485 }
00486 pDialog=this;
00487 return CDialog::WindowProc(message, wParam, lParam);
00488 }
00489
00490
00491 unsigned long Browse::MyControllingFunction( void* pParam )
00492 {
00493 thread_actif = 1;
00494 Browse *br = (Browse*)pParam;
00495 br->m_ctrl.lockInsertion = 1;
00496 int iFV,iLV;
00497 br->m_ctrl.GetVisibility(iFV, iLV, br->m_128x128);
00498 br->m_ctrl.UpdateBar(iFV, iLV, br->m_128x128);
00499 tilelist::iterator p = br->m_ctrl.InfoList.GetFirst(br->m_128x128);
00500 tilelist::iterator plast = p;
00501 for (int i=0;i<br->m_ctrl.InfoList.GetSize(br->m_128x128);i++)
00502 {
00503 int *ld;
00504 int rot=0;
00505 std::string path;
00506 LPBITMAPINFO pBmp;
00507 std::vector<NLMISC::CBGRA>* bits;
00508
00509 switch (br->m_128x128)
00510 {
00511 case 0:
00512 path = tileBank2.getTile (tileBank2.getTileSet (br->m_ctrl.InfoList._tileSet)->getTile128 (i))->
00513 getRelativeFileName ((CTile::TBitmap)(br->m_ctrl.Texture-1));
00514 break;
00515 case 1:
00516 path = tileBank2.getTile (tileBank2.getTileSet (br->m_ctrl.InfoList._tileSet)->getTile256 (i))->
00517 getRelativeFileName ((CTile::TBitmap)(br->m_ctrl.Texture-1));
00518 break;
00519 case 2:
00520 {
00521 int index=tileBank2.getTileSet (br->m_ctrl.InfoList._tileSet)->getTransition (i)->getTile();
00522 if (index!=-1)
00523 {
00524 path = tileBank2.getTile (index)->getRelativeFileName ((CTile::TBitmap)(br->m_ctrl.Texture-1));
00525 if (br->m_ctrl.Texture==3)
00526 rot = tileBank2.getTile (index)->getRotAlpha ();
00527 }
00528 else
00529 path = "";
00530 }
00531 break;
00532 case 3:
00533
00534 path = tileBank2.getTileSet (br->m_ctrl.InfoList._tileSet)->getDisplacementFileName((CTileSet::TDisplacement)i);
00535 break;
00536 }
00537 std::vector<NLMISC::CBGRA>* pAlpha=NULL;
00538 switch (br->m_ctrl.Texture)
00539 {
00540 case 1:
00541 ld = &p->loaded;
00542 pBmp = &p->BmpInfo;
00543 bits = &p->Bits;
00544 pAlpha = &p->alphaBits;
00545 break;
00546 case 2:
00547 ld = &p->nightLoaded;
00548 pBmp = &p->nightBmpInfo;
00549 bits = &p->nightBits;
00550 pAlpha = &p->alphaBits;
00551 break;
00552 case 3:
00553 ld = &p->alphaLoaded;
00554 pBmp = &p->alphaBmpInfo;
00555 bits = &p->alphaBits;
00556 break;
00557 }
00558
00559 if ((path!="") && _LoadBitmap(tileBank2.getAbsPath() + path, pBmp, *bits, pAlpha, rot))
00560 {
00561 *ld=1;
00562 int iFV,iLV; br->m_ctrl.GetVisibility(iFV, iLV, br->m_128x128);
00563 if (i<=iLV && i>=iFV)
00564 {
00565 CDC *pDC = br->m_ctrl.GetDC();
00566 br->m_ctrl.DrawTile(p,pDC,1,br->m_128x128);
00567 ::ReleaseDC(*br,*pDC);
00568 }
00569 }
00570 p++;
00571 }
00572 br->m_ctrl.lockInsertion = 0;
00573 thread_actif = 0;
00574 return 1;
00575 }
00576
00577 void Browse::LoadInThread(void)
00578 {
00579 if (!thread_actif)
00580 MyControllingFunction (this);
00581 }
00582
00583
00584 void Browse::Init()
00585 {
00586 UpdateData ();
00587 lbutton = 0;
00588 selection = 0;
00589 control = 0;
00590 m_ctrl.lockInsertion = 0; oldsel = -1;
00591 HKEY regkey;
00592 unsigned long value;
00593 unsigned long type;
00594 int cx=-1,cy=-1,x=-1,y=-1;
00595 char sWindowpl[256];
00596
00597 if (RegOpenKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,®key)==ERROR_SUCCESS)
00598 {
00599 value=256;
00600 type=REG_SZ;
00601 if (RegQueryValueEx(regkey,REGKEY_WNDPL,0,&type,(unsigned char *)&sWindowpl,&value)==ERROR_SUCCESS)
00602 {
00603 WINDOWPLACEMENT wndpl;
00604 sscanf(sWindowpl,"%d %d %d %d %d %d %d %d %d %d",
00605 &wndpl.flags,
00606 &wndpl.ptMaxPosition.x,&wndpl.ptMaxPosition.y,
00607 &wndpl.ptMinPosition.x,&wndpl.ptMinPosition.y,
00608 &wndpl.rcNormalPosition.bottom,&wndpl.rcNormalPosition.left,&wndpl.rcNormalPosition.right,&wndpl.rcNormalPosition.top,
00609 &wndpl.showCmd);
00610 wndpl.length = sizeof(WINDOWPLACEMENT);
00611 this->SetWindowPlacement(&wndpl);
00612 }
00613 value=256;
00614 type=REG_SZ;
00615 if (RegQueryValueEx(regkey,REGKEY_LASTPATH,0,&type,(unsigned char *)&sWindowpl,&value)!=ERROR_SUCCESS)
00616 m_ctrl.LastPath="";
00617 else
00618 m_ctrl.LastPath=(const char*)sWindowpl;
00619 value=4;
00620 type=REG_DWORD;
00621 if (RegQueryValueEx(regkey,REGKEY_BUTTONZOOM,0,&type,(unsigned char *)&m_ctrl.Zoom,&value)!=ERROR_SUCCESS)
00622 m_ctrl.Zoom = 3;
00623 value=4;
00624 type=REG_DWORD;
00625 if (RegQueryValueEx(regkey,REGKEY_BUTTONVARIETY,0,&type,(unsigned char *)&m_128x128,&value)!=ERROR_SUCCESS)
00626 m_128x128 = 0;
00627 value=4;
00628 type=REG_DWORD;
00629 if (RegQueryValueEx(regkey,REGKEY_BUTTONTEXTURE,0,&type,(unsigned char *)&m_ctrl.Texture,&value)!=ERROR_SUCCESS)
00630 m_ctrl.Texture = 1;
00631 value=4;
00632 type=REG_DWORD;
00633 if (RegQueryValueEx(regkey,REGKEY_BUTTONTEXTINFO,0,&type,(unsigned char *)&m_ctrl.InfoTexte,&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->SetCheck(1);
00639 button = (CButton*)GetDlgItem(IDC_JOUR + m_ctrl.Texture -1);
00640 button->SetCheck(1);
00641 button = (CButton*)GetDlgItem(IDC_INFONUM + m_ctrl.InfoTexte -1);
00642 button->SetCheck(1);
00643 if (cx!=-1 && cy!=-1 && x!=-1 && y!=-1) SetWindowPos(0,x,y,cx,cy,0);
00644
00645 m_ctrl.Init(land, m_128x128);
00646 SelectionTerritoire *slt = (SelectionTerritoire*)GetParent();
00647 ccount=1;
00648
00649 RECT rect;
00650 this->GetWindowRect(&rect);
00651 SendMessage(WM_SIZE,rect.right - rect.left,rect.bottom - rect.top);
00652
00653 SelectionTerritoire *parent = (SelectionTerritoire*)GetParent();
00654
00655
00656 CTileSet *tileSet=tileBank2.getTileSet (land);
00657
00658
00659 m_ctrl.InfoList.theList128.resize (tileSet->getNumTile128 ());
00660 for (int i=0; i<tileSet->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->getNumTile128 (), 0);
00669
00670
00671 m_ctrl.InfoList.theList256.resize (tileSet->getNumTile256 ());
00672 for (i=0; i<tileSet->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->getNumTile256 (), 1);
00681
00682
00683 for (i=0; i<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
00694 for (i=0; i<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->DefautPath + parent->CurrentTerritory;
00705
00706 LoadInThread();
00707 UpdateData (FALSE);
00708
00709 OnChangeVariety();
00710 }
00711
00712
00713
00714 void Browse::OnSize(UINT nType, int cx, int cy)
00715 {
00716 CDialog::OnSize(nType, cx, cy);
00717 }
00718
00719 void Browse::OnAlpha ()
00720 {
00721
00722 m_ctrl.Texture = 3;
00723 LoadInThread();
00724 m_ctrl.RedrawWindow();
00725 }
00726
00727 void Browse::OnJour ()
00728 {
00729
00730 m_ctrl.Texture = 1;
00731 LoadInThread();
00732 m_ctrl.RedrawWindow();
00733 }
00734
00735 void Browse::OnNuit ()
00736 {
00737
00738 m_ctrl.Texture = 2;
00739 LoadInThread();
00740 m_ctrl.RedrawWindow();
00741 }
00742
00743 void Browse::OnNum()
00744 {
00745
00746 m_ctrl.Sort = 1;
00747 m_ctrl.SendMessage(WM_PAINT);
00748 }
00749
00750 void Browse::OnCancel()
00751 {
00752
00753 if (thread_actif) return;
00754
00755 if (::MessageBox (NULL, "Are you sure you want to cancel?", "Cancel", MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES)
00756 {
00757 this->SendMessage(WM_CLOSE);
00758 CDialog::OnCancel();
00759 00760
00761 }
00762 }
00763
00764 void Browse::UpdateAll(void)
00765 {
00766
00767 }
00768
00769 void Browse::OnDestroy()
00770 {
00771
00772 HKEY regkey;
00773 WINDOWPLACEMENT wndpl;
00774 this->GetWindowPlacement(&wndpl);
00775 char sWindowpl[256];
00776 sprintf(sWindowpl,"%d %d %d %d %d %d %d %d %d %d",
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 if (RegCreateKey(HKEY_CURRENT_USER,REGKEY_TILEDIT,®key)==ERROR_SUCCESS)
00783 {
00784
00785 RegSetValueEx(regkey,REGKEY_WNDPL,0,REG_SZ,(const unsigned char*)sWindowpl,strlen(sWindowpl));
00786 RegSetValueEx(regkey,REGKEY_LASTPATH,0,REG_SZ,(const unsigned char*)m_ctrl.LastPath.c_str(),strlen(m_ctrl.LastPath.c_str()));
00787 RegSetValueEx(regkey,REGKEY_BUTTONZOOM,0,REG_DWORD,(const unsigned char*)&m_ctrl.Zoom,4);
00788 RegSetValueEx(regkey,REGKEY_BUTTONVARIETY,0,REG_DWORD,(const unsigned char*)&m_128x128,4);
00789 RegSetValueEx(regkey,REGKEY_BUTTONTEXTURE,0,REG_DWORD,(const unsigned char*)&m_ctrl.Texture,4);
00790 RegSetValueEx(regkey,REGKEY_BUTTONSORT,0,REG_DWORD,(const unsigned char*)&m_ctrl.Sort,4);
00791 RegSetValueEx(regkey,REGKEY_BUTTONTEXTINFO,0,REG_DWORD,(const unsigned char*)&m_ctrl.InfoTexte,4);
00792 RegCloseKey(regkey);
00793 }
00794 }
00795
00796 void Browse::OnOk()
00797 {
00798
00799 if (thread_actif) return;
00800
00801 this->SendMessage(WM_CLOSE);
00802 EndDialog(1);
00803 }
00804
00805 void Browse::OnRButtonDown(UINT nFlags, CPoint point)
00806 {
00807
00808 m_ctrl.PostMessage(WM_RBUTTONDOWN,point.x,point.y);
00809 CDialog::OnRButtonDown(nFlags, point);
00810 }
00811
00812 void Browse::OnSelchangeListtype()
00813 {
00814 }
00815
00816 void Browse::OnUpdateTiles()
00817 {
00818
00819 LoadInThread();
00820 }
00821
00822
00823 void Browse::OnChangeVariety()
00824 {
00825 UpdateData();
00826 m_ctrl.UpdateSize (m_128x128);
00827
00828
00829 GetDlgItem (IDC_JOUR)->EnableWindow (m_128x128!=3);
00830 GetDlgItem (IDC_NUIT)->EnableWindow (m_128x128!=3);
00831 GetDlgItem (IDC_ALPHA)->EnableWindow (m_128x128==2);
00832 GetDlgItem (IDC_BATCH_LOAD)->EnableWindow (m_128x128==2);
00833
00834 if ((m_ctrl.Texture==3)&&(m_128x128!=2))
00835 {
00836 m_ctrl.Texture=2;
00837 ((CButton*)GetDlgItem (IDC_ALPHA))->SetCheck (0);
00838 ((CButton*)GetDlgItem (IDC_NUIT))->SetCheck (1);
00839 }
00840
00841 if ((m_ctrl.Texture!=1)&&(m_128x128==3))
00842 {
00843 m_ctrl.Texture=1;
00844 ((CButton*)GetDlgItem (IDC_ALPHA))->SetCheck (0);
00845 ((CButton*)GetDlgItem (IDC_NUIT))->SetCheck (0);
00846 ((CButton*)GetDlgItem (IDC_JOUR))->SetCheck (1);
00847 }
00848
00849 m_ctrl.Invalidate ();
00850 UpdateData(FALSE);
00851 }
00852
00853 void Browse::OnBatchLoad ()
00854 {
00855 CFileDialog sFile (true, NULL, NULL, OFN_ENABLESIZING,
00856 "Targa bitmap (*.tga)|*.tga|All files (*.*)|*.*||",NULL);
00857
00858 if (sFile.DoModal()==IDOK)
00859 {
00860 char sDrive[256];
00861 char sPath[256];
00862 char sName[256];
00863 char sExt[256];
00864 _splitpath (sFile.GetPathName(), sDrive, sPath, sName, sExt);
00865
00866
00867 char *sNumber=sName+strlen(sName)-1;
00868 while ((sNumber>sName)&&(*sNumber>='0')&&(*sNumber<='9'))
00869 {
00870 sNumber--;
00871 }
00872 sNumber[1]=0;
00873
00874 bool rotate=false;
00875 if (::MessageBox (NULL, "Do you want to use rotation to reuse alpha tiles ?", "Import rotated tiles", MB_OK|MB_ICONQUESTION|MB_YESNO)==IDYES)
00876 rotate=true;
00877
00878 for (int i=0; i<CTileSet::count; i++)
00879 {
00880 if (m_ctrl.Texture==3)
00881 {
00882
00883 CTileSet::TTransition transition=(CTileSet::TTransition)i;
00884
00885
00886 CTileSetTransition* trans=tileBank2.getTileSet (land)->getTransition (transition);
00887 if (tileBank2.getTile (trans->getTile())->getRelativeFileName (CTile::alpha)=="")
00888 {
00889
00890 for (int rot=0; rot<4; rot++)
00891 {
00892
00893 char sName2[256];
00894 char sFinal[256];
00895 sprintf (sName2, "%s%02d", sName, (int)transition);
00896 _makepath (sFinal, sDrive, sPath, sName2, sExt);
00897 FILE *pFile=fopen (sFinal, "rb");
00898
00899
00900 if (pFile)
00901 {
00902 fclose (pFile);
00903 m_ctrl.InfoList.setTileTransitionAlpha (i, sFinal, (4-rot)%4);
00904
00905
00906 break;
00907 }
00908
00909
00910 transition=CTileSet::rotateTransition (transition);
00911
00912 if (!rotate)
00913 break;
00914 }
00915 }
00916 }
00917 else
00918 {
00919
00920 CTileSet::TTransition transition=(CTileSet::TTransition)i;
00921
00922
00923 CTileSetTransition* trans=tileBank2.getTileSet (land)->getTransition (transition);
00924 if (tileBank2.getTile (trans->getTile())->getRelativeFileName (m_ctrl.Texture==1?CTile::diffuse:CTile::additive)=="")
00925 {
00926
00927 char sName2[256];
00928 char sFinal[256];
00929 sprintf (sName2, "%s%02d", sName, (int)transition);
00930 _makepath (sFinal, sDrive, sPath, sName2, sExt);
00931 FILE *pFile=fopen (sFinal, "rb");
00932
00933
00934 if (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
00947 void Browse::UpdateFlags ()
00948 {
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
00963 uint or=0, and=0xffffffff;
00964 bool find=false;
00965
00966
00967 for (int i=0;i<m_ctrl.InfoList.GetSize(m_128x128);i++)
00968 {
00969
00970 if (m_ctrl.InfoList.theList[m_128x128][i].Selected)
00971 {
00972
00973 sint index;
00974
00975
00976 switch (m_128x128)
00977 {
00978 case 0:
00979
00980 index=tileBank2.getTileSet (land)->getTile128 (i);
00981 break;
00982 case 1:
00983
00984 index=tileBank2.getTileSet (land)->getTile256 (i);
00985 break;
00986 case 2:
00987
00988 index=tileBank2.getTileSet (land)->getTransition (i)->getTile ();
00989 break;
00990 case 3:
00991
00992 index=-1;
00993 break;
00994 default:
00995 nlassert (0);
00996 }
00997
00998
00999 if (index!=-1)
01000 {
01001
01002 or|=tileBank2.getTile (index)->getGroupFlags ();
01003 and&=tileBank2.getTile (index)->getGroupFlags ();
01004
01005
01006 find=true;
01007 }
01008 }
01009 }
01010
01011
01012 GetDlgItem (IDC_SUBGROUP0)->EnableWindow (find?TRUE:FALSE);
01013 GetDlgItem (IDC_SUBGROUP1)->EnableWindow (find?TRUE:FALSE);
01014 GetDlgItem (IDC_SUBGROUP2)->EnableWindow (find?TRUE:FALSE);
01015 GetDlgItem (IDC_SUBGROUP3)->EnableWindow (find?TRUE:FALSE);
01016 GetDlgItem (IDC_SUBGROUP4)->EnableWindow (find?TRUE:FALSE);
01017 GetDlgItem (IDC_SUBGROUP5)->EnableWindow (find?TRUE:FALSE);
01018 GetDlgItem (IDC_SUBGROUP6)->EnableWindow (find?TRUE:FALSE);
01019 GetDlgItem (IDC_SUBGROUP7)->EnableWindow (find?TRUE:FALSE);
01020 GetDlgItem (IDC_SUBGROUP8)->EnableWindow (find?TRUE:FALSE);
01021 GetDlgItem (IDC_SUBGROUP9)->EnableWindow (find?TRUE:FALSE);
01022 GetDlgItem (IDC_SUBGROUP10)->EnableWindow (find?TRUE:FALSE);
01023 GetDlgItem (IDC_SUBGROUP11)->EnableWindow (find?TRUE:FALSE);
01024
01025
01026 if (find)
01027 {
01028
01029 SubGroup0=(and&0x1)?1:(or&0x1)?2:0;
01030 SubGroup1=(and&0x2)?1:(or&0x2)?2:0;
01031 SubGroup2=(and&0x4)?1:(or&0x4)?2:0;
01032 SubGroup3=(and&0x8)?1:(or&0x8)?2:0;
01033 SubGroup4=(and&0x10)?1:(or&0x10)?2:0;
01034 SubGroup5=(and&0x20)?1:(or&0x20)?2:0;
01035 SubGroup6=(and&0x40)?1:(or&0x40)?2:0;
01036 SubGroup7=(and&0x80)?1:(or&0x80)?2:0;
01037 SubGroup8=(and&0x100)?1:(or&0x100)?2:0;
01038 SubGroup9=(and&0x200)?1:(or&0x200)?2:0;
01039 SubGroup10=(and&0x400)?1:(or&0x400)?2:0;
01040 SubGroup11=(and&0x800)?1:(or&0x800)?2:0;
01041 }
01042
01043
01044 UpdateData (FALSE);
01045 }
01046
01047 void Browse::Flags (int flagNumber, bool go)
01048 {
01049
01050 for (int i=0;i<m_ctrl.InfoList.GetSize(m_128x128);i++)
01051 {
01052
01053 if (m_ctrl.InfoList.theList[m_128x128][i].Selected)
01054 {
01055
01056 sint index;
01057
01058
01059 switch (m_128x128)
01060 {
01061 case 0:
01062
01063 index=tileBank2.getTileSet (land)->getTile128 (i);
01064 break;
01065 case 1:
01066
01067 index=tileBank2.getTileSet (land)->getTile256 (i);
01068 break;
01069 case 2:
01070
01071 index=tileBank2.getTileSet (land)->getTransition (i)->getTile ();
01072 break;
01073 default:
01074 nlassert (0);
01075 }
01076
01077
01078 if (index!=-1)
01079 {
01080
01081 uint value=tileBank2.getTile (index)->getGroupFlags ();
01082
01083
01084 value&=~(1<<flagNumber);
01085
01086
01087 if (go)
01088 value|=(1<<flagNumber);
01089
01090
01091 tileBank2.getTile (index)->setGroupFlags (value);
01092 }
01093 }
01094 }
01095 }
01096
01097
01098 void Browse::OnSubgroup0()
01099 {
01100
01101
01102
01103 UpdateData ();
01104 if (SubGroup0==2)
01105 {
01106 SubGroup0=0;
01107 UpdateData (FALSE);
01108 }
01109
01110 nlassert (SubGroup0!=2);
01111 if (SubGroup0==0)
01112 Flags (0, false);
01113 if (SubGroup0==1)
01114 Flags (0, true);
01115 }
01116
01117 void Browse::OnSubgroup1()
01118 {
01119
01120
01121
01122 UpdateData ();
01123 if (SubGroup1==2)
01124 {
01125 SubGroup1=0;
01126 UpdateData (FALSE);
01127 }
01128
01129 nlassert (SubGroup1!=2);
01130 if (SubGroup1==0)
01131 Flags (1, false);
01132 if (SubGroup1==1)
01133 Flags (1, true);
01134 }
01135
01136 void Browse::OnSubgroup2()
01137 {
01138
01139
01140
01141 UpdateData ();
01142 if (SubGroup2==2)
01143 {
01144 SubGroup2=0;
01145 UpdateData (FALSE);
01146 }
01147
01148 nlassert (SubGroup2!=2);
01149 if (SubGroup2==0)
01150 Flags (2, false);
01151 if (SubGroup2==1)
01152 Flags (2, true);
01153 }
01154
01155 void Browse::OnSubgroup3()
01156 {
01157
01158
01159
01160 UpdateData ();
01161 if (SubGroup3==2)
01162 {
01163 SubGroup3=0;
01164 UpdateData (FALSE);
01165 }
01166
01167 nlassert (SubGroup3!=2);
01168 if (SubGroup3==0)
01169 Flags (3, false);
01170 if (SubGroup3==1)
01171 Flags (3, true);
01172 }
01173
01174 void Browse::OnSubgroup4()
01175 {
01176
01177
01178
01179 UpdateData ();
01180 if (SubGroup4==2)
01181 {
01182 SubGroup4=0;
01183 UpdateData (FALSE);
01184 }
01185
01186 nlassert (SubGroup4!=2);
01187 if (SubGroup4==0)
01188 Flags (4, false);
01189 if (SubGroup4==1)
01190 Flags (4, true);
01191 }
01192
01193 void Browse::OnSubgroup5()
01194 {
01195
01196
01197
01198 UpdateData ();
01199 if (SubGroup5==2)
01200 {
01201 SubGroup5=0;
01202 UpdateData (FALSE);
01203 }
01204
01205 nlassert (SubGroup5!=2);
01206 if (SubGroup5==0)
01207 Flags (5, false);
01208 if (SubGroup5==1)
01209 Flags (5, true);
01210 }
01211
01212 void Browse::OnSubgroup6()
01213 {
01214
01215
01216
01217 UpdateData ();
01218 if (SubGroup6==2)
01219 {
01220 SubGroup6=0;
01221 UpdateData (FALSE);
01222 }
01223
01224 nlassert (SubGroup6!=2);
01225 if (SubGroup6==0)
01226 Flags (6, false);
01227 if (SubGroup6==1)
01228 Flags (6, true);
01229 }
01230
01231 void Browse::OnSubgroup7()
01232 {
01233
01234
01235
01236 UpdateData ();
01237 if (SubGroup7==2)
01238 {
01239 SubGroup7=0;
01240 UpdateData (FALSE);
01241 }
01242
01243 nlassert (SubGroup7!=2);
01244 if (SubGroup7==0)
01245 Flags (7, false);
01246 if (SubGroup7==1)
01247 Flags (7, true);
01248 }
01249
01250 void Browse::OnSubgroup8()
01251 {
01252
01253
01254
01255 UpdateData ();
01256 if (SubGroup8==2)
01257 {
01258 SubGroup8=0;
01259 UpdateData (FALSE);
01260 }
01261
01262 nlassert (SubGroup8!=2);
01263 if (SubGroup8==0)
01264 Flags (8, false);
01265 if (SubGroup8==1)
01266 Flags (8, true);
01267 }
01268
01269 void Browse::OnSubgroup9()
01270 {
01271
01272
01273
01274 UpdateData ();
01275 if (SubGroup9==2)
01276 {
01277 SubGroup9=0;
01278 UpdateData (FALSE);
01279 }
01280
01281 nlassert (SubGroup9!=2);
01282 if (SubGroup9==0)
01283 Flags (9, false);
01284 if (SubGroup9==1)
01285 Flags (9, true);
01286 }
01287
01288 void Browse::OnSubgroup10()
01289 {
01290
01291
01292
01293 UpdateData ();
01294 if (SubGroup10==2)
01295 {
01296 SubGroup10=0;
01297 UpdateData (FALSE);
01298 }
01299
01300 nlassert (SubGroup10!=2);
01301 if (SubGroup10==0)
01302 Flags (10, false);
01303 if (SubGroup10==1)
01304 Flags (10, true);
01305 }
01306
01307 void Browse::OnSubgroup11()
01308 {
01309
01310
01311
01312 UpdateData ();
01313 if (SubGroup11==2)
01314 {
01315 SubGroup11=0;
01316 UpdateData (FALSE);
01317 }
01318
01319 nlassert (SubGroup11!=2);
01320 if (SubGroup11==0)
01321 Flags (11, false);
01322 if (SubGroup11==1)
01323 Flags (11, true);
01324 }