]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/dialogs/pathplotterdialog.cpp
reformat code! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / contrib / bobtoolz / dialogs / pathplotterdialog.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 // PathPlotterDialog.cpp : implementation file
21 //
22
23 #include "../StdAfx.h"
24 #include "../bobtoolz.h"
25 #include "PathPlotterDialog.h"
26
27 /////////////////////////////////////////////////////////////////////////////
28 // CPathPlotterDialog dialog
29
30
31 CPathPlotterDialog::CPathPlotterDialog(CWnd *pParent /*=NULL*/ )
32         : CDialog(CPathPlotterDialog::IDD, pParent)
33 {
34     //{{AFX_DATA_INIT(CPathPlotterDialog)
35     m_fGravity = -800.0f;
36     m_fMultiplier = 3.0f;
37     m_bNoUpdate = FALSE;
38     m_nPoints = 25;
39     m_bShowExtra = FALSE;
40     //}}AFX_DATA_INIT
41 }
42
43
44 void CPathPlotterDialog::DoDataExchange(CDataExchange *pDX)
45 {
46     CDialog::DoDataExchange(pDX);
47     //{{AFX_DATA_MAP(CPathPlotterDialog)
48     DDX_Text(pDX, IDC_GRAVITY_EDIT, m_fGravity);
49     DDV_MinMaxFloat(pDX, m_fGravity, -10000.f, -1.f);
50     DDX_Text(pDX, IDC_MULTIPLIER_EDIT, m_fMultiplier);
51     DDV_MinMaxFloat(pDX, m_fMultiplier, 1.f, 10.f);
52     DDX_Check(pDX, IDC_NOUPDATE_CHECK, m_bNoUpdate);
53     DDX_Text(pDX, IDC_POINTCOUNT_EDIT, m_nPoints);
54     DDV_MinMaxInt(pDX, m_nPoints, 1, 1000);
55     DDX_Check(pDX, IDC_SHOWEXTRA_CHECK, m_bShowExtra);
56     //}}AFX_DATA_MAP
57 }
58
59
60 BEGIN_MESSAGE_MAP( CPathPlotterDialog, CDialog
61 )
62 //{{AFX_MSG_MAP(CPathPlotterDialog)
63 ON_BN_CLICKED( IDYES, OnYes
64 )
65 ON_BN_CLICKED( IDNO, OnNo
66 )
67
68 //}}AFX_MSG_MAP
69 END_MESSAGE_MAP()
70
71 /////////////////////////////////////////////////////////////////////////////
72 // CPathPlotterDialog message handlers
73
74 void CPathPlotterDialog::OnYes()
75 {
76     if (UpdateData()) {
77         EndModalLoop(IDYES);
78     }
79 }
80
81 void CPathPlotterDialog::OnNo()
82 {
83     EndModalLoop(IDNO);
84 }