formedst.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/formedst.h
00003  * \brief MGUI::FORM_EDITSTYLE class definitions
00004  *
00005  * \if NODOC
00006  * $Id: formedst.h_v 1.11 2004/04/08 21:18:34 mju Exp $
00007  *
00008  * $Log: formedst.h_v $
00009  * Revision 1.11  2004/04/08 21:18:34  mju
00010  * Make IsCreated public.
00011  *
00012  * Revision 1.10  2003/11/12 14:28:35  mju
00013  * Add ResetModified method.
00014  *
00015  * Revision 1.9  2003/09/25 21:56:37  dwilliss
00016  * doxygen
00017  *
00018  * Revision 1.8  2003/09/15 13:49:45  fileserver!dwilliss
00019  * Doxygen
00020  *
00021  * Revision 1.7  2003/07/29 21:20:35  dwilliss
00022  * Made SetEnabled public again.
00023  *
00024  * Revision 1.6  2003/03/10 21:49:31  mju
00025  * Remove parm from deletepattern.
00026  *
00027  * Revision 1.5  2003/01/31 18:47:49  mju
00028  * Remove unneeded styleopenmode member.
00029  *
00030  * Revision 1.4  2003/01/23 22:37:29  mju
00031  * Big redesign, move nested classes to implementation file.
00032  *
00033  * Revision 1.3  2003/01/06 15:54:22  mju
00034  * More functionality.
00035  *
00036  * Revision 1.2  2002/10/14 20:59:12  mju
00037  * Restructure so works in X.
00038  *
00039  * Revision 1.1  2002/08/13 21:57:04  mju
00040  * Initial revision
00041  *
00042  * 
00043  * 8     6/05/02 3:12p Mju
00044  * No vararg
00045  * 
00046  * 7     2/08/02 5:27p Dwilliss
00047  * Changed to use new CTRL_GRID
00048  * 
00049  * 6     12/13/01 10:55a Mju
00050  * MGUI unificiation with X.
00051  * 
00052  * 5     12/03/01 11:05a Mju
00053  * Remove references to old deprecated MGUI names.
00054  * 
00055  * 4     10/24/01 4:16p Mju
00056  * Use OnItemSelect instead of OnClickItem.
00057  * 
00058  * 3     10/24/01 12:04p Mju
00059  * Properly handle pattern deletion.
00060  * Show sample patterns and sort pattern lists.
00061  * Allow selection by single-click on item.
00062  * 
00063  * 2     10/10/01 9:49a Mju
00064  * 
00065  * 1     9/14/01 3:35p Mju
00066  * \endif
00067 **/
00068 
00069 #ifndef  INC_RVC_FORMEDST_H
00070 #define  INC_RVC_FORMEDST_H
00071 
00072 #ifndef  INC_MI32_STDDEFNS_H
00073 #include <mi32/stddefns.h>
00074 #endif
00075 
00076 #ifndef  INC_MGUI_CTRL_H
00077 #include <mgui/ctrl.h>
00078 #endif
00079 
00080 #ifndef  INC_MGUI_LISTITEM_H
00081 #include <mgui/listitem.h>
00082 #endif
00083 
00084 #ifndef  INC_MGUI_FORMRBTN_H
00085 #include <mgui/formrbtn.h>
00086 #endif
00087 
00088 #ifndef  INC_RVC_STYLE_H
00089 #include <rvc/style.h>
00090 #endif
00091 
00092 #ifndef  INC_MI32_ELEMSTYL_H
00093 #include <mi32/elemstyl.h>
00094 #endif
00095 
00096 #ifndef  INC_MGUI_IMAGELST_H
00097 #include <mgui/imagelst.h>
00098 #endif
00099 
00100 namespace MGUI {
00101 
00102 class CTRL_GRID;
00103 
00104 class FORM_EDITSTYLE : public MGUI::FORM {
00105    public:
00106 
00107       //! Constructor.
00108       FORM_EDITSTYLE (
00109          );
00110 
00111       //! Destructor.
00112       virtual ~FORM_EDITSTYLE (
00113          );
00114 
00115       //! Commit changes made by user to file.
00116       ERRVALUE CommitChanges (
00117          );
00118 
00119       //! Create the form.
00120       ERRVALUE Create (
00121          MGUI::LAYOUT_PANE_BASE& ParentPane,
00122          RVC::STYLE::TYPE StyleType,
00123          RVC::EDITSTYLEFLAGS FormStyle = RVC::EDITSTYLEFLAG_None
00124          );
00125 
00126       //! Get active style number.
00127       //! @return Active style number, -1 for "default" style, < -1 if error.
00128       INT32 GetActiveStyleNum (
00129          ) const { return (GetActiveStyleNum(m_StyleType)); }
00130 
00131       //! Get active style number for specified type.
00132       //! @return Active style number, -1 for "default" style, < -1 if error.
00133       INT32 GetActiveStyleNum (
00134          RVC::STYLE::TYPE StyleType
00135          ) const;
00136 
00137       //! Get active style type.
00138       RVC::STYLE::TYPE GetActiveStyleType (
00139          ) const { return (m_StyleType); }
00140 
00141       //! Get current scale.
00142       double GetCurrentScale (
00143          ) { return (v_OnGetCurrentScale()); }
00144 
00145       //! Get default POINTSTYLE.
00146       void GetDefaultStyle (
00147          POINTSTYLE& PointStyle
00148          ) const;
00149 
00150       //! Get default LINESTYLE.
00151       void GetDefaultStyle (
00152          LINESTYLE& LineStyle
00153          ) const;
00154 
00155       //! Get default POLYSTYLE.
00156       void GetDefaultStyle (
00157          POLYSTYLE& PolyStyle
00158          ) const;
00159 
00160       //! Get default TEXTSTYLE.
00161       void GetDefaultStyle (
00162          TEXTSTYLE& TextStyle
00163          ) const;
00164 
00165       //! Get default MULTISTYLE.
00166       void GetDefaultStyle (
00167          MULTISTYLE& MultiStyle
00168          ) const;
00169 
00170       //! Get current style object item.
00171       void GetStyleObjItem (
00172          RVC::OBJITEM& ObjItem
00173          ) const { m_StyleObj.GetObjectItem(ObjItem); }
00174 
00175       virtual bool IsCreated () const;
00176 
00177       //! Determine if RVC style object has been modified by user edits.
00178       bool IsObjectModified (
00179          ) { CommitChanges(); return (m_ObjectModified); }
00180 
00181       //! Reset 'modified' status.
00182       void ResetModified (
00183          ) { m_ObjectModified = false; }
00184 
00185       //! Set active style number for specified style type.
00186       //! This does not change the style type being "edited", use SetStyleType() to do that.
00187       ERRVALUE SetActiveStyleNum (
00188          RVC::STYLE::TYPE StyleType,
00189          INT32 StyleNum
00190          );
00191 
00192       //! Set current 'map scale' for style samples and 'Current Scale' button.
00193       void SetCurrentMapScale (
00194          double CurMapScale
00195          ) { m_CurMapScale = CurMapScale; }
00196 
00197       //! Set default LINE style.
00198       void SetDefaultStyle (
00199          const LINESTYLE& LineStyle
00200          );
00201 
00202       //! Set default POINT style.
00203       void SetDefaultStyle (
00204          const POINTSTYLE& PointStyle
00205          );
00206 
00207       //! Set default POLYGON style.
00208       void SetDefaultStyle (
00209          const POLYSTYLE& PolygonStyle
00210          );
00211 
00212       //! Set default TEXT style.
00213       void SetDefaultStyle (
00214          const TEXTSTYLE& TextStyle
00215          );
00216 
00217       //! Set default MULTISTYLE style.
00218       void SetDefaultStyle (
00219          const MULTISTYLE& MultiStyle
00220          );
00221 
00222       //! MGUI::FORM overrides.
00223       virtual void SetEnabled (bool enabled = true);
00224 
00225       //! Set hardcopy pixel spacing in "pixels per inch".
00226       //! This value is used when user chooses units to view style elements in.
00227       void SetHardcopyDPI (
00228          double HardcopyDPI
00229          );
00230 
00231       //! Set style object to edit or select styles from.
00232       ERRVALUE SetStyleObject (
00233          const RVC::OBJITEM& ObjItem,
00234          RVC::OBJECT::OPENMODE OpenMode = RVC::OBJECT::OPENMODE_Read
00235          );
00236 
00237       //! Set type of style being edited.
00238       void SetStyleType (
00239          RVC::STYLE::TYPE StyleType
00240          );
00241 
00242    protected:
00243 
00244       void NotifyModified () { v_OnNotifyModified(); }
00245 
00246       void SetObjectModified (
00247          bool ObjectModified = true
00248          ) { m_ObjectModified = ObjectModified; }
00249 
00250    private:
00251       #ifndef GENERATING_DOXYGEN_OUTPUT
00252 
00253       class FORM_STYLES;
00254       friend class FORM_STYLES;
00255       class FORM_TYPE;
00256       friend class FORM_TYPE;
00257       class FORM_POINT;
00258       friend class FORM_POINT;
00259       class FORM_LINE;
00260       friend class FORM_LINE;
00261       class FORM_POLYGON;
00262       friend class FORM_POLYGON;
00263       class FORM_TEXT;
00264       friend class FORM_TEXT;
00265 
00266       //! Self-initializing members.
00267       LAYOUT_PANE m_FormPane;
00268       RVC::STYLE m_StyleObj;
00269       LISTITEMDEF m_ComboItemScaleAt[4];
00270       FORM_RADIOBUTTONS_T<FORM_EDITSTYLE> m_StyleTypeRB;
00271       CTRL_EDIT_STRING_T<FORM_EDITSTYLE> m_SampleStrES;
00272       IMAGELIST m_IconImageList;
00273 
00274       //! Explicitly initialized.
00275       RVC::EDITSTYLEFLAGS m_FormStyleFlags;
00276       MDLGPARENT m_dlgparent;
00277       bool m_ObjectModified;
00278       UINT32 m_NoDrawSample;
00279       double m_HardcopyDPI;
00280       double m_CurMapScale;
00281       RVC::STYLE::TYPE m_StyleType;
00282       FORM_STYLES *m_pFormStyles;
00283       FORM_POINT *m_pFormPoint;
00284       FORM_LINE *m_pFormLine;
00285       FORM_POLYGON *m_pFormPolygon;
00286       FORM_TEXT *m_pFormText;
00287       FORM_TYPE *m_pFormType[RVC::STYLE::TYPE_NumTypes];
00288       int m_IconIdxCheckBoxEmpty;
00289       int m_IconIdxCheckBoxBlack;
00290       int m_IconIdxCheckBoxGray;
00291 
00292       ERRVALUE ChangeStyleObject ();
00293       bool DeletePattern (RVC::STYLE::PATTERN PatternType, INT32 PatternNum);
00294       void EnableControls ();
00295       MDLGPARENT GetDlgParent () const { return (m_dlgparent); }
00296       double GetSizeUnitScale (int units) const;
00297       bool HasDftStyle () const { return (HasDftStyle(m_StyleType)); }
00298       bool HasDftStyle (RVC::STYLE::TYPE StyleType) const;
00299       bool HasStyle (RVC::STYLE::TYPE StyleType) const;
00300       bool InsertPatterns (RVC::STYLE::PATTERN PatternType, INT32 PatternNum, const COLOR& varcolor);
00301       void InvalidateSample ();
00302       bool IsObjectWritable () const { return (m_StyleObj.IsWritable()); }
00303       ERRVALUE LoadStyle ();
00304       void OnEditSampleStr ();
00305       void OnRadioStyleType ();
00306       void ResetStyleNums ();
00307       void RedrawStylesList ();
00308       INT32 SaveNewStyle (const RVC::OBJECTNAME& NewStyleName);
00309 
00310       //! MGUI::FORM overrides.
00311       virtual bool IsEnabled () const;
00312       virtual void SetVisible (bool visible = true);
00313 
00314       FORM_EDITSTYLE (const FORM_EDITSTYLE&);
00315       FORM_EDITSTYLE& operator= (const FORM_EDITSTYLE&);
00316 
00317       #endif // GENERATING_DOXYGEN_OUTPUT
00318 
00319       // FORM_EDITSTYLE overridables.
00320 
00321       //! Called to obtain "current" map scale.
00322       //! Default implementation returns -1.
00323       virtual double v_OnGetCurrentScale (
00324          );
00325 
00326       //! Method to obtain style description.
00327       //! Override to provide own descriptions.
00328       virtual void v_OnGetStyleDescription (
00329          RVC::STYLE::TYPE StyleType,
00330          INT32 StyleNum,
00331          MISTRING& desc
00332          );
00333 
00334       //! Called when modification made to current style.
00335       virtual void v_OnNotifyModified (
00336          );
00337 
00338    };
00339 
00340 }  //! End of MGUI namespace
00341 
00342 
00343 #endif   //!< INC_RVC_FORMEDST_H

Generated on Tue Dec 14 13:18:50 2004 for TNTsdk by  doxygen 1.3.8-20040913