]> icculus.org git repositories - taylor/freespace2.git/blob - src/fred2/prefsdlg.cpp
Initial revision
[taylor/freespace2.git] / src / fred2 / prefsdlg.cpp
1 /*
2  * $Logfile: /Freespace2/code/FRED2/PrefsDlg.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Fred Preferences dialog box handling code
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:08  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 6:28p Dave
15  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
16  * Fred. Globalized mission and campaign file extensions. Removed Silent
17  * Threat specific code.
18  * 
19  * 1     10/07/98 3:01p Dave
20  * 
21  * 1     10/07/98 3:00p Dave
22  * 
23  * 3     2/17/97 5:28p Hoffoss
24  * Checked RCS headers, added them were missing, changing description to
25  * something better, etc where needed.
26  *
27  * $NoKeywords: $
28  */
29
30 #include "stdafx.h"
31 #include "fred.h"
32 #include "prefsdlg.h"
33 #include "freddoc.h"
34 #include "fredview.h"
35
36 #ifdef _DEBUG
37 #define new DEBUG_NEW
38 #undef THIS_FILE
39 static char THIS_FILE[] = __FILE__;
40 #endif
41
42 /////////////////////////////////////////////////////////////////////////////
43 // CPrefsDlg dialog
44
45
46
47 CPrefsDlg::CPrefsDlg(CWnd* pParent /*=NULL*/)
48         : CDialog(CPrefsDlg::IDD, pParent)
49 {
50         //{{AFX_DATA_INIT(CPrefsDlg)
51         m_ConfirmDeleting = TRUE;
52         m_ShowCapitalShips = TRUE;
53         m_ShowElevations = TRUE;
54         m_ShowFighters = TRUE;
55         m_ShowGrid = TRUE;
56         m_ShowMiscObjects = TRUE;
57         m_ShowPlanets = TRUE;
58         m_ShowWaypoints = TRUE;
59         m_ShowStarfield = FALSE;
60         //}}AFX_DATA_INIT
61 }
62
63 extern int Show_stars;
64
65 void CPrefsDlg::DoDataExchange(CDataExchange* pDX)
66 {
67         CDialog::DoDataExchange(pDX);
68         //{{AFX_DATA_MAP(CPrefsDlg)
69         DDX_Check(pDX, ID_CONFIRM_DELETING, m_ConfirmDeleting);
70         DDX_Check(pDX, ID_SHOW_CAPITALSHIPS, m_ShowCapitalShips);
71         DDX_Check(pDX, ID_SHOW_ELEVATIONS, m_ShowElevations);
72         DDX_Check(pDX, ID_SHOW_FIGHTERS, m_ShowFighters);
73         DDX_Check(pDX, ID_SHOW_GRID, m_ShowGrid);
74         DDX_Check(pDX, ID_SHOW_MISCOBJECTS, m_ShowMiscObjects);
75         DDX_Check(pDX, ID_SHOW_PLANETS, m_ShowPlanets);
76         DDX_Check(pDX, ID_SHOW_WAYPOINTS, m_ShowWaypoints);
77         DDX_Check(pDX, IDC_PREF_STARFIELD, m_ShowStarfield);
78         //}}AFX_DATA_MAP
79
80         Show_stars = m_ShowStarfield;
81         // CFREDView::SetViewParms(m_ConfirmDeleting);
82 }
83
84
85 BEGIN_MESSAGE_MAP(CPrefsDlg, CDialog)
86         //{{AFX_MSG_MAP(CPrefsDlg)
87         ON_BN_CLICKED(IDC_SAVE_DEFAULT_PREFS, OnSaveDefaultPrefs)
88         ON_WM_CLOSE()
89         //}}AFX_MSG_MAP
90 END_MESSAGE_MAP()
91
92 /////////////////////////////////////////////////////////////////////////////
93 // CPrefsDlg message handlers
94
95 void CPrefsDlg::OnSaveDefaultPrefs() 
96 {
97         // Put code to save user prefs here.
98         
99         m_ConfirmDeleting = 1;
100 }
101
102 void CPrefsDlg::OnClose() 
103 {
104         // MessageBeep((WORD) -1);
105         
106         CDialog::OnClose();
107 }
108
109 BOOL CPrefsDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
110 {
111         // MessageBeep((WORD) -1);
112         
113         return CDialog::Create(IDD, pParentWnd);
114 }