源碼:
菜單項
void CMainFrame::OnAppendMenu() { // TODO: Add your command handler code here //獲取主菜單 CMenu* pMenu=GetMenu(); //獲取子菜單 CMenu *pSubMenu=pMenu->GetSubMenu(4); if (pSubMenu->GetMenuItemCount()==4) { //在菜單末端添加菜單項 pSubMenu->AppendMenu(MF_STRING,ID_TEST_MENU,_T("新菜單")); //重畫菜單 DrawMenuBar(); } } void CMainFrame::OnDeleteMenu() { // TODO: Add your command handler code here CMenu* pMenu=GetMenu(); CMenu* pSubMenu=pMenu->GetSubMenu(4); if (pSubMenu->GetMenuItemCount()==5) { pSubMenu->DeleteMenu(4,MF_BYPOSITION); DrawMenuBar(); } } void CMainFrame::OnRemoveMenu() { // TODO: Add your command handler code here CMenu* pMenu=GetMenu(); CMenu* pSubMenu=pMenu->GetSubMenu(4); if (pSubMenu->GetMenuItemCount()==5) { pSubMenu->RemoveMenu(4,MF_BYPOSITION); DrawMenuBar(); } } void CMainFrame::OnInsertMenu() { // TODO: Add your command handler code here CMenu* pMenu=GetMenu(); CMenu* pSubMenu=pMenu->GetSubMenu(4); if (pSubMenu->GetMenuItemCount()==4) { //在指定的位置添加菜單項 pSubMenu->InsertMenu(2,MF_BYPOSITION,ID_TEST_MENU,_T("Insert菜單項")); DrawMenuBar(); } } void CMainFrame::OnMenuDlg() { dlg.DoModal(); } void CMainFrame::OnMenuTest1() { m_bEnable1=FALSE; m_bEnable2=TRUE; } void CMainFrame::OnMenuTest2() { m_bEnable1=TRUE; m_bEnable2=FALSE; } void CMainFrame::OnUpdateMenuTest1(CCmdUI* pCmdUI) { //啓用或者禁用菜單 pCmdUI->Enable(m_bEnable1); } void CMainFrame::OnUpdateMenuTest2(CCmdUI* pCmdUI) { pCmdUI->Enable(m_bEnable2); }
光標:
void CMenuView::OnDraw(CDC* pDC) { /* CMenuDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here*/ ////////////////////////////////////////////////////////////////////////// /* //獲取客戶光標座標 CRect rect; GetClientRect(&rect); //繪製十字光標 pDC->MoveTo(0,m_point.y); pDC->LineTo(rect.Width(),m_point.y); pDC->MoveTo(m_point.x,0); pDC->LineTo(m_point.x,rect.Height()); //輸出光標座標 CString strText=_T(""); strText.Format(_T("%d,%d"),m_point.x,m_point.y); pDC->SetBkMode(TRANSPARENT); pDC->SetTextAlign(TA_RIGHT|TA_BOTTOM); pDC->TextOut(m_point.x,m_point.y,strText); ////////////////////////////////////////////////////////////////////////// */ CRect rect; GetClientRect(rect); CRect rect2; rect2.left=rect.left+rect.Width()/4; rect2.right=rect.right-rect.Width()/4; rect2.top=rect.top+rect.Height()/4; rect2.bottom=rect.bottom-rect.Height()/4; //繪製光標的移動範圍 pDC->Rectangle(rect2); } ///////////////////////////////////////////////////////////////////////////// // CMenuView printing BOOL CMenuView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CMenuView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CMenuView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CMenuView diagnostics #ifdef _DEBUG void CMenuView::AssertValid() const { CView::AssertValid(); } void CMenuView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CMenuDoc* CMenuView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMenuDoc))); return (CMenuDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMenuView message handlers //void CMenuView::OnMove(int x, int y) //{ //CView::OnMove(x, y); // TODO: Add your message handler code here //} void CMenuView::OnMouseMove(UINT nFlags, CPoint point) { //保存光標座標 m_point=point; //刷新客戶區 Invalidate(); CView::OnMouseMove(nFlags, point); } void CMenuView::OnLButtonDown(UINT nFlags, CPoint point) { //光標的自由移動 ClipCursor(NULL); //加載光標 m_hCursor=AfxGetApp()->LoadCursor(IDC_CURSOR); //設置光標 CRect rect; GetClientRect(rect); CRect rect2; rect2.left=rect.left+rect.Width()/4; rect2.right=rect.right-rect.Width()/4; rect2.top=rect.top+rect.Height()/4; rect2.bottom=rect.bottom-rect.Height()/4; //映射屏幕座標 ClientToScreen(rect2); //限制光標的移動 ClipCursor(&rect2); CView::OnLButtonDown(nFlags, point); } void CMenuView::OnLButtonUp(UINT nFlags, CPoint point) { //光標的自由移動 ClipCursor(NULL); //加載光標 m_hCursor=AfxGetApp()->LoadCursor(IDC_CURSOR); //設置光標 ::SetCursor(m_hCursor); CView::OnLButtonUp(nFlags, point); } void CMenuView::OnInitialUpdate() { CView::OnInitialUpdate(); //加載光標 m_hCursor=AfxGetApp()->LoadCursor(IDC_CURSOR); } BOOL CMenuView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { //設置光標 ::SetCursor(m_hCursor); return TRUE; //return CView::OnSetCursor(pWnd, nHitTest, message); }
Before 本文是 \(2024\) 中國大學生程序設計競賽全國邀請賽(長春)暨第 \(17\) 屆吉林省大學生設計競賽和新建比賽的遊記 寫的很爛 寫的很爛 寫的很爛 Day0 省賽報到及熱身賽。 \(14:00\) 前報到。 \(12:
一、前言 在使用yolo做人工智能運算後,運算結果除了一個方框,還可能需要增加文字顯示在對應方框上,以便標記是何種物體,比如顯示是人還是動物,或者還有可能追蹤人員,顯示該人員的姓名。這種應用場景非常普遍,而且非常有必要,可以非常直觀的直接看
一、如何對一列數據進行相同操作,比如全都添加雙引號 https://www.jiachong.com/wps/340708.html 1.首先打開表格,按Ctrl+C複製第一個單元格內容, 2.然後把複製的單元格內容按Ctrl+V粘貼到與其
恆生電子LightDB順利通過了金融信創生態實驗室的產品測試,本次測試基於典型金融業務場景並在國產硬件環境中進行,經過測試,LightDB在產品性能、功能性、兼容性以及可靠性等多個維度100%符合金融業務系統,表現優異。 在本
8月1日,強制性國家標準GB 18030-2022《信息技術 中文編碼字符集》實施。10月09日,恆生電子LightDB正式通過中國電子技術標準化研究院強制性國家標準GB18030-2022《信息技術 中文編碼字符集》最高級(實現級別
1.描述一下服務器配置: 一臺2c4g的centos,做api接口反代 一臺8c16g的windows 2019 作爲實際服務器,跑了iis,sql server,mongodb,redis 2.業務描述 2.0 服務器分爲兩個站
現象:nginx域名配置合併之後,發現consul-template無法完成nginx重載,然後發現需要重啓nginx,才能讓配置生效。 注意:下次哪個服務有報錯,就看重啓時所有日誌輸出,各種情況日誌輸出。不要忽略細節。很多時候其實已經
sudo docker run -it -d --name minio_latest -p 9000:9000 -p 9001:9001 -v /minio/data:/data -e MINIO_ROOT_USER="賬號" -e MIN
Quotations in HTML allow you to include and format quoted text within your web content. HTML provides tags such as <bl
HTML Comments are used to comment in HTML codes, so the developer can understand the purpose of that code section and it
從 Ubuntu 存儲庫安裝預構建的 Ubuntu 包 更新 Ubuntu 存儲庫信息: sudo apt-get update 安裝包: sudo apt-get install nginx 驗證安裝: sudo ngin
前臺服務變化 前臺服務一直是比較損耗電池壽命的操作,在 Android 15 Beta 2 裏,**dataSync 和 mediaProcessing 的前臺服務類型現在有大約 6 小時的超時時間**,之後系統將調用 Android 15
管理學大師彼得·德魯克說“終身學習是現在社會的生存法則”,而現實中,很少有人能清醒地意識到這一點,人們總是習慣在舒適區兜圈,重複做已經掌握的事情,對真正需要突破的職業困境視而不見。 偶爾看到同事跳槽漲薪,技術越來越嫺熟,自己也期望着可以跟他
本文介紹的主流一體化協同辦公平臺有:Worktile、PingCode、Microsoft Teams、釘釘、Google Workspace、Jive、Avaya、Bitrix24、Asana、ClickUp、飛書。 在現代工作環
近期,著名的.NET開源社區Mono正式支持LoongArch(龍架構),目前LoongArch64架構已出現在.NET社區主幹分支上。詳細內容可以跟蹤 https://github.com/mono/mono/issues/21381,