2 * $Logfile: /Freespace2/code/FRED2/StarfieldEditor.cpp $
7 * Starfield editor dialog handling code
10 * Revision 1.1 2002/05/03 03:28:08 root
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.
19 * 1 10/07/98 3:01p Dave
21 * 1 10/07/98 3:00p Dave
23 * 11 12/08/97 4:48p Hoffoss
24 * Moved starfield editor controls to background editor.
26 * 10 4/17/97 2:01p Hoffoss
27 * All dialog box window states are saved between sessions now.
29 * 9 4/17/97 9:33a Hoffoss
32 * 8 4/16/97 5:18p Hoffoss
33 * Moved Asteroid field editor stuff to a seperate dialog box.
35 * 7 3/17/97 3:00p Hoffoss
36 * slider updates on the fly now.
38 * 6 2/21/97 5:34p Hoffoss
39 * Added extensive modification detection and fixed a bug in initial
42 * 5 2/17/97 5:28p Hoffoss
43 * Checked RCS headers, added them were missing, changing description to
44 * something better, etc where needed.
46 * 4 1/31/97 3:16p Hoffoss
47 * Asteroid field management implemented.
54 #include "starfieldeditor.h"
55 #include "starfield.h"
61 static char THIS_FILE[] = __FILE__;
64 /////////////////////////////////////////////////////////////////////////////
65 // starfield_editor dialog
67 starfield_editor::starfield_editor(CWnd* pParent /*=NULL*/)
68 : CDialog(starfield_editor::IDD, pParent)
70 //{{AFX_DATA_INIT(starfield_editor)
74 void starfield_editor::DoDataExchange(CDataExchange* pDX)
76 CDialog::DoDataExchange(pDX);
77 //{{AFX_DATA_MAP(starfield_editor)
78 DDX_Control(pDX, IDC_SLIDER1, m_slider);
82 BEGIN_MESSAGE_MAP(starfield_editor, CDialog)
83 //{{AFX_MSG_MAP(starfield_editor)
88 /////////////////////////////////////////////////////////////////////////////
89 // starfield_editor message handlers
91 void starfield_editor::OnOK()
96 theApp.record_window_data(&Starfield_wnd_data, this);
97 MODIFY(Num_stars, m_slider.GetPos());
98 sprintf(buf, "%d", Num_stars);
99 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
103 void starfield_editor::OnCancel()
105 theApp.record_window_data(&Starfield_wnd_data, this);
109 BOOL starfield_editor::OnInitDialog()
112 CDialog::OnInitDialog();
113 theApp.init_window(&Starfield_wnd_data, this);
115 m_slider.SetRange(100, MAX_STARS);
116 m_slider.SetPos(Num_stars);
117 sprintf(buf, "%d", Num_stars);
118 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
122 void starfield_editor::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
126 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
128 MODIFY(Num_stars, m_slider.GetPos());
129 sprintf(buf, "%d", Num_stars);
130 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);