2 * $Logfile: /Freespace2/code/FRED2/StarfieldEditor.cpp $
7 * Starfield editor dialog handling code
10 * Revision 1.2 2002/05/07 03:16:44 theoddone33
11 * The Great Newline Fix
13 * Revision 1.1.1.1 2002/05/03 03:28:08 root
17 * 2 10/07/98 6:28p Dave
18 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
19 * Fred. Globalized mission and campaign file extensions. Removed Silent
20 * Threat specific code.
22 * 1 10/07/98 3:01p Dave
24 * 1 10/07/98 3:00p Dave
26 * 11 12/08/97 4:48p Hoffoss
27 * Moved starfield editor controls to background editor.
29 * 10 4/17/97 2:01p Hoffoss
30 * All dialog box window states are saved between sessions now.
32 * 9 4/17/97 9:33a Hoffoss
35 * 8 4/16/97 5:18p Hoffoss
36 * Moved Asteroid field editor stuff to a seperate dialog box.
38 * 7 3/17/97 3:00p Hoffoss
39 * slider updates on the fly now.
41 * 6 2/21/97 5:34p Hoffoss
42 * Added extensive modification detection and fixed a bug in initial
45 * 5 2/17/97 5:28p Hoffoss
46 * Checked RCS headers, added them were missing, changing description to
47 * something better, etc where needed.
49 * 4 1/31/97 3:16p Hoffoss
50 * Asteroid field management implemented.
57 #include "starfieldeditor.h"
58 #include "starfield.h"
64 static char THIS_FILE[] = __FILE__;
67 /////////////////////////////////////////////////////////////////////////////
68 // starfield_editor dialog
70 starfield_editor::starfield_editor(CWnd* pParent /*=NULL*/)
71 : CDialog(starfield_editor::IDD, pParent)
73 //{{AFX_DATA_INIT(starfield_editor)
77 void starfield_editor::DoDataExchange(CDataExchange* pDX)
79 CDialog::DoDataExchange(pDX);
80 //{{AFX_DATA_MAP(starfield_editor)
81 DDX_Control(pDX, IDC_SLIDER1, m_slider);
85 BEGIN_MESSAGE_MAP(starfield_editor, CDialog)
86 //{{AFX_MSG_MAP(starfield_editor)
91 /////////////////////////////////////////////////////////////////////////////
92 // starfield_editor message handlers
94 void starfield_editor::OnOK()
99 theApp.record_window_data(&Starfield_wnd_data, this);
100 MODIFY(Num_stars, m_slider.GetPos());
101 sprintf(buf, "%d", Num_stars);
102 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
106 void starfield_editor::OnCancel()
108 theApp.record_window_data(&Starfield_wnd_data, this);
112 BOOL starfield_editor::OnInitDialog()
115 CDialog::OnInitDialog();
116 theApp.init_window(&Starfield_wnd_data, this);
118 m_slider.SetRange(100, MAX_STARS);
119 m_slider.SetPos(Num_stars);
120 sprintf(buf, "%d", Num_stars);
121 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
125 void starfield_editor::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
129 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
131 MODIFY(Num_stars, m_slider.GetPos());
132 sprintf(buf, "%d", Num_stars);
133 GetDlgItem(IDC_TOTAL)->SetWindowText(buf);