00001 00023 #ifndef INC_MGUI_FORMNRGL_H 00024 #define INC_MGUI_FORMNRGL_H 00025 00026 #ifndef INC_MGUI_GRID_H 00027 #include <mgui/grid.h> 00028 #endif 00029 00030 #ifndef INC_MI32_NAMEDRGN_H 00031 #include <mi32/namedrgn.h> 00032 #endif 00033 00034 namespace MGUI { 00035 00036 class FORM_NAMEDREGION_LIST : public FORM_COMPOSITE { 00037 public: 00038 00040 FORM_NAMEDREGION_LIST ( 00041 NAMEDREGION_LIST& RegionList 00042 ); 00043 00045 virtual ~FORM_NAMEDREGION_LIST ( 00046 ); 00047 00049 void Create ( 00050 MGUI::LAYOUT_PANE_BASE& ParentPane, 00051 MGUI::LAYOUT_SIZEALIGN sizing = MGUI::LAYOUT_SIZEALIGN_Expand 00052 ); 00053 00056 const NAMEDREGION& GetSelectedRegion ( 00057 ) const { return (GetSelRegion()); } 00058 00060 bool IsRegionSelected ( 00061 ) const { return (m_ListCtrl.GetSelectedCount() > 0); } 00062 00064 void SetDelegateOnChangeSelection ( 00065 DELEGATE_VOID_NOPARMS delegate 00066 ) { m_DelegateOnChangeSelection = delegate; } 00067 00068 protected: 00069 00073 virtual void v_OnChangeSelection (); 00074 00075 private: 00076 #ifndef GENERATING_DOXYGEN_OUTPUT 00077 00078 class LISTOBSERVER : public NAMEDREGION_LIST::OBSERVER { 00079 public: 00080 LISTOBSERVER ( 00081 FORM_NAMEDREGION_LIST& form 00082 ); 00083 virtual void OnChanged (const NAMEDREGION& item); 00084 virtual void OnClear (); 00085 virtual void OnInsert (const NAMEDREGION& item); 00086 virtual void OnRemove (const NAMEDREGION& item); 00087 private: 00088 FORM_NAMEDREGION_LIST& m_form; 00089 }; 00090 00091 DELEGATE_VOID_NOPARMS m_DelegateOnChangeSelection; 00092 NAMEDREGION_LIST& m_RegionList; 00093 LISTOBSERVER m_ListObserver; 00094 MGUI::CTRL_GRID m_ListCtrl; 00095 MGUI::CTRL_PUSHBUTTON m_AddPB; 00096 MGUI::CTRL_PUSHBUTTON m_SaveAsPB; 00097 MGUI::CTRL_PUSHBUTTON m_RemovePB; 00098 MGUI::CTRL_PUSHBUTTON m_CombinePB; 00099 MDLGPARENT m_DlgParent; 00100 00101 void AddListCtrlItem (const NAMEDREGION&); 00102 NAMEDREGION& GetSelRegion () const; 00103 void OnAdd (); 00104 void OnCombine (); 00105 bool OnListCtrlBeginLabelEdit (int, int); 00106 void OnListCtrlItemSelect (int itemnum, int subitem); 00107 bool OnListCtrlEndLabelEdit (int, int, MISTRING&); 00108 void OnRemove (); 00109 void OnSaveAs (); 00110 00111 // UNIMPLEMENTED / UNSUPPORTED 00112 FORM_NAMEDREGION_LIST (const FORM_NAMEDREGION_LIST&); 00113 FORM_NAMEDREGION_LIST& operator= (const FORM_NAMEDREGION_LIST&); 00114 00115 friend class LISTOBSERVER; 00116 friend class LISTCTRL; 00117 #endif // GENERATING_DOXYGEN_OUTPUT 00118 }; 00119 00120 00121 } // End namespace MGUI 00122 00123 #endif // INC_MGUI_FORMNRGL_H
1.6.1