00001
00002
00003
00004 #include "stdafx.h"
00005 #include "MapEditor.h"
00006 #include "BrushDialog.h"
00007
00008
00009
00010
00011 IMPLEMENT_DYNAMIC(CBrushDialog, CDialog)
00012
00013 CBrushDialog::CBrushDialog(CWnd* pParent )
00014 : CDialog(CBrushDialog::IDD, pParent)
00015 {
00016 }
00017
00018 CBrushDialog::~CBrushDialog()
00019 {
00020 }
00021
00022 void CBrushDialog::DoDataExchange(CDataExchange* pDX)
00023 {
00024 CDialog::DoDataExchange(pDX);
00025 DDX_Control(pDX, IDC_COMBO_TYPE, m_ComboType);
00026 }
00027
00028
00029 BEGIN_MESSAGE_MAP(CBrushDialog, CDialog)
00030 ON_CBN_SELCHANGE(IDC_COMBO_TYPE, OnCbnSelchangeComboType)
00031 ON_WM_KEYDOWN()
00032 ON_WM_KEYUP()
00033 ON_WM_CLOSE()
00034 END_MESSAGE_MAP()
00035
00036
00037
00038
00039 BOOL CBrushDialog::OnInitDialog()
00040 {
00041 CDialog::OnInitDialog();
00042
00043 m_BrushLevelDlg.Create( IDD_DIALOG_BRUSHLEVEL, this );
00044 m_BrushTerrainDlg.Create( IDD_DIALOG_BRUSHTERRAIN, this );
00045 m_BrushUnitsDlg.Create( IDD_DIALOG_BRUSHUNITS, this );
00046 m_BrushObjectsDlg.Create( IDD_DIALOG_BRUSHOBJECTS, this );
00047
00048 m_ComboType.SetCurSel( 0 );
00049 OnCbnSelchangeComboType();
00050
00051 return TRUE;
00052
00053 }
00054
00055 void CBrushDialog::OnCbnSelchangeComboType()
00056 {
00057 CWnd* pWnd = GetDlgItem( IDC_STATIC_BRUSHES );
00058 CRect FrameRect;
00059
00060 pWnd->GetWindowRect( &FrameRect );
00061 ScreenToClient( FrameRect );
00062
00063 switch( m_ComboType.GetCurSel() )
00064 {
00065 case 0:
00066 m_BrushLevelDlg.SetWindowPos( NULL, FrameRect.left, FrameRect.top, FrameRect.right - FrameRect.left, FrameRect.bottom - FrameRect.top, SWP_NOZORDER | SWP_SHOWWINDOW );
00067 m_BrushTerrainDlg.ShowWindow( SW_HIDE );
00068 m_BrushUnitsDlg.ShowWindow( SW_HIDE );
00069 m_BrushObjectsDlg.ShowWindow( SW_HIDE );
00070 break;
00071 case 1:
00072 m_BrushLevelDlg.ShowWindow( SW_HIDE );
00073 m_BrushTerrainDlg.SetWindowPos( NULL, FrameRect.left, FrameRect.top, FrameRect.right - FrameRect.left, FrameRect.bottom - FrameRect.top, SWP_NOZORDER | SWP_SHOWWINDOW );
00074 m_BrushUnitsDlg.ShowWindow( SW_HIDE );
00075 m_BrushObjectsDlg.ShowWindow( SW_HIDE );
00076 break;
00077 case 2:
00078 m_BrushLevelDlg.ShowWindow( SW_HIDE );
00079 m_BrushTerrainDlg.ShowWindow( SW_HIDE );
00080 m_BrushUnitsDlg.SetWindowPos( NULL, FrameRect.left, FrameRect.top, FrameRect.right - FrameRect.left, FrameRect.bottom - FrameRect.top, SWP_NOZORDER | SWP_SHOWWINDOW );
00081 m_BrushObjectsDlg.ShowWindow( SW_HIDE );
00082 break;
00083 case 3:
00084 m_BrushLevelDlg.ShowWindow( SW_HIDE );
00085 m_BrushTerrainDlg.ShowWindow( SW_HIDE );
00086 m_BrushUnitsDlg.ShowWindow( SW_HIDE );
00087 m_BrushObjectsDlg.SetWindowPos( NULL, FrameRect.left, FrameRect.top, FrameRect.right - FrameRect.left, FrameRect.bottom - FrameRect.top, SWP_NOZORDER | SWP_SHOWWINDOW );
00088 break;
00089 default:
00090 m_BrushLevelDlg.ShowWindow( SW_HIDE );
00091 m_BrushTerrainDlg.ShowWindow( SW_HIDE );
00092 m_BrushUnitsDlg.ShowWindow( SW_HIDE );
00093 m_BrushObjectsDlg.ShowWindow( SW_HIDE );
00094 break;
00095 }
00096 }
00097
00098 void CBrushDialog::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00099 {
00100
00101
00102 CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
00103 }
00104
00105 void CBrushDialog::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
00106 {
00107
00108
00109 CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
00110 }
00111
00112 BOOL CBrushDialog::OnCommand(WPARAM wParam, LPARAM lParam)
00113 {
00114
00115
00116 return CDialog::OnCommand(wParam, lParam);
00117 }
00118
00119 void CBrushDialog::OnOK()
00120 {
00121
00122
00123
00124 }
00125
00126 void CBrushDialog::OnCancel()
00127 {
00128
00129
00130 }
00131
00132 void CBrushDialog::OnClose()
00133 {
00134 ShowWindow( SW_HIDE );
00135
00136 CDialog::OnClose();
00137 }