Exemplo n.º 1
0
//----------------------------------------------------------------------------------------------------
CView* UITemplateSettingsController::verifyView (CView* view, const UIAttributes& attributes, IUIDescription* description)
{
	CTextEdit* control = dynamic_cast<CTextEdit*>(view);
	if (control)
	{
		switch (control->getTag ())
		{
			case kNameTag:
			{
				controls[kNameTag] = control;
				control->setText (templateName.c_str ());
				break;
			}
			case kMinWidthTag:
			{
				controls[kMinWidthTag] = control;
				control->setStringToValueProc (stringToValue);
				control->setValueToStringProc (valueToString);
				control->setValue ((float)minSize.x);
				break;
			}
			case kMinHeightTag:
			{
				controls[kMinHeightTag] = control;
				control->setStringToValueProc (stringToValue);
				control->setValueToStringProc (valueToString);
				control->setValue ((float)minSize.y);
				break;
			}
			case kMaxWidthTag:
			{
				controls[kMaxWidthTag] = control;
				control->setStringToValueProc (stringToValue);
				control->setValueToStringProc (valueToString);
				control->setValue ((float)maxSize.x);
				break;
			}
			case kMaxHeightTag:
			{
				controls[kMaxHeightTag] = control;
				control->setStringToValueProc (stringToValue);
				control->setValueToStringProc (valueToString);
				control->setValue ((float)maxSize.y);
				break;
			}
		}
	}
	return view;
}
Exemplo n.º 2
0
//----------------------------------------------------------------------------------------------------
CView* UIGridController::verifyView (CView* view, const UIAttributes& attributes, const IUIDescription* description)
{
	CTextEdit* control = dynamic_cast<CTextEdit*>(view);
	if (control)
	{
		switch (control->getTag ())
		{
			case kGridXTag:
			{
				gridControls[0] = control;
			#if VSTGUI_HAS_FUNCTIONAL
				gridControls[0]->setStringToValueFunction (stringToValue);
				gridControls[0]->setValueToStringFunction (valueToString);
			#else
				gridControls[0]->setStringToValueProc (stringToValue);
				gridControls[0]->setValueToStringProc (valueToString);
			#endif
				gridControls[0]->setValue ((float)size.x);
				break;
			}
			case kGridYTag:
			{
				gridControls[1] = control;
			#if VSTGUI_HAS_FUNCTIONAL
				gridControls[1]->setStringToValueFunction (stringToValue);
				gridControls[1]->setValueToStringFunction (valueToString);
			#else
				gridControls[1]->setStringToValueProc (stringToValue);
				gridControls[1]->setValueToStringProc (valueToString);
			#endif
				gridControls[1]->setValue ((float)size.y);
				break;
			}
		}
	}
	return DelegationController::verifyView (view, attributes, description);
}