2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
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.
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.
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
20 // PolygonDialog.cpp : implementation file
23 #include "../StdAfx.h"
24 #include "PolygonDialog.h"
25 #include "../shapes.h"
30 static char THIS_FILE[] = __FILE__;
33 /////////////////////////////////////////////////////////////////////////////
34 // CPolygonDialog dialog
37 CPolygonDialog::CPolygonDialog( CWnd* pParent /*=NULL*/ )
38 : CDialog( CPolygonDialog::IDD, pParent ){
39 //{{AFX_DATA_INIT(CPolygonDialog)
48 void CPolygonDialog::DoDataExchange( CDataExchange* pDX ){
49 CDialog::DoDataExchange( pDX );
50 //{{AFX_DATA_MAP(CPolygonDialog)
51 DDX_Text( pDX, IDC_EDIT1, m_nSideCount );
52 DDV_MinMaxUInt( pDX, m_nSideCount, 3, MAX_POLYGON_FACES );
53 DDX_Check( pDX, IDC_INVERSE_CHK, m_bInverse );
54 DDX_Check( pDX, IDC_BORDER_CHK, m_bBorder );
55 DDX_Text( pDX, IDC_BORDER_EDIT, m_nBorderSize );
56 DDV_MinMaxUInt( pDX, m_nBorderSize, 1, 1024 );
57 DDX_Check( pDX, IDC_ALIGN_CHK, m_bAlignTop );
62 BEGIN_MESSAGE_MAP( CPolygonDialog, CDialog )
63 //{{AFX_MSG_MAP(CPolygonDialog)
64 ON_BN_CLICKED( IDC_BORDER_CHK, OnBorderChkClicked )
65 ON_BN_CLICKED( IDC_INVERSE_CHK, OnInverseChkClickrd )
69 /////////////////////////////////////////////////////////////////////////////
70 // CPolygonDialog message handlers
72 BOOL CPolygonDialog::OnInitDialog(){
73 CDialog::OnInitDialog();
75 EnableBordered( !GetChkBool( IDC_INVERSE_CHK ) );
76 EnableBorderEdit( !GetChkBool( IDC_INVERSE_CHK ) && GetChkBool( IDC_BORDER_CHK ) );
78 return TRUE; // return TRUE unless you set the focus to a control
79 // EXCEPTION: OCX Property Pages should return FALSE
82 void CPolygonDialog::EnableBordered( BOOL bEnable ){
83 CWnd* dtlChk = GetDlgItem( IDC_BORDER_CHK );
85 dtlChk->EnableWindow( bEnable );
89 void CPolygonDialog::EnableBorderEdit( BOOL bEnable ){
90 CWnd* dtlChk = GetDlgItem( IDC_BORDER_EDIT );
92 dtlChk->EnableWindow( bEnable );
96 void CPolygonDialog::OnBorderChkClicked(){
97 EnableBorderEdit( !GetChkBool( IDC_INVERSE_CHK ) && GetChkBool( IDC_BORDER_CHK ) );
100 void CPolygonDialog::OnInverseChkClickrd(){
101 EnableBordered( !GetChkBool( IDC_INVERSE_CHK ) );
102 EnableBorderEdit( !GetChkBool( IDC_INVERSE_CHK ) && GetChkBool( IDC_BORDER_CHK ) );
105 BOOL CPolygonDialog::GetChkBool( int nID ){
106 CButton* btn = (CButton*)GetDlgItem( nID );
108 return btn->GetCheck();