DialogTextures.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. // DialogTextures.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "Radiant.h"
  22. #include "DialogTextures.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CDialogTextures dialog
  30. CDialogTextures::CDialogTextures(CWnd* pParent /*=NULL*/)
  31. : CDialog(CDialogTextures::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(CDialogTextures)
  34. // NOTE: the ClassWizard will add member initialization here
  35. //}}AFX_DATA_INIT
  36. }
  37. void CDialogTextures::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CDialog::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(CDialogTextures)
  41. DDX_Control(pDX, IDC_LIST_TEXTURES, m_wndList);
  42. //}}AFX_DATA_MAP
  43. }
  44. BEGIN_MESSAGE_MAP(CDialogTextures, CDialog)
  45. //{{AFX_MSG_MAP(CDialogTextures)
  46. ON_LBN_DBLCLK(IDC_LIST_TEXTURES, OnDblclkListTextures)
  47. //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CDialogTextures message handlers
  51. void CDialogTextures::OnOK()
  52. {
  53. m_nSelection = m_wndList.GetCurSel();
  54. CDialog::OnOK();
  55. }
  56. void CDialogTextures::OnDblclkListTextures()
  57. {
  58. OnOK();
  59. }
  60. BOOL CDialogTextures::OnInitDialog()
  61. {
  62. CDialog::OnInitDialog();
  63. CStringArray sa;
  64. FillTextureMenu(&sa);
  65. m_nSelection = -1;
  66. for (int i = 0; i < sa.GetSize(); i ++)
  67. {
  68. m_wndList.AddString(sa.GetAt(i));
  69. }
  70. return TRUE; // return TRUE unless you set the focus to a control
  71. // EXCEPTION: OCX Property Pages should return FALSE
  72. }