00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef INC_GRE_LRREGION_H
00036 #define INC_GRE_LRREGION_H
00037
00038 #ifndef INC_MI32_GRE_H
00039 #include <mi32/gre.h>
00040 #endif
00041
00042 #ifndef INC_MI32_REGION2D_H
00043 #include <mi32/region2d.h>
00044 #endif
00045
00046 class GRE_LAYER_REGION : public GRE_LAYER {
00047 public:
00048
00049
00050 class DISPPARM : public GRE_LAYER::DISPPARM {
00051 public:
00052
00053 class DLG;
00054
00055 RVC::OBJITEM m_ObjItem;
00056 RVC::OBJITEM m_ObjItemStyle;
00057 POLYSTYLE m_Style;
00058
00059 DISPPARM ();
00060 DISPPARM (
00061 const DISPPARM& rhs
00062 ): GRE_LAYER::DISPPARM(rhs) { Copy(rhs); }
00063 virtual ~DISPPARM (
00064 ) { Free(); }
00065
00066 DISPPARM& operator= (const DISPPARM& rhs) {
00067 if (this != &rhs) {
00068 Free();
00069 Copy(rhs);
00070 }
00071 return (*this);
00072 }
00073
00074
00075 ERRVALUE SetObject (
00076 const RVCOBJITEM& objitem,
00077 GRE_LAYER_REGION* layer,
00078 bool keepsettings = false
00079 );
00080
00081 protected:
00082 virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const;
00083
00084 private:
00085 #ifndef GENERATING_DOXYGEN_OUTPUT
00086 void Copy (const DISPPARM&);
00087 void Free ();
00088 static ERRVALUE SerializerCB_StyleFileName (SERIALIZER&, const SERIALIZER::ITEMDEF *, void *, SERIALIZER::ITEMDEF::ACTION);
00089
00090 virtual ERRVALUE v_SetObjItem (const RVC::OBJITEM& objitem, bool replace);
00091 virtual ERRVALUE v_Validate ();
00092 friend class GRE_LAYER_REGION;
00093 #endif
00094 }; // End of GRE_LAYER_REGION::DISPPARM
00095
00096
00097 static int Construct (
00098 GRE_GROUP *group,
00099 GRE_LAYER **retlayer,
00100 GRE_LAYER *reflayer,
00101 UINT32 flags
00102 );
00103
00104
00105 static void RegisterType (
00106 );
00107
00108
00109 explicit GRE_LAYER_REGION (
00110 GRE_GROUP *group,
00111 GRE_LAYER *reflayer = 0,
00112 UINT32 flags = MDISPCREATE_InsertAfter
00113 );
00114
00115
00116 virtual ~GRE_LAYER_REGION ();
00117
00118
00119 void ClearRegion (
00120 );
00121
00122
00123 const DISPPARM& GetDispParm (
00124 ) const { return (m_dispparm); }
00125
00126
00127
00128
00129
00130
00131
00132
00133 ERRVALUE SetDispParm (
00134 const DISPPARM& dispparm
00135 );
00136
00137 void SetRegion (
00138 const REGION2D& region
00139 );
00140
00141 protected:
00142
00143 DISPPARM m_dispparm;
00144
00145 private:
00146 #ifndef GENERATING_DOXYGEN_OUTPUT
00147
00148 static void LegendMsgHandler (GRAPHICTREEITEM_MSG *msg);
00149
00150 GRE_LEGEND_POLY m_Legend;
00151
00152 int DrawSetup (void*, GRE_LAYERDC&);
00153
00154
00155 #ifdef WIN32_MFC
00156 virtual void v_AddTreeViewLegend (GRE_MFC_TREEVIEW& TreeView, HTREEITEM hParent, HTREEITEM hInsertAfter);
00157 #endif
00158 virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem, MDLGPARENT dlgparent);
00159 #if defined(X_NATIVE) || defined(WIN32_MFC)
00160 virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0);
00161 #endif
00162 virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc);
00163 virtual const GRE_LEGEND* v_GetLegend (ELEMTYPE ElemType);
00164 virtual const RVC::OBJITEM& v_GetObjItem (int component) const;
00165 #ifdef WIN32_MFC
00166 virtual bool v_HasTreeViewLegend () const;
00167 #endif
00168 #if defined(X_NATIVE) || defined(WIN32_MFC)
00169 virtual ERRVALUE v_PromptObject (bool OpenCtrlPanel, MDLGPARENT dlgparent);
00170 #endif
00171 virtual const char* v_SerialGetTagName () const;
00172 virtual void v_SetDftName (bool ReplaceExisting);
00173 virtual void v_SetLegendSampleFlags (MGD::STYLESAMPLEFLAGS SampleFlags);
00174 virtual ERRVALUE v_SetStyleObjItem (const RVC::OBJITEM& ObjItem);
00175 virtual int v_UpdateExtents (bool forceupdate);
00176 virtual bool v_UsesTransparency (const MGD::CONTEXT* gc = 0) const;
00177
00178 GRE_LAYER_REGION (const GRE_LAYER_REGION&);
00179 GRE_LAYER_REGION& operator= (const GRE_LAYER_REGION&);
00180
00181 class PRIVDRAWDATA;
00182 friend class PRIVDRAWDATA;
00183 friend class DISPPARM;
00184
00185 #endif
00186 };
00187
00188
00189 #endif