Go to the
documentation of this file.
00001 #ifndef __GENERIC_MENU_H__
00002 #define __GENERIC_MENU_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00047 #include <kaydaradef.h>
00048 #ifndef FBSDK_DLL
00049
00050 #define FBSDK_DLL K_DLLEXPORT
00051 #endif
00052
00053 #include <fbsdk/fbcomponent.h>
00054 #include <fbcontrols/fbcontrols.h>
00055
00056 K_FORWARD( IKtObject );
00057
00058
00059 #ifdef FBSDKUseNamespace
00060 namespace FBSDKNamespace {
00061 #endif
00062
00063 __FB_FORWARD( FBGenericMenuItem );
00064 __FB_FORWARD( FBGenericMenu );
00065 __FB_FORWARD( FBMenuManager );
00066 FB_DEFINE_COMPONENT( FBSDK_DLL, GenericMenuItem );
00067 FB_DEFINE_COMPONENT( FBSDK_DLL, GenericMenu );
00068 FB_DEFINE_COMPONENT( FBSDK_DLL, MenuManager );
00069
00080 class FBSDK_DLL FBGenericMenuItem : public FBComponent {
00081 __FBClassDeclare( FBGenericMenuItem, FBComponent );
00082 public:
00083 FBPropertyString Caption;
00084 FBPropertyInt Id;
00085 FBPropertyBool Enable;
00086 FBPropertyGenericMenu Menu;
00087 private:
00088 friend class DataFBGenericMenu;
00089 FBGenericMenuItem(DataFBGenericMenuItem* pData );
00090 };
00091
00127 class FBSDK_DLL FBGenericMenu : public FBComponent {
00128 __FBClassDeclare( FBGenericMenu, FBComponent );
00129 public:
00132 FBGenericMenu();
00133
00138 FBGenericMenuItem* GetFirstItem();
00139
00144 FBGenericMenuItem* GetLastItem();
00145
00150 FBGenericMenuItem* GetNextItem(FBGenericMenuItem* pItem);
00151
00156 FBGenericMenuItem* GetPrevItem(FBGenericMenuItem* pItem);
00157
00162 FBGenericMenuItem* GetItem( int pItemId );
00163
00170 FBGenericMenuItem* InsertFirst(const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
00171
00178 FBGenericMenuItem* InsertLast(const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
00179
00187 FBGenericMenuItem* InsertAfter(FBGenericMenuItem* pBeforeItem, const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
00188
00196 FBGenericMenuItem* InsertBefore(FBGenericMenuItem* pAfterItem, const char* pItemName, int pItemId, FBGenericMenu* pMenu = NULL);
00197
00201 void DeleteItem(FBGenericMenuItem* pToDelete);
00202
00210 FBGenericMenuItem* Execute(int pX, int pY, bool pRightAlign = true);
00211
00212
00213 FBPropertyEvent OnMenuActivate;
00214 private:
00215 friend class FBMenuManager;
00216 friend class DataFBMenuManager;
00217 friend class DataFBGenericMenu;
00218 FBGenericMenu(HIObject pObject);
00219
00220 };
00221
00252 class FBSDK_DLL FBMenuManager : public FBComponent {
00253 __FBClassDeclare( FBMenuManager, FBComponent );
00254 public:
00258 FBMenuManager();
00259
00266 FBGenericMenu* GetMenu(char* pPath);
00267
00273 FBGenericMenuItem* InsertFirst(char* pMenuPath, char* pMenuName);
00274
00280 FBGenericMenuItem* InsertLast(char* pMenuPath, char* pMenuName);
00281
00287 FBGenericMenuItem* InsertBefore(char* pMenuPath, char* pAfterMenuName, char* pMenuName);
00288
00294 FBGenericMenuItem* InsertAfter(char* pMenuPath, char* pBeforeMenuName, char* pMenuName);
00295
00302 void SetItemEnable(char* pMenuPath, int pItemId, bool pEnable );
00303
00310 bool IsItemEnable(char* pMenuPath, int pItemId);
00311 private:
00312 FBGenericMenuItem* GetMenuItem(char* pMenuPath, char* pMenuName, int pId );
00313 };
00314
00315
00316
00317 #ifdef FBSDKUseNamespace
00318 }
00319 #endif
00320
00321 #endif