void CTTCheckBtnGroup::InvalidateButtonRect(BtnInfo* pBtnInfo) { CRect invalidRect(pBtnInfo->m_rect); invalidRect.right++; invalidRect.bottom++; InvalidateRect(invalidRect, FALSE); }
void SelectBox::looseFocus() { state_ &= ~Focused; invalidRect( rcBox_ ); commit( true ); }
void SelectBox::valueChanged( CControl* pControl ) { if( rcScrollsize_.height() > rcDropdown_.height() ) { float value = pControl->getValue(); CCoord offset = (CCoord)( (rcScrollsize_.height() - rcDropdown_.height()) * value ); scrollOffset_ = (INT32)( offset / (TextHeight-0.5f) ); scrollOffset_ = min( (INT32)list_.size() - maxVisible_, scrollOffset_ ); } invalidRect( rcClip_ ); }
/** * @param src rect which to scroll * @param distance point of distance */ void CFrame::scrollRect (const CRect& src, const CPoint& distance) { CRect rect (src); rect.offset (getViewSize ().left, getViewSize ().top); if (platformFrame) { if (platformFrame->scrollRect (src, distance)) return; } invalidRect (src); }
TEST_F(DocumentMarkerControllerTest, CompositionMarkersNotMerged) { IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect()); setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); RefPtrWillBeRawPtr<Node> text = document().body()->firstChild()->firstChild(); document().updateLayout(); markerController().addCompositionMarker(Position(text, 0), Position(text, 1), Color::black, false, Color::black); markerController().addCompositionMarker(Position(text, 1), Position(text, 3), Color::black, true, Color::black); EXPECT_EQ(2u, markerController().markers().size()); }
nsIntRect Downscaler::TakeInvalidRect() { if (MOZ_UNLIKELY(!HasInvalidation())) { return nsIntRect(); } nsIntRect invalidRect(0, mPrevInvalidatedLine, mTargetSize.width, mCurrentOutLine - mPrevInvalidatedLine); mPrevInvalidatedLine = mCurrentOutLine; return invalidRect; }
TEST_F(DocumentMarkerControllerTest, UpdateRenderedRectsForComposition) { IntRect invalidRect(RenderedDocumentMarker::create(DocumentMarker(0, 0, false))->renderedRect()); setBodyInnerHTML("<div style='margin: 100px'>foo</div>"); RefPtrWillBeRawPtr<Element> div = toElement(document().body()->firstChild()); markNodeContentsWithComposition(div); Vector<IntRect> renderedRects = markerController().renderedRectsForMarkers(DocumentMarker::Composition); EXPECT_EQ(1u, renderedRects.size()); EXPECT_NE(invalidRect, renderedRects[0]); div->setAttribute(HTMLNames::styleAttr, "margin: 200px"); document().updateLayout(); Vector<IntRect> newRenderedRects = markerController().renderedRectsForMarkers(DocumentMarker::Composition); EXPECT_EQ(1u, newRenderedRects.size()); EXPECT_NE(renderedRects[0], newRenderedRects[0]); }
//----------------------------------------------------------------------------- bool Win32Frame::setSize (const CRect& newSize) { if (deviceContext) { deviceContext->forget (); deviceContext = 0; } if (backBuffer) { backBuffer->forget (); backBuffer = createOffscreenContext (newSize.getWidth (), newSize.getHeight ()); } // TODO for VST2: we only set the size of the window we own. In VST2 this was not the case, we also resized the parent window. This must be done upstream now. SetWindowPos (windowHandle, HWND_TOP, (int)newSize.left, (int)newSize.top, (int)newSize.getWidth (), (int)newSize.getHeight (), SWP_NOMOVE|SWP_NOCOPYBITS|SWP_NOREDRAW|SWP_DEFERERASE); invalidRect (newSize); return true; }
void SelectBox::setState( UINT16 state ) { if( state != state_ ) { state_ = state; invalidRect( rcClip_ ); ChildFrame* frame = dynamic_cast< ChildFrame* >( getFrame() ); if( frame ) { if( state_ & Dropped ) { frame->setMouseCaptureView( this ); indexSel_ = index_; } else { frame->setMouseCaptureView( NULL ); } } } }
CMouseEventResult SelectBox::onMouseMoved( CPoint& pos, const long& buttons ) { if( (state_ & Dropped) ) { if( rcScrollbar_.pointInside( pos ) && scrollbar_->isVisible() ) // draging the scrollbar handle { scrollbar_->onMouseMoved( pos, buttons ); } else if( rcDropdown_.pointInside( pos ) && buttons != kRButton ) // hovering or draging inside list { INT32 oldIdx = indexSel_; indexSel_ = indexFromPosition( pos ); if( oldIdx != index_ ) { invalidRect( rcClip_ ); } } } return kMouseEventHandled; }
bool SelectBox::onWheel( const CPoint& pos, const CMouseWheelAxis& axis, const float& distance, const long& buttons ) { if( axis == kMouseWheelAxisY ) { if (state_ & Dropped ) { INT32 oldIdx = indexSel_; bool result = scrollbar_->onWheel( pos, axis, distance, buttons ); indexSel_ = indexFromPosition( pos ); if( oldIdx != index_ ) { invalidRect( rcClip_ ); } return result; } else if( rcBox_.pointInside( pos ) ) { scrollTo( index_ + (INT32)distance*-1 ); } } return false; }
INT32 SelectBox::scrollTo( INT32 index ) { index_ = max( 0, min( (INT32)list_.size()-1, index )); indexSel_ = index_; if( index_ >= maxVisible_ + scrollOffset_ ) scrollOffset_ = (index_ - maxVisible_) + 1; if( index_ < scrollOffset_ ) scrollOffset_ = index_; int offset = scrollOffset_ * TextHeight; float value = offset / (float)(rcScrollsize_.height() - rcDropdown_.height()); scrollbar_->setValue( value ); if( (state_ & Dropped) == 0 ) { invalid(); } else { invalidRect( rcClip_ ); } return index_; }
void SelectBox::takeFocus() { state_ |= Focused; invalidRect( rcBox_ ); }