// // FUNCTION: ContextMenuExt::QueryContextMenu // // PURPOSE: The Shell calls IContextMenu::QueryContextMenu to allow the // context menu handler to add its menu items to the menu. It // passes in the HMENU handle in the hmenu parameter. The // indexMenu parameter is set to the index to be used for the // first menu item that is to be added. // // doc about MENUITEMINFO: // http://msdn.microsoft.com/en-us/library/windows/desktop/ms647578(v=vs.85).aspx // // doc about InsertMenuItem: // http://msdn.microsoft.com/en-us/library/windows/desktop/ms647988(v=vs.85).aspx // IFACEMETHODIMP ContextMenuExt::QueryContextMenu( HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { // If uFlags include CMF_DEFAULTONLY then we should not do anything. if (CMF_DEFAULTONLY & uFlags) { return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(0)); } // context menu menu handle m_hTopMenu = hMenu; // position index m_topMenuIndex = indexMenu; m_subMenuIndex = 0; // command id m_firstCmdId = idCmdFirst; m_currentCmdId = idCmdFirst; m_cmdIdToCommand.clear(); // create and populate the submenu. if (!CreateSubMenu()) { return HRESULT_FROM_WIN32(GetLastError()); } // create and populate top level menu if (!CreateTopMenu()) { return HRESULT_FROM_WIN32(GetLastError()); } // Return an HRESULT value with the severity set to SEVERITY_SUCCESS. // Set the code value to the offset of the largest command identifier // that was assigned, plus one (1). return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(m_currentCmdId - idCmdFirst + 1)); }
void SceneEditorScreenMain::LoadResources() { new ErrorNotifier(); new HintManager(); new UNDOManager(); new PropertyControlCreator(); ControlsFactory::CustomizeScreenBack(this); font = ControlsFactory::GetFontLight(); //init file system dialog fileSystemDialog = new UIFileSystemDialog("~res:/Fonts/MyriadPro-Regular.otf"); fileSystemDialog->SetDelegate(this); String path = EditorSettings::Instance()->GetDataSourcePath(); if(path.length()) fileSystemDialog->SetCurrentDir(path); // add line after menu Rect fullRect = GetRect(); AddLineControl(Rect(0, ControlsFactory::BUTTON_HEIGHT, fullRect.dx, LINE_HEIGHT)); CreateTopMenu(); // settingsDialog = new SettingsDialog(fullRect, this); UIButton *settingsButton = ControlsFactory::CreateImageButton(Rect(fullRect.dx - ControlsFactory::BUTTON_HEIGHT, 0, ControlsFactory::BUTTON_HEIGHT, ControlsFactory::BUTTON_HEIGHT), "~res:/Gfx/UI/settingsicon"); settingsButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSettingsPressed)); AddControl(settingsButton); SafeRelease(settingsButton); menuPopup = new MenuPopupControl(GetRect(), ControlsFactory::BUTTON_HEIGHT + LINE_HEIGHT); menuPopup->SetDelegate(this); InitializeNodeDialogs(); textureTrianglesDialog = new TextureTrianglesDialog(); textureConverterDialog = new TextureConverterDialog(fullRect); materialEditor = new MaterialEditor(); particlesEditor = new ParticlesEditorControl(); //add line before body AddLineControl(Rect(0, BODY_Y_OFFSET, fullRect.dx, LINE_HEIGHT)); //Library libraryButton = ControlsFactory::CreateButton( Rect(fullRect.dx - ControlsFactory::BUTTON_WIDTH, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT, ControlsFactory::BUTTON_WIDTH, ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.library")); libraryButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnLibraryPressed)); AddControl(libraryButton); int32 libraryWidth = EditorSettings::Instance()->GetRightPanelWidth(); libraryControl = new LibraryControl( Rect(fullRect.dx - libraryWidth, BODY_Y_OFFSET + 1, libraryWidth, fullRect.dy - BODY_Y_OFFSET - 1)); libraryControl->SetDelegate(this); libraryControl->SetPath(path); //properties propertiesButton = ControlsFactory::CreateButton( Vector2(libraryButton->GetRect().x - ControlsFactory::BUTTON_WIDTH, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.properties")); propertiesButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnPropertiesPressed)); AddControl(propertiesButton); //scene ingo sceneInfoButton = ControlsFactory::CreateButton( Vector2(propertiesButton->GetRect().x - ControlsFactory::BUTTON_WIDTH, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.sceneinfo")); sceneInfoButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSceneInfoPressed)); AddControl(sceneInfoButton); sceneGraphButton = ControlsFactory::CreateButton( Vector2(0, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.scene")); sceneGraphButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnSceneGraphPressed)); AddControl(sceneGraphButton); dataGraphButton = ControlsFactory::CreateButton(Vector2(ControlsFactory::BUTTON_WIDTH, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.data")); dataGraphButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnDataGraphPressed)); AddControl(dataGraphButton); entitiesButton = ControlsFactory::CreateButton(Vector2(ControlsFactory::BUTTON_WIDTH*2, BODY_Y_OFFSET - ControlsFactory::BUTTON_HEIGHT), LocalizedString(L"panel.graph.entities")); entitiesButton->AddEvent(UIControl::EVENT_TOUCH_UP_INSIDE, Message(this, &SceneEditorScreenMain::OnEntitiesPressed)); AddControl(entitiesButton); InitializeBodyList(); SetupAnimation(); helpDialog = new HelpDialog(); }