mgui/formelemselect.h

Go to the documentation of this file.
00001 /**
00002  * \file mgui/formelemselect.h
00003  * \brief MGUI::FORM_ELEMENT_SELECT class definitions
00004  *
00005  * \if NODOC
00006  * $Id: formelemselect.h_v 1.5 2003/12/16 15:57:43 mju Exp $
00007  *
00008  * $Log: formelemselect.h_v $
00009  * Revision 1.5  2003/12/16 15:57:43  mju
00010  * Use dlgshell.
00011  *
00012  * Revision 1.4  2003/10/03 19:58:19  linux32build!build
00013  * Doxygen
00014  *
00015  * Revision 1.3  2003/09/15 13:49:32  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.2  2003/06/19 19:10:35  scowan
00019  * *** empty log message ***
00020  *
00021  * Revision 1.1  2003/04/24 19:08:45  scowan
00022  * Initial revision
00023  *
00024  * \endif
00025 **/
00026 
00027 #ifndef  INC_MGUI_FORMELEMSELECT_H
00028 #define  INC_MGUI_FORMELEMSELECT_H
00029 
00030 #ifndef  INC_MGUI_CTRL_H
00031 #include <mgui/ctrl.h>
00032 #endif
00033 
00034 #ifndef  INC_MGUI_GRID_H
00035 #include <mgui/grid.h>
00036 #endif
00037 
00038 #ifndef  INC_MGUI_DLGSHELL_H
00039 #include <mgui/dlgshell.h>
00040 #endif
00041 
00042 #ifndef  INC_MGUI_FORMOBJL_H
00043 #include <mgui/formobjl.h>
00044 #endif
00045 
00046 #ifndef  INC_MGUI_COMBOBOX_H
00047 #include <mgui/combobox.h>
00048 #endif
00049 
00050 #ifndef  INC_RVC_GEOMETRC_H
00051 #include <rvc/geometrc.h>
00052 #endif
00053 
00054 #ifndef  INC_RVC_DBASE_H
00055 #include <rvc/dbase.h>
00056 #endif
00057 
00058 #ifndef  INC_RVC_DBTABLE_H
00059 #include <rvc/dbtable.h>
00060 #endif
00061 
00062 #ifndef  INC_MI32_REGION2D_H
00063 #include <mi32/region2d.h>
00064 #endif
00065 
00066 namespace MGUI {
00067    
00068 class FORM_ELEMENT_SELECT : public MGUI::FORM_COMPOSITE {
00069    public:
00070    
00071       //! Constructor.
00072       FORM_ELEMENT_SELECT (
00073          );
00074 
00075       //! Destructor.
00076       virtual ~FORM_ELEMENT_SELECT (
00077          );
00078    
00079       ERRVALUE Create (
00080          MGUI::LAYOUT_PANE_BASE& ParentPane,          //!< Parent pane
00081          ELEMTYPE ElemType,
00082          MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
00083          );
00084          
00085       const RVC::GEOMETRIC::ELEMSELECTPARMS::ITEM& GetElemSelectParmsItem (
00086          );
00087          
00088       CTRL_LABEL& GetLabel (
00089          );
00090          
00091       void SetElemSelectParmsItem (
00092          const RVC::GEOMETRIC::ELEMSELECTPARMS::ITEM& item
00093          );
00094          
00095       void SetGeometricObject (
00096          const RVC::OBJITEM& ObjItem
00097          );
00098    
00099    private:
00100       #ifndef GENERATING_DOXYGEN_OUTPUT
00101       MGUI::FORM_COMBOBOX_T<FORM_ELEMENT_SELECT> m_ElemSelect;
00102       MGUI::CTRL_PUSHBUTTON_T<FORM_ELEMENT_SELECT> m_Select;
00103       RVC::GEOMETRIC::ELEMSELECTPARMS::ITEM m_SelectItem;
00104       RVC::OBJITEM m_ObjItem;
00105       ELEMTYPE m_ElemType;
00106 
00107       void OnSelection ();
00108       void OnSelectPressed ();
00109       void UpdateState ();
00110       #endif // GENERATING_DOXYGEN_OUTPUT
00111    };
00112    
00113    
00114 class FORM_REGION_SELECT : public MGUI::FORM_COMPOSITE {
00115    public:
00116    
00117       //! Constructor.
00118       FORM_REGION_SELECT (
00119          );
00120 
00121       //! Destructor.
00122       virtual ~FORM_REGION_SELECT (
00123          );
00124    
00125       ERRVALUE Create (
00126          MGUI::LAYOUT_PANE_BASE& ParentPane,          //!< Parent pane
00127          MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
00128          );
00129          
00130       RVC::GEOMETRIC::ELEMSELECTPARMS::EXTRACT GetExtractMode (
00131          ) const;
00132          
00133       CTRL_LABEL& GetLabel (
00134          );
00135          
00136       const REGION2D& GetRegion (
00137          ) const;
00138          
00139       const MAPPROJPARM& GetRegionProjection (
00140          ) const;
00141          
00142       void SetExtractMode (
00143          RVC::GEOMETRIC::ELEMSELECTPARMS::EXTRACT ExtractMode
00144          );
00145          
00146       void SetGeometricObject (
00147          const RVC::OBJITEM& ObjItem
00148          );
00149    
00150       void SetRegion (
00151          const REGION2D& region
00152          );
00153          
00154       void SetRegionProjection (
00155          const MAPPROJPARM& MapProj
00156          );
00157          
00158    private:
00159       #ifndef GENERATING_DOXYGEN_OUTPUT
00160       MGUI::FORM_COMBOBOX_T<FORM_REGION_SELECT> m_ExtractSelect;
00161       MGUI::CTRL_PUSHBUTTON_T<FORM_REGION_SELECT> m_Select;
00162       RVC::OBJITEM m_ObjItem;
00163       REGION2D m_Region;
00164       MAPPROJPARM m_RegionProj;
00165 
00166       void OnSelection ();
00167       void OnSelectPressed ();
00168       #endif // GENERATING_DOXYGEN_OUTPUT
00169    };
00170    
00171    
00172 class FORM_VECTOR_ELEMENT_SELECT : public MGUI::FORM_COMPOSITE {
00173    public:
00174    
00175       //! Constructor.
00176       FORM_VECTOR_ELEMENT_SELECT (
00177          );
00178 
00179       //! Destructor.
00180       virtual ~FORM_VECTOR_ELEMENT_SELECT (
00181          );
00182    
00183       ERRVALUE Create (
00184          MGUI::LAYOUT_PANE_BASE& ParentPane,          //!< Parent pane
00185          MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_FixedSize
00186          );
00187          
00188       const RVC::GEOMETRIC::ELEMSELECTPARMS& GetElemSelectParms (
00189          );
00190          
00191       void SetElemSelectParms (
00192          const RVC::GEOMETRIC::ELEMSELECTPARMS& parms
00193          );
00194          
00195       void SetVectorObject (
00196          const RVC::OBJITEM& ObjItem
00197          );
00198    
00199    private:
00200       #ifndef GENERATING_DOXYGEN_OUTPUT
00201       FORM_ELEMENT_SELECT m_Point;
00202       FORM_ELEMENT_SELECT m_Line;
00203       FORM_ELEMENT_SELECT m_Polygon;
00204       FORM_ELEMENT_SELECT m_Label;
00205       FORM_REGION_SELECT m_Region;
00206       RVC::GEOMETRIC::ELEMSELECTPARMS m_SelectParms;
00207       #endif // GENERATING_DOXYGEN_OUTPUT
00208    };
00209    
00210    
00211 class FORM_VECTOR_EXTRACT_SELECT : public MGUI::FORM_COMPOSITE {
00212    public:
00213    
00214       //! Constructor.
00215       FORM_VECTOR_EXTRACT_SELECT (
00216          );
00217 
00218       //! Destructor.
00219       virtual ~FORM_VECTOR_EXTRACT_SELECT (
00220          );
00221    
00222       ERRVALUE Create (
00223          MGUI::LAYOUT_PANE_BASE& ParentPane,          //!< Parent pane
00224          MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_Expand
00225          );
00226          
00227       const MILIST<RVC::GEOMETRIC::ELEMSELECTPARMS>& GetElemSelectParms (
00228          );
00229          
00230       const RVC::OBJITEMLIST& GetVectorList (
00231          ) const;
00232          
00233    protected:
00234    
00235       virtual void v_OnObjectSelected (const RVC::OBJITEM& ObjItem);
00236    
00237    private:
00238       #ifndef GENERATING_DOXYGEN_OUTPUT
00239       FORM_OBJECT_LIST_T<FORM_VECTOR_EXTRACT_SELECT> m_VectorList;
00240       FORM_VECTOR_ELEMENT_SELECT m_ElemSelect;
00241       MILIST<RVC::GEOMETRIC::ELEMSELECTPARMS> m_SelectParms;
00242       SIMPLE_ARRAY<bool> m_SelectSet;
00243       INT32 m_CurItem;
00244       RVC::GEOMETRIC::GETOBJFILTER_ISNOTEMPTY m_IsEmptyFilter;
00245       
00246       void OnObjectAdded (const RVC::OBJITEM& ObjItem, INT32 ItemNum);
00247       void OnObjectRemoved (INT32 ItemNum);
00248       void OnObjectSelected (const RVC::OBJITEM& ObjItem);
00249       void OnObjectSelectedNum (const RVC::OBJITEM& ObjItem, INT32 ItemNum);
00250       void OnObjectsRemoved ();
00251       #endif // GENERATING_DOXYGEN_OUTPUT
00252    };
00253    
00254 
00255 //-------------------------------------------------------------------------------------------------------------------
00256 //! Convenience template for OBJECT_LIST form to allow method in container class to be called.
00257 //! This template allows a method in a 'container' class to be called when the button is pressed,
00258 //! rather than requiring that a subclass be defined with the OnPressed() virtual method overridden.
00259 template <class _CT> class FORM_VECTOR_EXTRACT_SELECT_T : public MGUI::FORM_VECTOR_EXTRACT_SELECT {
00260    public:
00261 
00262       //! Constructor.
00263       FORM_VECTOR_EXTRACT_SELECT_T (
00264          ) : m_pContainer(0), m_pfOnObjectSelected(0) {}
00265 
00266       //! Create control with label from resource lookup.
00267       void Create (
00268          MGUI::LAYOUT_PANE_BASE& ParentPane,    //!< Parent pane
00269          _CT *pContainer,                       //!< Pointer to callback container class
00270          void (_CT::*pfOnObjectSelected)(const RVC::OBJITEM& ObjItem),        //! Callback function pointer
00271          MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_Expand
00272          ) {
00273          m_pContainer = pContainer;
00274          m_pfOnObjectSelected = pfOnObjectSelected;
00275          FORM_VECTOR_EXTRACT_SELECT::Create(ParentPane, sizealign);
00276          }
00277 
00278    private:
00279       #ifndef GENERATING_DOXYGEN_OUTPUT
00280       _CT *m_pContainer;
00281       void (_CT::*m_pfOnObjectSelected)(const RVC::OBJITEM& ObjItem);
00282       virtual void v_OnObjectSelected (const RVC::OBJITEM& ObjItem) { (m_pContainer->*m_pfOnObjectSelected)(ObjItem); }
00283       #endif // GENERATING_DOXYGEN_OUTPUT
00284    };
00285 
00286    
00287 class DLG_RECORD_SET_SELECT : public MGUI::DLGSHELL {
00288    public:
00289 
00290       //! Constructor.
00291       DLG_RECORD_SET_SELECT (
00292          const RVC::OBJITEM& ParentObjItem,
00293          ELEMTYPE ElemType
00294          );
00295    
00296       //! Destructor.
00297       virtual ~DLG_RECORD_SET_SELECT (
00298          );
00299          
00300       const BITSET& GetRecordSet (
00301          ) const { return (m_RecordSet); }
00302    
00303       const RVC::OBJECTNAME& GetTableName (
00304          ) const { return (m_TableName); }
00305    
00306       void SetRecordSet (
00307          const BITSET& RecordSet
00308          );
00309    
00310       void SetTableName (
00311          const RVC::OBJECTNAME& TableName
00312          );
00313    
00314    private:
00315       #ifndef GENERATING_DOXYGEN_OUTPUT
00316       MGUI::LAYOUT_PANE m_IconPane;
00317       MGUI::FORM_COMBOBOX_T<DLG_RECORD_SET_SELECT> m_FieldSelect;
00318       MGUI::CTRL_PUSHBUTTON_T<DLG_RECORD_SET_SELECT> m_Select;
00319       MGUI::CTRL_PUSHBUTTON_T<DLG_RECORD_SET_SELECT> m_SelectAll;
00320       MGUI::CTRL_PUSHBUTTON_T<DLG_RECORD_SET_SELECT> m_Unselect;
00321       MGUI::CTRL_PUSHBUTTON_T<DLG_RECORD_SET_SELECT> m_UnselectAll;
00322       MGUI::CTRL_GRID_T<DLG_RECORD_SET_SELECT> m_RecGrid;
00323       RVC::OBJITEM m_ObjItem;
00324       RVC::DBASE m_DBaseObj;
00325       RVC::DBTABLE m_TableObj;
00326       RVC::DBTABLE::RECORD m_Record;
00327       SIMPLE_ARRAY<INT32> m_RecIndex;
00328       BITSET m_DuplicateBits;
00329       RVC::OBJECTNAME m_TableName;
00330       INT32 m_FieldNum;
00331       BITSET m_RecordSet;
00332       ELEMTYPE m_ElemType;
00333 
00334       virtual ERRVALUE v_CreateContent ();
00335 
00336       void OnClickItem (int itemnum, int column, KEYSTATE state);    
00337       void OnFieldSelect ();
00338       bool OnGetDispInfo (int row, int col, CTRL_GRID::DISPINFO& dispinfo);
00339       void OnSelectPressed ();
00340       void OnSelectAllPressed ();
00341       void OnUnselectPressed ();
00342       void OnUnselectAllPressed ();
00343       #endif // GENERATING_DOXYGEN_OUTPUT
00344 
00345    };
00346    
00347 }     // End of MGUI namespace
00348 
00349 #endif   // INC_MGUI_FORMELEMSELECT_H

Generated on Thu Aug 12 06:18:28 2004 for TNTsdk by doxygen 1.3.4-20031026