]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - misc/mediasource/extra/netradiant-src/contrib/bobtoolz/dialogs/StairDialog.cpp
Rename the compiled fteqcc to fteqcc-win32 (as that's what it is)
[voretournament/voretournament.git] / misc / mediasource / extra / netradiant-src / contrib / bobtoolz / dialogs / StairDialog.cpp
1 /*
2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20 // StairDialog.cpp : implementation file
21 //
22
23 #include "../StdAfx.h"
24 #include "StairDialog.h"
25
26 #ifdef _DEBUG
27 #define new DEBUG_NEW
28 #undef THIS_FILE
29 static char THIS_FILE[] = __FILE__;
30 #endif
31
32 /////////////////////////////////////////////////////////////////////////////
33 // CStairDialog dialog
34
35
36 CStairDialog::CStairDialog(CWnd* pParent /*=NULL*/)
37         : CDialog(CStairDialog::IDD, pParent)
38 {
39         //{{AFX_DATA_INIT(CStairDialog)
40         m_nStairHeight = 8;
41         m_StairDir = 0;
42         m_StairStyle = 0;
43         m_riserTexture = _T("");
44         m_bDetail = TRUE;
45         //}}AFX_DATA_INIT
46 }
47
48 void CStairDialog::DoDataExchange(CDataExchange* pDX)
49 {
50         CDialog::DoDataExchange(pDX);
51         //{{AFX_DATA_MAP(CStairDialog)
52         DDX_Text(pDX, IDC_EDIT1, m_nStairHeight);
53         DDV_MinMaxUInt(pDX, m_nStairHeight, 1, 256);
54         DDX_Radio(pDX, IDC_DIR_N_RADIO, m_StairDir);
55         DDX_Radio(pDX, IDC_STYLE_ORIG_RADIO, m_StairStyle);
56         DDX_Text(pDX, IDC_RISER_EDIT, m_riserTexture);
57         DDV_MaxChars(pDX, m_riserTexture, 256);
58         DDX_Check(pDX, IDC_DETAIL_CHK, m_bDetail);
59         //}}AFX_DATA_MAP
60 }
61
62
63 BEGIN_MESSAGE_MAP(CStairDialog, CDialog)
64         //{{AFX_MSG_MAP(CStairDialog)
65         ON_BN_CLICKED(IDC_STYLE_BOB_RADIO, OnStyleBobClicked)
66         ON_BN_CLICKED(IDC_STYLE_ORIG_RADIO, OnStyleOrigClicked)
67         ON_BN_CLICKED(IDC_STYLE_CORNER_RADIO, OnStyleCornerClicked)
68         //}}AFX_MSG_MAP
69 END_MESSAGE_MAP()
70
71 /////////////////////////////////////////////////////////////////////////////
72 // CStairDialog message handlers
73
74 void CStairDialog::OnStyleBobClicked() 
75 {
76         EnableDetail(TRUE);
77 }
78
79 void CStairDialog::OnStyleOrigClicked() 
80 {
81         EnableDetail(FALSE);
82 }
83
84 void CStairDialog::EnableDetail(BOOL bEnable)
85 {
86         CWnd* dtlChk = GetDlgItem(IDC_DETAIL_CHK);
87         if(dtlChk)
88                 dtlChk->EnableWindow(bEnable);
89 }
90
91
92 BOOL CStairDialog::OnInitDialog() 
93 {
94         CDialog::OnInitDialog();
95         
96         EnableDetail(m_StairStyle == 1);
97         
98         return TRUE;  // return TRUE unless you set the focus to a control
99                       // EXCEPTION: OCX Property Pages should return FALSE
100 }
101
102 void CStairDialog::OnStyleCornerClicked() 
103 {
104         EnableDetail(FALSE);    
105 }