예제 #1
0
BOOL ColourDragInformation::GetStatusLineText(String_256 * TheText, DragTarget* pDragTarget)
{
	ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");

	String_256 DragString(_R(IDS_DRAGCOL_DRAGGING_COLOUR)); // "Dragging colour '");

	if (TheColour.IsTransparent())
		DragString = _R(IDS_DRAGCOL_DRAGGING_NO_COLOUR);	// "Dragging 'no colour' : ";
	else
	{
		IndexedColour *TheIxCol = GetInitiallyDraggedColour();
		if (TheIxCol != NULL)
			DragString += *(TheIxCol->GetName());		// Document IndexedColour
		else
			DragString += ColourName;					// Library colour

		DragString += String_16(_R(IDS_DRAGCOL_DRAGGING_COLOUR_RIGHT_BIT)); // "' : ";
	}

	if (pDragTarget->IS_KIND_OF(ViewDragTarget))
	{
		PageDropInfo PageDropInfo;
		((ViewDragTarget*)pDragTarget)->GetDropInfo(&PageDropInfo);

		NodeRenderableInk* pObjectHit 	= PageDropInfo.pObjectHit;
		ObjectDragTarget TargetHit 		= PageDropInfo.TargetHit;

		String_256 ObjectDesc = _R(IDS_DRAGCOL_THIS_OBJECT); //" this object";

		if (pObjectHit)
		{
			ObjectDesc = pObjectHit->Describe(FALSE);
		}

		ClickModifiers ClickMods = ClickModifiers::GetClickModifiers();
		BOOL IsInside = ClickMods.Constrain;

		if (!IsInside && pObjectHit && pObjectHit->IsCompound())
		{
			TargetHit = MANY_TARGET;
		}

		switch (TargetHit)
		{
			case FILL_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL)); // "Drop to set the fill colour of this ";
				DragString += ObjectDesc;
				if (IsInside)
					DragString += String_64(_R(IDS_DRAGCOL_ALONE)); // " alone";
				break;
			case LINE_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_LINE)); //"Drop to set the line colour of this ";
				DragString += ObjectDesc;
				if (IsInside)
					DragString += String_64(_R(IDS_DRAGCOL_ALONE)); // " alone";
				break;
			case STARTCOL_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_START)); //"Drop to set the fill start colour of this ";
				DragString += ObjectDesc;
				break;
			case ENDCOL_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END)); //"Drop to set the fill end colour of this ";
				DragString += ObjectDesc;
				break;
			case ENDCOL2_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END2)); //"Drop to set the fill end colour of this ";
				DragString += ObjectDesc;
				break;
			case ENDCOL3_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL_END3)); //"Drop to set the fill end colour of this ";
				DragString += ObjectDesc;
				break;
			case MANY_TARGET:
				DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_FILL)); //"Drop to set the fill colour of this ";
				DragString += ObjectDesc;
				DragString += String_64(_R(IDS_DRAGCOL_PRESS_CONTROL)); // "; Press 'Control' to drop 'Inside'";
				break;

			case NO_TARGET:
				if (IsInside)
				{
					DragString += String_256(_R(IDS_DRAGCOL_DROP_SETPAGEBACKGROUND)); // "Drop to set the fill colour of the page background";
				}
				else
				{
					DragString += String_64(_R(IDS_DRAGCOL_DROP_SET_CURRENT_FILL_COLOUR)); // "Drop to set the 'current fill colour' attribute";
				}
				break;
		};

	 	*TheText = DragString;
		return TRUE;
	}
 	
	return FALSE;
}
예제 #2
0
BOOL GalleryLineDragInfo::GetStatusLineText(String_256 * TheText, DragTarget* pDragTarget)
{
	ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");

	if (TheBitmap == NULL || TheBitmap->ActualBitmap == NULL)
		return FALSE;

 	String_256 DragString(_R(IDS_SGLDRAG_DRAG_LINE_ATTR)); // "Dragging line attribute"
	DragString += String_8(_R(IDS_SGDFONTS_STAT_COLON_SEP)); //" : ";

	if (pDragTarget && pDragTarget->IS_KIND_OF(ViewDragTarget))
	{
		PageDropInfo PageDropInfo;
		((ViewDragTarget*)pDragTarget)->GetDropInfo(&PageDropInfo);

		NodeRenderableInk* pObjectHit 	= PageDropInfo.pObjectHit;
		ObjectDragTarget TargetHit 		= PageDropInfo.TargetHit;

		String_256 ObjectDesc = _R(IDS_SGLDRAG_THIS_OBJECT); // " this object";

		if (pObjectHit)
		{
			ObjectDesc = pObjectHit->Describe(FALSE);
		}

		ClickModifiers ClickMods = ClickModifiers::GetClickModifiers();
		BOOL IsInside = ClickMods.Constrain;

		if (!IsInside && pObjectHit && pObjectHit->IsCompound())
		{
			TargetHit = MANY_TARGET;
		}

		switch (TargetHit)
		{
			case FILL_TARGET:
			case LINE_TARGET:
			case STARTCOL_TARGET:
			case ENDCOL_TARGET:
				DragString += String_64(_R(IDS_SGLDRAG_DROP_TO_APPLY)); // "Drop to apply this attribute to this ";
				DragString += ObjectDesc;
				if (IsInside)
					DragString += String_64(_R(IDS_SGLDRAG_SPACE_ALONE)); // " alone";
				break;

			case MANY_TARGET:
				DragString += String_64(_R(IDS_SGLDRAG_DROP_TO_APPLY)); // "Drop to apply this attribute to this ";
				DragString += ObjectDesc;
				DragString += String_64(_R(IDS_SGLDRAG_CONTROL_DROP_INSIDE)); // "; Press 'Control' to drop 'Inside'";
				break;

			case NO_TARGET:
				DragString += String_64(_R(IDS_SGLDRAG_DROP_CURRENT_ATTRIBUTE)); // "Drop to set the Current Attribute";
				break;
			default:
				break;
		};

	 	*TheText = DragString;
		return TRUE;
	}
 	
	return FALSE;
}