示例#1
0
void RectPropertyGridWidget::Initialize(BaseMetadata* activeMetadata)
{
    BasePropertyGridWidget::Initialize(activeMetadata);
    
    // Build the properties map to make the properties search faster.
    PROPERTIESMAP propertiesMap = BuildMetadataPropertiesMap();
    
    // Initialize the widgets. TODO - understand how to re-use property names!
    RegisterSpinBoxWidgetForProperty(propertiesMap, "RelativeX", ui->relativeXSpinBox);
    RegisterSpinBoxWidgetForProperty(propertiesMap, "RelativeY", ui->relativeYSpinBox);

    RegisterSpinBoxWidgetForProperty(propertiesMap, "AbsoluteX", ui->absoluteXSpinBox);
    RegisterSpinBoxWidgetForProperty(propertiesMap, "AbsoluteY", ui->absoluteYSpinBox);

    RegisterSpinBoxWidgetForProperty(propertiesMap, "SizeX", ui->sizeXSpinBox);
    RegisterSpinBoxWidgetForProperty(propertiesMap, "SizeY", ui->sizeYSpinBox);
    
    RegisterSpinBoxWidgetForProperty(propertiesMap, "PivotX", ui->pivotXSpinBox);
    RegisterSpinBoxWidgetForProperty(propertiesMap, "PivotY", ui->pivotYSpinBox);

    RegisterSpinBoxWidgetForProperty(propertiesMap, "Angle", ui->angleSpinBox);
	
	UpdateHorizontalWidgetsState();
	UpdateVerticalWidgetsState();
}
void RectPropertyGridWidget::Initialize(BaseMetadata* activeMetadata)
{
    BasePropertyGridWidget::Initialize(activeMetadata);
    
    // Build the properties map to make the properties search faster.
    PROPERTIESMAP propertiesMap = BuildMetadataPropertiesMap();
    
    // Initialize the widgets. TODO - understand how to re-use property names!
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "RelativeX", ui->relativeXDoubleSpinBox);
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "RelativeY", ui->relativeYDoubleSpinBox);

    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "AbsoluteX", ui->absoluteXDoubleSpinBox);
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "AbsoluteY", ui->absoluteYDoubleSpinBox);

    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "SizeX", ui->sizeXDoubleSpinBox);
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "SizeY", ui->sizeYDoubleSpinBox);
    
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "PivotX", ui->pivotXDoubleSpinBox);
    RegisterDoubleSpinBoxWidgetForProperty(propertiesMap, "PivotY", ui->pivotYDoubleSpinBox);

    RegisterSpinBoxWidgetForProperty(propertiesMap, "Angle", ui->angleSpinBox);

    connect(ui->centerPivotPointButton, SIGNAL(clicked()), this, SLOT(OnCenterPivotPointButtonClicked()));

	UpdateHorizontalWidgetsState();
	UpdateVerticalWidgetsState();
}
示例#3
0
void RectPropertyGridWidget::HandleChangePropertySucceeded(const QString& propertyName)
{
	//If one of the align option state is changed we should check it and disable/enable appropriate Relative postion or size spinbox(es)
    BasePropertyGridWidget::HandleChangePropertySucceeded(propertyName);
	
	if (propertyName == PropertyNames::LEFT_ALIGN_ENABLED ||
		propertyName == PropertyNames::RIGHT_ALIGN_ENABLED ||
		propertyName == PropertyNames::HCENTER_ALIGN_ENABLED)
	{
		UpdateHorizontalWidgetsState();
	}

	if (propertyName == PropertyNames::TOP_ALIGN_ENABLED ||
		propertyName == PropertyNames::BOTTOM_ALIGN_ENABLED ||
		propertyName == PropertyNames::VCENTER_ALIGN_ENABLED)
	{
		UpdateVerticalWidgetsState();
	}
}