00001 // $Id: sgmenu.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 // Context sensitive menu for SuperGalleries 00100 00101 00102 #ifndef INC_SGMENU 00103 #define INC_SGMENU 00104 00105 #include "contmenu.h" 00106 //#include "ops.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00107 //#include "sgallery.h" - in camtypes.h [AUTOMATICALLY REMOVED] 00108 00109 00110 00111 // --- Gallery menu commands - placed here for all to see, and to reduce dependencies 00112 // + Useful strings for "standard" commands - these must be handled entirely by the derived class 00113 const String_32 SGCmd_Apply( _T("Apply") ); 00114 const String_32 SGCmd_New( _T("New") ); 00115 const String_32 SGCmd_Rename( _T("Rename") ); 00116 const String_32 SGCmd_Redefine( _T("Redefine") ); 00117 const String_32 SGCmd_Edit( _T("Edit") ); 00118 const String_32 SGCmd_Copy( _T("Copy") ); 00119 const String_32 SGCmd_Delete( _T("Delete") ); 00120 const String_32 SGCmd_Create( _T("Create") ); 00121 00122 // + Strings for specific galleries - these are handled only by the galleries that use them 00123 const String_32 SGCmd_Add( _T("Add") ); // Add/Remove libraries (font/fill/clipart) 00124 const String_32 SGCmd_Remove( _T("Remove") ); 00125 const String_32 SGCmd_RemoveWebFonts( _T("Get") ); 00126 00127 const String_32 SGCmd_XPE_Edit( _T("XPEEdit") ); // Bitmap Trace/Effects/Save/Properties 00128 const String_32 SGCmd_Trace( _T("Trace") ); // Bitmap Trace/Effects/Save/Properties 00129 const String_32 SGCmd_Effects( _T("Effects") ); 00130 const String_32 SGCmd_Save( _T("Save") ); 00131 // WEBSTER-ranbirr-22/11/96 00132 const String_32 SGCmd_Props( _T("BmpProperties") ); 00133 const String_32 SGCmd_FrameProps( _T("Frame properties") ); 00134 00135 const String_32 SGCmd_Install( _T("Install") ); // Font install/deinstall 00136 const String_32 SGCmd_Deinstall( _T("Deinstall") ); 00137 const String_32 SGCmd_StopLoading( _T("StopLoading") ); 00138 const String_32 SGCmd_EmptyClipartCache( _T("EmptyClpCache") ); 00139 const String_32 SGCmd_EmptyFontsCache( _T("EmptyFntCache") ); 00140 const String_32 SGCmd_EmptyFillsCache( _T("EmptyFlsCache") ); 00141 00142 const String_32 SGCmd_Open( _T("Open") ); 00143 const String_32 SGCmd_Import( _T("Import") ); 00144 const String_32 SGCmd_Insert( _T("Insert") ); 00145 const String_32 SGCmd_Fill( _T("Fill") ); 00146 const String_32 SGCmd_Transp( _T("Transp") ); 00147 const String_32 SGCmd_Download( _T("Download") ); 00148 00149 const String_32 SGCmd_PlugIns( _T("PlugIns") ); // new bitmap plug-ins menu 00150 00151 const String_32 SGCmd_SetBackground( _T("Background") ); // Set background 00152 const String_32 SGCmd_ShowInColourLine( _T("ColourLine") ); // Show group in colour line 00153 const String_32 SGCmd_Preview( _T("Preview") ); // Preview 00154 00155 const String_32 SGCmd_Animation( _T("Animation") ); // Animation properties 00156 const String_32 SGCmd_Browser( _T("Browser") ); // preview in browser 00157 00158 const String_32 SGCmd_Show( _T("Show") ); // show frame in animation 00159 00160 // Name gallery commands. 00161 const String_32 SGCmd_RemoveNames( _T("RemoveNames") ); // remove names from selection 00162 const String_32 SGCmd_Select( _T("Select") ); // select union of attributes 00163 const String_32 SGCmd_Intersect( _T("Intersect") ); // select intersection of attributes 00164 const String_32 SGCmd_Export( _T("Export") ); // export named objects 00165 00166 // Line Gallery commands 00167 const String_32 SGCmd_ExportBrush( _T("ExportBrush") ); // exports brush to clipboard 00168 const String_32 SGCmd_RenameBrush( _T("RenameBrush") ); 00169 00170 // + Standard commands that are handled by the base class (all you need to do is add a menu 00171 // command of this name, and the base class will handle it for you) 00172 const String_32 SGCmd_Find( _T("Find") ); 00173 const String_32 SGCmd_Sort( _T("Sort") ); 00174 const String_32 SGCmd_Properties( _T("Properties") ); 00175 00176 const String_32 SGCmd_FoldGroup( _T("FoldGroup") ); 00177 const String_32 SGCmd_UnfoldGroup( _T("UnfoldGroup") ); 00178 const String_32 SGCmd_NextGroup( _T("NextGroup") ); 00179 const String_32 SGCmd_PrevGroup( _T("PrevGroup") ); 00180 00181 00182 // With the new GIF Animation frame gallery, this can mean that the OpToken can easily 00183 // overrun its String_32 allocation. Therefore, restrict the name to the first n characters 00184 // defined by the following constant. 00185 const INT32 GalleryBarNameLimitSize = 16; 00186 00187 /******************************************************************************************** 00188 00189 > class GalleryContextMenu : public ContextMenu 00190 00191 Author: Jason_Williams (Xara Group Ltd) <camelotdev@xara.com> 00192 Created: 14/9/95 00193 Purpose: Implements the SuperGallery context sensitive menus 00194 00195 SeeAlso: SuperGallery::BuildCommandMenu 00196 00197 ********************************************************************************************/ 00198 00199 class GalleryContextMenu : public ContextMenu 00200 { 00201 CC_DECLARE_MEMDUMP(GalleryContextMenu); 00202 00203 public: 00204 GalleryContextMenu(); 00205 // Default constructor - DO NOT CALL this constructor - use the one below 00206 00207 GalleryContextMenu(SGMenuID TheMenuType, SuperGallery *ParentGallery); 00208 // Constructs a menu object, letting it know what kind of menu it should build 00209 00210 virtual BOOL Build(void); 00211 // Builds a pop-up menu over the gallery list 00212 00213 protected: 00214 SuperGallery *ParentGallery; // The gallery to call to build the menu 00215 SGMenuID MenuType; // The type (options or list-popup) of menu 00216 }; 00217 00218 00219 00220 00221 /******************************************************************************************** 00222 00223 > class OpGalleryCommand : public Operation 00224 00225 Author: Jason_Williams (Xara Group Ltd) <camelotdev@xara.com> 00226 Created: 14/9/95 00227 00228 Purpose: A polymorphic Op which is used for all generic gallery "commands". 00229 00230 A gallery command is an OpToken along the lines "Colour gallery:DoSomething" 00231 where "Colour gallery" is the gallery bar name, and "DoSomething" is a command 00232 supported by either the "Colour gallery" bar or the SuperGallery base class. 00233 00234 SeeAlso: SuperGallery::DoMenuCommand; SuperGallery::GetMenuCommandState; 00235 SuperGallery::GetMenuCommandName 00236 00237 ********************************************************************************************/ 00238 00239 class OpGalleryCommand : public Operation 00240 { 00241 CC_DECLARE_DYNCREATE(OpGalleryCommand); 00242 00243 public: 00244 // There is no Init() method for this base class 00245 00246 static BOOL InitPolymorphicCommand(StringBase *OpToken, UINT32 MenuTextID); 00247 // Called by SuperGallery::InitMenuCommand to create another OpDescriptor 00248 // for this Op. 00249 00250 static OpState GetCommandState(String_256 *ShadeReason, OpDescriptor *pOpDesc); 00251 // The GetState method goes by a different name to avoid clashes with 00252 // derived classes. This one calls the parent gallery to determine the state. 00253 00254 virtual void Do(OpDescriptor* pOpDesc); 00255 // Calls the parent gallery with a command based on the OpDescriptor OpToken 00256 // (see GetGalleryAndCommand, below) 00257 00258 00259 protected: // Derived class interface 00260 static SuperGallery *GetGalleryAndCommand(OpDescriptor *pOpDesc, String_32 *Command); 00261 // Determines the gallery and command-string given the OpDescriptor we were invoked with 00262 }; 00263 00264 00265 #endif 00266