Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

BSInput.cpp (3367B)


      1 /*
      2 ===========================================================================
      3 Copyright (C) 1999-2005 Id Software, Inc.
      4 
      5 This file is part of Quake III Arena source code.
      6 
      7 Quake III Arena source code is free software; you can redistribute it
      8 and/or modify it under the terms of the GNU General Public License as
      9 published by the Free Software Foundation; either version 2 of the License,
     10 or (at your option) any later version.
     11 
     12 Quake III Arena source code is distributed in the hope that it will be
     13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 GNU General Public License for more details.
     16 
     17 You should have received a copy of the GNU General Public License
     18 along with Foobar; if not, write to the Free Software
     19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20 ===========================================================================
     21 */
     22 // BSInput.cpp : implementation file
     23 //
     24 
     25 #include "stdafx.h"
     26 #include "Radiant.h"
     27 #include "BSInput.h"
     28 
     29 #ifdef _DEBUG
     30 #define new DEBUG_NEW
     31 #undef THIS_FILE
     32 static char THIS_FILE[] = __FILE__;
     33 #endif
     34 
     35 /////////////////////////////////////////////////////////////////////////////
     36 // CBSInput dialog
     37 
     38 
     39 CBSInput::CBSInput(CWnd* pParent /*=NULL*/)
     40 	: CDialog(CBSInput::IDD, pParent)
     41 {
     42 	//{{AFX_DATA_INIT(CBSInput)
     43 	m_fField1 = 0.0f;
     44 	m_fField2 = 0.0f;
     45 	m_fField3 = 0.0f;
     46 	m_fField4 = 0.0f;
     47 	m_fField5 = 0.0f;
     48 	m_strField1 = _T("");
     49 	m_strField2 = _T("");
     50 	m_strField3 = _T("");
     51 	m_strField4 = _T("");
     52 	m_strField5 = _T("");
     53 	//}}AFX_DATA_INIT
     54 }
     55 
     56 
     57 void CBSInput::DoDataExchange(CDataExchange* pDX)
     58 {
     59 	CDialog::DoDataExchange(pDX);
     60 	//{{AFX_DATA_MAP(CBSInput)
     61 	DDX_Text(pDX, IDC_EDIT_FIELD1, m_fField1);
     62 	DDX_Text(pDX, IDC_EDIT_FIELD2, m_fField2);
     63 	DDX_Text(pDX, IDC_EDIT_FIELD3, m_fField3);
     64 	DDX_Text(pDX, IDC_EDIT_FIELD4, m_fField4);
     65 	DDX_Text(pDX, IDC_EDIT_FIELD5, m_fField5);
     66 	DDX_Text(pDX, IDC_STATIC_FIELD1, m_strField1);
     67 	DDX_Text(pDX, IDC_STATIC_FIELD2, m_strField2);
     68 	DDX_Text(pDX, IDC_STATIC_FIELD3, m_strField3);
     69 	DDX_Text(pDX, IDC_STATIC_FIELD4, m_strField4);
     70 	DDX_Text(pDX, IDC_STATIC_FIELD5, m_strField5);
     71 	//}}AFX_DATA_MAP
     72 }
     73 
     74 
     75 BEGIN_MESSAGE_MAP(CBSInput, CDialog)
     76 	//{{AFX_MSG_MAP(CBSInput)
     77 	//}}AFX_MSG_MAP
     78 END_MESSAGE_MAP()
     79 
     80 /////////////////////////////////////////////////////////////////////////////
     81 // CBSInput message handlers
     82 
     83 BOOL CBSInput::OnInitDialog() 
     84 {
     85 	CDialog::OnInitDialog();
     86 
     87   if (m_strField1.GetLength() == 0)
     88   {
     89     GetDlgItem(IDC_EDIT_FIELD1)->ShowWindow(SW_HIDE);
     90     GetDlgItem(IDC_STATIC_FIELD1)->ShowWindow(SW_HIDE);
     91   }
     92   if (m_strField2.GetLength() == 0)
     93   {
     94     GetDlgItem(IDC_EDIT_FIELD2)->ShowWindow(SW_HIDE);
     95     GetDlgItem(IDC_STATIC_FIELD2)->ShowWindow(SW_HIDE);
     96   }
     97   if (m_strField3.GetLength() == 0)
     98   {
     99     GetDlgItem(IDC_EDIT_FIELD3)->ShowWindow(SW_HIDE);
    100     GetDlgItem(IDC_STATIC_FIELD3)->ShowWindow(SW_HIDE);
    101   }
    102   if (m_strField4.GetLength() == 0)
    103   {
    104     GetDlgItem(IDC_EDIT_FIELD4)->ShowWindow(SW_HIDE);
    105     GetDlgItem(IDC_STATIC_FIELD4)->ShowWindow(SW_HIDE);
    106   }
    107   if (m_strField5.GetLength() == 0)
    108   {
    109     GetDlgItem(IDC_EDIT_FIELD5)->ShowWindow(SW_HIDE);
    110     GetDlgItem(IDC_STATIC_FIELD5)->ShowWindow(SW_HIDE);
    111   }
    112 	
    113 	return TRUE;  // return TRUE unless you set the focus to a control
    114 	              // EXCEPTION: OCX Property Pages should return FALSE
    115 }