00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #pragma once
00017
00018 #include "iMenus.h"
00019
00020 typedef int MenuContextId;
00021
00022
00023
00024 const MenuContextId kMainMenuBar = 1;
00025 const MenuContextId kViewportQuad = 2;
00026 const MenuContextId kSchematicViewQuad = 3;
00027 const MenuContextId kIReshadeQuad = 4;
00028 const MenuContextId kIUVWUnwrapQuad = 5;
00029 const MenuContextId kTrackViewQuad = 6;
00030 const MenuContextId kTrackViewMenuBar = 7;
00031 const MenuContextId kSchematicViewMenuBar = 8;
00032 const MenuContextId kMaterialEditorMenuBar = 9;
00033
00034
00035 enum MenuContextType {
00036 kMenuContextMenuBar = 0,
00037 kMenuContextQuadMenu,
00038 kMenuContextPopupMenu,
00039 };
00040
00041
00049 class IMenuContext : public InterfaceServer {
00050
00051 public:
00053 virtual MenuContextId GetId() = 0;
00062 virtual MenuContextType GetType() = 0;
00064 virtual MSTR& GetName() = 0;
00065 };
00066
00075 class IMenuBarContext: public IMenuContext {
00076
00077 public:
00078
00084 virtual void SetMenu(IMenu* pMenu) = 0;
00085
00088 virtual IMenu* GetMenu() = 0;
00091 virtual HMENU CreateWindowsMenu() = 0;
00094 virtual void UpdateWindowsMenu() = 0;
00095
00098 virtual HMENU GetCurWindowsMenu() = 0;
00099
00105 virtual void ExecuteAction(int cmdId) = 0;
00110 virtual bool CommandIDInRange(int cmdId) = 0;
00111 };
00112
00121 class IQuadMenuContext: public IMenuContext {
00122
00123 public:
00124
00125
00133 virtual bool AddQuadMenu(IQuadMenu* pMenu, const MCHAR* pName) = 0;
00134
00144 virtual void SetMenu(int index, IQuadMenu* pMenu, const MCHAR* pName) = 0;
00145
00151 virtual void RemoveMenu(int index) = 0;
00152
00153
00156 virtual int MenuCount() = 0;
00162 virtual IQuadMenu* GetMenu(int index) = 0;
00163
00164
00167 virtual int GetCurrentMenuIndex() = 0;
00173 virtual void SetCurrentMenuIndex(int index) = 0;
00174
00175
00182 virtual bool GetShowAllQuads(int index) = 0;
00191 virtual void SetShowAllQuads(int index, bool showAll) = 0;
00192
00196 enum RightClickContext {
00197 kNonePressed,
00198 kShiftPressed,
00199 kAltPressed,
00200 kControlPressed,
00201 kShiftAndAltPressed,
00202 kShiftAndControlPressed,
00203 kControlAndAltPressed,
00204 kShiftAndAltAndControlPressed,
00205 };
00207
00208
00209
00213 virtual RightClickContext GetRightClickContext() = 0;
00214
00215
00222 virtual IQuadMenu* GetRightClickMenu(RightClickContext context) = 0;
00230 virtual void SetRightClickMenu(RightClickContext context, IQuadMenu *pMenu) = 0;
00231
00232
00238 virtual int FindMenu(IQuadMenu* pMenu) = 0;
00239
00246 virtual IQuadMenu* FindMenuByTitle(const MCHAR* pTitle) = 0;
00247
00248 };
00249
00250 const DWORD kMenuMenuBar = (1 << 0);
00251 const DWORD kMenuQuadMenu = (1 << 1);
00252
00253 #define MENU_MGR_INTERFACE Interface_ID(0xadc20bd, 0x7491741d)
00254
00259 class IMenuManager : public FPStaticInterface {
00260
00261 public:
00262
00270 virtual bool RegisterMenu(IMenu* pMenu, DWORD flags = 0) = 0;
00271
00278 virtual bool UnRegisterMenu(IMenu* pMenu) = 0;
00279
00280
00287 virtual IMenu* FindMenu(const MCHAR* pTitle) = 0;
00288
00289
00296 virtual IQuadMenu* FindQuadMenu(const MCHAR* pTitle) = 0;
00297
00298
00299
00308 virtual bool RegisterMenuBarContext(MenuContextId contextId, const MCHAR* pName) = 0;
00317 virtual bool RegisterQuadMenuContext(MenuContextId contextId, const MCHAR* pName) = 0;
00318
00320 virtual int NumContexts() = 0;
00326 virtual IMenuContext* GetContextByIndex(int index) = 0;
00333 virtual IMenuContext* GetContext(MenuContextId contextId) = 0;
00334
00335
00338 virtual void UpdateMenuBar() = 0;
00339
00340
00347 virtual BOOL LoadMenuFile(const MCHAR* pMenuFile) = 0;
00348
00349
00355 virtual BOOL SaveMenuFile(const MCHAR* pMenuFile) = 0;
00356
00357
00360 virtual const MCHAR* GetMenuFile() = 0;
00361
00362
00368 virtual BOOL SetMainMenuBar(IMenu* pMenu) = 0;
00369
00370
00379 virtual BOOL SetViewportRightClickMenu(IQuadMenuContext::RightClickContext context,
00380 IQuadMenu* pQuadMenu) = 0;
00381
00382
00388 virtual IQuadMenu* GetViewportRightClickMenu(IQuadMenuContext::RightClickContext context) = 0;
00389
00390
00392 virtual IMenu* GetMainMenuBar() = 0;
00393
00394
00401 virtual bool GetShowAllQuads(IQuadMenu* pQuadMenu) = 0;
00408 virtual void SetShowAllQuads(IQuadMenu* pQuadMenu, bool showAll) = 0;
00409
00410
00415 virtual const MCHAR* GetQuadMenuName(IQuadMenu* pQuadMenu) = 0;
00422 virtual void SetQuadMenuName(IQuadMenu* pQuadMenu, const MCHAR* pName) = 0;
00423
00424
00425 enum {
00426 #ifndef NO_CUI // russom - 02/12/02
00427 loadMenuFile,
00428 saveMenuFile,
00429 getMenuFile,
00430 #endif // NO_CUI
00431 unRegisterMenu,
00432 unRegisterQuadMenu,
00433 registerMenuContext,
00434 findMenu,
00435 findQuadMenu,
00436 updateMenuBar,
00437 createQuadMenu,
00438 createMenu,
00439 createSubMenuItem,
00440 createSeparatorItem,
00441 createActionItem,
00442 setViewportRightClickMenu,
00443 getViewportRightClickMenu,
00444 getMainMenuBar,
00445 setMainMenuBar,
00446 getShowAllQuads,
00447 setShowAllQuads,
00448 numMenus,
00449 getMenu,
00450 numQuadMenus,
00451 getQuadMenu,
00452 getQuadMenuName,
00453 setQuadMenuName,
00454 createMenuItemFromAction,
00455 };
00456
00457
00458 enum { rightClickContext, };
00459 };
00460