/*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);
}
Beispiel #2
0
/*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);
}
Beispiel #3
0
/*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);
}
Beispiel #4
0
bool SkOSMenu::FindSliderValue(const SkEvent& evt, const char slotName[], SkScalar* value) {
    return evt.isType(gMenuEventType) && evt.findScalar(slotName, value);
}
Beispiel #5
0
bool SkOSMenu::FindSliderMax(const SkEvent& evt, SkScalar* max) {
    return evt.isType(gMenuEventType) && evt.findScalar(gSlider_Max_Scalar, max);
}
Beispiel #6
0
bool SkOSMenu::FindSliderMin(const SkEvent& evt, SkScalar* min) {
    return evt.isType(gMenuEventType) && evt.findScalar(gSlider_Min_Scalar, min);
}