2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
29 #include "../../idlib/precompiled.h"
34 #include "NewTexWnd.h"
37 #include "../../renderer/tr_local.h"
42 static char THIS_FILE[] = __FILE__;
46 =======================================================================================================================
47 =======================================================================================================================
49 bool Sys_KeyDown( int key ) {
50 return ( ( ::GetAsyncKeyState( key ) & 0x8000 ) != 0 );
54 IMPLEMENT_DYNCREATE(CNewTexWnd, CWnd);
57 =======================================================================================================================
58 =======================================================================================================================
60 CNewTexWnd::CNewTexWnd() {
64 cursor.x = cursor.y = 0;
65 origin.x = origin.y = 0;
69 =======================================================================================================================
70 =======================================================================================================================
72 CNewTexWnd::~CNewTexWnd() {
75 BEGIN_MESSAGE_MAP(CNewTexWnd, CWnd)
76 //{{AFX_MSG_MAP(CNewTexWnd)
96 // =======================================================================================================================
97 // CNewTexWnd message handlers
98 // =======================================================================================================================
100 BOOL CNewTexWnd::PreCreateWindow(CREATESTRUCT &cs) {
102 HINSTANCE hInstance = AfxGetInstanceHandle();
103 if (::GetClassInfo(hInstance, TEXTURE_WINDOW_CLASS, &wc) == FALSE) {
104 // Register a new class
105 memset(&wc, 0, sizeof(wc));
106 wc.style = CS_NOCLOSE | CS_PARENTDC; // | CS_OWNDC;
107 wc.lpszClassName = TEXTURE_WINDOW_CLASS;
108 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
109 wc.lpfnWndProc = ::DefWindowProc;
110 if (AfxRegisterClass(&wc) == FALSE) {
111 Error("CNewTexWnd RegisterClass: failed");
115 cs.lpszClass = TEXTURE_WINDOW_CLASS;
117 if (cs.style != QE3_CHILDSTYLE && cs.style != QE3_STYLE) {
118 cs.style = QE3_SPLITTER_STYLE;
121 return CWnd::PreCreateWindow(cs);
125 =======================================================================================================================
126 =======================================================================================================================
128 int CNewTexWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) {
129 if (CWnd::OnCreate(lpCreateStruct) == -1) {
133 ShowScrollBar(SB_VERT, g_PrefsDlg.m_bTextureScrollbar);
136 hdcTexture = GetDC();
137 QEW_SetupPixelFormat(hdcTexture->m_hDC, false);
139 EnableToolTips(TRUE);
140 EnableTrackingToolTips(TRUE);
146 =======================================================================================================================
147 =======================================================================================================================
149 void CNewTexWnd::OnSize(UINT nType, int cx, int cy) {
150 CWnd::OnSize(nType, cx, cy);
151 GetClientRect(rectClient);
156 =======================================================================================================================
157 =======================================================================================================================
159 void CNewTexWnd::OnParentNotify(UINT message, LPARAM lParam) {
160 CWnd::OnParentNotify(message, lParam);
164 =======================================================================================================================
165 =======================================================================================================================
167 void CNewTexWnd::UpdatePrefs() {
168 ShowScrollBar(SB_VERT, g_PrefsDlg.m_bTextureScrollbar);
175 =======================================================================================================================
176 =======================================================================================================================
178 void CNewTexWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {
179 g_pParentWnd->HandleKey(nChar, nRepCnt, nFlags);
183 =======================================================================================================================
184 =======================================================================================================================
186 void CNewTexWnd::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) {
187 g_pParentWnd->HandleKey(nChar, nRepCnt, nFlags, false);
191 =======================================================================================================================
192 =======================================================================================================================
194 const idMaterial *CNewTexWnd::NextPos() {
195 const idMaterial *mat = NULL;
197 if (currentIndex >= declManager->GetNumDecls( DECL_MATERIAL )) {
201 mat = declManager->MaterialByIndex(currentIndex, false);
205 //if (mat->getName()[0] == '(') { // fake color texture
209 if ( !mat->IsValid() ) {
213 if (!mat->TestMaterialFlag(MF_EDITOR_VISIBLE)) {
219 // ensure it is uploaded
220 declManager->FindMaterial(mat->GetName());
222 int width = mat->GetEditorImage()->uploadWidth * ((float)g_PrefsDlg.m_nTextureScale / 100);
223 int height = mat->GetEditorImage()->uploadHeight * ((float)g_PrefsDlg.m_nTextureScale / 100);
225 if (current.x + width > rectClient.Width() - 8 && currentRow) {
226 // go to the next row unless the texture is the first on the row
228 current.y -= currentRow + FONT_HEIGHT + 4;
234 // Is our texture larger than the row? If so, grow the row height to match it
235 if (currentRow < height) {
239 // never go less than 64, or the names get all crunched up
240 current.x += width < 64 ? 64 : width;
246 =======================================================================================================================
247 =======================================================================================================================
249 void CNewTexWnd::OnPaint() {
251 CPaintDC dc(this); // device context for painting
253 int nOld = g_qeglobals.d_texturewin.m_nTotalHeight;
255 //hdcTexture = GetDC();
256 if (!qwglMakeCurrent(dc.GetSafeHdc(), win32.hGLRC)) {
257 common->Printf("ERROR: wglMakeCurrent failed..\n ");
263 g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][0],
264 g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][1],
265 g_qeglobals.d_savedinfo.colors[COLOR_TEXTUREBACK][2],
268 qglViewport(0, 0, rectClient.Width(), rectClient.Height());
269 qglScissor(0, 0, rectClient.Width(), rectClient.Height());
270 qglMatrixMode(GL_PROJECTION);
272 qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
273 qglDisable(GL_DEPTH_TEST);
274 qglDisable(GL_BLEND);
275 qglOrtho(0, rectClient.Width(), origin.y - rectClient.Height(), origin.y, -100, 100);
276 qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
284 const idMaterial *mat = NextPos();
289 int width = mat->GetEditorImage()->uploadWidth * ((float)g_PrefsDlg.m_nTextureScale / 100);
290 int height = mat->GetEditorImage()->uploadHeight * ((float)g_PrefsDlg.m_nTextureScale / 100);
292 // Is this texture visible?
293 if ((draw.y - height - FONT_HEIGHT < origin.y) && (draw.y > origin.y - rectClient.Height())) {
294 // if in use, draw a background
297 globalImages->BindNull();
298 qglBegin(GL_LINE_LOOP);
299 qglVertex2f(draw.x - 1, draw.y + 1 - FONT_HEIGHT);
300 qglVertex2f(draw.x - 1, draw.y - height - 1 - FONT_HEIGHT);
301 qglVertex2f(draw.x + 1 + width, draw.y - height - 1 - FONT_HEIGHT);
302 qglVertex2f(draw.x + 1 + width, draw.y + 1 - FONT_HEIGHT);
306 float fScale = (g_PrefsDlg.m_bHiColorTextures == TRUE) ? ((float)g_PrefsDlg.m_nTextureScale / 100) : 1.0;
308 mat->GetEditorImage()->Bind();
309 QE_CheckOpenGLForErrors();
313 qglVertex2f(draw.x, draw.y - FONT_HEIGHT);
315 qglVertex2f(draw.x + width, draw.y - FONT_HEIGHT);
317 qglVertex2f(draw.x + width, draw.y - FONT_HEIGHT - height);
319 qglVertex2f(draw.x, draw.y - FONT_HEIGHT - height);
322 // draw the selection border
323 if ( !idStr::Icmp(g_qeglobals.d_texturewin.texdef.name, mat->GetName()) ) {
326 globalImages->BindNull();
328 qglBegin(GL_LINE_LOOP);
329 qglVertex2f(draw.x - 4, draw.y - FONT_HEIGHT + 4);
330 qglVertex2f(draw.x - 4, draw.y - FONT_HEIGHT - height - 4);
331 qglVertex2f(draw.x + 4 + width, draw.y - FONT_HEIGHT - height - 4);
332 qglVertex2f(draw.x + 4 + width, draw.y - FONT_HEIGHT + 4);
338 // draw the texture name
339 globalImages->BindNull();
341 qglRasterPos2f(draw.x, draw.y - FONT_HEIGHT + 2);
343 // don't draw the directory name
344 for (name = mat->GetName(); *name && *name != '/' && *name != '\\'; name++) {
349 name = mat->GetName();
354 qglCallLists(strlen(name), GL_UNSIGNED_BYTE, name);
355 //qglCallLists(va("%s -- %d, %d" strlen(name), GL_UNSIGNED_BYTE, name);
359 g_qeglobals.d_texturewin.m_nTotalHeight = abs(draw.y) + 100;
361 // reset the current texture
362 globalImages->BindNull();
364 qwglSwapBuffers(dc.GetSafeHdc());
365 TRACE("Texture Paint\n");
368 if (g_PrefsDlg.m_bTextureScrollbar && (m_bNeedRange || g_qeglobals.d_texturewin.m_nTotalHeight != nOld)) {
369 m_bNeedRange = false;
370 SetScrollRange(SB_VERT, 0, g_qeglobals.d_texturewin.m_nTotalHeight, TRUE);
373 //ReleaseDC(hdcTexture);
377 =======================================================================================================================
378 =======================================================================================================================
380 void CNewTexWnd::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) {
381 CWnd::OnVScroll(nSBCode, nPos, pScrollBar);
383 int n = GetScrollPos(SB_VERT);
387 n = (n - 15 > 0) ? n - 15 : 0;
392 n = (n + 15 < g_qeglobals.d_texturewin.m_nTotalHeight) ? n + 15 : n;
397 n = (n - g_qeglobals.d_texturewin.height > 0) ? n - g_qeglobals.d_texturewin.height : 0;
402 n = (n + g_qeglobals.d_texturewin.height < g_qeglobals.d_texturewin.m_nTotalHeight) ? n + g_qeglobals.d_texturewin.height : n;
406 case SB_THUMBPOSITION: {
411 case SB_THUMBTRACK: {
417 SetScrollPos(SB_VERT, n);
422 // Sys_UpdateWindows(W_TEXTURE);
425 BOOL CNewTexWnd::DestroyWindow() {
426 ReleaseDC(hdcTexture);
427 return CWnd::DestroyWindow();
431 =======================================================================================================================
432 =======================================================================================================================
434 BOOL CNewTexWnd::Create
436 LPCTSTR lpszClassName,
437 LPCTSTR lpszWindowName,
442 CCreateContext *pContext
444 BOOL ret = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
446 hdcTexture = GetDC();
447 QEW_SetupPixelFormat(hdcTexture->m_hDC, false);
453 const idMaterial *CNewTexWnd::getMaterialAtPoint(CPoint point) {
456 int my = rectClient.Height() - 1 - point.y;
457 my += origin.y - rectClient.Height();
465 const idMaterial *mat = NextPos();
470 int width = mat->GetEditorImage()->uploadWidth * ((float)g_PrefsDlg.m_nTextureScale / 100);
471 int height = mat->GetEditorImage()->uploadHeight * ((float)g_PrefsDlg.m_nTextureScale / 100);
472 //if (point.x > draw.x && point.x - draw.x < width && my < draw.y && my + draw.y < height + FONT_HEIGHT) {
473 if (point.x > draw.x && point.x - draw.x < width && my < draw.y && draw.y - my < height + FONT_HEIGHT) {
481 =======================================================================================================================
482 =======================================================================================================================
484 void CNewTexWnd::OnLButtonDown(UINT nFlags, CPoint point) {
488 bool fitScale = Sys_KeyDown(VK_CONTROL);
489 bool edit = Sys_KeyDown(VK_SHIFT) && !fitScale;
491 const idMaterial *mat = getMaterialAtPoint(point);
493 Select_SetDefaultTexture(mat, fitScale, true);
495 Sys_Status("Did not select a texture\n", 0);
499 UpdateSurfaceDialog();
500 UpdatePatchInspector();
504 =======================================================================================================================
505 =======================================================================================================================
507 void CNewTexWnd::OnMButtonDown(UINT nFlags, CPoint point) {
508 CWnd::OnMButtonDown(nFlags, point);
513 =======================================================================================================================
514 =======================================================================================================================
516 void CNewTexWnd::OnRButtonDown(UINT nFlags, CPoint point) {
522 ===============================t========================================================================================
523 =======================================================================================================================
525 void CNewTexWnd::OnLButtonUp(UINT nFlags, CPoint point) {
526 CWnd::OnLButtonUp(nFlags, point);
527 g_pParentWnd->SetFocus();
531 =======================================================================================================================
532 =======================================================================================================================
534 void CNewTexWnd::OnMButtonUp(UINT nFlags, CPoint point) {
535 CWnd::OnMButtonUp(nFlags, point);
539 =======================================================================================================================
540 =======================================================================================================================
542 void CNewTexWnd::OnRButtonUp(UINT nFlags, CPoint point) {
543 CWnd::OnRButtonUp(nFlags, point);
546 extern float fDiff(float f1, float f2);
549 =======================================================================================================================
550 =======================================================================================================================
552 void CNewTexWnd::OnMouseMove(UINT nFlags, CPoint point) {
555 if (Sys_KeyDown(VK_SHIFT)) {
559 // rbutton = drag texture origin
560 if (Sys_KeyDown(VK_RBUTTON)) {
561 if (point.y != cursor.y) {
562 if (Sys_KeyDown(VK_MENU)) {
564 long *px2 = &cursor.x;
566 if (fDiff(point.y, cursor.y) > fDiff(point.x, cursor.x)) {
573 g_PrefsDlg.m_nTextureScale += 4;
574 if (g_PrefsDlg.m_nTextureScale > 500) {
575 g_PrefsDlg.m_nTextureScale = 500;
578 else if (*px < *px2) {
580 g_PrefsDlg.m_nTextureScale -= 4;
581 if (g_PrefsDlg.m_nTextureScale < 1) {
582 g_PrefsDlg.m_nTextureScale = 1;
587 CPoint screen = cursor;
588 ClientToScreen(&screen);
589 SetCursorPos(screen.x, screen.y);
590 //Sys_SetCursorPos(cursor.x, cursor.y);
591 InvalidateRect(NULL, false);
594 else if (point.y != cursor.y || point.x != cursor.x) {
595 origin.y += (point.y - cursor.y) * scale;
600 //Sys_SetCursorPos(cursor.x, cursor.y);
601 CPoint screen = cursor;
602 ClientToScreen(&screen);
603 SetCursorPos(screen.x, screen.y);
604 if (g_PrefsDlg.m_bTextureScrollbar) {
605 SetScrollPos(SB_VERT, abs(origin.y));
608 InvalidateRect(NULL, false);
618 =======================================================================================================================
619 =======================================================================================================================
621 void CNewTexWnd::LoadMaterials() {
625 void Texture_SetTexture(texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale, bool bSetSelection) {
627 if (texdef->name[0] == '(') {
628 Sys_Status("Can't select an entity texture\n", 0);
632 g_qeglobals.d_texturewin.texdef = *texdef;
635 // store the texture coordinates for new brush primitive mode be sure that all the
636 // callers are using the default 2x2 texture
638 if (g_qeglobals.m_bBrushPrimitMode) {
639 g_qeglobals.d_texturewin.brushprimit_texdef = *brushprimit_texdef;
642 g_dlgFind.updateTextures(texdef->name);
644 if (!g_dlgFind.isOpen() && bSetSelection) {
645 Select_SetTexture(texdef, brushprimit_texdef, bFitScale);
648 g_Inspectors->texWnd.EnsureTextureIsVisible(texdef->name);
650 if ( g_Inspectors->mediaDlg.IsWindowVisible() ) {
651 g_Inspectors->mediaDlg.SelectCurrentItem(true, g_qeglobals.d_texturewin.texdef.name, CDialogTextures::MATERIALS);
654 g_qeglobals.d_texturewin.texdef = *texdef;
655 // store the texture coordinates for new brush primitive mode be sure that all the
656 // callers are using the default 2x2 texture
658 if (g_qeglobals.m_bBrushPrimitMode) {
659 g_qeglobals.d_texturewin.brushprimit_texdef = *brushprimit_texdef;
663 Sys_UpdateWindows(W_TEXTURE);
668 const idMaterial *Texture_LoadLight(const char *name) {
669 return declManager->FindMaterial(name);
673 void Texture_ClearInuse(void) {
676 void Texture_ShowAll(void) {
677 int count = declManager->GetNumDecls( DECL_MATERIAL );
678 for (int i = 0; i < count; i++) {
679 const idMaterial *mat = declManager->MaterialByIndex(i, false);
681 mat->SetMaterialFlag(MF_EDITOR_VISIBLE);
684 g_Inspectors->SetWindowText("Textures (all)");
685 Sys_UpdateWindows(W_TEXTURE);
688 void Texture_HideAll() {
689 int count = declManager->GetNumDecls( DECL_MATERIAL );
690 for (int i = 0; i < count; i++) {
691 const idMaterial *mat = declManager->MaterialByIndex(i, false);
693 mat->ClearMaterialFlag(MF_EDITOR_VISIBLE);
696 g_Inspectors->SetWindowText("Textures (all)");
697 Sys_UpdateWindows(W_TEXTURE);
700 const idMaterial *Texture_ForName(const char *name) {
701 const idMaterial *mat = declManager->FindMaterial(name);
703 mat = declManager->FindMaterial("_default");
705 mat->SetMaterialFlag(MF_EDITOR_VISIBLE);
710 void Texture_ShowInuse(void) {
714 for (b = active_brushes.next; b != NULL && b != &active_brushes; b = b->next) {
716 Texture_ForName(b->pPatch->d_texture->GetName());
718 for (face_t *f = b->brush_faces; f; f = f->next) {
719 Texture_ForName(f->texdef.name);
724 for (b = selected_brushes.next; b != NULL && b != &selected_brushes; b = b->next) {
726 Texture_ForName(b->pPatch->d_texture->GetName());
728 for (face_t *f = b->brush_faces; f; f = f->next) {
729 Texture_ForName(f->texdef.name);
734 Sys_UpdateWindows(W_TEXTURE);
736 g_Inspectors->SetWindowText("Textures (in use)");
739 void Texture_Cleanup(CStringList *pList) {
742 int texture_mode = GL_LINEAR_MIPMAP_LINEAR;
743 bool texture_showinuse = true;
747 =======================================================================================================================
749 =======================================================================================================================
751 void Texture_SetMode(int iMenu) {
754 bool texturing = true;
756 hMenu = GetMenu(g_pParentWnd->GetSafeHwnd());
760 case ID_VIEW_NEAREST:
763 case ID_VIEW_NEARESTMIPMAP:
764 iMode = GL_NEAREST_MIPMAP_NEAREST;
767 iMode = GL_NEAREST_MIPMAP_LINEAR;
769 case ID_VIEW_BILINEAR:
772 case ID_VIEW_BILINEARMIPMAP:
773 iMode = GL_LINEAR_MIPMAP_NEAREST;
775 case ID_VIEW_TRILINEAR:
776 iMode = GL_LINEAR_MIPMAP_LINEAR;
779 case ID_TEXTURES_WIREFRAME:
784 case ID_TEXTURES_FLATSHADE:
791 CheckMenuItem(hMenu, ID_VIEW_NEAREST, MF_BYCOMMAND | MF_UNCHECKED);
792 CheckMenuItem(hMenu, ID_VIEW_NEARESTMIPMAP, MF_BYCOMMAND | MF_UNCHECKED);
793 CheckMenuItem(hMenu, ID_VIEW_LINEAR, MF_BYCOMMAND | MF_UNCHECKED);
794 CheckMenuItem(hMenu, ID_VIEW_BILINEARMIPMAP, MF_BYCOMMAND | MF_UNCHECKED);
795 CheckMenuItem(hMenu, ID_VIEW_BILINEAR, MF_BYCOMMAND | MF_UNCHECKED);
796 CheckMenuItem(hMenu, ID_VIEW_TRILINEAR, MF_BYCOMMAND | MF_UNCHECKED);
797 CheckMenuItem(hMenu, ID_TEXTURES_WIREFRAME, MF_BYCOMMAND | MF_UNCHECKED);
798 CheckMenuItem(hMenu, ID_TEXTURES_FLATSHADE, MF_BYCOMMAND | MF_UNCHECKED);
800 CheckMenuItem(hMenu, iMenu, MF_BYCOMMAND | MF_CHECKED);
802 g_qeglobals.d_savedinfo.iTexMenu = iMenu;
803 texture_mode = iMode;
805 if (!texturing && iMenu == ID_TEXTURES_WIREFRAME) {
806 g_pParentWnd->GetCamera()->Camera().draw_mode = cd_wire;
807 Map_BuildBrushData();
808 Sys_UpdateWindows(W_ALL);
811 else if (!texturing && iMenu == ID_TEXTURES_FLATSHADE) {
812 g_pParentWnd->GetCamera()->Camera().draw_mode = cd_solid;
813 Map_BuildBrushData();
814 Sys_UpdateWindows(W_ALL);
818 if (g_pParentWnd->GetCamera()->Camera().draw_mode != cd_texture) {
819 g_pParentWnd->GetCamera()->Camera().draw_mode = cd_texture;
820 Map_BuildBrushData();
823 Sys_UpdateWindows(W_ALL);
828 void CNewTexWnd::EnsureTextureIsVisible(const char *name) {
829 // scroll origin so the texture is completely on screen
837 const idMaterial *mat = NextPos();
842 int width = mat->GetEditorImage()->uploadWidth * ((float)g_PrefsDlg.m_nTextureScale / 100);
843 int height = mat->GetEditorImage()->uploadHeight * ((float)g_PrefsDlg.m_nTextureScale / 100);
845 if ( !idStr::Icmp(name, mat->GetName()) ) {
846 if (current.y > origin.y) {
847 origin.y = current.y;
848 Sys_UpdateWindows(W_TEXTURE);
852 if (current.y - height - 2 * FONT_HEIGHT < origin.y - rectClient.Height()) {
853 origin.y = current.y - height - 2 * FONT_HEIGHT + rectClient.Height();
854 Sys_UpdateWindows(W_TEXTURE);
865 BOOL CNewTexWnd::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) {
866 static char tip[1024];
868 GetCursorPos(&point);
869 const idMaterial *mat = getMaterialAtPoint(point);
872 TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
873 strcpy(tip, mat->GetDescription());
874 pTTT->lpszText = tip;
881 int CNewTexWnd::OnToolHitTest(CPoint point, TOOLINFO * pTI)
883 const idMaterial *mat = getMaterialAtPoint(point);
890 BOOL CNewTexWnd::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
892 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
893 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
894 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
895 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
896 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
897 OnVScroll((zDelta >= 0) ? SB_LINEUP : SB_LINEDOWN, 0, NULL);
901 BOOL CNewTexWnd::PreTranslateMessage(MSG* pMsg)
903 if (pMsg->message == WM_KEYDOWN) {
904 if (pMsg->wParam == VK_ESCAPE) {
905 g_pParentWnd->GetCamera()->SetFocus();
909 if (pMsg->wParam == VK_RIGHT || pMsg->wParam == VK_LEFT || pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN) {
910 g_pParentWnd->PostMessage(WM_KEYDOWN, pMsg->wParam);
914 return CWnd::PreTranslateMessage(pMsg);
917 void CNewTexWnd::OnSetFocus(CWnd* pOldWnd)
919 CWnd::OnSetFocus(pOldWnd);