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