void MkBodyFrameControlNode::SetClientSize(const MkFloat2& clientSize)
{
	MkWindowBaseNode::SetClientSize(clientSize);

	if ((m_ParentNodePtr != NULL) && (m_ParentNodePtr->IsDerivedFrom(ePA_SNT_TitleBarControlNode)))
	{
		MkTitleBarControlNode* parentNode = dynamic_cast<MkTitleBarControlNode*>(m_ParentNodePtr);
		if (parentNode != NULL)
		{
			// 부모의 크기(length)를 변경
			float sizeOffset = 0.f;
			if ((m_HangingType == eHT_IncludeParentAtTop) || (m_HangingType == eHT_IncludeParentAtBottom))
			{
				const MkWindowThemeFormData* formData = MK_STATIC_RES.GetWindowThemeSet().GetFormData(GetThemeName(), GetComponentType(), GetCustomForm());
				if (formData != NULL)
				{
					sizeOffset += formData->GetLeftMargin();
					sizeOffset += formData->GetRightMargin();
				}
			}

			float frameSize = MK_STATIC_RES.GetWindowThemeSet().GetFrameSize(parentNode->GetThemeName(), parentNode->GetFrameType());
			float titleLength = GetMax<float>(m_ClientRect.size.x - sizeOffset, 0.f);
			parentNode->SetClientSize(MkFloat2(titleLength, frameSize));
		}
	}
}
Ejemplo n.º 2
0
MkFloat2 MkWindowThemedNode::CalculateWindowSize(void) const
{
	return ConvertClientToWindowSize(GetThemeName(), GetComponentType(), GetCustomForm(), GetClientSize());
}
void MkBodyFrameControlNode::_ApplyHangingType(void)
{
	bool pivotIsWindowRect = false;
	bool targetIsWindowRect = true;
	eRectAlignmentPosition alignPos = eRAP_NonePosition;

	if (m_HangingType != eHT_None)
	{
		switch (m_HangingType)
		{
		case eHT_OverParentWindow:
			pivotIsWindowRect = true;
			alignPos = eRAP_LeftOver;
			break;

		case eHT_UnderParentWindow:
			pivotIsWindowRect = true;
			alignPos = eRAP_LeftUnder;
			break;

		case eHT_IncludeParentAtTop:
		case eHT_IncludeParentAtBottom:
			{
				const MkWindowThemeFormData* formData = MK_STATIC_RES.GetWindowThemeSet().GetFormData(GetThemeName(), GetComponentType(), GetCustomForm());
				if (formData != NULL)
				{
					switch (m_HangingType)
					{
					case eHT_IncludeParentAtTop:
						pivotIsWindowRect = true;
						targetIsWindowRect = false;
						alignPos = eRAP_LeftTop;
						break;

					case eHT_IncludeParentAtBottom:
						pivotIsWindowRect = true;
						targetIsWindowRect = false;
						alignPos = eRAP_LeftBottom;
						break;
					}
				}
			}
			break;
		}
	}

	SetAlignmentPivotIsWindowRect(pivotIsWindowRect);
	SetAlignmentTargetIsWindowRect(targetIsWindowRect);
	SetAlignmentPosition(alignPos);
}