void Slider::OnValueChanged(double oldValue, double newValue) { InvalidateArrange(); InvalidateVisual(); __super::OnValueChanged(oldValue, newValue); }
void Image::ImageFailed (ImageErrorEventArgs *args) { BitmapSource *source = (BitmapSource*) GetSource (); if (source->Is (Type::BITMAPIMAGE)) { source->RemoveHandler (BitmapImage::DownloadProgressEvent, download_progress, this); source->RemoveHandler (BitmapImage::ImageOpenedEvent, image_opened, this); source->RemoveHandler (BitmapImage::ImageFailedEvent, image_failed, this); } source->RemoveHandler (BitmapSource::PixelDataChangedEvent, source_pixel_data_changed, this); InvalidateArrange (); InvalidateMeasure (); UpdateBounds (); Invalidate (); args = new ImageErrorEventArgs (this, *(MoonError*)args->GetMoonError ()); if (HasHandlers (ImageFailedEvent)) { Emit (ImageFailedEvent, args); } else { GetDeployment ()->GetSurface ()->EmitError (args); } }
void ItemsControl::RemoveAt(int iIndex) { if (iIndex < GetItems()->GetCount() && iIndex >= 0) { GetItems()->RemoveAt(iIndex); InvalidateArrange(); } }
void TabControl::OnItemSelected(suic::ObjectPtr item, ItemSelectionEventArg& e) { __super::OnItemSelected(item, e); // // 设置测量大小脏区域标志,使布局管理器重新元素测量大小 // RaisedMeasureDirty(); // // 刷新布局和显示 // InvalidateMeasure(); InvalidateArrange(); InvalidateVisual(); }
void Canvas::OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error) { if (args->GetProperty ()->GetOwnerType() != Type::CANVAS) { Panel::OnPropertyChanged (args, error); return; } if (args->GetId () == Canvas::TopProperty || args->GetId () == Canvas::LeftProperty) { if (GetVisualParent () == NULL) { UpdateTransform (); InvalidateArrange (); } } NotifyListenersOfPropertyChange (args, error); }
void Image::ImageOpened (RoutedEventArgs *args) { BitmapSource *source = (BitmapSource*)GetSource (); if (source->Is (Type::BITMAPIMAGE)) { source->RemoveHandler (BitmapImage::DownloadProgressEvent, download_progress, this); source->RemoveHandler (BitmapImage::ImageOpenedEvent, image_opened, this); source->RemoveHandler (BitmapImage::ImageFailedEvent, image_failed, this); } InvalidateArrange (); InvalidateMeasure (); UpdateBounds (); Invalidate (); if (HasHandlers (ImageOpenedEvent)) { args->ref (); // to counter the unref in Emit Emit (ImageOpenedEvent, args); } }
void Control::OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error) { if (args->GetProperty ()->GetOwnerType() != Type::CONTROL) { FrameworkElement::OnPropertyChanged (args, error); return; } if (args->GetId () == Control::TemplateProperty) { if (GetSubtreeObject ()) ElementRemoved ((UIElement *) GetSubtreeObject ()); InvalidateMeasure (); } else if (args->GetId () == Control::PaddingProperty || args->GetId () == Control::BorderThicknessProperty) { InvalidateMeasure (); } else if (args->GetId () == Control::IsEnabledProperty) { if (!args->GetNewValue ()->AsBool ()) { Surface *surface = Deployment::GetCurrent ()->GetSurface (); if (surface && surface->GetFocusedElement () == this) { // Ensure this element loses focus, then try to focus the next suitable element surface->FocusElement (NULL); TabNavigationWalker::Focus (this, true); } ReleaseMouseCapture (); } PropertyChangedEventArgs *pargs = new PropertyChangedEventArgs (args->GetProperty(), args->GetId (), args->GetOldValue(), args->GetNewValue()); EmitAsync (IsEnabledChangedEvent, pargs); } else if (args->GetId () == Control::HorizontalContentAlignmentProperty || args->GetId () == Control::VerticalContentAlignmentProperty) { InvalidateArrange (); } NotifyListenersOfPropertyChange (args, error); }
void ScrollBar::ScrollTo(int nNewPos, bool bRepaint) { int iMin = 0; int iMaxPos = max(0, (_scroInfo.iMax - iMin + 1 - _scroInfo.iPage)); if (nNewPos < iMin) { nNewPos = iMin; } int iOldPos = _scroInfo.iVisualPos; _scroInfo.iVisualPos = min(iMaxPos, nNewPos); if (iOldPos != _scroInfo.iVisualPos) { InvalidateArrange(); } if (bRepaint) { InvalidateVisual(); } }
void ScrollBar::ShowSecondScrollButton(bool bShow) { _increaseBtn.SetVisible(bShow); InvalidateArrange(); InvalidateVisual(); }
void ScrollBar::ShowFirstScrollButton(bool bShow) { _decreaseBtn.SetVisible(bShow); InvalidateArrange(); InvalidateVisual(); }
void ScrollBar::UpdateScrollBar() { InvalidateArrange(); }
void ItemsControl::ClearChildren() { GetItems()->Clear(); InvalidateArrange(); }
void ItemsControl::RemoveChild(suic::ObjectPtr ePtr) { GetItems()->Remove(ePtr); InvalidateArrange(); }