00001 00044 #ifndef INC_RVC_UIEDITDESCRIPTOR_H 00045 #define INC_RVC_UIEDITDESCRIPTOR_H 00046 00047 #ifndef INC_MGUI_EDIT_H 00048 #include <mgui/edit.h> 00049 #endif 00050 00051 #ifndef INC_RVC_DESCRIPTOR_H 00052 #include <rvc/descriptor.h> 00053 #endif 00054 00055 namespace RVC { 00056 namespace UI { 00057 00058 //=================================================================================================================== 00060 class FORM_EDIT_DESCRIPTOR : public MGUI::FORM_COMPOSITE { 00061 public: 00062 enum FLAGS { 00063 FLAG_Default = 0x0000, 00064 FLAG_NoModifyName = 0x0008, 00065 FLAG_IsFileDescriptor = 0x0010 00066 }; 00067 00069 FORM_EDIT_DESCRIPTOR ( 00070 ); 00071 00073 virtual ~FORM_EDIT_DESCRIPTOR ( 00074 ); 00075 00077 void Create ( 00078 MGUI::LAYOUT_PANE_BASE& ParentPane, 00079 FLAGS flags = FLAG_Default, 00080 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_Expand, 00081 MGUI::CTRL_EDIT_TEXT::FLAGS textflags = MGUI::CTRL_EDIT_TEXT::FLAG_Default, 00082 int DescriptionHeight = 5 00083 ); 00084 00087 const RVC::DESCRIPTOR& GetValue ( 00088 ); 00089 00091 void SetDelegateOnAnyChange ( 00092 DELEGATE_VOID_NOPARMS delegate 00093 ) { m_DelegateOnAnyChange = delegate; } 00094 00096 void SetDelegateOnNameChange ( 00097 FastDelegate<void(const MISTRING&)> delegate 00098 ) { m_DelegateOnNameChange = delegate; } 00099 00102 void SetDelegateOnTestUniqueShortName ( 00103 FastDelegate<int(const RVC::OBJECTNAME&)> delegate 00104 ) { m_DelegateOnTestUniqueShortName = delegate; } 00105 00107 void SetDelegateOnValidateShortName ( 00108 FastDelegate<bool(RVC::OBJECTNAME&)> delegate 00109 ) { m_DelegateOnValidateShortName = delegate; } 00110 00111 void SetFocusToName ( 00112 ) { m_NameForm.SetFocus(); } 00113 00114 void SetParentDirectory ( 00115 const FILEPATH* pParentDirectory 00116 ) { m_pParentDirectory = pParentDirectory; } 00117 00120 void SetValue ( 00121 const RVC::DESCRIPTOR& Descriptor, 00122 bool notify = true 00123 ); 00124 00125 private: 00126 #ifndef GENERATING_DOXYGEN_OUTPUT 00127 MGUI::FORM_EDIT_STRING m_NameForm; 00128 MGUI::CTRL_LABEL m_DescLabel; 00129 MGUI::CTRL_EDIT_TEXT m_DescForm; 00130 00131 RVC::DESCRIPTOR m_Descriptor; 00132 bool m_LegacyNameUnique; 00133 const FILEPATH *m_pParentDirectory; 00134 FastDelegate<void(const MISTRING&)> m_DelegateOnNameChange; 00135 FastDelegate<int(const RVC::OBJECTNAME&)> m_DelegateOnTestUniqueShortName; 00136 FastDelegate<bool(RVC::OBJECTNAME&)> m_DelegateOnValidateShortName; 00137 DELEGATE_VOID_NOPARMS m_DelegateOnAnyChange; 00138 00139 void OnNameUserEditChange (); 00140 void OnNameChangeValue (); 00141 void OnDescUserEditChange (); 00142 #endif // GENERATING_DOXYGEN_OUTPUT 00143 }; 00144 00145 #ifndef GENERATING_DOXYGEN_OUTPUT 00146 DEFINE_ENUM_OP_BITWISE(FORM_EDIT_DESCRIPTOR::FLAGS); 00147 #endif // GENERATING_DOXYGEN_OUTPUT 00148 00149 00150 //=================================================================================================================== 00151 } // End of UI namespace 00152 } // End of RVC namespace 00153 00154 #endif // INC_RVC_UIEDITDESCRIPTOR_H 00155
1.6.1