2 BobToolz plugin for GtkRadiant
\r
3 Copyright (C) 2001 Gordon Biggans
\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
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
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
20 // PolygonDialog.cpp : implementation file
\r
23 #include "../StdAfx.h"
\r
24 #include "PolygonDialog.h"
\r
25 #include "../shapes.h"
\r
28 #define new DEBUG_NEW
\r
30 static char THIS_FILE[] = __FILE__;
\r
33 /////////////////////////////////////////////////////////////////////////////
\r
34 // CPolygonDialog dialog
\r
37 CPolygonDialog::CPolygonDialog(CWnd* pParent /*=NULL*/)
\r
38 : CDialog(CPolygonDialog::IDD, pParent)
\r
40 //{{AFX_DATA_INIT(CPolygonDialog)
\r
45 m_bAlignTop = FALSE;
\r
49 void CPolygonDialog::DoDataExchange(CDataExchange* pDX)
\r
51 CDialog::DoDataExchange(pDX);
\r
52 //{{AFX_DATA_MAP(CPolygonDialog)
\r
53 DDX_Text(pDX, IDC_EDIT1, m_nSideCount);
\r
54 DDV_MinMaxUInt(pDX, m_nSideCount, 3, MAX_POLYGON_FACES);
\r
55 DDX_Check(pDX, IDC_INVERSE_CHK, m_bInverse);
\r
56 DDX_Check(pDX, IDC_BORDER_CHK, m_bBorder);
\r
57 DDX_Text(pDX, IDC_BORDER_EDIT, m_nBorderSize);
\r
58 DDV_MinMaxUInt(pDX, m_nBorderSize, 1, 1024);
\r
59 DDX_Check(pDX, IDC_ALIGN_CHK, m_bAlignTop);
\r
64 BEGIN_MESSAGE_MAP(CPolygonDialog, CDialog)
\r
65 //{{AFX_MSG_MAP(CPolygonDialog)
\r
66 ON_BN_CLICKED(IDC_BORDER_CHK, OnBorderChkClicked)
\r
67 ON_BN_CLICKED(IDC_INVERSE_CHK, OnInverseChkClickrd)
\r
71 /////////////////////////////////////////////////////////////////////////////
\r
72 // CPolygonDialog message handlers
\r
74 BOOL CPolygonDialog::OnInitDialog()
\r
76 CDialog::OnInitDialog();
\r
78 EnableBordered(!GetChkBool(IDC_INVERSE_CHK));
\r
79 EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
\r
81 return TRUE; // return TRUE unless you set the focus to a control
\r
82 // EXCEPTION: OCX Property Pages should return FALSE
\r
85 void CPolygonDialog::EnableBordered(BOOL bEnable)
\r
87 CWnd* dtlChk = GetDlgItem(IDC_BORDER_CHK);
\r
89 dtlChk->EnableWindow(bEnable);
\r
92 void CPolygonDialog::EnableBorderEdit(BOOL bEnable)
\r
94 CWnd* dtlChk = GetDlgItem(IDC_BORDER_EDIT);
\r
96 dtlChk->EnableWindow(bEnable);
\r
99 void CPolygonDialog::OnBorderChkClicked()
\r
101 EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
\r
104 void CPolygonDialog::OnInverseChkClickrd()
\r
106 EnableBordered(!GetChkBool(IDC_INVERSE_CHK));
\r
107 EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
\r
110 BOOL CPolygonDialog::GetChkBool(int nID)
\r
112 CButton* btn = (CButton*)GetDlgItem(nID);
\r
114 return btn->GetCheck();
\r