1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #if !defined(AFX_DIRECTION_ATTR_H__C906E2A2_917C_4F4A_B771_5656204914F5__INCLUDED_)
19 #define AFX_DIRECTION_ATTR_H__C906E2A2_917C_4F4A_B771_5656204914F5__INCLUDED_
25 #include "edit_attrib_dlg.h"
26 #include "ps_wrapper.h"
27 #include "popup_notify.h"
34 /** This dialog helps to choose from several preset directions, or to choose a custom one.
35 * This also allow to bind the direction to a global variable when it is supported
37 class CDirectionAttr
: public CEditAttribDlg
, public IPopupNotify
41 // construct the dialog.
42 CDirectionAttr(const std::string
&id
); // standard constructor
44 // inherited from CEditAttribDlg
45 virtual void init(uint32 x
, uint32 y
, CWnd
*pParent
);
47 void setWrapper(IPSWrapper
<NLMISC::CVector
> *wrapper
) { _Wrapper
= wrapper
; }
49 /** The CPSDirection object is used to see if a global variable can be bound to the direction.
50 * When set to NULL it has no effect (the default)
52 void setDirectionWrapper(NL3D::CPSDirection
*wrapper
) { _DirectionWrapper
= wrapper
; }
54 BOOL
EnableWindow( BOOL bEnable
= TRUE
);
58 //{{AFX_DATA(CDirectionAttr)
59 enum { IDD
= IDD_DIRECTION_ATTR
};
60 // NOTE: the ClassWizard will add data members here
67 // ClassWizard generated virtual function overrides
68 //{{AFX_VIRTUAL(CDirectionAttr)
70 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
76 friend class CDirectionEdit
;
78 // a dialog that we may create for custom direction edition
79 class CDirectionEdit
*_DirectionDlg
;
81 // inherited from IPopupNotify
82 void childPopupClosed(CWnd
*);
84 IPSWrapper
<NLMISC::CVector
> *_Wrapper
;
85 NL3D::CPSDirection
*_DirectionWrapper
;
87 // Generated message map functions
88 //{{AFX_MSG(CDirectionAttr)
89 afx_msg
void OnVectI();
90 afx_msg
void OnVectJ();
91 afx_msg
void OnVectK();
92 afx_msg
void OnVectMinusI();
93 afx_msg
void OnVectMinusJ();
94 afx_msg
void OnVectMinusK();
95 afx_msg
void OnCustomDirection();
96 afx_msg
void OnDestroy();
97 afx_msg
void OnGlobalDirection();
102 //{{AFX_INSERT_LOCATION}}
103 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
105 #endif // !defined(AFX_DIRECTION_ATTR_H__C906E2A2_917C_4F4A_B771_5656204914F5__INCLUDED_)