layerprp.h

Go to the documentation of this file.
00001 // $Id: layerprp.h 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 // 
00099 // Header file for AppPrefs.cpp
00100 //
00101 // 
00102 
00103 // WEBSTER - markn 15/1/97
00104 // Don't need the layer properties dlg in Webster
00105 //#ifdef WEBSTER
00106 //#define INC_LAYERPROPERTYTABS
00107 //#endif 
00108 
00109 #ifndef INC_LAYERPROPERTYTABS
00110 #define INC_LAYERPROPERTYTABS
00111 
00112 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00113 //#include "unittype.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00114 //#include "units.h"        // units e.g. Millimeters - in camtypes.h [AUTOMATICALLY REMOVED]
00115 #include "property.h"   // PropertyTabs class
00116 
00117 class LayerPropertyTabs;
00118 
00119 /********************************************************************************************
00120 
00121 >   class LayerPropertyTabsDlg : public DialogTabOp
00122 
00123     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 
00124     Created:    28/09/95
00125     Purpose:    The layer properties dialog box
00126     
00127                 Allows the user to set options like:-
00128                     The name of the layer
00129                     The colour of the guides
00130                     If a guide layer then all the guides on the layer
00131 
00132                 Uses the LayerPropertyTabs class which is declared and initialised by this class.
00133                 This uses any application options pages which have been declared to the
00134                 options tabs list. The document options uses the same system.
00135                 Also, declares the PageSizes class to the system so that they are available
00136                 to all options tabs.
00137 
00138     SeeAlso:    LayerPropertyTabs;
00139     SeeAlso:    AppPrefsDlg; LayerPropertyTabs;
00140                 
00141 ********************************************************************************************/
00142 #define OPTOKEN_LAYERPROPERTYTABS   _T("LayerPropertyTabs")
00143 
00144 class LayerPropertyTabsDlg : public DialogTabOp
00145 {
00146     CC_DECLARE_DYNCREATE( LayerPropertyTabsDlg )
00147 
00148 public:
00149     LayerPropertyTabsDlg();                         // constructor
00150     LayerPropertyTabsDlg(INT32 StartingPage);           // constructor
00151     ~LayerPropertyTabsDlg();                            // destructor
00152 
00153     void Do(OpDescriptor*);                         // "Do" function
00154 
00155     static BOOL Init();                             // Setup function
00156     static void Deinit();                           // Remove function
00157 
00158     // No create function as this is handled by the main tab dialog code
00159 
00160     static OpState GetState(String_256*, OpDescriptor*);
00161                                                     // Return the state of this operation
00162     virtual MsgResult Message(Msg* Message);        // Message handler
00163     virtual BOOL RegisterYourPagesInOrderPlease();  // Add in tab pages
00164     
00165     // Set up explicit details about this dialog box such as id, type (MODE or MODELESS)
00166     static const CDlgResID IDD;                     // Dialog box id
00167     static const CDlgMode Mode;                     // Dialog box mode of operation (mode or modeless)
00168 
00169     // Functions to commit the values on the dialog box and its sections on ok
00170     BOOL CommitDialogValues();
00171 
00172     // returns pointer to the layer properties handling class
00173     static LayerPropertyTabs * GetLayerPropertiesTabs();
00174 
00175 private:
00176     String_256 TitleString;                         // title of dialog box
00177 
00178     static LayerPropertyTabs * pLayerProperties;    // pointer to the list class handling this tab
00179 };
00180 
00181 
00182 /********************************************************************************************
00183 
00184 >   class LayerPropertiesDlg : public LayerPropertyTabsDlg
00185 
00186     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 
00187     Created:    10/10/95
00188     Purpose:    To open up the layer properties tabbed dialog box with the layer's tab
00189                 selected. This is used by the layers pop up menu.
00190 
00191     SeeAlso:    LayerPropertyTabsDlg; LayerPropertyTabs;
00192     
00193 ********************************************************************************************/
00194 
00195 class LayerPropertiesDlg : public LayerPropertyTabsDlg
00196 {
00197     // Defines the OPTOKEN_DLG as this now links to the units tab in
00198     // this document options dialog box.
00199 #define OPTOKEN_LAYERPROPERTIESDLG  _T("LayerPropertiesDlg")
00200 
00201     CC_DECLARE_DYNCREATE( LayerPropertiesDlg )
00202 
00203 public:
00204     LayerPropertiesDlg();                   // constructor
00205 
00206     // All other functionality comes from the LayerPropertyTabsDlg class.
00207 };
00208 
00209 /********************************************************************************************
00210 
00211 >   class GuidePropertiesDlg : public LayerPropertyTabsDlg
00212 
00213     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 
00214     Created:    10/10/95
00215     Purpose:    To open up the layer properties tabbed dialog box with the guide's tab
00216                 selected. This is used by the guides pop up menu.
00217 
00218     SeeAlso:    LayerPropertyTabsDlg; LayerPropertyTabs;
00219     
00220 ********************************************************************************************/
00221 
00222 class GuidePropertiesDlg : public LayerPropertyTabsDlg
00223 {
00224     // Defines the OPTOKEN_DLG as this now links to the units tab in
00225     // this document options dialog box.
00226 #define OPTOKEN_GUIDEPROPERTIESDLG  _T("GuidePropertiesDlg")
00227 
00228     CC_DECLARE_DYNCREATE( GuidePropertiesDlg )
00229 
00230 public:
00231     GuidePropertiesDlg();                   // constructor
00232 
00233     // All other functionality comes from the LayerPropertyTabsDlg class.
00234 };
00235 
00236 
00237 /********************************************************************************************
00238 
00239 >   class LayerPropertyTabs : public PropertyTabs
00240 
00241     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com> 
00242     Created:    28/9/95
00243     Purpose:    These encompass all the tabs available for the layer properties dialog box
00244                 to use. Derived off the baseclass which has a lot of globally useful
00245                 functionality for all property tabbed dialog box handlers. This is just
00246                 derived of the list class.
00247 
00248     SeeAlso:    PropertyTabs; ListItem;
00249 
00250 ********************************************************************************************/
00251 class CCAPI LayerPropertyTabs : public PropertyTabs
00252 {
00253     CC_DECLARE_DYNAMIC(LayerPropertyTabs);
00254 
00255 public:
00256     LayerPropertyTabs();                        // Constructor
00257 
00258     static BOOL InitLayerPropertyTabs();        // set up all option tabs available
00259     static BOOL DeinitLayerPropertyTabs();          // remove all option tabs available
00260 
00261     static LayerPropertyTabs *GetFirst();
00262     static LayerPropertyTabs *GetNext(LayerPropertyTabs*);
00263 
00264     virtual BOOL Init();                        // Initialisation
00265 
00266     // Function to declare a tab/section to the options system
00267     static BOOL DeclareLayerProperty(LayerPropertyTabs *pLayerProperty);
00268 
00269     // Functions to handle the apply now and message state flags
00270     virtual BOOL GetApplyNowState();                    // Get current state of ApplyNow flag
00271     virtual BOOL SetApplyNowState(BOOL NewState);       // set new state for ApplyNow 
00272 
00273     virtual BOOL SetInitMessageState(BOOL NewState);    // set new state of InitMessage
00274     virtual BOOL GetInitMessageState();                 // get current state of InitMessage
00275 
00276     // Overridable by the tab section handlers. These are the must be specified functions
00277     // and so are pure.
00278     virtual CDlgResID GetPageID();              // Return section/page id system
00279     virtual BOOL InitSection();                 // Called when page first opened
00280     virtual BOOL CommitSection();               // Called when ok action is required
00281     virtual BOOL HandleMsg(DialogMsg* Msg);     // Called when messages arrive
00282 
00283     // The following are used to open the specific options tab 
00284     static UINT32 LayersTabNumber;              // Tab number assigned to the layers tab
00285     static UINT32 GuidesTabNumber;              // Tab number assigned to the guides tab
00286 
00287     virtual DialogTabOp * GetTabbedDlg();           // return pointer to the main dialog box
00288     
00289     static BOOL SetTabbedDlg(DialogTabOp * pDlg);   // return pointer to the main dialog box
00290 
00291 protected:
00292     static DialogTabOp *pPropertiesDlg;     // pointer to the main dialog box
00293 
00294 private:
00295     BOOL InitMessage;                       // True if handling an init message
00296     BOOL ApplyNow;                          // True if Apply now should be ungreyed
00297 
00298     // The list of property tabs that is understood.
00299     static List LayerPropertyTabsList;      // list of available tabs
00300 };
00301 
00302 #endif  // INC_LAYERPROPERTYTABS
00303 
00304 

Generated on Sat Nov 10 03:45:37 2007 for Camelot by  doxygen 1.4.4