fbcontrols/fbgenericmenu.h Source File

fbgenericmenu.h
Go to the documentation of this file.
1 #ifndef __GENERIC_MENU_H__
2 #define __GENERIC_MENU_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
47 #include <kaydaradef.h>
48 #ifndef FBSDK_DLL
49  #define FBSDK_DLL K_DLLEXPORT
51 #endif
52 
53 #include <fbsdk/fbcomponent.h>
54 #include <fbcontrols/fbcontrols.h>
55 
56 K_FORWARD( IKtObject );
57 
58 
59 #ifdef FBSDKUseNamespace
60  namespace FBSDKNamespace {
61 #endif
62 
63 __FB_FORWARD( FBGenericMenuItem );
64 __FB_FORWARD( FBGenericMenu );
65 __FB_FORWARD( FBMenuManager );
66 FB_DEFINE_COMPONENT( FBSDK_DLL, GenericMenuItem );
69 
82 public:
83  FBGenericMenuItem(HIObject pObject);
84 
89 };
90 
138 public:
141  FBGenericMenu(HIObject pObject=NULL);
142 
145  virtual void FBDelete() override;
146 
151  FBGenericMenuItem* GetFirstItem();
152 
157  FBGenericMenuItem* GetLastItem();
158 
163  FBGenericMenuItem* GetNextItem(FBGenericMenuItem* pItem);
164 
169  FBGenericMenuItem* GetPrevItem(FBGenericMenuItem* pItem);
170 
175  FBGenericMenuItem* GetItem( int pItemId );
176 
183  FBGenericMenuItem* InsertFirst(const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
184 
191  FBGenericMenuItem* InsertLast(const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
192 
200  FBGenericMenuItem* InsertAfter(FBGenericMenuItem* pBeforeItem, const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
201 
209  FBGenericMenuItem* InsertBefore(FBGenericMenuItem* pAfterItem, const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
210 
214  void DeleteItem(FBGenericMenuItem* pToDelete);
215 
223  FBGenericMenuItem* Execute(int pX, int pY, bool pRightAlign = true);
224 
225 
227 private:
228  friend class FBMenuManager;
229  friend class DataFBMenuManager;
230  friend class DataFBGenericMenu;
231 };
232 
260 public:
264  FBMenuManager();
265 
272  FBGenericMenu* GetMenu(const char* pPath);
273 
279  FBGenericMenuItem* InsertFirst(const char* pMenuPath, const char* pMenuName);
280 
286  FBGenericMenuItem* InsertLast(const char* pMenuPath, const char* pMenuName);
287 
293  FBGenericMenuItem* InsertBefore(const char* pMenuPath, const char* pAfterMenuName, const char* pMenuName);
294 
300  FBGenericMenuItem* InsertAfter(const char* pMenuPath, const char* pBeforeMenuName, const char* pMenuName);
301 
308  void SetItemEnable(const char* pMenuPath, int pItemId, bool pEnable );
309 
316  bool IsItemEnable(const char* pMenuPath, int pItemId);
317 private:
318  FBGenericMenuItem* GetMenuItem(const char* pMenuPath, const char* pMenuName, int pId );
319 
320 public:
328  bool ExecuteMenuItem( const char* pMenuPath, int pMenuItemID );
329 
345  bool ExecuteMenuItemFromFullPath( const char* pMenuItemFullPath );
346 };
347 
348 
349 
350 #ifdef FBSDKUseNamespace
351  }
352 #endif
353 
354 #endif
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBGenericMenuItem This class stores data for a single menu item.
Definition: fbgenericmenu.h:80
K_FORWARD(KStringList)
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
FBPropertyGenericMenu Menu
Read/Write Property: If the menu item leads to another menu.
Definition: fbgenericmenu.h:88
#define NULL
Definition: kaydara.h:169
Property class: const char * (String).
Contains the user interface components for the SDK.
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
FBPropertyInt Id
Read/Write Property: Id of the menu item.
Definition: fbgenericmenu.h:86
FBPropertyString Caption
Read/Write Property: Caption of the menu item.
Definition: fbgenericmenu.h:85
#define FBSDK_DLL
FBSDKDLL_ K_DLLEXPORT.
Definition: fbgenericmenu.h:50
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
PropertyEvent: Base event class.
Definition: fbproperties.h:507
FBPropertyBool Enable
Read/Write Property: Enable or Disable (grey out) a menu Item.
Definition: fbgenericmenu.h:87
The menu manager allows access to MotionBuilder menu bar.
FBPropertyEvent OnMenuActivate
Event Property: Register on this property to be notified when a menu item is clicked by the user...
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
A GenericMenu class.
class FBPropertyBaseComponent< FBGenericMenu * > FBPropertyGenericMenu
Definition: fbgenericmenu.h:67