这篇教程C++ HasCapture函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HasCapture函数的典型用法代码示例。如果您正苦于以下问题:C++ HasCapture函数的具体用法?C++ HasCapture怎么用?C++ HasCapture使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HasCapture函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CaptureMousevoid CFCEditorGLWindow::OnMouse(wxMouseEvent& event){ if(event.ButtonDown(wxMOUSE_BTN_RIGHT)) { if (!HasCapture()) { CaptureMouse(); } HideCursor(); SetFocus();//Call this for catch the EVT_MOUSEWHEEL event, in left mouse button down event is not necessary to call this m_startPosition = event.GetPosition(); m_bRightDown = true; } else if(event.ButtonUp(wxMOUSE_BTN_RIGHT)) { if (!m_bLeftDown && HasCapture()) { ReleaseMouse(); } ShowCursor(); m_bRightDown = false; } else if(event.ButtonDown(wxMOUSE_BTN_LEFT)) { if (!HasCapture()) { CaptureMouse(); } HideCursor(); m_startPosition = event.GetPosition(); m_bLeftDown = true; } else if(event.ButtonUp(wxMOUSE_BTN_LEFT)) { if (!m_bRightDown && HasCapture()) { ReleaseMouse(); } ShowCursor(); m_bLeftDown = false; } else if(event.Dragging()) { if (m_bRightDown || m_bLeftDown) { wxPoint curPos = event.GetPosition(); wxPoint pnt = ClientToScreen(m_startPosition); SetCursorPos(pnt.x, pnt.y); if (m_bRightDown) { int nDeltaX = curPos.x - m_startPosition.x; int nDeltaY = curPos.y - m_startPosition.y; wxSize clientSize = GetClientSize(); m_pCamera->Yaw((float)nDeltaX / clientSize.x); m_pCamera->Pitch((float)nDeltaY / clientSize.y); } } } event.Skip();}
开发者ID:nobitalwm,项目名称:FCEngine,代码行数:60,
示例2: switchImage RichEdit::CursorImage(Point p, dword flags){ if(tablesel) return Image::Arrow(); switch(GetHotSpot(p)) { case 0: return Image::SizeBottomRight(); case 1: return Image::SizeVert(); case 2: return Image::SizeHorz(); default: if(text.GetRichPos(GetMousePos(p)).object) { return Image::Arrow(); } else if(HasCapture() && tabmove.table && tabmove.column >= -2) return Image::SizeHorz(); else { RichHotPos hp = GetHotPos(p); if(hp.table > 0) return Image::SizeHorz(); else { int c = GetMousePos(p); return InSelection(c) && !HasCapture() ? Image::Arrow() : Image::IBeam(); } } } return Image::Arrow();}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:31,
示例3: OnMotion void OnMotion( wxMouseEvent & event ) { // Don't do anything if we're docked or not resizeable if( mBar->IsDocked() || !mBar->IsResizable() ) { return; } // Retrieve the mouse position wxPoint pos = ClientToScreen( event.GetPosition() ); if( HasCapture() && event.Dragging() ) { wxRect rect = GetRect(); rect.SetBottomRight( pos ); if( rect.width < mMinSize.x ) { rect.width = mMinSize.x; } if( rect.height < mMinSize.y ) { rect.height = mMinSize.y; } SetMinSize( rect.GetSize() ); SetSize( rect.GetSize() ); Layout(); Refresh( false ); } else if( HasCapture() && event.LeftUp() ) { ReleaseMouse(); } else if( !HasCapture() ) { wxRect rect = GetRect(); wxRect r; r.x = rect.GetRight() - sizerW - 2, r.y = rect.GetBottom() - sizerW - 2; r.width = sizerW + 2; r.height = sizerW + 2; // Is left click within resize grabber? if( r.Contains( pos ) && !event.Leaving() ) { SetCursor( wxCURSOR_SIZENWSE ); if( event.LeftDown() ) { CaptureMouse(); } } else { SetCursor( wxCURSOR_ARROW ); } } }
开发者ID:GYGit,项目名称:Audacity,代码行数:59,
示例4: GetMousePosvoid LineEdit::MouseMove(Point p, dword flags) { if((flags & K_MOUSELEFT) && HasFocus() && HasCapture()) { int c = GetMousePos(p); dorectsel = flags & K_ALT; PlaceCaret(c, mpos != c || HasCapture()); dorectsel = false; }}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:8,
示例5: CaptureMousevoid AudioDisplay::SetDraggedObject(AudioDisplayInteractionObject *new_obj){ dragged_object = new_obj; if (dragged_object && !HasCapture()) CaptureMouse(); else if (!dragged_object && HasCapture()) ReleaseMouse(); if (!dragged_object) audio_marker.reset();}
开发者ID:Gpower2,项目名称:Aegisub,代码行数:12,
示例6: Refreshvoid IconDes::LeftUp(Point p, dword keyflags){ if(!IsCurrent()) return; if(IsPasting() && HasCapture()) Refresh(); else if(HasCapture() && selectrect) Move(); else Current().base_image.Clear(); SetBar(); SyncShow();}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:14,
示例7: GetClientSizevoid wxSkinSlider::OnMouseMotion(wxMouseEvent& event){ wxPoint pt = event.GetPosition(); if( HasCapture() && event.Dragging()) { m_bOver = true; int w,h; GetClientSize(&w,&h); int scale; if (m_isvertical) { scale = (int)(((float)m_maxvalue/(float)h)*pt.y); } else { scale = (int)(((float)m_maxvalue/(float)w)*pt.x); } if(scale > m_maxvalue) scale = m_maxvalue; if(scale < 0) scale = 0; m_currentvalue = scale; wxCommandEvent evt(wxEVT_COMMAND_SLIDER_UPDATED,GetId()); evt.SetInt(m_currentvalue); evt.SetEventObject(this); GetEventHandler()->ProcessEvent(evt); }#if wxCHECK_VERSION(2, 7, 0) else if(m_sliderRect.Contains(pt))#else else if(m_sliderRect.Inside(pt))#endif { m_bOver = true; CaptureMouse(); } else { m_bOver = false; if(HasCapture()) ReleaseMouse(); } Refresh();}
开发者ID:EEmmanuel7,项目名称:wxskintoy,代码行数:49,
示例8: OnIdlevoid wxJigsawEditorCanvas::OnIdle( wxIdleEvent& event ){ do { if(!HasCapture()) break; // get mouse in client coordinates wxPoint currentPos = ScreenToClient(wxGetMousePosition()); //Update the offset to the next mouse down event if(m_View->GetSelectedObject()) { wxPoint diagramPoint = PointToViewPoint(currentPos); wxPoint groupPosition = m_View->GetRealGroupPosition(m_View->GetSelectedObject()); m_SelectedObjectOffset = wxSize( diagramPoint.x - groupPosition.x, diagramPoint.y - groupPosition.y); } // get scroll position wxPoint scrollPos = GetScrollPosition(); // auto scroll // check current drag position and update scroll regularly if(AutoScroll(currentPos, scrollPos)) { event.RequestMore(); } FixViewOffset(); } while(false);}
开发者ID:cubemoon,项目名称:game-editor,代码行数:33,
示例9: OnCaptureLostvoid ToolBar::OnCaptureLost( wxMouseCaptureLostEvent & event ){ if( HasCapture() ) { ReleaseMouse(); }}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:7,
示例10: MainMenuButton::~MainMenuButton(){ if (HasCapture()) ReleaseMouse(); safe_delete(m_mainMenu);}
开发者ID:boskee,项目名称:Desurium-1,代码行数:7,
示例11: WXUNUSEDvoid ToolBarResizer::OnCaptureLost( wxMouseCaptureLostEvent & WXUNUSED(event) ){ if( HasCapture() ) { ReleaseMouse(); }}
开发者ID:jengelh,项目名称:audacity,代码行数:7,
示例12: OnCaptureLost void OnCaptureLost( wxMouseCaptureLostEvent & WXUNUSED(event) ) { if( HasCapture() ) { ReleaseMouse(); } }
开发者ID:GYGit,项目名称:Audacity,代码行数:7,
示例13: SetFocusvoid ActorSceneCanvas::OnLeftDown(wxMouseEvent& e){ SetFocus(); mDragStarted = true; mDragOrigin = Ogre::Vector2(e.GetX(),e.GetY()); mDragDelta = Ogre::Vector2(0.0f,0.0f); if (!GetSceneManipulator()) return; if (HasCapture()) return; wxASSERT(!m_pCameraManip); wxASSERT(mDragButton == wxMOUSE_BTN_NONE); if (!GetActiveAction()) return; //GetSceneManipulator()->setActiveAction("ManipObjectAction"); //GetActiveAction()->setParameter("%CurrentMode", ""); m_pUpdateListener->enable(); mDragButton = e.GetButton(); GetActiveAction()->onBegin(e.GetX(), e.GetY()); CaptureMouse();}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:30,
示例14: On_Mouse_LUp//---------------------------------------------------------void CPoints_View_Extent::On_Mouse_LUp(wxMouseEvent &event){ if( HasCapture() ) { ReleaseMouse(); } _Draw_Inverse(m_Mouse_Down, m_Mouse_Move); wxPoint p; p.x = event.GetX() < 0 ? 0 : event.GetX() >= GetClientSize().x ? GetClientSize().x - 1 : event.GetX(); p.y = event.GetY() < 0 ? 0 : event.GetY() >= GetClientSize().y ? GetClientSize().y - 1 : event.GetY(); if( m_Mouse_Down.x != p.x || m_Mouse_Down.y != p.y ) { m_Select = wxRect(wxPoint(m_Mouse_Down.x, m_Mouse_Down.y), p); } else { m_Select.SetX(p.x - m_Select.GetWidth () / 2); m_Select.SetY(p.y - m_Select.GetHeight() / 2); } Refresh(false); ((CPoints_View_Dialog *)GetParent())->Update_Extent();}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:29,
示例15: On_Mouse_MUp//---------------------------------------------------------void CVIEW_Map_Control::On_Mouse_MUp(wxMouseEvent &event){ if( HasCapture() ) { ReleaseMouse(); } _Draw_Inverse(m_Mouse_Down, event.GetPosition()); m_Drag_Mode = TOOL_INTERACTIVE_DRAG_NONE; switch( m_Mode ) { //----------------------------------------------------- case MAP_MODE_SELECT: break; //----------------------------------------------------- case MAP_MODE_DISTANCE: break; //----------------------------------------------------- case MAP_MODE_ZOOM: break; //----------------------------------------------------- case MAP_MODE_PAN: break; //----------------------------------------------------- case MAP_MODE_PAN_DOWN: Set_Mode(MAP_MODE_ZOOM); _Move(m_Mouse_Down, event.GetPosition()); break; }}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:36,
示例16: LeftRepeatvoid LineEdit::LeftRepeat(Point p, dword flags) { if(HasCapture()) { int c = GetMousePos(p); if(mpos != c) PlaceCaret(c, true); }}
开发者ID:pedia,项目名称:raidget,代码行数:7,
示例17: WXUNUSEDvoid wxSkinWindow::OnLeaveWindow(wxMouseEvent& WXUNUSED(event)){ m_bInside = false; if(HasCapture()) ReleaseMouse(); Refresh();}
开发者ID:EEmmanuel7,项目名称:wxskintoy,代码行数:7,
示例18: OnMouseMovevoid SongCanvas::OnMouseMove(wxMouseEvent& event) { if (!event.m_leftDown || !HasCapture()) { event.Skip(); return; } /* int w, h; GetClientSize(&w, &h); float x1 = (float) event.m_x / (float) w; float y1 = (float) event.m_y / (float) h; int x = x1 * 16; int y = 15 - (int)(y1 * 16); if (x < 0) x = 0; if (x > 15) x = 15; if (y < 0) y = 0; if (y > 15) y = 15; tonematrix[x][y] = fill; Refresh(); */ //event.Skip();}
开发者ID:sanyaade-g2g-repos,项目名称:nuzynth,代码行数:26,
示例19: if//---------------------------------------------------------void CVIEW_Map_3D::On_Mouse_Motion(wxMouseEvent &event){ if( HasCapture() && event.Dragging() ) { if( event.LeftIsDown() ) { m_pImage->m_zRotate = m_xDown - GET_MOUSE_X_RELDIFF * M_PI_180; m_pImage->m_xRotate = m_yDown - GET_MOUSE_Y_RELDIFF * M_PI_180; _Parms_Changed(); } else if( event.RightIsDown() ) { m_pImage->m_xShift = m_xDown - GET_MOUSE_X_RELDIFF * 100.0; m_pImage->m_yShift = m_yDown + GET_MOUSE_Y_RELDIFF * 100.0; _Parms_Changed(); } else if( event.MiddleIsDown() ) { m_pImage->m_yRotate = m_xDown + GET_MOUSE_X_RELDIFF * M_PI_180; m_pImage->m_zShift = m_yDown + GET_MOUSE_Y_RELDIFF * 100.0; _Parms_Changed(); } }}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:28,
示例20: MouseMovevoid ScrollBar::MouseMove(Point p, dword) { if(HasCapture() && push == 2) Drag(p); else if(light != GetMousePart()) Refresh();}
开发者ID:pedia,项目名称:raidget,代码行数:7,
示例21: OnLeftUpvoid wxSkinSlider::OnLeftUp(wxMouseEvent& evt){ if (HasCapture()) { ReleaseMouse(); }}
开发者ID:EEmmanuel7,项目名称:wxskintoy,代码行数:7,
示例22: OnCharvoid DraggableListCtrl::OnChar(wxKeyEvent& event){ // Don't respond to the keyboard if the user is dragging things (else // the undo system might get slightly confused) if (HasCapture()) return; if (event.GetKeyCode() == WXK_DELETE) { long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (item != -1) { AtlasWindowCommandProc::GetFromParentFrame(this)->Submit( new DeleteCommand(this, item) ); UpdateDisplay(); } } else { event.Skip(); }}
开发者ID:Marlinc,项目名称:0ad,代码行数:26,
示例23: SetValuevoid wxSkinSlider::SetValue(int value){ if(!HasCapture()) { m_currentvalue = value; Refresh(); }}
开发者ID:EEmmanuel7,项目名称:wxskintoy,代码行数:7,
示例24: OnLeftMouseDownvoid SongCanvas::OnLeftMouseDown(wxMouseEvent& event) { if (!HasCapture()) { CaptureMouse(); } /* int w, h; GetClientSize(&w, &h); float x1 = (float) event.m_x / (float) w; float y1 = (float) event.m_y / (float) h; int x = x1 * 16; int y = 15 - (int)(y1 * 16); if (x < 0) x = 0; if (x > 15) x = 15; if (y < 0) y = 0; if (y > 15) y = 15; fill = !tonematrix[x][y]; OnMouseMove(event); */ //Refresh(); //event.Skip();}
开发者ID:sanyaade-g2g-repos,项目名称:nuzynth,代码行数:26,
示例25: Disablevoid AButton::Disable(){ mEnabled = false; mButtonState = AButtonDis; if (HasCapture()) ReleaseMouse(); this->Refresh(false);}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:8,
示例26: LOG_MSGTemplateFrame::~TemplateFrame(){ LOG_MSG("Called TemplateFrame::~TemplateFrame()"); if (HasCapture()) ReleaseMouse(); frames_manager->removeObserver(this); table_state->removeObserver(this); time_state->removeObserver(this);}
开发者ID:grzegorz-m-dziedzic,项目名称:geoda,代码行数:8,
示例27: OnKeyDownvoid ToolFrame::OnKeyDown( wxKeyEvent &event ){ event.Skip(); if( HasCapture() && event.GetKeyCode() == WXK_ESCAPE ) { Resize( mOrigSize ); ReleaseMouse(); }}
开发者ID:henricj,项目名称:audacity,代码行数:8,
示例28: FinishPastevoid IconDes::SetTool(void (IconDes::*_tool)(Point p, dword flags)){ FinishPaste(); if(HasCapture()) ReleaseCapture(); tool = _tool; SetBar();}
开发者ID:ultimatepp,项目名称:mirror,代码行数:8,
示例29: OnLeftMouseUpvoid EffectCanvas::OnLeftMouseUp(wxMouseEvent& event) { if (HasCapture()) { effect->inst->song->history.record(change); change = 0; ReleaseMouse(); } //event.Skip();}
开发者ID:sanyaade-g2g-repos,项目名称:nuzynth,代码行数:8,
示例30: SetFocus//------------------------------------------------------------------------------void CIwUIEdFrame::OnMouse(wxMouseEvent& event){ if (CIwTheHost.m_Link==NULL) return; int mode=128; if (!m_OnDrag) { if (event.LeftIsDown()) mode|=1; if (event.MiddleIsDown()) mode|=2; if (event.RightIsDown()) mode|=4; if (event.ShiftDown()) mode|=8; if (event.ControlDown()) mode|=16; if (event.MetaDown()) mode|=32; } int x = event.m_x; int y = event.m_y; int mouse[]={mode,x,y,0}; //CIwTheHost.m_Link->SetData(CIwViewerUI::MOUSE_POS,(void*)mouse); if (mode!=128 || m_OldMode!=128) { if ( AcceptsFocus() ) SetFocus(); if (!mCapturingMouse) { CaptureMouse(); mCapturingMouse = true; } } else { if (mCapturingMouse) { mCapturingMouse = false; if (HasCapture()) ReleaseMouse(); } } m_OldMode=mode;}
开发者ID:SamanthaClark,项目名称:UI-Builder,代码行数:59,
注:本文中的HasCapture函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ HasClientObjectData函数代码示例 C++ HasAttr函数代码示例 |