2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/FRED2/StarfieldEditor.cpp $
15 * Starfield editor dialog handling code
18 * Revision 1.3 2002/06/09 04:41:17 relnev
19 * added copyright header
21 * Revision 1.2 2002/05/07 03:16:44 theoddone33
22 * The Great Newline Fix
24 * Revision 1.1.1.1 2002/05/03 03:28:08 root
28 * 2 10/07/98 6:28p Dave
29 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
30 * Fred. Globalized mission and campaign file extensions. Removed Silent
31 * Threat specific code.
33 * 1 10/07/98 3:01p Dave
35 * 1 10/07/98 3:00p Dave
37 * 11 12/08/97 4:48p Hoffoss
38 * Moved starfield editor controls to background editor.
40 * 10 4/17/97 2:01p Hoffoss
41 * All dialog box window states are saved between sessions now.
43 * 9 4/17/97 9:33a Hoffoss
46 * 8 4/16/97 5:18p Hoffoss
47 * Moved Asteroid field editor stuff to a seperate dialog box.
49 * 7 3/17/97 3:00p Hoffoss
50 * slider updates on the fly now.
52 * 6 2/21/97 5:34p Hoffoss
53 * Added extensive modification detection and fixed a bug in initial
56 * 5 2/17/97 5:28p Hoffoss
57 * Checked RCS headers, added them were missing, changing description to
58 * something better, etc where needed.
60 * 4 1/31/97 3:16p Hoffoss
61 * Asteroid field management implemented.
68 #include "starfieldeditor.h"
69 #include "starfield.h"
75 static char THIS_FILE[] = __FILE__;
78 /////////////////////////////////////////////////////////////////////////////
79 // starfield_editor dialog
81 starfield_editor::starfield_editor(CWnd* pParent /*=NULL*/)
82 : CDialog(starfield_editor::IDD, pParent)
84 //{{AFX_DATA_INIT(starfield_editor)
88 void starfield_editor::DoDataExchange(CDataExchange* pDX)
90 CDialog::DoDataExchange(pDX);
91 //{{AFX_DATA_MAP(starfield_editor)
92 DDX_Control(pDX, IDC_SLIDER1, m_slider);
96 BEGIN_MESSAGE_MAP(starfield_editor, CDialog)
97 //{{AFX_MSG_MAP(starfield_editor)
102 /////////////////////////////////////////////////////////////////////////////
103 // starfield_editor message handlers
105 void starfield_editor::OnOK()
110 theApp.record_window_data(&Starfield_wnd_data, this);
111 MODIFY(Num_stars, m_slider.GetPos());
112 sprintf(buf, "%d", Num_stars);
113 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
117 void starfield_editor::OnCancel()
119 theApp.record_window_data(&Starfield_wnd_data, this);
123 BOOL starfield_editor::OnInitDialog()
126 CDialog::OnInitDialog();
127 theApp.init_window(&Starfield_wnd_data, this);
129 m_slider.SetRange(100, MAX_STARS);
130 m_slider.SetPos(Num_stars);
131 sprintf(buf, "%d", Num_stars);
132 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
136 void starfield_editor::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
140 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
142 MODIFY(Num_stars, m_slider.GetPos());
143 sprintf(buf, "%d", Num_stars);
144 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);