00001
00060 #ifndef INC_GRE_LRLEGEND_H
00061 #define INC_GRE_LRLEGEND_H
00062
00063 #ifndef INC_GRE_LAYER_H
00064 #include <gre/layer.h>
00065 #endif
00066
00067 #ifndef INC_RVC_OBJITEM_H
00068 #include <rvc/objitem.h>
00069 #endif
00070
00071 namespace GRE {
00072
00073
00074
00075 class LAYER_LEGEND : public GRE::LAYER {
00076 public:
00077
00078 enum SUBTYPE {
00081 SUBTYPE_Point = 0,
00082 SUBTYPE_Line = 1,
00083 SUBTYPE_Poly = 2,
00084 SUBTYPE_ColorSample = 3,
00085 SUBTYPE_ColorScale = 4,
00086 SUBTYPE_RasterSample = 5
00087 };
00088
00089 class DISPPARM : public GRE::LAYER::DISPPARM {
00090 public:
00091
00092 class DLG;
00093
00094 RVC::OBJITEM m_ObjItem;
00095 RVC::OBJITEM m_ObjItemStyle;
00096
00097
00098 INT32 flags;
00099 SUBTYPE LegendType;
00100 int StyleTable;
00101 int NumCols;
00102 TEXTSTYLE Style[4];
00103 COLOR BackgroundColor;
00104 COLOR SampleBorderColor;
00105 COLOR LegendBorderColor;
00106
00107 double SampleBorderWidth;
00108 double LegendBorderWidth;
00109 double ColSpace;
00110 double SampleSpace;
00111 double SampleHeight;
00112 double SampleWidth;
00113 double SampleOffset;
00114 double MapScale;
00115 double LineSpace;
00116 double MarginWidth;
00117 int units;
00118
00120 double MinIndex;
00121 double MaxIndex;
00122 UINT32 NumTicksL;
00123 UINT32 NumTicksR;
00124 double MinValL;
00125 double MinValR;
00126 double MaxValL;
00127 double MaxValR;
00128
00129
00130
00131 double Height, Width;
00132 double FullDescHeightM;
00133
00134 DISPPARM ();
00135 DISPPARM (const DISPPARM& rhs) {
00136 Copy(rhs);
00137 }
00138 virtual ~DISPPARM () {
00139 Free();
00140 }
00141
00142 DISPPARM& operator= (const DISPPARM& rhs) {
00143 if (this != &rhs) {
00144 Free();
00145 Copy(rhs);
00146 }
00147 return (*this);
00148 }
00149
00150 protected:
00151 virtual const SERIALIZERITEM* SerialGetItemDef (SERIALIZER& serializer) const;
00152
00153 private:
00154 #ifndef GENERATING_DOXYGEN_OUTPUT
00155 void Copy (const DISPPARM&);
00156 void Free ();
00157 #endif
00158 };
00159
00161 static void RegisterType (
00162 );
00163
00165 explicit LAYER_LEGEND (
00166 GRE::GROUP *group,
00167 CREATEFLAGS createflags = CREATEFLAG_None
00168 );
00169
00170 virtual ~LAYER_LEGEND ();
00171
00173 const DISPPARM& GetDispParm (
00174 ) const { return (m_dispparm); }
00175
00183 ERRVALUE SetDispParm (
00184 const DISPPARM& dispparm
00185 );
00186
00187 #ifndef GENERATING_DOXYGEN_OUTPUT
00188 #if defined(X_NATIVE)
00189 static void CB_CreateDialog (Widget, void*, void*);
00190 #endif
00191 #ifdef USE_MGUI
00192 static void OnMenuCreateDialog (MGUI::ID subtype, bool);
00193 #endif
00194 #endif // GENERATING_DOXYGEN_OUTPUT
00195
00196 protected:
00197
00198 DISPPARM m_dispparm;
00199
00200 private:
00201 #ifndef GENERATING_DOXYGEN_OUTPUT
00202
00203 int DrawLegend (void*, int);
00204 int SetupLegend (void*);
00205
00207 virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem, MDLGPARENT dlgparent);
00208 #ifdef USE_MGUI
00209 virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0);
00210 #endif
00211 virtual GRE::LAYER* v_Copy (GRE::GROUP *group) const;
00212 virtual ERRVALUE v_Draw (GRE::LAYERDC& layerdc);
00213 virtual const RVC::OBJITEM& v_GetObjItem (int component) const;
00214 virtual const char* v_SerialGetTagName () const;
00215 virtual void v_SetDftName (bool ReplaceExisting);
00216 virtual ERRVALUE v_TemplateRead (SERIALIZER& serializer);
00217 virtual int v_UpdateExtents (bool forceupdate);
00218 virtual bool v_UsesTransparency (const MGD::DEVICE*) const;
00219
00220 LAYER_LEGEND (const LAYER_LEGEND&);
00221 LAYER_LEGEND& operator= (const LAYER_LEGEND&);
00222 #endif // GENERATING_DOXYGEN_OUTPUT
00223 };
00224
00225
00226 #define LEGENDFLAG_ConstantSize 0x00000001
00227 #define LEGENDFLAG_RowMajor 0x00000002
00228 #define LEGENDFLAG_LayoutScale 0x00000004
00229 #define LEGENDFLAG_RightJustify 0x00000008
00230 #define LEGENDFLAG_SampleOnRight 0x00000010
00231 #define LEGENDFLAG_SideA 0x00000040
00232 #define LEGENDFLAG_SideB 0x00000080
00233 #define LEGENDFLAG_DescCenterVert 0x00000100
00234 #define LEGENDFLAG_CenterHeadings 0x00000200
00235 #define LEGENDFLAG_Horizontal LEGENDFLAG_RowMajor
00236
00237
00238 }
00239
00240 #endif