/*virtual*/ bool SkBorderView::onEvent(const SkEvent& evt) { if (evt.isType(SK_EventType_Inval)) { this->inval(NULL); return true; } if (evt.isType("recommendDim")) { evt.findScalar("leftMargin", &fLeft); evt.findScalar("rightMargin", &fRight); evt.findScalar("topMargin", &fTop); evt.findScalar("bottomMargin", &fBottom); //setup_views.cpp uses SkView::Layout instead of SkStackViewLayout //but that gives me an error SkStackViewLayout* layout; fMargin.set(fLeft, fTop, fRight, fBottom); if (this->getLayout()) { layout = (SkStackViewLayout*)this->getLayout(); layout->setMargin(fMargin); } else { layout = new SkStackViewLayout; layout->setMargin(fMargin); this->setLayout(layout)->unref(); } this->invokeLayout(); } return this->INHERITED::onEvent(evt); }
/*virtual*/ bool SkProgressBarView::onEvent(const SkEvent& evt) { if (evt.isType(SK_EventType_Inval)) { this->inval(NULL); return true; } if (evt.isType("recommendDim")) { SkScalar height; if (evt.findScalar("y", &height)) this->setHeight(height); return true; } return this->INHERITED::onEvent(evt); }
/*virtual*/ bool SkScrollBarView::onEvent(const SkEvent& evt) { if (evt.isType(SK_EventType_Inval)) { this->inval(NULL); return true; } if (evt.isType("recommendDim")) { SkScalar width; if (evt.findScalar("x", &width)) this->setWidth(width); return true; } return this->INHERITED::onEvent(evt); }
bool SkOSMenu::FindSliderValue(const SkEvent& evt, const char slotName[], SkScalar* value) { return evt.isType(gMenuEventType) && evt.findScalar(slotName, value); }
bool SkOSMenu::FindSliderMax(const SkEvent& evt, SkScalar* max) { return evt.isType(gMenuEventType) && evt.findScalar(gSlider_Max_Scalar, max); }
bool SkOSMenu::FindSliderMin(const SkEvent& evt, SkScalar* min) { return evt.isType(gMenuEventType) && evt.findScalar(gSlider_Min_Scalar, min); }