BOOL CStory::Play() /***********************************************************************/ { // returns TRUE if it started playing if (lstrlen(m_szStoryFile)) m_hMCIfile = MCIOpen( App.m_hDeviceWAV, m_szStoryFile, NULL/*lpAlias*/ ); if (m_hMCIfile) { if (m_nRects) { HDC hDC = GetDC(m_hWnd); m_iHighlight = 0 + 1; Story_OnDraw(m_hWnd, hDC, &m_lpWordData[0].rArea, TRUE); ReleaseDC(m_hWnd, hDC); } if (MCIPlay( m_hMCIfile, m_hWnd, 0)) { EnableCursor(FALSE); m_fPlaying = TRUE; SetTimer( m_hWnd, 0xDEAD, 5, NULL ); return(TRUE); } else { MCIClose( m_hMCIfile ); m_hMCIfile = NULL; } } return(FALSE); }
/*-----------------------------------------------------------------*/ void __fastcall CrCursorHandlerImpl::SetCursor (FELD _feld, int _i, int _j, bool _clearselection/*=true*/) { DisableCursor(); CrFeld* p = GetFeld (_feld); if (p) { p->SetCursor (_i, _j); feld = p; } frm->kbd_field = feld->feld; //xxx Obsolet?! if (_clearselection) frm->ClearSelection(); EnableCursor(); CheckLocked(); }
/*-----------------------------------------------------------------*/ void __fastcall CrCursorHandlerImpl::GotoField (FELD _feld) { dbw3_assert(feld); dbw3_assert(frm); CrFeld* p = GetFeld (_feld); if (!p || !p->IsVisible()) return; DisableCursor(); feld = p; frm->kbd_field = _feld; feld->SyncSharedCoord(); EnableCursor(); frm->ClearSelection(); CheckLocked(); }
void CRegDlg::OnReceiveComplete() { //BYTE b=m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0]; switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0]) { case TOKEN_REG_PATH: //接收项 addPath((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1))); EnableCursor(true); break; case TOKEN_REG_KEY: //接收键 ,值 addKey((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1))); EnableCursor(true); break; case TOKEN_REG_OK: TestOK(); isEdit=false; EnableCursor(true); break; default: EnableCursor(true); isEdit=false; break; } }
/*-----------------------------------------------------------------*/ void __fastcall CrFeld::MoveCursorDown (int _step, bool _select) { DisableCursor(); if (_select) frm->ResizeSelection (fb.kbd.i+fb.ScrollX(), fb.kbd.j+fb.ScrollY(), feld, false); fb.kbd.j -= _step; if (fb.kbd.j<0) fb.kbd.j = 0; UpdateSharedCoord (fb.kbd.i, fb.kbd.j); EnableCursor(); if (_select) frm->ResizeSelection (fb.kbd.i+fb.ScrollX(), fb.kbd.j+fb.ScrollY(), feld, false); else frm->ClearSelection(); }
int CSDL_ApplicationBase::SetVideoMode(int width, int height, int bpp, int flags) { if(m_PrimarySurface != NULL) { delete m_PrimarySurface; } EnableCursor(SDL_DISABLE); m_PrimarySurface = new CSDL_DisplaySurface(width, height, bpp, flags); if (m_PrimarySurface == NULL) { MsgBox("Couldn't set video mode: %s\n", ::SDL_GetError()); ::exit(EXIT_FAILURE + 1); } m_nScreenWidth = width; m_nScreenHeight = height; m_nScreenBPP = bpp; m_nScreenFlags = flags; return 0; }
/*-----------------------------------------------------------------*/ void __fastcall CrCursorHandlerImpl::GotoPrevField() { dbw3_assert(feld); dbw3_assert(frm); if (feld) { DisableCursor(); // Funktioniert nur wenn mindestens ein // Feld sichtbar ist. do { feld = feld->prev; if (frm->ViewSchlagpatrone->Checked && feld->feld==AUFKNUEPFUNG) feld = feld->prev; } while (!feld->IsVisible()); frm->kbd_field = feld->feld; //xxx Obsolet?! feld->SyncSharedCoord(); EnableCursor(); frm->ClearSelection(); CheckLocked(); } dbw3_assert(feld); }
void CStory::Reset() /***********************************************************************/ { if (m_hMCIfile) { MCIClose( m_hMCIfile ); m_hMCIfile = NULL; } if (m_fPlaying) { EnableCursor(TRUE); m_fPlaying = FALSE; KillTimer( m_hWnd, 0xDEAD ); if (m_iHighlight) { HDC hDC = GetDC(m_hWnd); Story_OnDraw(m_hWnd, hDC, &m_lpWordData[m_iHighlight-1].rArea, FALSE); m_iHighlight = 0; ReleaseDC(m_hWnd, hDC); } } }
void CRegDlg::OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; // TODO: Add your control notification handler code here if(!isEnable) return; TVITEM item = pNMTreeView->itemNew; if(item.hItem == m_hRoot) { return; } SelectNode=item.hItem; //保存用户打开的子树节点句柄 m_list.DeleteAllItems(); CString FullPath=GetFullPath(SelectNode); m_wndStatusBar.SetPaneText(0,FullPath); HTREEITEM CurrentNode = item.hItem; //取得此节点的全路径 while(m_tree.GetChildItem(CurrentNode)!=NULL) { m_tree.DeleteItem(m_tree.GetChildItem(CurrentNode)); //删除 会产生 OnSelchangingTree事件 *** } char bToken=getFatherPath(FullPath); //愈加一个键 int nitem=m_list.InsertItem(0,"(默认)",0); m_list.SetItemText(nitem,1,"REG_SZ"); m_list.SetItemText(nitem,2,"(数值未设置)"); //BeginWaitCursor(); //char *buf=new char[FullPath.GetLength] FullPath.Insert(0,bToken);//插入 那个根键 bToken=COMMAND_REG_FIND; FullPath.Insert(0,bToken); //插入查询命令 EnableCursor(false); m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1); *pResult = 0; }
/*-----------------------------------------------------------------*/ void __fastcall CrCursorHandlerImpl::CheckLocked() { if (locked && feld) { // Position modulo Rapport dbw3_assert(frm); DisableCursor(); if (feld->feld==GEWEBE || feld->feld==EINZUG) { int rx = frm->rapport.kr.count(); if (rx>0) { int x0 = frm->rapport.kr.a; int i = feld->fb.kbd.i+frm->scroll_x1; int ii = i-x0; while (ii<0) ii += rx; int newi = ii%rx + x0; if (newi<frm->scroll_x1) newi = frm->scroll_x1; feld->fb.kbd.i = newi-frm->scroll_x1; } } if (feld->feld==GEWEBE || feld->feld==TRITTFOLGE) { int ry = frm->rapport.sr.count(); if (ry>0) { int y0 = frm->rapport.sr.a; int j = feld->fb.kbd.j+frm->scroll_y2; int jj = j-y0; while (jj<0) jj += ry; int newj = jj%ry + y0; if (newj<frm->scroll_y2) newj = frm->scroll_y2; feld->fb.kbd.j = newj-frm->scroll_y2; } } EnableCursor(); } }