]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/dialogs/StairDialog.cpp
Merge branch 'NateEag-master-patch-12920' into 'master'
[xonotic/netradiant.git] / 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 /////////////////////////////////////////////////////////////////////////////
27 // CStairDialog dialog
28
29
30 CStairDialog::CStairDialog( CWnd* pParent /*=NULL*/ )
31         : CDialog( CStairDialog::IDD, pParent ){
32         //{{AFX_DATA_INIT(CStairDialog)
33         m_nStairHeight = 8;
34         m_StairDir = 0;
35         m_StairStyle = 0;
36         m_riserTexture = _T( "" );
37         m_bDetail = TRUE;
38         //}}AFX_DATA_INIT
39 }
40
41 void CStairDialog::DoDataExchange( CDataExchange* pDX ){
42         CDialog::DoDataExchange( pDX );
43         //{{AFX_DATA_MAP(CStairDialog)
44         DDX_Text( pDX, IDC_EDIT1, m_nStairHeight );
45         DDV_MinMaxUInt( pDX, m_nStairHeight, 1, 256 );
46         DDX_Radio( pDX, IDC_DIR_N_RADIO, m_StairDir );
47         DDX_Radio( pDX, IDC_STYLE_ORIG_RADIO, m_StairStyle );
48         DDX_Text( pDX, IDC_RISER_EDIT, m_riserTexture );
49         DDV_MaxChars( pDX, m_riserTexture, 256 );
50         DDX_Check( pDX, IDC_DETAIL_CHK, m_bDetail );
51         //}}AFX_DATA_MAP
52 }
53
54
55 BEGIN_MESSAGE_MAP( CStairDialog, CDialog )
56 //{{AFX_MSG_MAP(CStairDialog)
57 ON_BN_CLICKED( IDC_STYLE_BOB_RADIO, OnStyleBobClicked )
58 ON_BN_CLICKED( IDC_STYLE_ORIG_RADIO, OnStyleOrigClicked )
59 ON_BN_CLICKED( IDC_STYLE_CORNER_RADIO, OnStyleCornerClicked )
60 //}}AFX_MSG_MAP
61 END_MESSAGE_MAP()
62
63 /////////////////////////////////////////////////////////////////////////////
64 // CStairDialog message handlers
65
66 void CStairDialog::OnStyleBobClicked(){
67         EnableDetail( TRUE );
68 }
69
70 void CStairDialog::OnStyleOrigClicked(){
71         EnableDetail( FALSE );
72 }
73
74 void CStairDialog::EnableDetail( BOOL bEnable ){
75         CWnd* dtlChk = GetDlgItem( IDC_DETAIL_CHK );
76         if ( dtlChk ) {
77                 dtlChk->EnableWindow( bEnable );
78         }
79 }
80
81
82 BOOL CStairDialog::OnInitDialog(){
83         CDialog::OnInitDialog();
84
85         EnableDetail( m_StairStyle == 1 );
86
87         return TRUE;  // return TRUE unless you set the focus to a control
88                       // EXCEPTION: OCX Property Pages should return FALSE
89 }
90
91 void CStairDialog::OnStyleCornerClicked(){
92         EnableDetail( FALSE );
93 }