-/*\r
-BobToolz plugin for GtkRadiant\r
-Copyright (C) 2001 Gordon Biggans\r
-\r
-This library is free software; you can redistribute it and/or\r
-modify it under the terms of the GNU Lesser General Public\r
-License as published by the Free Software Foundation; either\r
-version 2.1 of the License, or (at your option) any later version.\r
-\r
-This library is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-Lesser General Public License for more details.\r
-\r
-You should have received a copy of the GNU Lesser General Public\r
-License along with this library; if not, write to the Free Software\r
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-*/\r
-\r
-// PolygonDialog.cpp : implementation file\r
-//\r
-\r
-#include "../StdAfx.h"\r
-#include "PolygonDialog.h"\r
-#include "../shapes.h"\r
-\r
-#ifdef _DEBUG\r
-#define new DEBUG_NEW\r
-#undef THIS_FILE\r
-static char THIS_FILE[] = __FILE__;\r
-#endif\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// CPolygonDialog dialog\r
-\r
-\r
-CPolygonDialog::CPolygonDialog(CWnd* pParent /*=NULL*/)\r
- : CDialog(CPolygonDialog::IDD, pParent)\r
-{\r
- //{{AFX_DATA_INIT(CPolygonDialog)\r
- m_nSideCount = 3;\r
- m_bInverse = FALSE;\r
- m_bBorder = FALSE;\r
- m_nBorderSize = 8;\r
- m_bAlignTop = FALSE;\r
- //}}AFX_DATA_INIT\r
-}\r
-\r
-void CPolygonDialog::DoDataExchange(CDataExchange* pDX)\r
-{\r
- CDialog::DoDataExchange(pDX);\r
- //{{AFX_DATA_MAP(CPolygonDialog)\r
- DDX_Text(pDX, IDC_EDIT1, m_nSideCount);\r
- DDV_MinMaxUInt(pDX, m_nSideCount, 3, MAX_POLYGON_FACES);\r
- DDX_Check(pDX, IDC_INVERSE_CHK, m_bInverse);\r
- DDX_Check(pDX, IDC_BORDER_CHK, m_bBorder);\r
- DDX_Text(pDX, IDC_BORDER_EDIT, m_nBorderSize);\r
- DDV_MinMaxUInt(pDX, m_nBorderSize, 1, 1024);\r
- DDX_Check(pDX, IDC_ALIGN_CHK, m_bAlignTop);\r
- //}}AFX_DATA_MAP\r
-}\r
-\r
-\r
-BEGIN_MESSAGE_MAP(CPolygonDialog, CDialog)\r
- //{{AFX_MSG_MAP(CPolygonDialog)\r
- ON_BN_CLICKED(IDC_BORDER_CHK, OnBorderChkClicked)\r
- ON_BN_CLICKED(IDC_INVERSE_CHK, OnInverseChkClickrd)\r
- //}}AFX_MSG_MAP\r
-END_MESSAGE_MAP()\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// CPolygonDialog message handlers\r
-\r
-BOOL CPolygonDialog::OnInitDialog() \r
-{\r
- CDialog::OnInitDialog();\r
- \r
- EnableBordered(!GetChkBool(IDC_INVERSE_CHK));\r
- EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));\r
- \r
- return TRUE; // return TRUE unless you set the focus to a control\r
- // EXCEPTION: OCX Property Pages should return FALSE\r
-}\r
-\r
-void CPolygonDialog::EnableBordered(BOOL bEnable)\r
-{\r
- CWnd* dtlChk = GetDlgItem(IDC_BORDER_CHK);\r
- if(dtlChk)\r
- dtlChk->EnableWindow(bEnable);\r
-}\r
-\r
-void CPolygonDialog::EnableBorderEdit(BOOL bEnable)\r
-{\r
- CWnd* dtlChk = GetDlgItem(IDC_BORDER_EDIT);\r
- if(dtlChk)\r
- dtlChk->EnableWindow(bEnable);\r
-}\r
-\r
-void CPolygonDialog::OnBorderChkClicked() \r
-{\r
- EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));\r
-}\r
-\r
-void CPolygonDialog::OnInverseChkClickrd() \r
-{\r
- EnableBordered(!GetChkBool(IDC_INVERSE_CHK));\r
- EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));\r
-}\r
-\r
-BOOL CPolygonDialog::GetChkBool(int nID)\r
-{\r
- CButton* btn = (CButton*)GetDlgItem(nID);\r
- if(btn)\r
- return btn->GetCheck();\r
- return FALSE;\r
-}\r
+/*
+BobToolz plugin for GtkRadiant
+Copyright (C) 2001 Gordon Biggans
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+// PolygonDialog.cpp : implementation file
+//
+
+#include "../StdAfx.h"
+#include "PolygonDialog.h"
+#include "../shapes.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CPolygonDialog dialog
+
+
+CPolygonDialog::CPolygonDialog(CWnd* pParent /*=NULL*/)
+ : CDialog(CPolygonDialog::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CPolygonDialog)
+ m_nSideCount = 3;
+ m_bInverse = FALSE;
+ m_bBorder = FALSE;
+ m_nBorderSize = 8;
+ m_bAlignTop = FALSE;
+ //}}AFX_DATA_INIT
+}
+
+void CPolygonDialog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CPolygonDialog)
+ DDX_Text(pDX, IDC_EDIT1, m_nSideCount);
+ DDV_MinMaxUInt(pDX, m_nSideCount, 3, MAX_POLYGON_FACES);
+ DDX_Check(pDX, IDC_INVERSE_CHK, m_bInverse);
+ DDX_Check(pDX, IDC_BORDER_CHK, m_bBorder);
+ DDX_Text(pDX, IDC_BORDER_EDIT, m_nBorderSize);
+ DDV_MinMaxUInt(pDX, m_nBorderSize, 1, 1024);
+ DDX_Check(pDX, IDC_ALIGN_CHK, m_bAlignTop);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CPolygonDialog, CDialog)
+ //{{AFX_MSG_MAP(CPolygonDialog)
+ ON_BN_CLICKED(IDC_BORDER_CHK, OnBorderChkClicked)
+ ON_BN_CLICKED(IDC_INVERSE_CHK, OnInverseChkClickrd)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CPolygonDialog message handlers
+
+BOOL CPolygonDialog::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ EnableBordered(!GetChkBool(IDC_INVERSE_CHK));
+ EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void CPolygonDialog::EnableBordered(BOOL bEnable)
+{
+ CWnd* dtlChk = GetDlgItem(IDC_BORDER_CHK);
+ if(dtlChk)
+ dtlChk->EnableWindow(bEnable);
+}
+
+void CPolygonDialog::EnableBorderEdit(BOOL bEnable)
+{
+ CWnd* dtlChk = GetDlgItem(IDC_BORDER_EDIT);
+ if(dtlChk)
+ dtlChk->EnableWindow(bEnable);
+}
+
+void CPolygonDialog::OnBorderChkClicked()
+{
+ EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
+}
+
+void CPolygonDialog::OnInverseChkClickrd()
+{
+ EnableBordered(!GetChkBool(IDC_INVERSE_CHK));
+ EnableBorderEdit(!GetChkBool(IDC_INVERSE_CHK) && GetChkBool(IDC_BORDER_CHK));
+}
+
+BOOL CPolygonDialog::GetChkBool(int nID)
+{
+ CButton* btn = (CButton*)GetDlgItem(nID);
+ if(btn)
+ return btn->GetCheck();
+ return FALSE;
+}