BOOL SGNameDrag::GetStatusLineText(String_256* pText, DragTarget* pDragTarget) { // Validate outputs and object state. ERROR3IF(pText == 0, "SGNameDrag::GetStatusLineText: no output parameter"); if (TheBitmap == 0 || TheBitmap->ActualBitmap == 0) return FALSE; // Only provide status-line help for drops on the document view. if (pDragTarget == 0 || !pDragTarget->IS_KIND_OF(ViewDragTarget)) return FALSE; // Get the name and type of the item being dragged. String_256 strName; m_pSourceItem->GetNameText(&strName); String strTypeDesc(((SGNameGroup*) m_pSourceItem->GetParent())->GetTypeID()); // Describe the object the mouse is over, if any. PageDropInfo pdInfo; ((ViewDragTarget*) pDragTarget)->GetDropInfo(&pdInfo); NodeRenderableInk* pObjectHit = pdInfo.pObjectHit; if (pObjectHit == 0) pText->MakeMsg(_R(IDST_NAMEOP_CANT_DROP), &strName, &strTypeDesc); else { String_64 strObjectDesc; strObjectDesc = pObjectHit->Describe(FALSE); pText->MakeMsg(_R(IDST_NAMEOP_DROP_TO_APPLY), &strName, &strTypeDesc, &strObjectDesc, &strTypeDesc, &strName); } return TRUE; }
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; }
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; }