00001
00020 #ifndef INC_RVC_UISTYLE_H
00021 #define INC_RVC_UISTYLE_H
00022
00023 #ifndef INC_MGUI_LISTITEM_H
00024 #include <mgui/listitem.h>
00025 #endif
00026
00027 #ifndef INC_MGUI_FORMRADIOBUTTONS_H
00028 #include <mgui/formradiobuttons.h>
00029 #endif
00030
00031 #ifndef INC_MGUI_EDIT_H
00032 #include <mgui/edit.h>
00033 #endif
00034
00035 #ifndef INC_MGUI_IMAGELST_H
00036 #include <mgui/imagelst.h>
00037 #endif
00038
00039 #ifndef INC_RVC_STYLETYPE_H
00040 #include <rvc/styletype.h>
00041 #endif
00042
00043 #ifndef INC_MI32_ELEMTYPE_H
00044 #include <mi32/elemtype.h>
00045 #endif
00046
00047 #ifndef INC_RVC_OBJECT_H
00048 #include <rvc/object.h>
00049 #endif
00050
00051
00052 #ifndef GENERATING_DOXYGEN_OUTPUT
00053
00054 class MISTRING;
00055 struct POINTSTYLE;
00056 struct LINESTYLE;
00057 struct MULTISTYLE;
00058 struct POLYSTYLE;
00059 struct TEXTSTYLE;
00060 namespace RVC {
00061 class OBJITEM;
00062 class STYLE;
00063 }
00064 #endif
00065
00066
00067 namespace RVC {
00068 namespace UI {
00069
00071 enum EDITSTYLEFLAGS {
00072 EDITSTYLEFLAG_None = 0x00000000,
00073 EDITSTYLEFLAG_DefaultOnly = 0x00000001,
00074 EDITSTYLEFLAG_CAD = 0x00000002,
00075 EDITSTYLEFLAG_SingleType = 0x00000004,
00076 EDITSTYLEFLAG_NoRenameStyles = 0x00000010,
00077 EDITSTYLEFLAG_NoNewDelStyles = 0x00000020,
00078 EDITSTYLEFLAG_NoElemHeight = 0x00000040,
00079 EDITSTYLEFLAG_NoTypeButtons = 0x00000080,
00080 EDITSTYLEFLAG_NoScaleToLayout = 0x00000100,
00081 EDITSTYLEFLAG_NoScaleOptions = 0x00000200,
00082 EDITSTYLEFLAG_NoSample = 0x00000400,
00083 EDITSTYLEFLAG_AllowScaleToNone = 0x00000800,
00084 EDITSTYLEFLAG_SymbolForceSquare = 0x00010000,
00085 EDITSTYLEFLAG_SymbolNoNone = 0x00020000,
00086 EDITSTYLEFLAG_TextAllowHTML = 0x00100000,
00087 EDITSTYLEFLAG_TextAllowSpecialFormat = 0x00200000,
00088 EDITSTYLEFLAG_TextAllowVertAlignment = 0x00400000,
00089 EDITSTYLEFLAG_TextForceWordWrap = 0x00800000,
00090 EDITSTYLEFLAG_TextNoBlockWidth = 0x01000000,
00091 EDITSTYLEFLAG_TextNoWordWrap = 0x02000000,
00092 };
00093 #ifndef GENERATING_DOXYGEN_OUTPUT
00094 DEFINE_ENUM_OP_BITWISE(EDITSTYLEFLAGS)
00095 #endif
00096
00097
00099 class FORM_EDIT_STYLE : public MGUI::FORM {
00100 public:
00101
00103 FORM_EDIT_STYLE (
00104 );
00105
00107 virtual ~FORM_EDIT_STYLE (
00108 );
00109
00111 ERRVALUE CommitChanges (
00112 );
00113
00115 ERRVALUE Create (
00116 MGUI::LAYOUT_PANE_BASE& ParentPane,
00117 RVC::STYLETYPE StyleType,
00118 EDITSTYLEFLAGS FormStyle = EDITSTYLEFLAG_None
00119 );
00120
00123 INT32 GetActiveStyleNum (
00124 ) const { return (GetActiveStyleNum(m_StyleType)); }
00125
00128 INT32 GetActiveStyleNum (
00129 RVC::STYLETYPE StyleType
00130 ) const;
00131
00133 RVC::STYLETYPE GetActiveStyleType (
00134 ) const { return (m_StyleType); }
00135
00137 double GetCurrentScale (
00138 );
00139
00141 void GetDefaultStyle (
00142 POINTSTYLE& PointStyle
00143 ) const;
00144
00146 void GetDefaultStyle (
00147 LINESTYLE& LineStyle
00148 ) const;
00149
00151 void GetDefaultStyle (
00152 POLYSTYLE& PolyStyle
00153 ) const;
00154
00156 void GetDefaultStyle (
00157 TEXTSTYLE& TextStyle
00158 ) const;
00159
00161 void GetDefaultStyle (
00162 MULTISTYLE& MultiStyle
00163 ) const;
00164
00166 void GetStyleObjItem (
00167 RVC::OBJITEM& ObjItem
00168 ) const;
00169
00170 virtual bool IsCreated () const;
00171
00173 bool IsObjectModified (
00174 ) { CommitChanges(); return (m_ObjectModified); }
00175
00177 void ResetModified (
00178 ) { m_ObjectModified = false; }
00179
00182 ERRVALUE SetActiveStyleNum (
00183 RVC::STYLETYPE StyleType,
00184 INT32 StyleNum
00185 );
00186
00188 void SetCurrentMapScale (
00189 double CurMapScale
00190 ) { m_CurMapScale = CurMapScale; }
00191
00193 void SetDefaultStyle (
00194 const LINESTYLE& LineStyle
00195 );
00196
00198 void SetDefaultStyle (
00199 const POINTSTYLE& PointStyle
00200 );
00201
00203 void SetDefaultStyle (
00204 const POLYSTYLE& PolygonStyle
00205 );
00206
00208 void SetDefaultStyle (
00209 const TEXTSTYLE& TextStyle
00210 );
00211
00213 void SetDefaultStyle (
00214 const MULTISTYLE& MultiStyle
00215 );
00216
00218 void SetDelegateGetCurrentScale (
00219 DELEGATE_DOUBLE_NOPARMS delegate
00220 ) { m_DelegateGetCurrentScale = delegate; }
00221
00223
00224
00225
00226
00228 void SetDelegateNotifyModified (
00229 DELEGATE_VOID_NOPARMS delegate
00230 ) { m_DelegateNotifyModified = delegate; }
00231
00232 virtual bool IsEnabled () const;
00233 virtual void SetEnabled (bool enabled = true);
00234
00237 void SetHardcopyDPI (
00238 double HardcopyDPI
00239 ) { m_HardcopyDPI = HardcopyDPI; }
00240
00242 ERRVALUE SetStyleObject (
00243 const RVC::OBJITEM& ObjItem,
00244 RVC::OBJECT::OPENMODE OpenMode = RVC::OBJECT::OPENMODE_Read
00245 );
00246
00248 void SetStyleType (
00249 RVC::STYLETYPE StyleType
00250 );
00251
00252 private:
00253 #ifndef GENERATING_DOXYGEN_OUTPUT
00254
00255 class FORM_STYLES;
00256 friend class FORM_STYLES;
00257 class FORM_TYPE;
00258 friend class FORM_TYPE;
00259 class FORM_POINT;
00260 friend class FORM_POINT;
00261 class FORM_LINE;
00262 friend class FORM_LINE;
00263 class FORM_POLYGON;
00264 friend class FORM_POLYGON;
00265 class FORM_TEXT;
00266 friend class FORM_TEXT;
00267
00269 MGUI::LAYOUT_PANE m_FormPane;
00270 MGUI::FORM_RADIOBUTTONS m_StyleTypeRB;
00271 MGUI::CTRL_EDIT_STRING m_SampleStrES;
00272 MGUI::IMAGELIST m_IconImageList;
00273 DELEGATE_DOUBLE_NOPARMS m_DelegateGetCurrentScale;
00274 DELEGATE_VOID_NOPARMS m_DelegateNotifyModified;
00275
00277 EDITSTYLEFLAGS m_FormStyleFlags;
00278 MDLGPARENT m_dlgparent;
00279 bool m_ObjectModified;
00280 UINT32 m_NoDrawSample;
00281 double m_HardcopyDPI;
00282 double m_CurMapScale;
00283 RVC::STYLE *m_pStyleObj;
00284 RVC::STYLETYPE m_StyleType;
00285 FORM_STYLES *m_pFormStyles;
00286 FORM_POINT *m_pFormPoint;
00287 FORM_LINE *m_pFormLine;
00288 FORM_POLYGON *m_pFormPolygon;
00289 FORM_TEXT *m_pFormText;
00290 FORM_TYPE *m_pFormType[RVC::STYLETYPE_NumTypes];
00291 int m_IconIdxCheckBoxEmpty;
00292 int m_IconIdxCheckBoxBlack;
00293 int m_IconIdxCheckBoxGray;
00294
00295 ERRVALUE ChangeStyleObject ();
00296 bool DeletePattern (RVC::PATTERNTYPE PatternType, INT32 PatternNum);
00297 void EnableControls ();
00298 MDLGPARENT GetDlgParent () const { return (m_dlgparent); }
00299 double GetSizeUnitScale (int units) const;
00300 bool HasDftStyle () const { return (HasDftStyle(m_StyleType)); }
00301 bool HasDftStyle (RVC::STYLETYPE StyleType) const;
00302 bool HasStyle (RVC::STYLETYPE StyleType) const;
00303 bool InsertPatterns (RVC::PATTERNTYPE PatternType, INT32 PatternNum, const COLOR& varcolor);
00304 void InvalidateSample ();
00305 bool IsObjectWritable () const;
00306 ERRVALUE LoadStyle ();
00307 void NotifyModified ();
00308 void OnEditSampleStr ();
00309 void OnRadioStyleType ();
00310 void ResetStyleNums ();
00311 void RedrawStylesList ();
00312 INT32 SaveNewStyle (const RVC::OBJECTNAME& NewStyleName);
00313 void SetObjectModified (
00314 bool ObjectModified = true
00315 ) { m_ObjectModified = ObjectModified; }
00316
00317
00318 virtual void SetVisible (bool visible = true);
00319
00320 FORM_EDIT_STYLE (const FORM_EDIT_STYLE&);
00321 FORM_EDIT_STYLE& operator= (const FORM_EDIT_STYLE&);
00322
00323 #endif // GENERATING_DOXYGEN_OUTPUT
00324
00325 };
00326
00329
00330
00335 int DlgGetIcon (
00336 MDLGPARENT dlgparent,
00337 const MISTRING& PromptStr,
00338 RVC::OBJITEM& StyleObjItem,
00339 const COLOR& SampleColor
00340 );
00341
00344 int DlgGetPattern (
00345 MDLGPARENT dlgparent,
00346 const MISTRING& PromptStr,
00347 RVC::PATTERNTYPE PatternType,
00348 const RVC::OBJITEM& StyleObjItem,
00349 const COLOR& SampleColor
00350 );
00351
00352
00354 ERRVALUE DlgGetPatterns (
00355 MDLGPARENT dlgparent,
00356 const MISTRING& PromptStr,
00357 RVC::PATTERNTYPE PatternType,
00358 RVC::OBJITEM& StyleObjItem,
00359 SIMPLE_ARRAY<INT32>& PatternNums,
00360 const COLOR& SampleColor
00361 );
00362
00363
00365 ERRVALUE DlgStyleEdit (
00366 MDLGPARENT dlgparent,
00367 const RVC::OBJITEM& ObjItemStyle,
00368 double CurMapScale,
00369 EDITSTYLEFLAGS flags,
00370 RVC::STYLETYPE StyleType = STYLETYPE_NumTypes
00371 );
00372
00373
00375 ERRVALUE DlgStyleEdit (
00376 MDLGPARENT dlgparent,
00377 const RVC::OBJITEM& ObjItemStyle,
00378 POINTSTYLE& DftStyle,
00379 double CurMapScale,
00380 EDITSTYLEFLAGS flags
00381 );
00382
00383
00385 ERRVALUE DlgStyleEdit (
00386 MDLGPARENT dlgparent,
00387 const RVC::OBJITEM& ObjItemStyle,
00388 LINESTYLE& DftStyle,
00389 double CurMapScale,
00390 EDITSTYLEFLAGS flags
00391 );
00392
00393
00395 ERRVALUE DlgStyleEdit (
00396 MDLGPARENT dlgparent,
00397 const RVC::OBJITEM& ObjItemStyle,
00398 POLYSTYLE& DftStyle,
00399 double CurMapScale,
00400 EDITSTYLEFLAGS flags
00401 );
00402
00403
00405 ERRVALUE DlgStyleEdit (
00406 MDLGPARENT dlgparent,
00407 const RVC::OBJITEM& ObjItemStyle,
00408 TEXTSTYLE& DftStyle,
00409 double CurMapScale,
00410 EDITSTYLEFLAGS flags
00411 );
00412
00413
00415 ERRVALUE DlgStyleEdit (
00416 MDLGPARENT dlgparent,
00417 const RVC::OBJITEM& ObjItemStyle,
00418 MULTISTYLE& DftStyle,
00419 double CurMapScale,
00420 EDITSTYLEFLAGS flags,
00421 RVC::STYLETYPE StyleType = STYLETYPE_NumTypes
00422 );
00423
00424
00426 ERRVALUE DlgStyleEditPattern (
00427 MDLGPARENT dlgparent,
00428 const RVC::OBJITEM& StyleObjItem,
00429 RVC::PATTERNTYPE PatternType,
00430 INT32 PatternNum,
00431 const COLOR& varcolor
00432 );
00433
00434
00436 ERRVALUE DlgStyleEditPatternSet (
00437 MDLGPARENT dlgparent,
00438 const RVC::OBJITEM& StyleObjItem,
00439 RVC::PATTERNTYPE PatternType,
00440 const COLOR& varcolor,
00441 INT32 PatternNum = -1
00442 );
00443
00444
00447 int DlgTableEditStyleByAttribute (
00448 MDLGPARENT dlgparent,
00449 const RVC::OBJITEM& dbobjitem,
00450 ELEMTYPE elemtype,
00451 RVC::OBJECTNAME& tablename,
00452 POINTSTYLE& DftStyle,
00453 double CurMapScale,
00454 const OBJITEM *pDftStyleObjItem = 0
00455 );
00456
00457
00460 int DlgTableEditStyleByAttribute (
00461 MDLGPARENT dlgparent,
00462 const RVC::OBJITEM& dbobjitem,
00463 ELEMTYPE elemtype,
00464 RVC::OBJECTNAME& tablename,
00465 LINESTYLE& DftStyle,
00466 double CurMapScale,
00467 const OBJITEM *pDftStyleObjItem = 0
00468 );
00469
00470
00473 int DlgTableEditStyleByAttribute (
00474 MDLGPARENT dlgparent,
00475 const RVC::OBJITEM& dbobjitem,
00476 ELEMTYPE elemtype,
00477 RVC::OBJECTNAME& tablename,
00478 POLYSTYLE& DftStyle,
00479 double CurMapScale,
00480 const OBJITEM *pDftStyleObjItem = 0
00481 );
00482
00483
00486 int DlgTableEditStyleByAttribute (
00487 MDLGPARENT dlgparent,
00488 const RVC::OBJITEM& dbobjitem,
00489 RVC::OBJECTNAME& tablename,
00490 MULTISTYLE& DftStyle,
00491 double CurMapScale,
00492 const OBJITEM *pDftStyleObjItem = 0,
00493 RVC::STYLETYPE DftStyleType = RVC::STYLETYPE_NumTypes
00494 );
00495
00496
00499 int DlgTableEditStyleByTheme (
00500 MDLGPARENT dlgparent,
00501 const RVC::OBJITEM& dbobjitem,
00502 ELEMTYPE elemtype,
00503 RVC::OBJECTNAME& tablename
00504 );
00505
00507
00508 }
00509 }
00510
00511 #endif // INC_RVC_UISTYLE_H