您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DrawMenuBar函数代码示例

51自学网 2021-06-01 20:30:05
  C++
这篇教程C++ DrawMenuBar函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DrawMenuBar函数的典型用法代码示例。如果您正苦于以下问题:C++ DrawMenuBar函数的具体用法?C++ DrawMenuBar怎么用?C++ DrawMenuBar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DrawMenuBar函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetMenu

void SAX::OnUpdateMenu(CCmdUI* pCmdUI){   CMenu *pMainMenu = GetMenu();   if (pMainMenu)   {      const MenuId2CmdNum* pmi2cn;      for (pmi2cn = g_MenuId2CmdNum; pmi2cn->id; ++pmi2cn)      {         // Update for menu items that are either checked or unchecked         if (m_sbpro.IsMenuCommandChecked(pmi2cn->cmd))            pMainMenu->CheckMenuItem(pmi2cn->id, MF_CHECKED);         else            pMainMenu->CheckMenuItem(pmi2cn->id, MF_UNCHECKED);         // Update for menu items that are either enabled or disabled         if (m_sbpro.IsMenuCommandEnabled(pmi2cn->cmd))            pMainMenu->EnableMenuItem(pmi2cn->id, MF_ENABLED);         else            pMainMenu->EnableMenuItem(pmi2cn->id, MF_GRAYED);      }   }   DrawMenuBar();}
开发者ID:mpatwa,项目名称:CCEtoODB_Translator,代码行数:24,


示例2: SpellsExit

/* * SpellsExit:  Free spells when game exited. */void SpellsExit(void){   int i;   for (i=0; i < num_schools; i++)   {      if (submenus[i])	 DestroyMenu(submenus[i]);   }   // Remove "Spells" menu   if (spell_menu != NULL)   {      RemoveMenu(cinfo->main_menu, MENU_POSITION_SPELLS, MF_BYPOSITION);      DrawMenuBar(cinfo->hMain);      DestroyMenu(spell_menu);   }   spell_menu = NULL;   SafeFree(submenus);   submenus = NULL;   FreeSpells();}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:27,


示例3: text_OnMDIActivate

static void text_OnMDIActivate(  HWND hwnd,   BOOL active,   HWND hActivate,   HWND hDeactivate)  {#if WIN_MCW#pragma unused(hActivate)#pragma unused(hDeactivate)#endif   CheckMenuItem(TextMenu,GetWindowWord(hwnd,0),                  (unsigned) (active ? MF_CHECKED : MF_UNCHECKED));                    if (active)     {      text_OnUpdateMenu(hwnd,GetMenu(hMainFrame));      if (FORWARD_WM_MDISETMENU(MDIClientWnd,TRUE,TextMenu,                                TextWindowMenu,SendMessage) != 0)        {         DrawMenuBar(hMainFrame);         PostMessage(hMainFrame,UWM_UPDATE_TOOLBAR,0,0);        }     }  }
开发者ID:atrniv,项目名称:CLIPS,代码行数:24,


示例4: mh_addsubitem

static int mh_addsubitem (lua_State* l) {menu* m = lua_touserdata(l,1);if (!m->sub) return 0;int k = 2, pos = 0;if (lua_isnumber(l,k)) pos = lua_tointeger(l,k++);if (pos==0) pos=-1;else if (pos>0) pos--;else if (pos<-1) pos += GetMenuItemCount(m->menu);const char* str = luaL_checkstring(l,k++);const wchar_t* wstr = strcvt(str, CP_UTF8, CP_UTF16, NULL);HMENU h = CreateMenu();InsertMenu(m->menu, pos, MF_BYPOSITION | MF_STRING | MF_POPUP, h, wstr);DrawMenuBar(win);free(wstr);menu it;it.sub = TRUE;it.parent = m->menu;it.origin = m->origin;it.position = GetMenuItemCount(m->menu) -1;it.menu = h;lua_settop(l,0);lua_pushfulluserdata(l, &it, sizeof(it), "menuhandle");return 1;}
开发者ID:qtnc,项目名称:6pad,代码行数:24,


示例5: WndProc

LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ){   switch( uMsg )   {      case WM_COMMAND :              switch( LOWORD( wParam ) )              {                 case IDM_TEST :                        // Add new menu option on a new line.                        //...................................                        AppendMenu( GetMenu( hWnd ),                                     MFT_STRING | MFT_MENUBARBREAK,                                    120, "New Item" );                        DrawMenuBar( hWnd );                        break;                 case IDM_ABOUT :                        DialogBox( hInst, "AboutBox", hWnd, (DLGPROC)About );                        break;                 case IDM_EXIT :                        DestroyWindow( hWnd );                        break;              }              break;            case WM_DESTROY :              PostQuitMessage(0);              break;      default :            return( DefWindowProc( hWnd, uMsg, wParam, lParam ) );   }   return( 0L );}
开发者ID:d4nie1,项目名称:TotulDespreCPP,代码行数:36,


示例6: EnableMenuItem

LRESULT CMainFrame::EnableDisableCloseItem(bool bActivate){    HMENU hMenu = ::GetMenu(m_hwnd);    UINT EnableFlag;    if (bActivate)    {        EnableFlag = MF_ENABLED;    }    else    {        EnableFlag = MF_GRAYED;    }    EnableMenuItem(hMenu, 1, MF_BYPOSITION | EnableFlag);    HMENU hFileMenu = ::GetSubMenu(hMenu, 0);    ::EnableMenuItem(hFileMenu, IDM_FILE_CLOSE, MF_BYCOMMAND | EnableFlag);    ::EnableMenuItem(hFileMenu, IDM_WINDOW_CLOSE_ALL, MF_BYCOMMAND | EnableFlag);    DrawMenuBar();    return 0;}
开发者ID:sanjayui,项目名称:tinymux,代码行数:24,


示例7: sizeof

//.........这里部分代码省略.........    // set environments    SetCurrentDirectoryA(_project.getProjectDir().c_str());    FileUtils::getInstance()->setDefaultResourceRootPath(_project.getProjectDir());    FileUtils::getInstance()->setWritablePath(_project.getWritableRealPath().c_str());    // check screen DPI    HDC screen = GetDC(0);    int dpi = GetDeviceCaps(screen, LOGPIXELSX);    ReleaseDC(0, screen);    // set scale with DPI    //  96 DPI = 100 % scaling    // 120 DPI = 125 % scaling    // 144 DPI = 150 % scaling    // 192 DPI = 200 % scaling    // http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx#dpi_and_the_desktop_scaling_factor    //    // enable DPI-Aware with DeclareDPIAware.manifest    // http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx#declaring_dpi_awareness    float screenScale = 1.0f;    if (dpi >= 120 && dpi < 144)    {        screenScale = 1.25f;    }    else if (dpi >= 144 && dpi < 192)    {        screenScale = 1.5f;    }    else if (dpi >= 192)    {        screenScale = 2.0f;    }    CCLOG("SCREEN DPI = %d, SCREEN SCALE = %0.2f", dpi, screenScale);    // create opengl view    Size frameSize = _project.getFrameSize();    float frameScale = 1.0f;    if (_project.isRetinaDisplay())    {        frameSize.width *= screenScale;        frameSize.height *= screenScale;    }    else    {        frameScale = screenScale;    }    const Rect frameRect = Rect(0, 0, frameSize.width, frameSize.height);    const bool isResize = _project.isResizeWindow();    std::stringstream title;    title << "Cocos Simulator - " << ConfigParser::getInstance()->getInitViewName();    initGLContextAttrs();    auto glview = GLViewImpl::createWithRect(title.str(), frameRect, frameScale);    _hwnd = glview->getWin32Window();    DragAcceptFiles(_hwnd, TRUE);    //SendMessage(_hwnd, WM_SETICON, ICON_BIG, (LPARAM)icon);    //SendMessage(_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)icon);    //FreeResource(icon);    auto director = Director::getInstance();    director->setOpenGLView(glview);    director->setAnimationInterval(1.0 / 60.0);    // set window position    if (_project.getProjectDir().length())    {        setZoom(_project.getFrameScale());     }    Vec2 pos = _project.getWindowOffset();    if (pos.x != 0 && pos.y != 0)    {        RECT rect;        GetWindowRect(_hwnd, &rect);        MoveWindow(_hwnd, pos.x, pos.y, rect.right - rect.left, rect.bottom - rect.top, FALSE);    }    // path for looking Lang file, Studio Default images    FileUtils::getInstance()->addSearchPath(getApplicationPath().c_str());    // init player services    initServices();    setupUI();    DrawMenuBar(_hwnd);    // prepare    FileUtils::getInstance()->setPopupNotify(false);    _project.dump();    auto app = Application::getInstance();    g_oldWindowProc = (WNDPROC)SetWindowLong(_hwnd, GWL_WNDPROC, (LONG)SimulatorWin::windowProc);    // update window size    RECT rect;    GetWindowRect(_hwnd, &rect);    MoveWindow(_hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + GetSystemMetrics(SM_CYMENU), FALSE);    // startup message loop    return app->run();}
开发者ID:hugohuang1111,项目名称:Bird,代码行数:101,


示例8: WndProc

万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。